+# This function is called when plugin_dispatch_notification () has been used
+sub my_notify
+{
+ my $notif = shift;
+
+ my ($sec, $min, $hour, $mday, $mon, $year) = localtime ($notif->{'time'});
+
+ printf "NOTIF (%04d-%02d-%02d %02d:%02d:%02d): %d - ",
+ $year + 1900, $mon + 1, $mday, $hour, $min, $sec,
+ $notif->{'severity'};
+
+ if (defined $notif->{'host'}) {
+ print "$notif->{'host'}: ";
+ }
+
+ if (defined $notif->{'plugin'}) {
+ print "$notif->{'plugin'}: ";
+ }
+
+ if (defined $notif->{'plugin_instance'}) {
+ print "$notif->{'plugin_instance'}: ";
+ }
+
+ if (defined $notif->{'type'}) {
+ print "$notif->{'type'}: ";
+ }
+
+ if (defined $notif->{'type_instance'}) {
+ print "$notif->{'type_instance'}: ";
+ }
+
+ print "$notif->{'message'}\n";
+ return 1;
+} # my_notify ()
+