Actions component questions

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Actions component questions

Post by WillemDH »

Hello,

I have some questions concerning the Actions component. is it somehow possible to create a Nagios XI Actions backup and restore. Is it possible add and remove actions in cli somehow? Does a regular Nagios XI backup contain the configured actions. So if I were to restore a backup on another XI server the actions are preserved?

Thanks and grtz.

Willem
Nagios XI 5.8.1
https://outsideit.net
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Actions component questions

Post by mcapra »

WillemDH wrote:Is it somehow possible to create a Nagios XI Actions backup and restore ... Does a regular Nagios XI backup contain the configured actions. So if I were to restore a backup on another XI server the actions are preserved?
The settings for the Actions component are stored in the nagiosxi.xi_options table, so they would be included in regular Nagios XI backups. Unfortunately, there isn't an easy way to backup/restore the settings for this component, though you could insert/select the value in xi_options where name=actions_component_options:

Code: Select all

# SELECT value FROM xi_options WHERE name='actions_component_options';
[root@xi-stable ~]# echo "SELECT value FROM nagiosxi.xi_options WHERE name='actions_component_options';" | mysql -uroot -pnagiosxi
value
a:2:{s:7:"enabled";i:1;s:7:"actions";a:2:{i:0;a:13:{s:4:"type";s:4:"host";s:4:"host";s:4:"/.*/";s:7:"service";s:0:"";s:9:"hostgroup";s:0:"";s:12:"servicegroup";s:0:"";s:11:"action_type";s:3:"url";s:3:"url";\n*/";s:5:"perms";s:0:"";s:7:"enabled";i:0;s:3:"uid";s:6:"WGN3OP";}i:1;a:13:{s:7:"enabled";i:1;s:4:"type";s:7:"service";s:4:"host";s:4:"/.*/";s:7:"service";s:4:"/.*/";s:9:"hostgroup";s:0:"";s:12:"servicegroup";s:0:"";s:11:"action_type";s:7:"command";s:3:"url";s:33:"/usr/local/nagios/libexec/3min.sh";s:6:"target";s:6:"_blank";s:4:"text";s:19:"PHP 3 minute script";s:4:"code";s:73:"    $img = '/nagiosxi/images/s\n";s:5:"perms";s:0:"";s:3:"uid";s:6:"O82Eru";}}}
And you could similarly insert a serialized PHP object. I'll look into filing a feature request for such functionality on the GUI end of things.
WillemDH wrote:Is it possible add and remove actions in cli somehow?
Not easily since the entire configuration for the component is stored as a serialized PHP object. See above for the SQL specifics.
Former Nagios employee
https://www.mcapra.com/
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Actions component questions

Post by WillemDH »

The reason I'm asking this is because I really want a way to order the actiosn alphabetically. It's really messy when you have a lot of quick axctions, but there is no way to reorder the actions..
Nagios XI 5.8.1
https://outsideit.net
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Actions component questions

Post by rkennedy »

I created two feature requests for the actions component -

Code: Select all

NEW TASK ID 10707 created - Nagios XI Feature Request: Create ordered list for Actions component (alphabetical)
NEW TASK ID 10708 created - Nagios XI Feature Request: Allow importing / exporting of Actions (component) through the GUI / CLI
Feel free to list more ideas of what you think should be capable with it Willem, and I'll get them filed as well.
Former Nagios Employee
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Actions component questions

Post by WillemDH »

Thanks Clint. You can close the thread.
Nagios XI 5.8.1
https://outsideit.net
Locked