Skip to content

cannot get result of Calls using check_asterisk_ami #2

@ChenYiHsiang

Description

@ChenYiHsiang

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions