Check File Content

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
User avatar
DrNox
Posts: 37
Joined: Wed Apr 19, 2017 9:20 am

Check File Content

Post by DrNox »

Hi,

I am trying to found a plugin which permit to check in a file if a got a right string (it's a summary of antivirus scan).
I see some plugin ( like it : https://exchange.nagios.org/directory/P ... nt/details ) but it don't really permit to do what i want.

If someone know a good plugin don't hesitate to tell me :)

Kind regards,

Nox
French Baguette
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Check File Content

Post by mcapra »

Is this plugin meant to be executed on a Windows machine or a Linux machine?

For Linux I recommend check_log3:
https://exchange.nagios.org/directory/P ... pl/details

For Windows I recommend check_logfiles, though it's a bit of a pain to build from scratch:
https://labs.consol.de/nagios/check_logfiles/
Former Nagios employee
https://www.mcapra.com/
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Check File Content

Post by scottwilkerson »

Probably the most common I usually see used is also
https://exchange.nagios.org/directory/P ... es/details
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
User avatar
DrNox
Posts: 37
Joined: Wed Apr 19, 2017 9:20 am

Re: Check File Content

Post by DrNox »

Thanks for your answers !
Is this plugin meant to be executed on a Windows machine or a Linux machine?
It s for manage a windows server 2008 R2

Then i will try https://exchange.nagios.org/directory/P ... 1493382673
i will come back to us if i got some issues :)
French Baguette
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Check File Content

Post by scottwilkerson »

Sounds good!
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
User avatar
DrNox
Posts: 37
Joined: Wed Apr 19, 2017 9:20 am

Re: Check File Content

Post by DrNox »

Hi,

I come back to you cause i have some issues :
On the plugin i don't saw where i can say that the string : "Infected files: 0" is okey and other number (>0) is critical.
And i'am totaly lost with this plugin : i don't know how to use it and install it ...
Do you know how to proceed ?
French Baguette
User avatar
DrNox
Posts: 37
Joined: Wed Apr 19, 2017 9:20 am

Re: Check File Content

Post by DrNox »

i forget to say that i manage Windows server :/
French Baguette
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Check File Content

Post by scottwilkerson »

DrNox wrote:Hi,

I come back to you cause i have some issues :
On the plugin i don't saw where i can say that the string : "Infected files: 0" is okey and other number (>0) is critical.
And i'am totaly lost with this plugin : i don't know how to use it and install it ...
Do you know how to proceed ?
From their page
--warning=<Number>. Complex handler-scripts can be provided with a warning-parameter (of course –critical is possible, too) this way. Inside the scripts the value is accessible as the macro CL_WARNING (resp. CL_CRITICAL).
https://labs.consol.de/nagios/check_log ... parameters
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
User avatar
DrNox
Posts: 37
Joined: Wed Apr 19, 2017 9:20 am

Re: Check File Content

Post by DrNox »

--warning=<Number>. Complex handler-scripts can be provided with a warning-parameter (of course –critical is possible, too) this way. Inside the scripts the value is accessible as the macro CL_WARNING (resp. CL_CRITICAL).
yeah, but on a string i can't put this ?

And if i'am with windows server, can I use this plugin ?
French Baguette
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Check File Content

Post by scottwilkerson »

You can but you would need to install an agent such as NSClient++
https://assets.nagios.com/downloads/nag ... ios-XI.pdf

However if you are just counting the files and installing the agent you may wish to configure the commands like described on this page:
http://sites.box293.com/nagios/guides/c ... es-folders

You will need to enable the NRPE listener as described in this doc
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked