admin/component configuration via script/API?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
psanchez
Posts: 23
Joined: Wed Oct 17, 2012 12:14 pm

admin/component configuration via script/API?

Post by psanchez »

Hello,

I would like to know if its possible, and if so how, to configure each of the below items via script/command line/API:
  • Scheduled Backups (FTP/SSH/LOCAL) - /nagiosxi/includes/components/scheduledbackups/managebackups.php
  • Manage Users - /nagiosxi/admin/users.php
  • Manage Components / Active Directory Integration - /nagiosxi/admin/components.php?config=active_directory
Basically, we want to make sure all our nagios instances are using AD authentication and that all members of a few allow groups exists so that they can access the Web GUI (not as contacts).
And if any user is missing, we should be able to quickly added them via script, (same goes for when a user is remove from the group we would like to be able to remove user) so that all our instances match....kind of an AD user import.

Also we are planing on having backup servers ready in case the prod one fails...so we are backing and restoring configuration...but would like to be able to reconfigure the 'Schedule Backup' once it has been restore, so that it doesn't backup to same location as prod instance.

Thanks in Advance!
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: admin/component configuration via script/API?

Post by abrist »

All three of your requests will require postgres db queries/inserts.


1. Backups: This is a protected component, so altering the script to accept cli params is out of the question for now. You could change the postgres entry for the setting though. You will find the row in the postresql database nagiosxi - table xi_options. You are looking for the name column that matches "scheduled_ssh_backups".

2. Users: This one is very problematic. If you just want the barebones, you could write a query to insert into the postgresql nagiosxi database table "xi_users". This table includes the base user settings and the password hash. The problem arises when you try to pull in all the other user options from the table "xi_usermeta" which contains all the other user settings.

3. AD integration: The same as backups. You will need to run a query to change the entry in xi_options. The row can be found by the 'name' field - the string in question to match is:
active_directory_component_options
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
psanchez
Posts: 23
Joined: Wed Oct 17, 2012 12:14 pm

Re: admin/component configuration via script/API?

Post by psanchez »

Thanks, was hoping there was a better way....I'll play around with postgres db.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: admin/component configuration via script/API?

Post by abrist »

No problem. Let me know if you need more information.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked