From cd76bdb7823a8d190e227592cfa88711adb55b6b Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Thu, 21 Oct 2010 13:24:23 -0700 Subject: [PATCH] Report database version on ubik okay Report the database version as extra information in check_udebug if there are no errors or warnings. --- NEWS | 3 +++ check_udebug | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 6ea5d4d..fc714f1 100644 --- a/NEWS +++ b/NEWS @@ -32,3 +32,6 @@ afs-monitor 2.0 (unreleased) Look for rxdebug in /usr/sbin and /usr/local/sbin since OpenAFS installs it into sbindir by default. + + Report the database version as extra information in check_udebug if + there are no errors or warnings. diff --git a/check_udebug b/check_udebug index a486eb8..c8df336 100755 --- a/check_udebug +++ b/check_udebug @@ -85,11 +85,14 @@ unless (open (UDEBUG, "$UDEBUG $host $port |")) { warn "$0: cannot run udebug\n"; exit 3; } -my ($issync, $recovery, $synchost); +my ($issync, $recovery, $synchost, $db); while () { $issync = 1 if /^I am sync site /; $recovery = 1 if /^Recovery state 1f/; $synchost = 1 if /^Sync host \d+(\.\d+){3} was set /; + if (/Local db version is (\d+\.\d+)/) { + $db = "db version $1"; + } } close UDEBUG; if ($? != 0) { @@ -105,7 +108,7 @@ if ($issync && !$recovery) { print "UBIK CRITICAL - no sync site\n"; exit 2; } else { - print "UBIK OK\n"; + print "UBIK OK - $db\n"; exit 0; } -- 2.39.5