Page 1 of 1
Manually update components from command line?
Posted: Thu Mar 21, 2019 11:13 am
by eloyd
Is there a command line equivalent of "Check for updates" and "Install updates" in the Nagios XI Admin -> Manage Components screen? We have a customer that wants to automate this process and I realized we had no knowledge of a script that did that, outside of the update script from a fresh install.
Re: Manually update components from command line?
Posted: Thu Mar 21, 2019 4:02 pm
by npolovenko
@eloyd, This is currently not possible. I can submit a feature request on your behalf if you'd like. Otherwise, you can try making a php script and have it require '/usr/local/nagiosxi/basedir/html/admin/components.php', then call the following functions:
do_checkupdates()
followed by
do_configure()
This should work in theory but needs to be tested.
Re: Manually update components from command line?
Posted: Thu Mar 21, 2019 4:09 pm
by eloyd
Feature request me, please!
In the meantime, I'm happy to go test....
Code: Select all
<html>
<body>
<data>Find big hammer...</data>
</body>
</html>
Re: Manually update components from command line?
Posted: Thu Mar 21, 2019 4:31 pm
by npolovenko
@eloyd, Ok, I will submit it!
Re: Manually update components from command line?
Posted: Mon Mar 25, 2019 8:16 am
by eloyd
Can't do it without a session ID, and I'm not ready to start hacking together a session ID from the command line. Maybe there's a way to do it with a valid token Id....
Re: Manually update components from command line?
Posted: Mon Mar 25, 2019 2:19 pm
by npolovenko
@eloyd, I see. I don't think token is going to work here because it is used just for the API right now. Guess we'll have to wait for Devs to look into this feature request then.
Re: Manually update components from command line?
Posted: Mon Mar 25, 2019 2:27 pm
by eloyd
My next attempt will be via scripted curl, but I'm too lazy to program that before I leave for the day.

Re: Manually update components from command line?
Posted: Mon Mar 25, 2019 4:50 pm
by npolovenko
@eloyd, No problem, let us know how it goes when you get to it!