Ad Widget

Collapse

UserParameter and items does not work

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ittec
    Member
    • Mar 2008
    • 73

    #1

    UserParameter and items does not work

    Hi all

    I have a script located in /home/zabbix, very simple:

    Code:
    #!/bin/bash
    ZABBIX_DIR="/home/zabbix"
    /bin/cat /etc/httpd/conf/httpd.conf |grep MaxClients |head -n1|cut -c 18-20 > $ZABBIX_DIR/apache_max.txt
    /bin/netstat -alntp | grep :80 | wc -l > $ZABBIX_DIR/apache_clients.txt
    There are two files in /home/zabbix that receipt two values by the script. It is very easy. Then in zabbix_agentd.conf I have:

    Code:
    UserParemeter=apache.maxclients,cat /home/zabbix/apache_max.txt
    UserParemeter=apache.clients,cat /home/zabbix/apache_clients.txt
    I know maybe it is not the better way but I always have used UserParemeter way to obtain non-standard zabbix info. Im surprised because I have no way to obtain this values properly. I have created two items in zabbix (decimal, float, whatever, i tried everything). I link template to a host, and then I can see two new items in host. But, after some minutes, two items status changes to "Non supported". I have restarted zabbix_agentd lot of times and I have change Debug to level 4 to view if there is something wrong:

    Code:
    -bash-3.2# cat /tmp/zabbix_agentd.log |grep apache
     -bash-3.2# cat /tmp/zabbix_agentd.log  |grep apache
     22145:20101117:154242.936 cfg: para: [UserParemeter] val [apache.maxclients,cat /home/zabbix/apache_max.txt]
     22145:20101117:154242.936 cfg: para: [UserParemeter] val [apache.clients,cat /home/zabbix/apache_clients.txt]
     22149:20101117:154633.590 Requested [apache.maxclients]
     22147:20101117:154634.310 Requested [apache.clients]
    But there is no value..???

    Im sure it is not the better way, I know...but this is so simple tha Im frustated :S

    ANy ideas gurus?

    Thanks a lot


    PS:

    Code:
    # ./zabbix_get -s127.0.0.1 -p10050 -k"system.cpu.load[all,avg1]"
    no output, with and without quotes :S
    Last edited by ittec; 17-11-2010, 17:05.
  • MrKen
    Senior Member
    • Oct 2008
    • 652

    #2
    Have you tried running the command on the command line?

    cat /etc/httpd/conf/httpd.conf |grep MaxClients |head -n1|cut -c 18-20

    The result that I got on 2 different servers was: xim

    MrKen
    Disclaimer: All of the above is pure speculation.

    Comment

    Working...