Page 1 of 1

plugin code change

Posted: Tue Jun 18, 2019 7:17 am
by olegus
I try to use an asterisk plugin to check check_asterisk_pri.php https://exchange.nagios.org/directory/P ... us/details
after solving some problems, it began to reach the server, but now it gives an error in the code:
root@icingadeb:/home/adman# /usr/lib/nagios/plugins/check_asterisk_pri -H xxx.xxx.xxx.xxx -U xxxxx -P xxxxxxxx -p 5038
PHP Warning: fsockopen(): unable to connect to xxx.xxx.xxx.xxx:5038 (Connection refused) in /usr/lib/nagios/plugins/check_asterisk_pri on line 163
the string itself looks like this:
if( ( $astsock = fsockopen( $host, $port, $errno, $errstr, $timeout ) ) === false )
please tell me what needs to be changed so that it would work
thank you in advance

Re: plugin code change

Posted: Tue Jun 18, 2019 4:00 pm
by cdienger
The service may be down or there may be a firewall preventing a connection. Is port 5038 up and listening on the asterisk server? Is there anything blocking this connection?

Re: plugin code change

Posted: Fri Jun 21, 2019 1:58 am
by olegus
everything. sorted out. fail2ban blocked

Re: plugin code change

Posted: Fri Jun 21, 2019 8:05 am
by scottwilkerson
olegus wrote:everything. sorted out. fail2ban blocked
Great!

Locking