<HTML>
<HEAD>
<TITLE>Problem monitoring asterisk</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hi guys<BR>
I am a new user which is trying to monitor an asterisk server using nagios, rigth now i am stuck in a problem and i would like to know if somebody could help me to fix my problem, any idea is more than welcome <BR>
Thank you very much for your time<BR>
<BR>
My scenario is very simple<BR>
<BR>
(NAGIOS 3.2.0)<====>(asterisk)<BR>
<BR>
i found in google a shell script developed by Peter Andersson, it looks like it do the job i mean if i run the shell the output is this In the remote server (asterisk), i run it using nagios user<BR>
And runs fine<BR>
===================================================================================== <BR>
<FONT COLOR="#0000FF"><B>[root@pbx-millenium nrpe-2.12]# sudo /usr/local/nagios/libexec/check_asterisk_sip_peers.sh 7458030<BR>
OK: 7458030/7458030 10.8.12.114 5060 OK (8 ms)|time=8ms<BR>
</B></FONT>=====================================================================================<BR>
<BR>
In the Asterisk i define the shell script and /usr/local/nagios/etc/nrpe.cfg and my conf is this:<BR>
<BR>
--------------------------------------------------------------------------------------------------------------------------------------<BR>
dont_blame_nrpe=1<BR>
debug=1<BR>
command[astpeer_7458030]=sudo /usr/local/nagios/libexec/check_asterisk_sip_peers.sh 7458030<BR>
---------------------------------------------------------------------------------------------------------------------------------------<BR>
<BR>
Then i restart xinetd<BR>
<BR>
=====================================================================================<BR>
service xinetd restart<BR>
=====================================================================================<BR>
<BR>
**************************************************************************************<BR>
In the nagios Server<BR>
<BR>
---------------------------------------------------------------------------------------------------------------------------------------<BR>
define host{<BR>
use linux-server ; Inherit default values from a template<BR>
host_name mpcpbx ; The name we're giving to this server<BR>
alias pbx1 ; A longer name for the server<BR>
address 192.168.222.3 ; IP address of the server<BR>
}<BR>
<BR>
define service{<BR>
use generic-service<BR>
host_name mpcpbx<BR>
service_description Asterisk Sip Provider<BR>
check_command check_nrpe!astpeer_7458030<BR>
}<BR>
<BR>
define service{<BR>
use generic-service<BR>
host_name mpcpbx<BR>
service_description CPU Load<BR>
check_command check_nrpe!check_load<BR>
}<BR>
---------------------------------------------------------------------------------------------------------------------------------------<BR>
If i run the configuration test it shows<BR>
<BR>
=====================================================================================<BR>
Things look okay - No serious problems were detected during the pre-flight check<BR>
=====================================================================================<BR>
<BR>
If i test in the Asterisk the predefined services<BR>
<BR>
=====================================================================================<BR>
[root@pbx-millenium nrpe-2.12]# /usr/local/nagios/libexec/check_nrpe -H localhost -c check_load<BR>
OK - load average: 0.01, 0.05, 0.04|load1=0.010;15.000;30.000;0; load5=0.050;10.000;25.000;0; load15=0.040;5.000;20.000;0; <BR>
=====================================================================================<BR>
<BR>
But testing the shell<BR>
<BR>
=====================================================================================<BR>
[root@pbx-millenium nrpe-2.12]# /usr/local/nagios/libexec/check_nrpe -H localhost -c astpeer_7458030<BR>
NRPE: Unable to read output<BR>
=====================================================================================<BR>
<BR>
The Documentation says<BR>
1-wrong nrpe.cfg => what could be the missconfig?<BR>
2-the program should have some output => but indeed it have some output (blue output)<BR>
<BR>
So guys i don’t know what to do, any idea?<BR>
<BR>
Thank you very much again<BR>
Best regards<BR>
<BR>
Yelson<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
</SPAN></FONT>
</BODY>
</HTML>