monit-general
[Top][All Lists]
Advanced

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

Re: asterisk channels scripts


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

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?




reply via email to

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