Page 1 of 1
Actions component questions
Posted: Mon Jan 16, 2017 3:29 am
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
Re: Actions component questions
Posted: Mon Jan 16, 2017 11:55 am
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.
Re: Actions component questions
Posted: Mon Jan 16, 2017 12:29 pm
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..
Re: Actions component questions
Posted: Mon Jan 16, 2017 1:34 pm
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.
Re: Actions component questions
Posted: Tue Jan 17, 2017 11:44 am
by WillemDH
Thanks Clint. You can close the thread.