Hi all!
We recently brought Nagios XI into our environment to monitor all of our assets. Our environment consists of mainly Windows 2012-2019 servers, so I've been struggling to find a solution to this one.
I've been working towards setting up folder monitoring for specific servers that check to make sure that files in a directory are older than one day. I don't believe Nagios has a good way of doing this out-of-the-box, so I've resorted to using NCPA plugins. I've gotten to the point where the the script does a good job at monitoring folders that do not have spaces in the name, but for those with spaces (C:\Program Files (x86)\ for example), I am having a very difficult time getting the script to pass the path to Nagios as a string.
The script I am using is located here: https://pastebin.com/PcU9Trki
I am calling the script via the NCPA by calling "check_xi_ncpa" with the following argument:
-H <IP Address> -t <token> -P 5693 -M 'plugins/check_windows_files2.ps1' -q "args=-checkPath C:\Program Files (x86)\Test\ -olderthanone"
Does anyone have any suggestions on how to easily monitor folder paths on Windows machines via Nagios XI, or any ideas on how to get my script to recognize paths with spaces?
Thanks in advance!
Nagios XI Windows Folder Monitoring
Re: Nagios XI Windows Folder Monitoring
Hi @JamesZimmerman,
Thank you for reaching out!
Unfortunately it looks like the script you linked is no longer accessible, however I would recommend looking into modifying said script to properly handle spaces in the "folder name" string.
If you have any other questions feel free to reach out!
Thank you for reaching out!
Unfortunately it looks like the script you linked is no longer accessible, however I would recommend looking into modifying said script to properly handle spaces in the "folder name" string.
If you have any other questions feel free to reach out!