Monitor DHCP status using powershell
Posted: Mon Apr 30, 2018 5:30 am
Hi
Nagios newbie here.
I have received a task to setup DHCP status monitoring to specifically monitor alert if DHCP scope is getting full on several servers located externally that is connected to our main site using VPN.
We have a script server where we are allowed to run powershell scripts from and where we also use Nagios++ client to execute different scripts as vbs, batch, powershell.
I am trying to use this script to solve this : https://exchange.nagios.org/directory/P ... es/details
Checking the nsclient.ini file on the script server I can see there is already an entry for Powershell Wrapping for Nagios scripts called :
ps1 = cmd /c echo scripts\\%SCRIPT% %ARGS%; exit($lastexitcode | powershell.exe -command -
Probably entered by another colleague I can not get in touch with atm.
Question 1:
For my script (check_dhcp_scopes.ps1) , can I simply enter another wrapping as well under the current one in nsclient.ini file?
What wrapping should I then enter for my script ?
Question 2:
What command must be used from the Nagios server itself to execute this script ?
I have tried to understand how our Nagios is setup and I have a config file called services.cfg I presume I must add the check_nrpe20! and something command for the powershell script.
BR
Elefanten
Nagios newbie here.
I have received a task to setup DHCP status monitoring to specifically monitor alert if DHCP scope is getting full on several servers located externally that is connected to our main site using VPN.
We have a script server where we are allowed to run powershell scripts from and where we also use Nagios++ client to execute different scripts as vbs, batch, powershell.
I am trying to use this script to solve this : https://exchange.nagios.org/directory/P ... es/details
Checking the nsclient.ini file on the script server I can see there is already an entry for Powershell Wrapping for Nagios scripts called :
ps1 = cmd /c echo scripts\\%SCRIPT% %ARGS%; exit($lastexitcode | powershell.exe -command -
Probably entered by another colleague I can not get in touch with atm.
Question 1:
For my script (check_dhcp_scopes.ps1) , can I simply enter another wrapping as well under the current one in nsclient.ini file?
What wrapping should I then enter for my script ?
Question 2:
What command must be used from the Nagios server itself to execute this script ?
I have tried to understand how our Nagios is setup and I have a config file called services.cfg I presume I must add the check_nrpe20! and something command for the powershell script.
BR
Elefanten