Page 1 of 2
NCPA to monitor all disks on windows server
Posted: Mon Jun 08, 2020 9:00 am
by Bala.Mutyam
Hi there,
Is it possible to configure NCPA to monitor all disks/drives on a windows server? I've seen some old posts related to this back in 2018 not recently.
Thanks
Bala
Re: NCPA to monitor all disks on windows server
Posted: Mon Jun 08, 2020 4:27 pm
by ssax
There is no built-in NCPA API endpoint that allows you to check all disks in a single check at this time.
Your only option would be to find a plugin that does it and use the plugins API endpoint to call the plugin, see here for more info:
https://www.nagios.org/ncpa/help.php#ap ... es-plugins
If you would like that added to NCPA, please open a feature request here as there doesn't look like there's an open one for this:
https://github.com/NagiosEnterprises/ncpa/issues
Thank you.
Re: NCPA to monitor all disks on windows server
Posted: Mon Jun 08, 2020 4:43 pm
by cdienger
@Bala.Mutyam I pinged dev and we'll be reopening
https://github.com/NagiosEnterprises/ncpa/issues/178 so there is no need to open a new feature request.
Re: NCPA to monitor all disks on windows server
Posted: Tue Jun 09, 2020 3:54 am
by Bala.Mutyam
@ssax Thank you. Would you suggest a plugin which works with NCPA please?
Re: NCPA to monitor all disks on windows server
Posted: Tue Jun 09, 2020 3:55 am
by Bala.Mutyam
@cdienger: Thank you.
Re: NCPA to monitor all disks on windows server
Posted: Tue Jun 09, 2020 2:36 pm
by lmiltchev
You could try using a 3rd party plugin, called check_multi, which can combine multiple checks into one. I haven't used it lately, and I am not sure if it's going to work well with the latest version of XI, but you could give it a try. It is listed on the Nagios Exchange here:
https://exchange.nagios.org/directory/P ... ti/details
The one, listed on GitHub could a a newer version - you can check this one as well:
https://github.com/flackem/check_multi
Once you have your check in place, tested from the command line, you could add a command and a service to Nagios XI by following the document below:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Hope this helps.
Re: NCPA to monitor all disks on windows server
Posted: Wed Jun 10, 2020 9:50 am
by Bala.Mutyam
@lmiltchev - Thanks for the update. Actually i'm looking for a plugin to monitor windows server disks/drives with one check.
Re: NCPA to monitor all disks on windows server
Posted: Wed Jun 10, 2020 10:28 am
by lmiltchev
This is what check_multi does - combines multiple checks into one.
Example service:
Code: Select all
define service {
host_name OldWorkstation-NCPA
service_description Check Drives
use xiwizard_generic_service
check_command check_multi!!!!!!!!
contacts nagiosadmin
register 1
}
Example command:
Code: Select all
define command {
command_name check_multi
command_line $USER1$/check_multi -f $USER1$/multi
}
Example config (with a couple of checks):
Code: Select all
command[Disk_C]=/usr/local/nagios/libexec/check_ncpa.py -H x.x.x.x -t 'mytoken' -P 5693 -M 'disk/logical/C:|' -w 70 -c 90
command[Disk_D]=/usr/local/nagios/libexec/check_ncpa.py -H x.x.x.x -t 'mytoken' -P 5693 -M 'disk/logical/D:|' -w 70 -c 90
Example of the plugin, run from the CLI:
Code: Select all
[nagios@main-nagios-xi libexec]$/usr/local/nagios/libexec/check_multi -f multi
OK - 2 plugins checked, 2 ok
[ 1] Disk_C OK: Used disk space was 58.20 % (Used: 62.58 GiB, Free: 44.86 GiB, Total: 107.44 GiB) [Disk_C perfdata discarded for 'used': bad UOM 'GiB' in data '62.58GiB;75;97;' ]
[ 2] Disk_D OK: Used disk space was 7.90 % (Used: 74.01 GiB, Free: 857.27 GiB, Total: 931.29 GiB) [Disk_D perfdata discarded for 'used': bad UOM 'GiB' in data '74.01GiB;652;838;' ]|check_multi::check_multi::plugins=2 time=0.266985
Example of the service in the GUI:
example-01.jpg
Is this something that you are looking for?
Re: NCPA to monitor all disks on windows server
Posted: Wed Jun 17, 2020 4:10 am
by Bala.Mutyam
@lmiltchev: Hi, thanks for that but that's not i'm after. I don't to combine multiple check, just a check monitor all disk on windows server.
Re: NCPA to monitor all disks on windows server
Posted: Wed Jun 17, 2020 9:21 am
by lmiltchev
Unfortunately, there is no such option in NCPA. If you could find a script, e.g. PowerShell script, that can monitor all drives on Windows (locally) via one check, you could call it via NCPA from the Nagios XI server.
Example:
Code: Select all
/usr/local/nagios/libexec/check_ncpa.py -H <client ip> -t <token> -M 'plugins/<your script>
Currently, this is the only option that I could offer.