Ncpa reinstall over existing does not update ncpa.cfg file

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
mcdonamw
Posts: 14
Joined: Mon Dec 04, 2023 5:36 pm

Ncpa reinstall over existing does not update ncpa.cfg file

Post by mcdonamw »

In Windows, I've found that if I simply install ncpa overtop of an existing installation, it will upgrade it to that new version, but I have cases where the previous install has an ncpa.cfg file with a bad token. It seems installing overtop does not overwrite an existing ncpa.cfg file.

Is there an option with the installer itself to force this, or do I have no choice but to move that previous ncpa.cfg file out of the way (del/rename/etc) before reinstall?

***EDIT*** Rewrote to make more clear.
Last edited by mcdonamw on Thu Aug 08, 2024 4:32 pm, edited 1 time in total.
User avatar
jmichaelson
Posts: 375
Joined: Wed Aug 23, 2023 1:02 pm

Re: Ncpa reinstall over existing does not update ncpa.cfg file

Post by jmichaelson »

Would you mind sharing how your script is doing the install to facilitate troubleshooting this?
Please let us know if you have any other questions or concerns.

-Jason
bbahn
Posts: 380
Joined: Thu Jan 12, 2023 5:42 pm

Re: Ncpa reinstall over existing does not update ncpa.cfg file

Post by bbahn »

Hello @mcdonamw,

When you upgrade NCPA, it keeps your ncpa.cfg in order to maintain your current configurations. If you want to change the token for NCPA with your script, you can use something like

Code: Select all

sudo sed -i '/^community_string.*=/c\community_string = [new_token_here]' /usr/local/ncpa/etc/ncpa.cfg
sudo systemctl restart ncpa
Actively advancing awesome answers with ardent alliteration, aptly addressing all ambiguities. Amplify your acumen and avail our amicable assistance. Eagerly awaiting your astute assessments of our advice.
mcdonamw
Posts: 14
Joined: Mon Dec 04, 2023 5:36 pm

Re: Ncpa reinstall over existing does not update ncpa.cfg file

Post by mcdonamw »

Apologies, I should have been more clear. I'm installing NCPA on Windows systems using Powershell. I'm simply using Invoke-Command to launch the installer in silent mode, including the token on the command line.

So there's no option on the installer itself to overwrite the current ncpa.cfg file?
bbahn
Posts: 380
Joined: Thu Jan 12, 2023 5:42 pm

Re: Ncpa reinstall over existing does not update ncpa.cfg file

Post by bbahn »

There is not. It is expected that users want to keep their configuration changes from previous versions. If you would like for this option to be added, I could file a feature request for you.
Actively advancing awesome answers with ardent alliteration, aptly addressing all ambiguities. Amplify your acumen and avail our amicable assistance. Eagerly awaiting your astute assessments of our advice.
mcdonamw
Posts: 14
Joined: Mon Dec 04, 2023 5:36 pm

Re: Ncpa reinstall over existing does not update ncpa.cfg file

Post by mcdonamw »

That makes sense. My concern is primarily the token not updating even though I passed it as part of the install. We're providing the token for a reason.

With that said, it would be nice to have an option for administrators to force a complete "reinstall" option, e.g. uninstall previous version before installing.
bbahn
Posts: 380
Joined: Thu Jan 12, 2023 5:42 pm

Re: Ncpa reinstall over existing does not update ncpa.cfg file

Post by bbahn »

@mcdonamw,

I'll file a feature request to upgrade the silent installs to be able to update configuration options and to be able to do a clean install after uninstalling the previous version.
Actively advancing awesome answers with ardent alliteration, aptly addressing all ambiguities. Amplify your acumen and avail our amicable assistance. Eagerly awaiting your astute assessments of our advice.
mcdonamw
Posts: 14
Joined: Mon Dec 04, 2023 5:36 pm

Re: Ncpa reinstall over existing does not update ncpa.cfg file

Post by mcdonamw »

Thank you!
Post Reply