Volans has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/398037 )

Change subject: Icinga: fine tune settings for dashboard links
......................................................................


Icinga: fine tune settings for dashboard links

* Revert the use of the environmental variables instead of the Icinga
  macros for the SERVICENOTESURL, we have enable_environment_macros=0
  for performance reasons.
* Icinga URL-encode the whole macro string, including the quotes when
  using multiple notes_url. Pipe the notification string to sed to
  remove them. From %27URL1%27+%27URL2%27 to URL1 URL2. This is a hack.
* Set the dashboard links to open in a new page/tab instead of inside
  the Icinga iframe.
* Remove the ampersend (&) from the characters to be removed from the
  MACROS, to avoid it to remove the & from the dashboard URLs.

Bug: T170353
Change-Id: I4ce84dec28e92b21524737827af66b3f5900ec26
---
M modules/icinga/files/cgi.cfg
M modules/icinga/templates/icinga.cfg.erb
M modules/nagios_common/templates/notification_commands.cfg.erb
3 files changed, 16 insertions(+), 16 deletions(-)

Approvals:
  Alexandros Kosiaris: Looks good to me, but someone else must approve
  jenkins-bot: Verified
  Volans: Looks good to me, approved



diff --git a/modules/icinga/files/cgi.cfg b/modules/icinga/files/cgi.cfg
index 6996653..7e30333 100644
--- a/modules/icinga/files/cgi.cfg
+++ b/modules/icinga/files/cgi.cfg
@@ -332,8 +332,8 @@
 # These options determine the target frames in which notes and
 # action URLs will open.
 
-action_url_target=main
-notes_url_target=main
+action_url_target=_blank
+notes_url_target=_blank
 
 
 
diff --git a/modules/icinga/templates/icinga.cfg.erb 
b/modules/icinga/templates/icinga.cfg.erb
index 03694a5..2faf417 100644
--- a/modules/icinga/templates/icinga.cfg.erb
+++ b/modules/icinga/templates/icinga.cfg.erb
@@ -1265,7 +1265,7 @@
 #      $SERVICEACKAUTHOR$
 #      $SERVICEACKCOMMENT$
 
-illegal_macro_output_chars=`~$&|'"<>
+illegal_macro_output_chars=`~$|'"<>
 
 
 
diff --git a/modules/nagios_common/templates/notification_commands.cfg.erb 
b/modules/nagios_common/templates/notification_commands.cfg.erb
index b51483f..1b1f32f 100644
--- a/modules/nagios_common/templates/notification_commands.cfg.erb
+++ b/modules/nagios_common/templates/notification_commands.cfg.erb
@@ -33,7 +33,7 @@
 # 'notify-by-email' command definition
 define command{
        command_name    notify-by-email
-       command_line    /usr/bin/printf "%b" "Notification Type: 
$NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: 
$HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nNotes 
URLs: $${SERVICENOTESURL}\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | 
/usr/bin/mail -s "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is 
$SERVICESTATE$ **" $CONTACTEMAIL$
+       command_line    /usr/bin/printf "%b" "Notification Type: 
$NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: 
$HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nNotes 
URLs: $SERVICENOTESURL$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | sed -r -e 
's/%27(https)/\1/g' -e 's/%27(\+|$)/ /g' |  /usr/bin/mail -s "** 
$NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" 
$CONTACTEMAIL$
        }
 
 # 'notify-by-sms-gateway' command definitions
@@ -54,7 +54,7 @@
 
 define command{
        command_name    notify-service-by-irc
-       command_line    echo "$NOTIFICATIONTYPE$ - $SERVICEDESC$ on $HOSTNAME$ 
is $SERVICESTATE$: $SERVICEOUTPUT$ $SERVICEACKAUTHOR$ $SERVICEACKCOMMENT$ 
$${SERVICENOTESURL}" >> <%= @irc_dir_path %>/irc.log
+       command_line    echo "$NOTIFICATIONTYPE$ - $SERVICEDESC$ on $HOSTNAME$ 
is $SERVICESTATE$: $SERVICEOUTPUT$ $SERVICEACKAUTHOR$ $SERVICEACKCOMMENT$ 
$SERVICENOTESURL$" | sed -r -e 's/%27(https)/\1/g' -e 's/%27(\+|$)/ /g' >> <%= 
@irc_dir_path %>/irc.log
        }
 
 # IRC output for wikidata
