Hello.
Whe use Thruk with remote backends, some under our control, other in customer networks and managed bu their teams.
We plan to use action_menu and action_menu_items directives to create tickets to different ticket systems (to our system or customer's systems). I found the "action menu" feature very interesting as we can externalize new actions to our own scripts without modifiying anything in Thruk core, like this :
<action_menu_items>
standardmenu = {"icon":"/naemon/themes/{{theme}}/images/add.png",\
"title": "Create ticket",\
"label":"ticket",\
"action":"server://create_ticket"}
</action_menu_items>
<action_menu_actions>
create_ticket = /opt/RmsTools/bin/
create_ticket.pl "hostname:$HOSTNAME$,hostalias:$HOSTALIAS$,hostaddress:$HOSTADDRESS$,\
hoststate:$HOSTSTATE$,lasthoststatechange:$LASTHOSTSTATECHANGE$\
hostoutput:$HOSTOUTPUT$,longhostoutput:$LONGHOSTOUTPUT$,hostnotesurl:$HOSTNOTESURL$\
servicedesc:$SERVICEDESC$,servicedisplayname:$SERVICEDISPLAYNAME$,\
servicestate:$SERVICESTATE$,lastservicestatechange:$LASTSERVICESTATECHANGE$,serviceoutput:$SERVICEOUTPUT$,\
servicenotesurl:$SERVICENOTESURL$,longserviceoutput:$LONGSERVICEOUTPUT$,user:$REMOTE_USER$"
</action_menu_actions>
But in the original templates, the feature is dependant on _THRUK_ACTION_MENU existence in Nagios configuration of remote backends.
The problem is that we do no manage all configurations, some of them can be under control of customer team. That's why I had to modify the templates to be able to use these new menus in all cases.
1 - Is the right way to do this ?
What do you think to have the possibility to activate action menu by default. For example,
If _THRUK_ACTION_MENU is not set, the hostdefaultmenu or a servicedefaultmenu are printed instead if they have been defined in thruk config.
2- Of course, we would like that our ticket creation script can create an acknownledgement with a comment containing the ticket number and the user for example.
Who to do that ?
The simpliest way I see is to just do it through the Livestatus socket by using socat for example. But how can I know the IP of remote backend. Is there a internal variable to pass to our script ?