Page 1 of 1

Display Service Status Dynamically

Posted: Tue Apr 24, 2018 10:03 pm
by josh3006
Hi,

I have a CSV file which has list of statuses of services
My requirement here is to read this CSV file and display it all the services with the statues with amber light ( health of the service)
This list of services are dynamically added and not a constant service. Means the next interval of CSV will have different service name

Eg : Interval 1

GetFile, 1 , 1
PutFile, 2 , 3


Eg : Interval 2

PutToES, 1 , 1
GeneratePDF, 2 , 3

Does anyone here knows how this can be done using Nagios ?

Re: Display Service Status Dynamically

Posted: Wed Apr 25, 2018 2:40 pm
by cdienger
The check_logfiles(https://labs.consol.de/nagios/check_logfiles/index.html) can be used to find partterns in strings. For example, to print out the lines containing "2,3":

./check_logfiles --criticalpattern '2,3' --logfile=/home/file.csv --report=long --configdir /dev/null