Ad Widget

Collapse

how to monitor vales in file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mkiler
    Junior Member
    • Aug 2017
    • 2

    #1

    how to monitor vales in file

    Hi, I have a problem.
    I have a file like this:

    Code:
    Enabled=0
    Status=0
    Value1=5
    Value2=10
    Value3=70
    This is a file where application put result - information about device.
    This file always looks in the same way, not like /var/log/messeges (never ending story).

    And now each value can bo in range from 1 to 100.
    I expect that if Value1 is less than 10 i should receive notification.

    Ho to do that? How to extract number 5,10,70 from line and monitor changes?
    Or better way is check if files contain line Value1=10, Value1=9 etc. and then run trigger and sent notifocation.

    Please help
  • ysus
    Senior Member
    • Mar 2016
    • 100

    #2
    Assuming this file is somewhere on Zabbix server I would suggest to write a small bash script with grep/tr/cut or sed commands

    Comment

    • mkiler
      Junior Member
      • Aug 2017
      • 2

      #3
      unfortunately this is a file on external machine

      I have a lot machines with same file, at same location. File structure are the same on each computer.

      Comment

      • ysus
        Senior Member
        • Mar 2016
        • 100

        #4
        I see at least 2 options

        1. Create cron job to copy file from every machine to zabbix server and parse them locally

        2. Install zabbix agent on every machine and use local script passing result to UserParameter

        Comment

        Working...