Migrating to NCPA

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Migrating to NCPA

Post by BanditBBS »

So all my Windows servers are running an older version of NSCLIENT+. I have tested NCPA and want to start using it. For what I need the standard install would work except for 1 small change in the cfg file(which of course requires a service restart) and 1 plugin that needs copied into the plugin folder.

For linux I can script all this and it'll be easy(many more plugins to copy too, but again, easy for me). My problem is only with the Windows, how is everyone else handling this? New servers won't be an issue as it'll just be a part of the build process for us, but I've got about 200 Windows hosts that manually I have these steps:
Install NCPA
  • Open Notepad as admin
  • make the small cfg change and save
  • Restart service
  • Copy plugin to plugin folder
Am I being stupid and not thinking of an easier method that can be scripted? These are all member servers of a domain.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
jdunitz
Posts: 235
Joined: Wed Feb 05, 2020 2:50 pm

Re: Migrating to NCPA

Post by jdunitz »

Pretty much all of this can be done with powershell.

I found this example of in-place string replacement in a file like this:
(Get-Content C:\Scripts\Test.txt) |
Foreach-Object {$_ -replace "oldString", "newString"} |
Set-Content C:\Scripts\Test.txt

here:
https://superuser.com/questions/674400/ ... irectory-w


Restart-Service -name ncpalistener

Powershell could also copy/download a file for you, or generate it from scratch.

If you're not opposed to doing so, you could also install Cygwin on all of your Windows machines, and then you can do things the Unixy way.

You could also use something like Cholocatey to blast out a config-file package you put together. I can't give specific advice on how exactly this works, but I know it's possible.

There are lots of possibilities, but these are a couple that I can suggest.

--Jeffrey
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Migrating to NCPA

Post by BanditBBS »

@jdunitz the powershell hint works for me. If you don't mind, don't lock this in case any other user want to reply with their methods :) Of course reply to it to knock off your support dashboard.

Thanks
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Migrating to NCPA

Post by ssax »

We'll leave it open for you.

Back in my day I just scripted it out with batch files/psexec.

Pretty sure you can do it through SCCM if you have that as well.

If you don't have a config management solution such as chef/puppet/ansible/SCCM I would look into setting one up for doing bulk changes like this, they make life a lot easier for deploying/changing things in bulk.
Locked