Outils pour utilisateurs

Outils du site


tech:notes_nsclient_nagios_windows

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
tech:notes_nsclient_nagios_windows [2025/05/12 17:02] Jean-Baptistetech:notes_nsclient_nagios_windows [2026/02/27 13:51] (Version actuelle) Jean-Baptiste
Ligne 1: Ligne 1:
 +<!DOCTYPE markdown>
 +{{tag>Nagios Centreon Windows REST Supervision}}
 +
 +# Notes NSClient (Agent Nagios / Centreon pour windows)
 +
 +Voir :
 +* https://assets.nagios.com/downloads/nagiosxi/docs/Configuring-The-Windows-Agent-NSClient++-for-Nagios-XI.pdf
 +* https://wiki.monitoring-fr.org/nagios/addons/nsclient.html
 +
 +WebAPI
 +
 +Voir : 
 +* [[Pb plugin Nagios centreon NSClient 403]]
 +
 +Voir aussi :
 +* check_ncpa
 +* check-mk-agent
 +* Exporter prometheus
 +
 +check_nt et Centreon : https://www.starmate.fr/centreon-et-nsclient/
 +
 +## Flux
 +
 +
 +| PORT          | SENS            | SERVICE        | PLUGIN                             |
 +| ------------- | --------------- | -------------- | ---------------------------------- |
 +| 12489/tcp     | NAGIOS => HOTE  | NSClientServer | check_nt                           |
 +| 5666/tcp      | NAGIOS => HOTE  | NRPEServer     | check_nrpe / check_centreon_nrpe3  |
 +| 5667/tcp      | NAGIOS <= HOTE  | NSCAClient                                        |
 +| 8443/tcp      | NAGIOS => HOTE  | NSClientServer | (restapi)                          |
 +| 80 or 443/tcp | NAGIOS <= HOTE  | NRDPClient                                        |
 +
 +En plus de 
 +
 +| PORT          | SENS            | SERVICE        | NOTE                               |
 +| ------------- | --------------- | -------------- | ---------------------------------- |
 +| ICMP          | NAGIOS => HOTE  | PING                                              |
 +| 161/udp       | NAGIOS => HOTE  | SNMP                                              |
 +| 162/udp       | NAGIOS <= HOTE  | SNMP Traps                                        |
 +
 +
 +~~~bash
 +# Port 5666
 +check_nrpe -H localhost -c check_load
 +
 +# Pour 1248
 +check_nt -H 192.168.1.10 -p 1248 -v UPTIME
 +check_nt -H 192.168.1.10 -p 1248 -v CLIENTVERSION
 +check_nt -H 192.168.1.10 -p 1248 -v INSTANCES -l Process
 +
 +#check_nt!CPULOAD!-l 5,80,90
 +#check_nt!MEMUSE!-w 80 -c 90
 +#check_nt!USEDDISKSPACE!-l c -w 80 -c 90
 +~~~
 +
 +~~~
 +$ /usr/lib64/nagios/plugins/check_nt -H 10.12.50.61 -p 12489 -s 'P@ssw0rd' -v USEDDISKSPACE -d SHOWALL -l c
 +c:\ - total: 49.90 Gb - used: 11.78 Gb (24%) - free 38.12 Gb (76%) | 'c:\ Used Space'=11.78Gb;0.00;0.00;0.00;49.90
 +~~~
 +
 +
 +
 +## Rest API
 +
 +
 +Changer 
 +
 +~~~ini
 +; Section for REST API users
 +[/settings/WEB/server/users/centreon]
 +password=centreon
 +role=limited
 +~~~
 +
 +en 
 +
 +~~~ini
 +; Section for REST API users
 +[/settings/WEB/server/users/SupUser]
 +password=P@ssw0rd
 +role=limited
 +~~~
 +
 +
 +### Autres
 +
 +The NSClient++ password can be found by running:
 +~~~winbatch
 +nscp web -- password --display
 +~~~
 +
 +or you can sett a new password:
 +~~~winbatch
 +nscp web -- password --set new-password
 +~~~
 +
 +Debug
 +~~~winbatch
 +nscp web password set=icinga --debug
 +~~~
 +
 +If you want to fill this file with all available options run the following command:
 +~~~winbatch
 +nscp settings --generate --add-defaults --load-all
 +~~~
 +
 +If you want to activate a module and bring in all its options use:
 +~~~winbatch
 +nscp settings --activate-module <MODULE NAME=""> --add-defaults
 +~~~
 +
 +For details run: 
 +~~~winbatch
 +nscp settings --help
 +~~~
 +
 +
 +## Conf
 +
 +Voir :
 +* https://assets.nagios.com/downloads/nagiosxi/docs/Configuring-The-Windows-Agent-NSClient++-for-Nagios-XI.pdf
 +* https://docs.centreon.com/fr/pp/integrations/plugin-packs/getting-started/how-to-guides/centreon-nsclient-tutorial/
 +* https://shinken.readthedocs.io/en/latest/13_monitoring/windows-monitoring-with-nsclient.html
 +* https://mehdinaciri.wordpress.com/wp-content/uploads/2013/06/installation-des-agents-nsclient-et-nrpe.pdf
 +
 +
 +''nsclient.ini''
 +~~~ini
 +[/settings/default]
 +password =Str0ngPassw0rd
 +; PORT NUMBER - Port to use for check_nt.
 +port = 12489
 +
 +[/modules]
 +NSClientServer = 1
 +CheckDisk = 1
 +CheckEventLog = 1
 +WebServer = 0
 +Scheduler = 1
 +
 +[/settings/default]
 +allowed hosts = 127.0.0.1,10.133.134.0/24,10.136.243.0/24
 +timeout = 30
 +
 +[/settings/log]
 +level = debug
 +~~~
 +
 +~~~ini
 +[/settings/default]
 +allowed hosts = 0.0.0.0/0
 +password = P@ssw0rd
 +port = 12489
 +
 +[/modules]
 +WEBServer = 1
 +NRPEServer = 0
 +NSClientServer = 1
 +
 +[/settings/WEB/server]
 +; ALLOWED HOSTS - A coma separated list of allowed hosts. You can use netmasks (/ syntax) or * to create ranges.
 +allowed hosts = 0.0.0.0/0
 +
 +[/settings/WEB/server/users/Sup]
 +password = P@ssw0rd
 +role=limited
 +~~~
 +
 +
 +
 +Multi instance - Multiple NSClient++
 +~~~winbatch
 +nscp service --install --name nscp2
 +~~~
 +Source : https://nsclient.org/docs/installing/
 +
 +Old
 +
 +~~~ini
 +[Settings]
 +use_file=1
 +
 +[modules]
 +NRPEListener.dll
 +NSClientListener.dll
 +;CheckWMI.dll
 +CheckSystem.dll
 +~~~
 +
 +
 +
 +
 +If you want to fill this file with all available options run the following command:
 +~~~winbatch
 +nscp settings --generate --add-defaults --load-all
 +~~~
 +
 +If you want to activate a module and bring in all its options use:
 +~~~winbatch
 +nscp settings --activate-module <MODULE NAME> --add-defaults
 +~~~
 +For details run: 
 +~~~winbatch
 +nscp settings --help
 +~~~
 +
 +
 +
 +
 +
 +## Notes
 +
 +NSCA - Nagios Service Check Acceptor : Supervision en mode actif
 +
 +
 +## Err
 +
 +~~~
 +# /usr/lib64/nagios/plugins/check_nt -H 10.12.50.61 -p 12489 -s 'P@ssw0rd' -v UPTIME
 +could not fetch information from server
 +~~~
 +
 +### Solution
 +
 +Dans mon cas il fallait autoriser le serveur Nagios par son nom ou son IP dans le fichier ''NSC.ini''
 +
 +
 +
  

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki