- add Nagios check for the PostgreSQL infrastructure chec
authorAndreas Scherbaum <andreas@scherbaum.biz>
Sun, 11 Nov 2012 18:05:29 +0000 (19:05 +0100)
committerAndreas Scherbaum <andreas@scherbaum.biz>
Sun, 11 Nov 2012 18:05:29 +0000 (19:05 +0100)
docbot.conf
docbot.pl
todo.txt

index 9e9babc2386df3ff3d1e7db618220528ad6ba42b..0a4386be007e4d4b05040b36571cd233d20a4b87 100644 (file)
@@ -57,3 +57,5 @@ search:
   searchsite: 'http://pg-docbot.de/search/?q='
 translations:
   file: 'docbot.translations'
+monitoring:
+  file: 'docbot.monitoring'
index a542e5aaee707d7985a2a0c9a6fe295066e8afe4..beadd8461cc694230935b7af3913de4de686f33b 100755 (executable)
--- a/docbot.pl
+++ b/docbot.pl
@@ -4095,6 +4095,20 @@ sub on_irc_raw {
     my $session = find_irc_session($irc);
 
     set_session_activity($session);
+
+
+    # write current timestamp into monitoring file
+    my $monitoring_file = config_get_key2('monitoring', 'file');
+    if (defined($monitoring_file)) {
+        my $monitoring_fh = new FileHandle;
+        # question: is a file lock required?
+        if (!open($monitoring_fh, ">", $monitoring_file)) {
+            print_msg("cannot open monitoring file: $!", ERROR);
+        } else {
+            print $monitoring_fh time();
+            close($monitoring_fh);
+        }
+    }
 }
 
 
index f3feb42e664d2085accc1e5d41b5693cd9ccd28e..a70dddc140802cb960ebd8aeb2dc1575d33ca886 100644 (file)
--- a/todo.txt
+++ b/todo.txt
@@ -12,7 +12,6 @@
 - user management through irc commands (add/remove/list/search users)
 - save last user/nick interaction time
 - add ?grant and ?revoke to add/delete users
-- add Nagios check for the PostgreSQL infrastructure check
 - ?status should know the status of each connection
   - including the last time the connection has seen traffic
 - history per channel
@@ -46,3 +45,4 @@
 - verify channel list from time to time, autojoin missing channels OK
 - nickserv handling (passwords) OK
 - post important commands into commandchannel OK
+- add Nagios check for the PostgreSQL infrastructure check