Ad Widget

Collapse

extracting numeric values from a text file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nicolasg
    Member
    • Apr 2011
    • 50

    #1

    extracting numeric values from a text file

    Hi All,

    I need to measure on zabbix numeric values from a specific text file (single line) that is created by an application and updated every minute.

    The way I was trying to accomplish this was by creating a UserParameter in the agent configuration file like:
    UserParameter=system.test,cat /tmp/test_file.txt
    or
    UserParameter=system.test,se 1q /tmp/test_file.txt

    Unfortunately when creating an item in the front end I can't see any data values and the item status changes to NOT SUPPORTED ...

    Any ideas on what am I doing wrong or a different method how to make this work ?
  • nicolasg
    Member
    • Apr 2011
    • 50

    #2
    Any ideas anyone ? can someone at least confirm this is a Zabbix limitation ?

    Comment

    • JBo
      Senior Member
      • Jan 2011
      • 310

      #3
      Hi,

      If /tmp/test_file.txt contains only a line with the numeric value you want,
      Code:
       UserParameter=system.test,cat /tmp/test_file.txt
      should be OK.

      I have done this kind of trick and it works fine.
      Make sure that zabbix user has read permission on the file.

      Regards,
      JBo

      Comment

      • eskytthe
        Senior Member
        Zabbix Certified Specialist
        • May 2011
        • 363

        #4
        Hi,
        NOT SUPPORTED means you are not getting any data from the agent.
        Hints I hope can help you:
        - Try full path to your cat command (/bin/cat)
        - Turn on debugging on the agent – and check the log file
        - Check that the zabbix user (on agent host) have permission to run cat …
        BR
        Erik

        Comment

        • jamied66
          Member
          • Sep 2008
          • 37

          #5
          if this is your first custom check on this server, also double-check that the zabbix user has a shell avaiable (look in /etc/passwd and make sure the zabbix user's shell is set to /bin/bash instead of something like /bin/false or /sbin/nologin).

          Comment

          Working...