@@ -65,7 +65,7 @@
 
 define command{
        command_name    notify-service-by-irc-wikidata
-       command_line    echo "$NOTIFICATIONTYPE$ - $SERVICEDESC$ on $HOSTNAME$ 
is $SERVICESTATE$: $SERVICEOUTPUT$ $SERVICEACKAUTHOR$ $SERVICEACKCOMMENT$ 
$${SERVICENOTESURL}" >> <%= @irc_dir_path %>/irc-wikidata.log
+       command_line    echo "$NOTIFICATIONTYPE$ - $SERVICEDESC$ on $HOSTNAME$ 
is $SERVICESTATE$: $SERVICEOUTPUT$ $SERVICEACKAUTHOR$ $SERVICEACKCOMMENT$ 
$SERVICENOTESURL$" | sed -r -e 's/%27(https)/\1/g' -e 's/%27(\+|$)/ /g' >> <%= 
@irc_dir_path %>/irc-wikidata.log
        }
 
 # IRC output for interactive
@@ -76,7 +76,7 @@
 
 define command{
        command_name    notify-service-by-irc-interactive
-       command_line    echo "$NOTIFICATIONTYPE$ - $SERVICEDESC$ on $HOSTNAME$ 
is $SERVICESTATE$: $SERVICEOUTPUT$ $SERVICEACKAUTHOR$ $SERVICEACKCOMMENT$ 
$${SERVICENOTESURL}" >> <%= @irc_dir_path %>/irc-interactive.log
+       command_line    echo "$NOTIFICATIONTYPE$ - $SERVICEDESC$ on $HOSTNAME$ 
is $SERVICESTATE$: $SERVICEOUTPUT$ $SERVICEACKAUTHOR$ $SERVICEACKCOMMENT$ 
$SERVICENOTESURL$" | sed -r -e 's/%27(https)/\1/g' -e 's/%27(\+|$)/ /g' >> <%= 
@irc_dir_path %>/irc-interactive.log
        }
 
        # IRC output for RelEng team
@@ -87,7 +87,7 @@
 
 define command{
        command_name    notify-service-by-irc-releng
-       command_line    echo "$NOTIFICATIONTYPE$ - $SERVICEDESC$ on $HOSTNAME$ 
is $SERVICESTATE$: $SERVICEOUTPUT$ $SERVICEACKAUTHOR$ $SERVICEACKCOMMENT$ 
$${SERVICENOTESURL}" >> <%= @irc_dir_path %>/irc-releng.log
+       command_line    echo "$NOTIFICATIONTYPE$ - $SERVICEDESC$ on $HOSTNAME$ 
is $SERVICESTATE$: $SERVICEOUTPUT$ $SERVICEACKAUTHOR$ $SERVICEACKCOMMENT$ 
$SERVICENOTESURL$" | sed -r -e 's/%27(https)/\1/g' -e 's/%27(\+|$)/ /g' >> <%= 
@irc_dir_path %>/irc-releng.log
        }
 
 # IRC output for (tool)labs
@@ -98,7 +98,7 @@
 
 define command{
        command_name    notify-service-by-irc-labs
-       command_line    echo "$NOTIFICATIONTYPE$ - $SERVICEDESC$ on $HOSTNAME$ 
is $SERVICESTATE$: $SERVICEOUTPUT$ $SERVICEACKAUTHOR$ $SERVICEACKCOMMENT$ 
$${SERVICENOTESURL}" >> <%= @irc_dir_path %>/irc-labs.log
+       command_line    echo "$NOTIFICATIONTYPE$ - $SERVICEDESC$ on $HOSTNAME$ 
is $SERVICESTATE$: $SERVICEOUTPUT$ $SERVICEACKAUTHOR$ $SERVICEACKCOMMENT$ 
$SERVICENOTESURL$" | sed -r -e 's/%27(https)/\1/g' -e 's/%27(\+|$)/ /g' >> <%= 
@irc_dir_path %>/irc-labs.log
        }
 
 # IRC output for Analytics
