Page 1 of 1
Manage Plugins
Posted: Sun Nov 06, 2016 8:24 am
by bashar.abed
Hi,
i am administrator at Nagios Xi version 5.3.2 VM,our case as below
we have server win 2012 VM we need to check file exist it by using Nagios features
• Checking whether no records inserted into this log file and send alarm to server administartor the location on server is D:\xxx\20161023-Sms.log the file create every 24 hours
i need to help me to fill the check command and command view as attached file
thanks
Re: Manage Plugins
Posted: Mon Nov 07, 2016 9:42 am
by rkennedy
Do you have NSClient++ installed on the client machine already? If not, uou'll want to do so, and then look at the check_files option which can do exactly what you're after.
https://docs.nsclient.org/reference/win ... heck_files
Re: Manage Plugins
Posted: Tue Nov 08, 2016 3:30 am
by bashar.abed
Hi,
NSClient++ already installed on the client machine,just i want to fill the Service Management (check commands and command view)
for example in other service check commands/check_nrpe ,command view $USER1$/check_nrpe -H $HOSTADDRESS$ -t 180 -c $ARG1$ $ARG2$
thanks
Re: Manage Plugins
Posted: Tue Nov 08, 2016 11:28 am
by rkennedy
Take a look at this link -
http://sites.box293.com/nagios/guides/c ... es-folders
Depending on your NSClient++ version, this is the section to look for -
Code: Select all
Make Sure A Specific File Exists
Check for a specific file in a folder. Generate a critical alert if file is not found.
Re: Manage Plugins
Posted: Tue Nov 08, 2016 2:21 pm
by bashar.abed
Hi,
Many thanks for info and documents, but I need the command to check the file if the size is 0 send critical if not send normal .
Re: Manage Plugins
Posted: Tue Nov 08, 2016 2:28 pm
by avandemore
That is covered in the document, see the section: Files Greater Than A Size
Also please note checking if a file exists is a very different requirement that checking if it is > 0 bytes.
Re: Manage Plugins
Posted: Tue Nov 08, 2016 2:43 pm
by bashar.abed
I read your the document, my case is the system generate a file if the file didn't write any word it is critical
So what is suitable command to check it
Thanks for help
Re: Manage Plugins
Posted: Tue Nov 08, 2016 3:25 pm
by avandemore
As noted above by rkennedy, this depends on your NSClient++ version. Please see the section
Files Greater Than A Size for example commands by version.
For example, the shown command
check_nrpe -H 192.168.142.1 -t 30 -c check_files -a path='C:\\NO BACKUP' pattern=*.* 'filter=size gt 500M' 'critical=count>0' 'detail-syntax=%(filename): %(size)' 'empty-state=ok'
will check 192.168.142.1 "C:\NO BACKUP" for files larger than 500 MB. If such a file is found, a Critical state is raised in Nagios.
You can find more detail here:
https://docs.nsclient.org/0.4.3/samples/#check-files