Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Directory
hostmaster@ip6.li
byhostmaster@ip6.li, November 4, 2011
--- check_asterisk_peers 2011-11-05 11:56:16.352105211 +0100
+++ check_asterisk_peers.sh 2011-11-05 11:56:11.376105311 +0100
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Check asterisk peers plugin for Nagios.
# Written by Chad Phillips (chad@apartmentlines.com)
@@ -7,6 +7,7 @@
ASTERISK=/usr/sbin/asterisk
PROGPATH=`dirname $0`
+PROGPATH="/usr/lib/nagios/plugins"
REVISION=`echo '$Revision: 2 $' | sed -e 's/[^0-9.]//g'`
. $PROGPATH/utils.sh
@@ -333,9 +334,11 @@
if [ "$registration_verified" ]; then
# Have to cut off registration name at 12 characters, so let's hope
# it's still unique!
- cut_user=${user:0:12}
+ #cut_user=${user:0:12}
+ cut_user=${r:0:12}
# This regex isn't perfect, but it does the trick ok.
- status=`echo "$command_output" | grep "^${uri}:[[:digit:]].\+[[:space:]].\+${cut_user}[[:space:]].\+" | awk '{print $4;}'`
+ #status=`echo "$command_output" | grep "^${uri}:[[:digit:]].\+[[:space:]].\+${cut_user}[[:space:]].\+" | awk '{print $4;}'`
+ status=`echo "$command_output" | grep "^${uri}:[[:digit:]].\+[[:space:]].\+[[:alpha:]].\+${cut_user}[[:space:]].\+" | awk '{print $5;}'`
if [ "$status" = "Registered" ]; then
if [ "$test_ok" ]; then
test_ok="${test_ok}, $r"
+++ check_asterisk_peers.sh 2011-11-05 11:56:11.376105311 +0100
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Check asterisk peers plugin for Nagios.
# Written by Chad Phillips (chad@apartmentlines.com)
@@ -7,6 +7,7 @@
ASTERISK=/usr/sbin/asterisk
PROGPATH=`dirname $0`
+PROGPATH="/usr/lib/nagios/plugins"
REVISION=`echo '$Revision: 2 $' | sed -e 's/[^0-9.]//g'`
. $PROGPATH/utils.sh
@@ -333,9 +334,11 @@
if [ "$registration_verified" ]; then
# Have to cut off registration name at 12 characters, so let's hope
# it's still unique!
- cut_user=${user:0:12}
+ #cut_user=${user:0:12}
+ cut_user=${r:0:12}
# This regex isn't perfect, but it does the trick ok.
- status=`echo "$command_output" | grep "^${uri}:[[:digit:]].\+[[:space:]].\+${cut_user}[[:space:]].\+" | awk '{print $4;}'`
+ #status=`echo "$command_output" | grep "^${uri}:[[:digit:]].\+[[:space:]].\+${cut_user}[[:space:]].\+" | awk '{print $4;}'`
+ status=`echo "$command_output" | grep "^${uri}:[[:digit:]].\+[[:space:]].\+[[:alpha:]].\+${cut_user}[[:space:]].\+" | awk '{print $5;}'`
if [ "$status" = "Registered" ]; then
if [ "$test_ok" ]; then
test_ok="${test_ok}, $r"
byhostmaster@ip6.li, July 22, 2011
Find a patched version here: https://www.ip6.li/cms/tiki-download_file.php?fileId=46