-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cannot get result of Calls using check_asterisk_ami #2
Comments
Hi Sam, Sorry I completely missed this, There's no reason this shouldn't work so I'm possibly doing something silly. |
Hello, same problem here Other commands work fine and also this same calls query works on some asterisk servers and on some not |
Hello,
so current awk expression is not catching correct column. But solution is rather simple, find around line 175 awk command:
and change it into
simple ;-) |
Wouldn't the print $2 break pre-asterisk 16 ? Maybe the right thing here is to default to print $2 and have a "-lagacy" flag on the script for the old one. It's probably safe (hah) to change to $2 now and have that as the default going forwards. but yes... changing the format of something that people use to monitor their systems .... would be good it if had a real key / value output or api for monitoring! :-) |
You are correct it would break compatibility with asterisk <= 13, but none should use it anyway, it is out of the support. :-), Version 16 is still supported in stable Debian.
This would be only one of the many wishes I would have. :-D |
Hi,
Nice plug-in for asterisk monitoring,
But I found one issue and I don't know how to fix.
the result I've got below.
[root@localhost libexec]# ./check_asterisk_ami -H XXXXXXXX -q sippeers -u admin -p XXXXXXXX -P 5038 -w 100 -c 20 OK: 20 online, 6 offline SIP peers|online=20 offline=6
[root@localhost libexec]# ./check_asterisk_ami -H XXXXXXXX -q channels -u admin -p XXXXXXXX -P 5038 -w 100 -c 20 OK: 0 Asterisk calls active|channels=0
[root@localhost libexec]# ./check_asterisk_ami -H XXXXXXXX -q calls -u admin -p XXXXXXXX -P 5038 -w 100 -c 20
./check_asterisk_ami: line 166: [: Output:: integer expression expected
./check_asterisk_ami: line 169: [: Output:: integer expression expected
./check_asterisk_ami: line 172: [: Output:: integer expression expected
and the code is :
...
166 if [ $CALLS -lt $WARNINGNUMBER ]; then
167 exitstatus=$STATE_OK
168 MSG="OK: ${CALLS} Asterisk calls active|calls=${CALLS}"
169 elif [ $CALLS -lt $CRITICALNUMBER ]; then
170 exitstatus=$STATE_WARNING
171 MSG="WARNING: ${CALLS} Asterisk calls active|calls=${CALLS}"
172 elif [ $CALLS -ge $CRITICALNUMBER ]; then
173 exitstatus=$STATE_CRITICAL
174 MSG="CRITICAL: ${CALLS} Asterisk calls active|calls=${CALLS}"
175 fi
...
I'm using lastest Nagios Core and CentOS 7
Is there any way to fix?
Sam
The text was updated successfully, but these errors were encountered: