Ad Widget

Collapse

Help to configure User Parameter

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Help to configure User Parameter

    Hi,

    I try to use UserParameter in order to monitor some host.

    The UserParameter will execute a shell script and return a value. I wrote this following sentence in the host's zabbix_agentd.conf :

    "UserParameter=check_glsa,/etc/zabbix/externalscripts/check_glsa"

    I already put the script in the good directory with the right permission.

    I configure an Item on the Zabbix server like this :

    Host : Template_Linux_myHost (my host is in this template)
    Description : GLSA
    Type : Zabbix Agent (Active)
    key : check_glsa

    I didn't have real error, however the value returned is bad, indeed in "latest data" the value GLSA is different that when a execute the script in my host. It's the value of my Zabbix Server..

    Plz someone can help me to resolve the problem..

    Regards,

    #2
    same

    I have the same error, did you fixed it?

    Comment


      #3
      Yes i resolv it, but i forgotten the issue, maybe can i help you.
      What is your configuration ?

      Comment


        #4
        size directory

        I set this on /zabbix/zabbix_agentd.conf

        UserParameter=test,du /home/aner/Desktop/test/ -cbxs | grep total | cut -f1

        When i do the command zabbix_agentd -p show me this

        test [t|29368637],

        but when i se it to zabbix item show me on lastest data value 0, and the file size is 29368637, so is not showing me correct data. Everyfile a try to get their size, showme 0

        Comment


          #5
          asantana:
          There are a few things that you should check/do.
          If your zabbix agent is running under the zabbix user, then you should ensure that the zabbix user has privileges to use `du` and that it can access that folder. Like I had issues with the Zabbix agent being unable to run `lsof -p <process id>`due to permissions.
          Secondly, it is best if you can use an absolute path for `du`, eg. `/usr/bin/du`.

          To find the absolute path for `du`, run `which du`.

          To simply check if zabbix user can run that command, run the following:
          su zabbix -c 'du /home/aner/Desktop/test/ -cbxs | grep total | cut -f1'

          Like my zabbix_agentd.conf would look like this:
          Code:
          UserParameter=test,/usr/bin/du /usr/src/zabbix-1.8.13/ -cbxs | grep total | cut -f1
          As a last resort, you can look for errors in your Zabbix server logfile.

          Comment

          Announcement

          Collapse
          No announcement yet.
          Working...
          X