]> git.pld-linux.org Git - packages/nagios-notify.git/commitdiff
rel 4; more information about service/host downtime
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Tue, 4 May 2021 07:22:28 +0000 (09:22 +0200)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Tue, 4 May 2021 07:22:28 +0000 (09:22 +0200)
duration.patch
nagios-notify.spec

index bc5a452b6ce644321c6d0bbfc9b25804c99fff4d..891ed545f985c669f0e1b2bc4456df3c41bcb72b 100644 (file)
@@ -1,20 +1,91 @@
+diff -urN nagios-notify-0.14.org/nagios-notify nagios-notify-0.14/nagios-notify
+--- nagios-notify-0.14.org/nagios-notify       2012-12-14 12:52:19.000000000 +0100
++++ nagios-notify-0.14/nagios-notify   2021-05-04 09:12:22.586849116 +0200
+@@ -53,6 +53,10 @@
+               return "=?" charset "?b?" base64_string(data) "?="
+       }
++      function timestamp_date(tstamp) {
++              return strftime("%Y-%m-%d %H:%M:%S", tstamp);
++      }
++
+       # urlencode
+       function urlencode(data,   hextab, i, n, res, c, lo, hi) {
+               split("1 2 3 4 5 6 7 8 9 a b c d e f", hextab, " ")
+@@ -276,6 +280,16 @@
+                       data = substr(params, index(params, ",") + 1)
+                       $0 = left encode_mime_header(charset, data) right;
+               }
++
++              # $(timestamp_date:data)
++              while (match($0, /\$\(timestamp_date:([^)]+)\)/)) {
++                      pos = length("$(timestamp_date:")
++                      data = substr($0, RSTART + pos, RLENGTH - pos - 1);
++                      left = substr($0, 0, RSTART);
++                      right = substr($0, RSTART + RLENGTH);
++                      $0 = left timestamp_date(data) right;
++              }
++
+               # $(urlencode:data)
+               while (match($0, /\$\(urlencode:([^)]+)\)/)) {
+                       pos = length("$(urlencode:")
 diff -urN nagios-notify-0.14.org/templates/notify-host-by-email.tmpl nagios-notify-0.14/templates/notify-host-by-email.tmpl
 --- nagios-notify-0.14.org/templates/notify-host-by-email.tmpl 2018-02-21 20:49:01.969994349 +0100
-+++ nagios-notify-0.14/templates/notify-host-by-email.tmpl     2018-02-21 20:55:06.047582770 +0100
-@@ -14,4 +14,5 @@
++++ nagios-notify-0.14/templates/notify-host-by-email.tmpl     2021-05-04 09:14:10.686925437 +0200
+@@ -14,4 +14,6 @@
  Address: $HOSTADDRESS$
  Info: $HOSTOUTPUT$
  
-+Duration: $SERVICEDURATION$
++Current state since: $SERVICEDURATION$
++Last service OK: $(timestamp_date:$LASTSERVICEOK$)
  Date/Time: $LONGDATETIME$
+diff -urN nagios-notify-0.14.org/templates/notify-host-by-jabber.tmpl nagios-notify-0.14/templates/notify-host-by-jabber.tmpl
+--- nagios-notify-0.14.org/templates/notify-host-by-jabber.tmpl        2012-12-14 11:48:27.000000000 +0100
++++ nagios-notify-0.14/templates/notify-host-by-jabber.tmpl    2021-05-04 09:14:37.994452535 +0200
+@@ -1,2 +1,2 @@
+-$HOSTNAME$ $NOTIFICATIONTYPE$: $HOSTSTATE$
++$HOSTNAME$ $NOTIFICATIONTYPE$: $HOSTSTATE$ (Current state since: $HOSTDURATION$; Last host UP: $(timestamp_date:$LASTHOSTUP$))
+ $HOSTOUTPUT$
+diff -urN nagios-notify-0.14.org/templates/notify-host-by-sms.tmpl nagios-notify-0.14/templates/notify-host-by-sms.tmpl
+--- nagios-notify-0.14.org/templates/notify-host-by-sms.tmpl   2012-12-14 11:48:27.000000000 +0100
++++ nagios-notify-0.14/templates/notify-host-by-sms.tmpl       2021-05-04 09:14:57.541734913 +0200
+@@ -4,4 +4,7 @@
+ From: $HOSTNAME$@nagios.0
+ Subject: $HOSTSTATE$
++Current state since: $HOSTDURATION$
++Last Host UP: $(timestamp_date:$LASTHOSTUP$)
++
+ $HOSTOUTPUT$
 diff -urN nagios-notify-0.14.org/templates/notify-service-by-email.tmpl nagios-notify-0.14/templates/notify-service-by-email.tmpl
 --- nagios-notify-0.14.org/templates/notify-service-by-email.tmpl      2018-02-21 20:49:19.157176605 +0100
-+++ nagios-notify-0.14/templates/notify-service-by-email.tmpl  2018-02-21 20:55:16.601232698 +0100
-@@ -15,6 +15,7 @@
++++ nagios-notify-0.14/templates/notify-service-by-email.tmpl  2021-05-04 09:15:31.462803004 +0200
+@@ -15,6 +15,8 @@
  Address: $HOSTADDRESS$
  State: $SERVICESTATE$
  
-+Duration: $SERVICEDURATION$
++Current state since: $SERVICEDURATION$
++Last service OK: $(timestamp_date:$LASTSERVICEOK$)
  Date/Time: $LONGDATETIME$
  
  Additional Info:
+diff -urN nagios-notify-0.14.org/templates/notify-service-by-jabber.tmpl nagios-notify-0.14/templates/notify-service-by-jabber.tmpl
+--- nagios-notify-0.14.org/templates/notify-service-by-jabber.tmpl     2012-12-14 11:48:27.000000000 +0100
++++ nagios-notify-0.14/templates/notify-service-by-jabber.tmpl 2021-05-04 09:15:48.273332157 +0200
+@@ -1,2 +1,2 @@
+-$SERVICEDESC$/$HOSTNAME$ $NOTIFICATIONTYPE$: $SERVICESTATE$
++$SERVICEDESC$/$HOSTNAME$ $NOTIFICATIONTYPE$: $SERVICESTATE$ (Current state since: $SERVICEDURATION$; Last service OK: $(timestamp_date:$LASTSERVICEOK$))
+ $SERVICEOUTPUT$
+diff -urN nagios-notify-0.14.org/templates/notify-service-by-sms.tmpl nagios-notify-0.14/templates/notify-service-by-sms.tmpl
+--- nagios-notify-0.14.org/templates/notify-service-by-sms.tmpl        2012-12-14 11:48:27.000000000 +0100
++++ nagios-notify-0.14/templates/notify-service-by-sms.tmpl    2021-05-04 09:16:17.924265238 +0200
+@@ -4,6 +4,9 @@
+ From: $SERVICEDESC$@$HOSTNAME$.0
+ Subject: $SERVICESTATE$
++Current state since: $SERVICEDURATION$
++Last service OK: $(timestamp_date:$LASTSERVICEOK$)
++
+ #if "$NOTIFICATIONTYPE$" == "ACKNOWLEDGEMENT"
+ Acknowledged by $SERVICEACKAUTHOR$: $SERVICEACKCOMMENT$
+ #else
index e7f7d1b99609db18ec9349c7955aa7245e9de8a4..15c5755b9a835085d38b45b1cbe19d042115bc42 100644 (file)
@@ -2,7 +2,7 @@ Summary:        Nagios Notify Script
 Summary(pl.UTF-8):     Skrypt powiadamiający dla Nagiosa
 Name:          nagios-notify
 Version:       0.14
-Release:       3
+Release:       4
 License:       GPL v2
 Group:         Applications
 Source0:       %{name}-%{version}.tar.bz2
This page took 0.109307 seconds and 4 git commands to generate.