Topic: Nagios check_asterisk for IAX2 [Comments: 0]
eeman

Wed, 02/03/2010 - 21:18 | Nagios check_asterisk for IAX2

for those using nagios to monitor when their pbx's stop listening for services like iax2, manager, sip etc...

the check_asterisk module stopped working after the iax2 security fix in 1.4.26.2. Instead of sending a REJECT frame, sending a POKE frame will continue to monitor IAX2 service. You can modify the check_asterisk file:

my $iax_timestamp = "00000000";
my $iax_outbound_seq = "00";
my $iax_inbound_seq = "00";
my $iax_type = "06"; #IAX_Control
+my $iax_frame_value = "1e"; #POKE

sub ok {
$s = shift;

and then further into the file:

socket(PING, PF_INET, SOCK_DGRAM, getprotobyname("udp"));

$msg = pack "H24", $iax_src_call . $iax_dst_call . $iax_timestamp .
- $iax_outbound_seq . $iax_inbound_seq . $iax_type . $iax_type;
+ $iax_outbound_seq . $iax_inbound_seq . $iax_type . $iax_frame_value ;

$ipaddr = inet_aton($host);
$sendto = sockaddr_in($port,$ipaddr);