@@ -109,7 +109,7 @@
 
 define command{
        command_name    notify-service-by-irc-analytics
-       command_line    echo "$NOTIFICATIONTYPE$ - $SERVICEDESC$ on $HOSTNAME$ 
is $SERVICESTATE$: $SERVICEOUTPUT$ $SERVICEACKAUTHOR$ $SERVICEACKCOMMENT$ 
$${SERVICENOTESURL}" >> <%= @irc_dir_path %>/irc-analytics.log
+       command_line    echo "$NOTIFICATIONTYPE$ - $SERVICEDESC$ on $HOSTNAME$ 
is $SERVICESTATE$: $SERVICEOUTPUT$ $SERVICEACKAUTHOR$ $SERVICEACKCOMMENT$ 
$SERVICENOTESURL$" | sed -r -e 's/%27(https)/\1/g' -e 's/%27(\+|$)/ /g' >> <%= 
@irc_dir_path %>/irc-analytics.log
        }
 
 # IRC output for Countervandalism Network
@@ -120,7 +120,7 @@
 
 define command{
        command_name    notify-service-by-irc-cvn
-       command_line    echo "$NOTIFICATIONTYPE$ - $SERVICEDESC$ on $HOSTNAME$ 
is $SERVICESTATE$: $SERVICEOUTPUT$ $SERVICEACKAUTHOR$ $SERVICEACKCOMMENT$ 
$${SERVICENOTESURL}" >> <%= @irc_dir_path %>/irc-cvn.log
+       command_line    echo "$NOTIFICATIONTYPE$ - $SERVICEDESC$ on $HOSTNAME$ 
is $SERVICESTATE$: $SERVICEOUTPUT$ $SERVICEACKAUTHOR$ $SERVICEACKCOMMENT$ 
$SERVICENOTESURL$" | sed -r -e 's/%27(https)/\1/g' -e 's/%27(\+|$)/ /g' >> <%= 
@irc_dir_path %>/irc-cvn.log
     }
 
 # IRC output for WMT
@@ -131,7 +131,7 @@
 
 define command{
        command_name    notify-service-by-irc-wmt
-       command_line    echo "$NOTIFICATIONTYPE$ - $SERVICEDESC$ on $HOSTNAME$ 
is $SERVICESTATE$: $SERVICEOUTPUT$ $SERVICEACKAUTHOR$ $SERVICEACKCOMMENT$ 
$${SERVICENOTESURL}" >> <%= @irc_dir_path %>/irc-wmt.log
+       command_line    echo "$NOTIFICATIONTYPE$ - $SERVICEDESC$ on $HOSTNAME$ 
is $SERVICESTATE$: $SERVICEOUTPUT$ $SERVICEACKAUTHOR$ $SERVICEACKCOMMENT$ 
$SERVICENOTESURL$" | sed -r -e 's/%27(https)/\1/g' -e 's/%27(\+|$)/ /g' >> <%= 
@irc_dir_path %>/irc-wmt.log
        }
 
 # IRC output for ORES
@@ -142,7 +142,7 @@
 
 define command{
         command_name    notify-service-by-irc-ores
-        command_line    echo "$NOTIFICATIONTYPE$ - $SERVICEDESC$ on $HOSTNAME$ 
is $SERVICESTATE$: $SERVICEOUTPUT$ $SERVICEACKAUTHOR$ $SERVICEACKCOMMENT$ 
$${SERVICENOTESURL}" >> <%= @irc_dir_path %>/irc-ores.log
+        command_line    echo "$NOTIFICATIONTYPE$ - $SERVICEDESC$ on $HOSTNAME$ 
is $SERVICESTATE$: $SERVICEOUTPUT$ $SERVICEACKAUTHOR$ $SERVICEACKCOMMENT$ 
$SERVICENOTESURL$" | sed -r -e 's/%27(https)/\1/g' -e 's/%27(\+|$)/ /g' >> <%= 
@irc_dir_path %>/irc-ores.log
         }
 
 # IRC output for performance
