Nagios Cross-Platform Agent silent install with powershell

Got bored packaged and app, based on Reddit User's script. then deploy it as an application in SCCM/MECM

SCRIPTSPROGRAMS

b

1/30/20242 min read

I'm making this post post because it is easier that trying to figure out how to reply properly on reddit.

original script from Mr Redditguy

first you need the files. download from here.

https://www.nagios.org/ncpa/#downloads

The version in used is here https://assets.nagios.com/downloads/ncpa3/ncpa-3.0.1.exe

here's the script

  1. start out by generating a random password (you could just make up any password here if you wanted)

  2. then get your current computername

  3. then the arguments actually needed for the installer. silent install commands here

  4. create some folders logs and temp these aren't needed for the install, but used for logging purposes incase they didn't already exist

  5. install the application and wait for the process to exist before writing the exist code to the logs.

  6. write the config information to a log

  7. then install completed.

Now set it up as an application in SCCM in the typical fashion.

right-click on application node -> create application ->manually specify the application information (next)-> give it a name and other info (next)-> give it software center info (next) -> add deployment type -> type: script installer(next)->name(next)->

the important bits

content location = your content location?

Install Program = Powershell.exe -file "Nagios_NCPA_3.0.1.0_R00.ps1"

Uninstall Program = "C:\Program Files\Nagios\NCPA\uninstall.exe" /AllUsers /S

Add file system detection method

Path = C:\Program Files\Nagios\NCPA

Filename = uninstall.exe

let's deploy the app and see if it installs

first we see the files shows up from the detection method.

test the login based on the information saved under c:\temp\NCPAServerData.txt

open a browser and goto https://localhost:5693