Apply Configuration Script?

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
Locked
lmncruser
Posts: 4
Joined: Fri Nov 09, 2018 4:03 pm

Apply Configuration Script?

Post by lmncruser »

Hi,
Is there a way to do 'Apply Configuration' through a script? After a fresh install the ports 2056 and 2057 are not open and the only way I can get them to listen is to log in, go to Configuration, and click Apply Configuration. I am trying to set up an automated build and I do not want the users messing around with the configurations. I tried running the 'php /var/.../index.php configure apply_to_instances' command from the restore_backup.sh script but this does not seem to work, nor does it return errors. Please advise. Thanks!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Apply Configuration Script?

Post by scottwilkerson »

To blindly write the configs to the current instance you could run

Code: Select all

php /var/www/html/nagioslogserver/www/index.php configure write_configs_for_node
And then most importantly you need to restart logstash

Code: Select all

systemctl restart logstash
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
lmncruser
Posts: 4
Joined: Fri Nov 09, 2018 4:03 pm

Re: Apply Configuration Script?

Post by lmncruser »

This doesnt seem to be working. The "configure write_configs_for_node" command does not seem to throw errors (i edited php.ini to show them then restarted the machine) and logstash restarts successfully. After I restart logstash I run

Code: Select all

netstat -tulpn | grep LISTEN 
to look for ports 2056 and 2057 for Ncat to connect to but they are not active.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Apply Configuration Script?

Post by scottwilkerson »

Have you already done the install steps through the GUI?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
lmncruser
Posts: 4
Joined: Fri Nov 09, 2018 4:03 pm

Re: Apply Configuration Script?

Post by lmncruser »

I take it back, the "configure write_configs_for_node" command worked after all. It wasnt working on the box I was using at the time but I did a full rebuild, ran that command and the ports opened up. Thanks! You can close this thread.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Apply Configuration Script?

Post by scottwilkerson »

lmncruser wrote:I take it back, the "configure write_configs_for_node" command worked after all. It wasnt working on the box I was using at the time but I did a full rebuild, ran that command and the ports opened up. Thanks! You can close this thread.
Great!

Locking
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked