Ad Widget

Collapse

Creating custom item for SIP trunk

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JohnnySSH
    Junior Member
    • Sep 2014
    • 6

    #1

    Creating custom item for SIP trunk

    Hi,

    I've been following this guide to creating a custom item to monitor my SIP trunks:



    I'm running Zabbix server 2.2.5 on FreeBSD 10.

    The agent is on a CentOS 5 based system with version 2.2.6.

    Basically what I did was per the guide, add this line to the agentd config file:

    Code:
    UserParameter=asterisk.sip[*],asterisk -r -x 'sip show registry'|grep "$1 "|cut -c 71-91|tr -d "\n "
    Then using the key:

    Code:
    asterisk.sip[nnnnnnnnn]
    where "nnnnnnnnn" is the username in the item field I should be able to get a text output in Zabbix.

    Unfortunately this is not the case and no data is being returned?

    If I run the command on it's own the output given is:

    Code:
    Registered
    If I run the command embedded in the agent using:

    Code:
    zabbix_agentd -t <key>
    The result is:

    Code:
    [t|Registered]
    So for the agent side everything is fine! ...it seems.


    Looking at the Zabbix server however, the item is shown as being "active" and checks are being run.

    The only issue is that there is no data in the "Last value" field??

    Item settings are as follows:

    Name: Item Name
    Type: Zabbix agent
    Key: <described above>
    Host interface: IP of host with agent port
    Type if information: Text
    Update interval: 30 secs
    Application: <created a new app called Trunks>
    Enabled: checked


    I'm really not sure what the issue is here? Also since I've just been debugging the MySQL application monitor which is now working properly. It just needed a little "fudging" of keyname to name put in the agent config.

    I also tried enabled debug mode of logging but unfortunately that didn't help either as I was unable to see what the server was doing.


    Could anyone help out?


    Thanks.
  • JohnnySSH
    Junior Member
    • Sep 2014
    • 6

    #2
    After "trying" out a few different things I managed to find a way to actually test directly from the server:

    Code:
    zabbix_get -s <host_ip> -I <server_ip> -k <key>
    Using my key above it became apparent that the server wasn't able to see any information.

    Setting the 'AllowRoot=1' option managed to solve the issue. Looks like the "zabbix" user couldn't run the 'asterisk' command for some reason though permissions on the actual binary were fine.

    Comment

    Working...