monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

asterisk channels scripts


From: Asterisk REQ
Subject: asterisk channels scripts
Date: Thu, 06 Jun 2013 11:45:04 +0200
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130509 Thunderbird/17.0.6

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?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]