Assistance with Check_File_Age plugin
Assistance with Check_File_Age plugin
Hello,
I'm new to Nagios and am trying to set up the Check_File_Age plugin to monitor directories on a Windows Server. Here's what I've done so far for testing:
1. Verified that Linux is at 6.10 Centos release (Final)
2. Installed NCPA on the host that I want to monitor
3. Copied the Check_File_Age plugin to the Windows server directory C:\Program Files (x86)\Nagios\NCPA\plugins
4. Ensured that the service is Check_File_Age active
5. Defined the monitoring command as:
check_xi_ncpa!-t '<redacted>' -P 5693 -M 'plugins/check_file_age' -H <redacted> -w 10 -c 20 -f 'c:\\test.txt'
When I run the command it comes back with:
Critical
(No output on stdout) stderr: Usage: check_ncpa.py [options]
check_ncpa.py: error: no such option: -f
Thanks in advance for any assistance.
Mike
I'm new to Nagios and am trying to set up the Check_File_Age plugin to monitor directories on a Windows Server. Here's what I've done so far for testing:
1. Verified that Linux is at 6.10 Centos release (Final)
2. Installed NCPA on the host that I want to monitor
3. Copied the Check_File_Age plugin to the Windows server directory C:\Program Files (x86)\Nagios\NCPA\plugins
4. Ensured that the service is Check_File_Age active
5. Defined the monitoring command as:
check_xi_ncpa!-t '<redacted>' -P 5693 -M 'plugins/check_file_age' -H <redacted> -w 10 -c 20 -f 'c:\\test.txt'
When I run the command it comes back with:
Critical
(No output on stdout) stderr: Usage: check_ncpa.py [options]
check_ncpa.py: error: no such option: -f
Thanks in advance for any assistance.
Mike
Re: Assistance with Check_File_Age plugin
Hey @mbishop4! Welcome to the forum.
I'm afraid the plugin should probably be run from the libexec folder on your XI server, unless I misunderstand what you're doing...
You may want to have a look at the following document for more information on configuring and testing plugins in XI.
PLUGINS IN NAGIOS XI
Feel free to link me the document you are following if you feel that I'm lacking context here.
I'm afraid the plugin should probably be run from the libexec folder on your XI server, unless I misunderstand what you're doing...
Code: Select all
/usr/local/nagios/libexecPLUGINS IN NAGIOS XI
Feel free to link me the document you are following if you feel that I'm lacking context here.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Assistance with Check_File_Age plugin
Anyone? Even a pointer to the right documentation would be appreciated.
Re: Assistance with Check_File_Age plugin
The check_file_age plugin is supposed to be run on Linux. It's not going to work on Windows. I would recommend that you try a different plugin, e.g. Powershell Script. I found this one on the Nagios Exchange:
https://exchange.nagios.org/directory/P ... ry/details
Once you make sure the plugin works "locally", you could call it from the Nagios XI server via NCPA.
https://www.nagios.org/ncpa/help.php#ap ... es-plugins
https://exchange.nagios.org/directory/P ... ry/details
Once you make sure the plugin works "locally", you could call it from the Nagios XI server via NCPA.
https://www.nagios.org/ncpa/help.php#ap ... es-plugins
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Assistance with Check_File_Age plugin
Thanks for the link!jbrunkow wrote:Hey @mbishop4
You may want to have a look at the following document for more information on configuring and testing plugins in XI.
PLUGINS IN NAGIOS XI
Re: Assistance with Check_File_Age plugin
Thanks for the information and the link.lmiltchev wrote:The check_file_age plugin is supposed to be run on Linux. It's not going to work on Windows. I would recommend that you try a different plugin, e.g. Powershell Script. I found this one on the Nagios Exchange:
https://exchange.nagios.org/directory/P ... ry/details
Once you make sure the plugin works "locally", you could call it from the Nagios XI server via NCPA.
https://www.nagios.org/ncpa/help.php#ap ... es-plugins
Re: Assistance with Check_File_Age plugin
You are welcome! Let us know if you have any further questions.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Assistance with Check_File_Age plugin
I have this working from a terminal session on the Windows machine. The directions for it say:lmiltchev wrote:I found this one on the Nagios Exchange:
https://exchange.nagios.org/directory/P ... ry/details
Once you make sure the plugin works "locally", you could call it from the Nagios XI server via NCPA.
https://www.nagios.org/ncpa/help.php#ap ... es-plugins
1. Copy the plugin in scripts directory of your nsclient folder
2. modify the Path & age in the plugin
3. add the command alias under "/settings/external scripts/wrapped scripts"
1 and 2 were no problem. Can you tell me where or what file I'd edit for step 3?
Re: Assistance with Check_File_Age plugin
The directions, listed on the Nagios Exchange are for NSClient++. My understanding was that you were trying to call the plugin via NCPA. You can use either agent but we recommend using NCPA. So, here's what you need to do:
1. Copy the plugin in the "C:\Program Files (x86)\Nagios\NCPA\plugins" directory on the Windows machine, running NCPA.
2. Open the plugin in a text editor, e.g. Notepad++, and modify the path, and number of days, hours, and minutes to match your requirements.
Example:
Save and exit.
3. Test the plugin from the command line by running the command below on the Nagios XI server:
Substitute the <client ip> and <token> with the actual IP address of the Windows machine and your NCPA token.
Example:
You could also test the command in the GUI, by accessing the NCPA API Endpoint.
Let us know if this helped.
1. Copy the plugin in the "C:\Program Files (x86)\Nagios\NCPA\plugins" directory on the Windows machine, running NCPA.
2. Open the plugin in a text editor, e.g. Notepad++, and modify the path, and number of days, hours, and minutes to match your requirements.
Example:
Code: Select all
$fullPath = "D:\TEMP\"
$numdays = 0
$numhours = 0
$nummins = 453. Test the plugin from the command line by running the command below on the Nagios XI server:
Code: Select all
/usr/local/nagios/libexec/check_ncpa.py -H <client ip> -t '<token>' -M 'plugins/check_fileage.ps1' -q ''Example:
Code: Select all
[root@main-nagios-xi ~]# /usr/local/nagios/libexec/check_ncpa.py -H x.x.x.x -t 'mytoken' -M 'plugins/check_fileage.ps1' -q ''
Old: test.txtLet us know if this helped.
You do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Assistance with Check_File_Age plugin
This helped tremendously, thanks! I have it all working now.