Read File And Shows Output

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.
Locked
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Read File And Shows Output

Post by rlinux57 »

How can i show file output of windows through nagios ?

Lets say there's a test file in windows contain random data, how can i show the output in nagios.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Read File And Shows Output

Post by mcapra »

What is "displayed" on the Nagios end of things is (almost completely) dependent on what the specific plugin you are leveraging does. I don't know of a plugin that will read the entire contents of a file and display them in Nagios, but you're welcome to check on the Nagios Exchange. Personally, I would be averted to letting the Nagios engine directly load/read the contents of an arbitrary file (for security/performance reasons).

These plugins allow you to check the contents of a file in a samba share. If you simply want to make sure the file contains a certain string, these should do the trick:
https://exchange.nagios.org/directory/P ... le/details
https://exchange.nagios.org/directory/A ... nt/details

If neither of those are adequate, can you share more information about your use case?
Former Nagios employee
https://www.mcapra.com/
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: Read File And Shows Output

Post by bwallace »

Nagios can monitor for strings within a file and alert if something is outside of your specified threshold or does not match with the string you've set, but it will not display all of a file or parts of it - is that what you're looking to do?

There are many options on our exchange site for monitoring files on Windows, here are a few:

Check if a string or a chain provided by -s option is present in a file.
https://exchange.nagios.org/directory/A ... nt/details

check_winfile is a Nagios NRPE plugin for checking simple files or files in directories by using various types of filters like file count, size, age or name match.
https://exchange.nagios.org/directory/P ... TK/details

Counts the number of files in given directory and its sub-directories, with optional filters applied. The output is compatible with Nagios.
https://exchange.nagios.org/directory/P ... in/details

- Hope this helps -
Be sure to check out the Knowledgebase for helpful articles and solutions!
Locked