Ticket #160 (closed enhancement: fixed)

Opened 4 years ago

Last modified 3 weeks ago

Extend capabilities of syntax argument.

Reported by: Matthew Owned by: mickem
Priority: 5 Milestone: 0.4.0
Component: CheckSystem Version: 0.3.1
Severity: Feature Requests Keywords:
Cc:

Description

With reference to Help request #124 and with particular regard to the CheckFile command.

The CheckFile command returns the name of each file matched. If the length of all names exceeds 1024 (or 4000 odd now I guess) bytes the message can not be sent. Not only does this necessitates the use of the truncate argument but the end messages on the Nagios GUI tend to be pretty opaque. This gets worse if you use the syntax argument as the expression used as the syntax is repeated for each matched file. I would like to suggest the following to improve this:

  1. Additional variables: %MinWarn% or %MaxWarn%, %MinCrit% or %MaxCrit% and %Result% as returned in the performance data.
  1. Additional variable: %Matches% (ie. in CheckFile all matched files.)
  1. Additional variable: %Status% (ie. OK Warning Critical)
  1. The syntax argument have the ability to only be evaluated once - maybe a new argument (eg. syntax_unique) easiest way to do this.

eg.

for Directory c:\tmp containing files 1.xml 2.xml 3.xml

CheckFile file=c:\tmp\*.xml syntax_unique="%Status%: %Result% files match" MaxWarn=3 MaxCrit=4 filter-size=>0

should return something like

Warning: 3 files match|''=3;3;4;

While:

CheckFile file=c:\tmp\*.xml syntax_unique="%Result%: These files found: %Matches%" MaxWarn=3 MaxCrit=4 filter-size=>0

Should return something like:

Warning: These files found: 1.xml 2.xml 3.xml

Change History

comment:1 Changed 3 weeks ago by mickem

  • Status changed from new to closed
  • Resolution set to fixed

Syntax fixed in 0.3.9 lenghts fixed in 0.4.0

Note: See TracTickets for help on using tickets.