NSclient Installtion from CMD
NSclient Installtion from CMD
I am trying to automate the installation of nsclient by using below command:
NSCLIENT-0.4.4.23
msiexec /i C:\Users\abcd\Downloads\NSCP-0.4.4.23-x64.msi CONF_CAN_CHANGE=1 ALLOWED_HOSTS=10.0.0.45 NSCLIENT_PWD=redhat CONF_NSCLIENT=1 /quiet
This command working perfectly except the password is not getting updated in "nsclient.ini" file
I tried to provide password in these formats also:- "redhat" 'redhat' `redhat` but its not updating in the file. Can you please help here.
NSCLIENT-0.5.1.44
msiexec /i C:\Users\abcd\Downloads\NSCP-0.5.1.44-x64.msi CONF_CAN_CHANGE=enabled ALLOWED_HOSTS=10.0.0.45 NSCLIENT_PWD="redhat" CONF_NSCLIENT=enabled /quiet
After running this command, If I manually enable few options in nsclient.ini file given below, its working perfectly otherwise not working.
CheckDisk = enabled
CheckSystem = enabled
NSClientServer = enabled
Please give a solution to enable these options as well in a single command.
Thanks in advance.
NSCLIENT-0.4.4.23
msiexec /i C:\Users\abcd\Downloads\NSCP-0.4.4.23-x64.msi CONF_CAN_CHANGE=1 ALLOWED_HOSTS=10.0.0.45 NSCLIENT_PWD=redhat CONF_NSCLIENT=1 /quiet
This command working perfectly except the password is not getting updated in "nsclient.ini" file
I tried to provide password in these formats also:- "redhat" 'redhat' `redhat` but its not updating in the file. Can you please help here.
NSCLIENT-0.5.1.44
msiexec /i C:\Users\abcd\Downloads\NSCP-0.5.1.44-x64.msi CONF_CAN_CHANGE=enabled ALLOWED_HOSTS=10.0.0.45 NSCLIENT_PWD="redhat" CONF_NSCLIENT=enabled /quiet
After running this command, If I manually enable few options in nsclient.ini file given below, its working perfectly otherwise not working.
CheckDisk = enabled
CheckSystem = enabled
NSClientServer = enabled
Please give a solution to enable these options as well in a single command.
Thanks in advance.
-
dwasswa
Re: NSclient Installtion from CMD
Hi, @vinish098,
Please look at this doc....https://support.nagios.com/kb/article/n ... 0-4-1.html
And if you wish to automate a process you need to look into Power shell scripting..see links below
https://technet.microsoft.com/en-us/lib ... 51144.aspx
https://technet.microsoft.com/en-us/lib ... 37351.aspx
https://www.howtogeek.com/137803/geek-s ... owershell/
Please look at this doc....https://support.nagios.com/kb/article/n ... 0-4-1.html
And if you wish to automate a process you need to look into Power shell scripting..see links below
https://technet.microsoft.com/en-us/lib ... 51144.aspx
https://technet.microsoft.com/en-us/lib ... 37351.aspx
https://www.howtogeek.com/137803/geek-s ... owershell/
-
dwhitfield
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: NSclient Installtion from CMD
Thanks @Derick Wasswa!
I'd also like to point out that we do not maintain NSClient, so you may get better answers at http://nsclient.org. I am not suggesting we are unwilling to help. We just do not have the deep knowledge of the code like they do.
I'd also like to point out that we do not maintain NSClient, so you may get better answers at http://nsclient.org. I am not suggesting we are unwilling to help. We just do not have the deep knowledge of the code like they do.
Re: NSclient Installtion from CMD
Alternatively, rather than trying to fit all the configuration into a single command-line script, you might look into something like Chef, Puppet, or Ansible. Rather than being at the mercy of what NSClient++ offers as part of it's installer, you could delegate configuration file creation/modification to a process built on any one of those platforms. You could also script out stuff like downloading and setting up specific custom plugins for NSClient++, which I am almost certain cannot be done with the installer alone.
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
-
dwhitfield
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: NSclient Installtion from CMD
I know its tedious, but after installing, I used to stop the service, copy a standard ini file over the new one, and restart the service.
net stop nscp
sc failure nscp reset= 86400 actions= restart/120000/restart/120000/none/120000
xcopy c:\Temp\nsclient.ini "c:\Program Files\NSClient++\nsclient.ini" /q /y
net start nscp
The sc command changed the service settings so it would restart a few times before giving up.
net stop nscp
sc failure nscp reset= 86400 actions= restart/120000/restart/120000/none/120000
xcopy c:\Temp\nsclient.ini "c:\Program Files\NSClient++\nsclient.ini" /q /y
net start nscp
The sc command changed the service settings so it would restart a few times before giving up.
-
dwhitfield
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
-
spurrellian
- Posts: 43
- Joined: Tue Jan 06, 2015 6:26 am
- Location: Bath, UK
Re: NSclient Installtion from CMD
This is exactly how I do it, also run checks for OS Architecture and copy plugins accrossgormank wrote:I know its tedious, but after installing, I used to stop the service, copy a standard ini file over the new one, and restart the service.
net stop nscp
sc failure nscp reset= 86400 actions= restart/120000/restart/120000/none/120000
xcopy c:\Temp\nsclient.ini "c:\Program Files\NSClient++\nsclient.ini" /q /y
net start nscp
The sc command changed the service settings so it would restart a few times before giving up.
Code: Select all
:::: Check OS Architecture ::::
:CheckOS
IF EXIST "%PROGRAMFILES(X86)%" (GOTO 64BIT) ELSE (GOTO 32BIT)
:::: Install 64 Bit ::::
:64BIT
msiexec /i "%~dp0NSCP-0.4.3.143-x64.msi" /qb /norestart ADDDEFAULT=ALL REMOVE=Documentation REMOVE=WEBPlugins
copy "%~dp0nsclient.ini" "C:\Program Files\NSClient++\nsclient.ini" /y
GOTO PLUGIN
:::: Install 32 Bit ::::
:32BIT
msiexec /i "%~dp0NSCP-0.4.3.143-Win32.msi" /qb /norestart ADDDEFAULT=ALL REMOVE=Documentation REMOVE=WEBPlugins
copy "%~dp0nsclient.ini" "C:\Program Files\NSClient++\nsclient.ini" /y
GOTO PLUGIN
:::: Copy Nagios Plugins into Correct Directory ::::
:PLUGIN
IF EXIST "C:\WXScript\Scripts" (GOTO Wessex) ELSE (GOTO NonWessex)
:Wessex
md "C:\WXScript\Scripts\Scripts"
copy "%~dp0restart_auto_services.vbs" "C:\WXScript\Scripts\scripts\restart_auto_services.vbs"/y
copy "%~dp0nm-check-certificate-expiration.ps1" "C:\WXScript\Scripts\scripts\nm-check-certificate-expiration.ps1" /y
copy "%~dp0check_ms_win_updates.ps1" "C:\WXScript\Scripts\scripts\check_ms_win_updates.ps1" /y
copy "%~dp0restart_auto_services.vbs" "C:\Program Files\NSClient++\scripts\restart_auto_services.vbs"/y
copy "%~dp0nm-check-certificate-expiration.ps1" "C:\Program Files\NSClient++\scripts\nm-check-certificate-expiration.ps1" /y
copy "%~dp0check_ms_win_updates.ps1" "C:\Program Files\NSClient++\scripts\check_ms_win_updates.ps1" /y
net stop nscp
net start nscp
GOTO END
:NonWessex
copy "%~dp0restart_auto_services.vbs" "C:\Program Files\NSClient++\scripts\restart_auto_services.vbs"/y
copy "%~dp0nm-check-certificate-expiration.ps1" "C:\Program Files\NSClient++\scripts\nm-check-certificate-expiration.ps1" /y
copy "%~dp0check_ms_win_updates.ps1" "C:\Program Files\NSClient++\scripts\check_ms_win_updates.ps1" /y
net stop nscp
net start nscp
GOTO END
:END
Paul S - Using Nagios XI, Network Analyzer, Log Server
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: NSclient Installtion from CMD
Thanks all for the great suggestions.
I have around 700 windows servers in my environment.
Instead of login to each server and perform NSClient installation, Do we have any other option in order to save time and efforts from where we can push the installation from our Nagios server.
I have around 700 windows servers in my environment.
Instead of login to each server and perform NSClient installation, Do we have any other option in order to save time and efforts from where we can push the installation from our Nagios server.