nagiosxi/admin/updates.php via shell?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Pres-Gas
Posts: 52
Joined: Thu Mar 22, 2012 12:09 pm

nagiosxi/admin/updates.php via shell?

Post by Pres-Gas »

Our servers are behind a private network and most of our settings have been working fine for this. The only thing that does not seem to be working is the web interface for "Check for Updates". I am having some trouble figuring out what to put in for the proxy configuration and would like some pointers for that.

Additionally, I was wondering if there was a way to run the updates.php script from the terminal (I have our proxy set up in our bash env for other tasks)?

We already automate removal of services/hosts with php scripts:

/usr/local/nagiosxi/scripts/nagiosql_delete_service.php
/usr/local/nagiosxi/scripts/nagiosql_delete_host.php

...and I know /usr/local/nagiosxi/scripts/reconfigure_nagios.sh also calls php scripts in line.

If I can be told the proper script to use and what arguments to feed it I would not have to use the web interface and can use the shell proxy settings I already use for upgrade installations. It may also help the XI community in implementing some other DevOps-y tasks like we use the scripts mentioned above.

Thanks,
Robert
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: nagiosxi/admin/updates.php via shell?

Post by gormank »

Have you tried
locate .php | grep -i update
and
php </path/script>.php

After reading the script to make sure its just checking?
Use the same technique to do the update once you trust the update bit.
You have to be a bit of a detective to figure out Nagios stuff... :)
Pres-Gas
Posts: 52
Joined: Thu Mar 22, 2012 12:09 pm

Re: nagiosxi/admin/updates.php via shell?

Post by Pres-Gas »

gormank wrote:Have you tried
locate .php | grep -i update
and
php </path/script>.php

After reading the script to make sure its just checking?
Use the same technique to do the update once you trust the update bit.
This does not work as it looks to be crypted by SourceGuardian.
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: nagiosxi/admin/updates.php via shell?

Post by gormank »

I don't know php, but it should be trivial to create a script to call the function in this:
/usr/local/nagiosxi/html/includes/utils-updatecheck.inc.php

I'm not subtle... :)
find / -name *.php | grep nagios | xargs grep do_update_check
/root/nagios_install/files/install_admin.php:do_update_check(true,true);
/usr/local/nagiosxi/html/includes/components/xicore/ajaxhelpers-misc.inc.php: do_update_check($force);
/usr/local/nagiosxi/html/includes/utils-updatecheck.inc.php:function do_update_check($forced = false, $firstcheck = false)
/usr/local/nagiosxi/html/install.php: do_update_check(true, true);
Pres-Gas
Posts: 52
Joined: Thu Mar 22, 2012 12:09 pm

Re: nagiosxi/admin/updates.php via shell?

Post by Pres-Gas »

Pres-Gas wrote:Our servers are behind a private network and most of our settings have been working fine for this. The only thing that does not seem to be working is the web interface for "Check for Updates". I am having some trouble figuring out what to put in for the proxy configuration and would like some pointers for that.
Anyone know what to put in for the "Proxy Address:" field? Should we put in http:// or https://, etc? What does the "Use HTTP tunnel" mean? What url is it trying to contact for the update/licensing?

Thanks,
Robert
Pres-Gas
Posts: 52
Joined: Thu Mar 22, 2012 12:09 pm

Re: nagiosxi/admin/updates.php via shell?

Post by Pres-Gas »

I realized I may not be clear on what I am trying to do. Our licensing is renewed but our servers cannot see this fact as they need to "phone home". The sales team says I should really just be able to go to Admin=>Check for Updates, but since we are in a private network it can't phone home.
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: nagiosxi/admin/updates.php via shell?

Post by gormank »

You need to re-apply the new license.
For the proxy, go to admin, proxy configuration and enter the proxy address/hostname, port, etc.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: nagiosxi/admin/updates.php via shell?

Post by ssax »

Just put in your proxy IP address or DNS name in the component settings, no need to use "http://" or "https://".

I've always seen the "Use HTTP tunnel" set but here is what it means:

https://curl.haxx.se/libcurl/c/CURLOPT_ ... UNNEL.html

As for upgrading from the command line, these commands should work:

Code: Select all

wget http://assets.nagios.com/downloads/nagiosxi/xi-latest.tar.gz -O /usr/local/nagiosxi/tmp/xi-latest.tar.gz
/usr/local/nagiosxi/scripts/upgrade_to_latest.sh
Pres-Gas
Posts: 52
Joined: Thu Mar 22, 2012 12:09 pm

Re: nagiosxi/admin/updates.php via shell?

Post by Pres-Gas »

ssax wrote:Just put in your proxy IP address or DNS name in the component settings, no need to use "http://" or "https://".

I've always seen the "Use HTTP tunnel" set but here is what it means:

https://curl.haxx.se/libcurl/c/CURLOPT_ ... UNNEL.html

As for upgrading from the command line, these commands should work:

Code: Select all

wget http://assets.nagios.com/downloads/nagiosxi/xi-latest.tar.gz -O /usr/local/nagiosxi/tmp/xi-latest.tar.gz
/usr/local/nagiosxi/scripts/upgrade_to_latest.sh
ssax,

I have no trouble actually performing an upgrade. When we renewed our license, sales directed me to go to the Admin=>Check for Updates link. Maybe that is the wrong place? Should Admin=>License Information also perform some sub function that "phones home" to let my installation know it is activated for another year?

Thanks for chiming in,
Robert
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: nagiosxi/admin/updates.php via shell?

Post by ssax »

Yes it should go out and check your maintenance every time you go to Admin > License Information and if you have the proxy component setup it will try to go through the proxy (validated it on my proxy logs). Is yours not showing the extended date?
Locked