@@ -153,7 +153,7 @@
 
 define command{
        command_name    notify-service-by-irc-performance
-       command_line    echo "$NOTIFICATIONTYPE$ - $SERVICEDESC$ on $HOSTNAME$ 
is $SERVICESTATE$: $SERVICEOUTPUT$ $SERVICEACKAUTHOR$ $SERVICEACKCOMMENT$ 
$${SERVICENOTESURL}" >> <%= @irc_dir_path %>/irc-performance.log
+       command_line    echo "$NOTIFICATIONTYPE$ - $SERVICEDESC$ on $HOSTNAME$ 
is $SERVICESTATE$: $SERVICEOUTPUT$ $SERVICEACKAUTHOR$ $SERVICEACKCOMMENT$ 
$SERVICENOTESURL$" | sed -r -e 's/%27(https)/\1/g' -e 's/%27(\+|$)/ /g' >> <%= 
@irc_dir_path %>/irc-performance.log
        }
 
 # IRC output for fundraising
@@ -164,7 +164,7 @@
 
 define command{
        command_name    notify-service-by-irc-fundraising
-       command_line    echo "$NOTIFICATIONTYPE$ - $SERVICEDESC$ on $HOSTNAME$ 
is $SERVICESTATE$: $SERVICEOUTPUT$ $SERVICEACKAUTHOR$ $SERVICEACKCOMMENT$ 
$${SERVICENOTESURL}" >> <%= @irc_dir_path %>/irc-fundraising.log
+       command_line    echo "$NOTIFICATIONTYPE$ - $SERVICEDESC$ on $HOSTNAME$ 
is $SERVICESTATE$: $SERVICEOUTPUT$ $SERVICEACKAUTHOR$ $SERVICEACKCOMMENT$ 
$SERVICENOTESURL$" | sed -r -e 's/%27(https)/\1/g' -e 's/%27(\+|$)/ /g' >> <%= 
@irc_dir_path %>/irc-fundraising.log
        }
 
 # IRC output for Reading Web
@@ -175,5 +175,5 @@
 
 define command{
        command_name    notify-service-by-irc-reading-web
-       command_line    echo "$NOTIFICATIONTYPE$ - $SERVICEDESC$ on $HOSTNAME$ 
is $SERVICESTATE$: $SERVICEOUTPUT$ $SERVICEACKAUTHOR$ $SERVICEACKCOMMENT$ 
$${SERVICENOTESURL}" >> <%= @irc_dir_path %>/irc-reading-web.log
+       command_line    echo "$NOTIFICATIONTYPE$ - $SERVICEDESC$ on $HOSTNAME$ 
is $SERVICESTATE$: $SERVICEOUTPUT$ $SERVICEACKAUTHOR$ $SERVICEACKCOMMENT$ 
$SERVICENOTESURL$" | sed -r -e 's/%27(https)/\1/g' -e 's/%27(\+|$)/ /g' >> <%= 
@irc_dir_path %>/irc-reading-web.log
        }

-- 
To view, visit https://gerrit.wikimedia.org/r/398037
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I4ce84dec28e92b21524737827af66b3f5900ec26
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Volans <rcocci...@wikimedia.org>
Gerrit-Reviewer: Alexandros Kosiaris <akosia...@wikimedia.org>
Gerrit-Reviewer: Faidon Liambotis <fai...@wikimedia.org>
Gerrit-Reviewer: Filippo Giunchedi <fgiunch...@wikimedia.org>
Gerrit-Reviewer: Volans <rcocci...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to