Ad Widget

Collapse

Trigger a windows txt file which within its content will have a value of 1 or 0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • beluwi23
    Junior Member
    • Oct 2021
    • 2

    #1

    Trigger a windows txt file which within its content will have a value of 1 or 0

    I have been working to create a trigger that will be capable to check the value inside of a windows server file.txt which within its content will have a value of 1 or 0.

    Zabbix will read the file and if the read value is = 1, it will do nothing. If not (0) , it will sent an alert and restart the service.

    {server.com:vfs.file.regexp[D:\path.txt].last(#3,"0",eq)}> 1

    but I when I try to update it says
    • Incorrect trigger function "last(#3,"0",eq)" provided in expression. Invalid number of parameters.
    Zabbix 4.4.4 version

    Any ideas?

    Thanks

  • niveastn
    Member
    • Oct 2021
    • 82

    #2
    Hey there

    I dont really understand why the "0" and eq in your parameters

    Try this

    Trigger expression > {host:item.last(#3)}=0 (if last 3 checks = 0 , alert)
    Recovery expression > {host:item.last(#3)}>=1

    Comment

    • beluwi23
      Junior Member
      • Oct 2021
      • 2

      #3
      Thanks Guys for your response, I already created the trigger with some Zabbix suggestions and finally it worked for me, just adding those values count(#15,"0",eq)}> 1 and use the vfs.file.contents as expression also the file must be in UTF-8 ANSI.

      Comment

      • cyber
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Dec 2006
        • 4806

        #4
        Originally posted by niveastn
        Hey there
        I dont really understand why the "0" and eq in your parameters
        Try this
        Trigger expression > {host:item.last(#3)}=0 (if last 3 checks = 0 , alert)
        Recovery expression > {host:item.last(#3)}>=1
        Wrong... last() works differently with #x. last(#3) is not "last three values" but it is 3rd value from the list...
        so if you want to trigger after value has been 0 for 3 times in a row. then use sum(#3)=0 for example.

        Comment

        Working...