Ok, it work now, we have to specify the full path

-----
#!/bin/bash

chan=$(/usr/sbin/asterisk -rx "core show channels" |grep "active channels" | awk '{ printf "%d",$(1) }')

echo $chan #for debug

exit $chan

-----
Thanks!

El 06/06/2013 11:45, Asterisk REQ escribió:
Hi,
I´m trying to monitor asterisk channels using exit value (between 0 and 255, I have no more concurrent calls) so, I try with this script:

-----
#!/bin/bash

chan=$(asterisk -rx "core show channels" |grep "active channels" | awk '{ printf "%d",$(1) }')

echo $chan #for debug

exit $chan

-----

and monitrc:

#asterisk channels
check program asterisk-channelsv with path "/etc/monitscripts/asterisk_channels.sh"
    if status > 100 then alert

-----------

but I can see the correct value on ECHO but monit always show 0, if I change "exit $chan" for "exit 2" monit shows 2 correctly.
Whats wrong? Any ideas?



--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Reply via email to