Ad Widget

Collapse

system.run and proc.num ????

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • denso
    Member
    • Sep 2005
    • 32

    #1

    system.run and proc.num ????

    after my previous post about proc.num not working correctly or me misunderstanding it I decided to try system.run item instead and found this will not work ad documented either. I was trying:
    [root@diam-orzabbix ~]# zabbix_get -s hrnpcm1 -p 10001 -k system.run[ps faux ]
    ZBX_NOTSUPPORTED

    so i look at the documentation and see:

    Example:
    Detailed file list of root directory.
    system.run[ls -l /]

    so I try:

    [root@diam-orzabbix ~]# zabbix_get -s hrnpcm1 -p 10001 -k system.run[ls -l /]
    zabbix_get: invalid option -- l
    usage: zabbix_get [-hv] -s<host name or IP> [-p<port number>] -k<key>

    Intresting.... Mabey I don't understand or I am not including something but I would like to try this option as stated in the documentation.
    Last edited by denso; 25-08-2006, 16:03.
  • denso
    Member
    • Sep 2005
    • 32

    #2
    update

    Workaround for problem....

    if you have an agent in /home/zabbix
    create /home/zabbix/bin directory
    inside directory create script eg: ps1

    script should have real command inside:

    #!/bin/bash
    #
    ps -faux | grep -c httpd.conf

    use system.run and point toward script:

    [root@diam-orzabbix ~]# zabbix_get -s hrnpcm1 -p 10001 -k system.run[/home/zabbix/bin/ps1]
    14


    works....
    but what about proc.num .....?

    Comment

    • dave smith
      Junior Member
      • Aug 2006
      • 7

      #3
      It may be worth quoting the square brackets, ie

      zabbix_get -s hrnpcm1 -p 10001 -k 'system.run[ps faux ]'

      Comment

      Working...