Page 1 of 2

nagiosxi/admin/updates.php via shell?

Posted: Thu Mar 03, 2016 10:31 am
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

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

Posted: Thu Mar 03, 2016 11:48 am
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... :)

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

Posted: Thu Mar 03, 2016 1:18 pm
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.

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

Posted: Thu Mar 03, 2016 1:26 pm
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);

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

Posted: Thu Mar 03, 2016 1:51 pm
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

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

Posted: Thu Mar 03, 2016 2:00 pm
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.

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

Posted: Thu Mar 03, 2016 2:06 pm
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.

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

Posted: Thu Mar 03, 2016 4:07 pm
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

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

Posted: Thu Mar 03, 2016 4:15 pm
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

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

Posted: Thu Mar 03, 2016 5:07 pm
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?