Adding hosts and services to Nagios - Windows hosts
Adding Windows Host in Nagios
Connect to Server (nagios.apoyar)
Go to below path and edit .cfg file
• cd /usr/local/etc/nagios/objects/machines
• ls
• vi apoyar.cfg (depending on whether we are adding host for Apoyar or other customers)
Copy the configuration format for windows server added before
Edit the hostname (TempNCC) and address (tempncc.apoyar-networks.com) for new host
Add the host name in member list
Save file (:wq!) and exit vi editor
Go to below path
• cd /usr/local/etc/nagios/objects
• vi services.cfg
Add the new hostname to the services, which we need for new server in Nagios
We can do with following command, will get same services like Mercury DC for new host
- %s/Mercury-DC, /Mercury-DC, TempNCC, /gc
Save file (:wq!) and exit vi editor
For those services, which we need other than Mercury DC
Go to that particular service configuration and enter new server (TempNCC) name manually
Connect to new host (TempNCC)
Type in file explorer \\ncc1701d\\sourcefiles
dir
copy NSClient++ folder
Paste it on (TempNCC) server’s desktop
Open NSClient++ folder on desktop
• Install 64-bit file
• Generic
• Typical
• Install
• Finish
Open services
Stop NSClient++ service
Go to NSClient++ folder on desktop
Copy nsclient file
Go to
C:\Program Files\NSClient++
Paste, Replace file in destination
Go to NSClient++ folder on desktop
Open scripts folder
Copy four scripts
Go to
C:\Program Files\NSClient++\Scripts
Paste
Start NSClient++ service
Delete NSClient++ folder on Desktop
Disable Nagios notifications
Run below command to check all warnings and alerts
/usr/local/bin/nagios -v /usr/local/etc/nagios/nagios.cfg
To disable windows (ex. MapsBroker) service
Open PowerShell as admin
Run below command
Get-Service -Name MapsBroker | Set-Service -StartupType Disabled
Go to server manager on (TempNCC) server
• Manage
• Add roles and features
• Select .NET Framework 3.5
• Next
• Next
• Install
• Finish
After this go to https://nagios.apoyar.net/
Check for the server we added
Reschedule the check for all services
It will be visible and working in Nagios for Monitoring