aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--debian/changelog2
-rwxr-xr-xsitesummary-nodes19
2 files changed, 20 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index 694b81e..ab41576 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -14,6 +14,8 @@ sitesummary (0.0.57~svn61900) UNRELEASED; urgency=low
easier to figure out why a machine is not monitored.
* Collect /etc/X11/fs/config to make it possible to figure out of
xfs should listen on TCP or not.
+ * Only generate TCP port check for xfs if /etc/X11/fs/config state
+ that it is listening on TCP.
-- Petter Reinholdtsen <pere@debian.org> Thu, 21 Jan 2010 20:21:50 +0100
diff --git a/sitesummary-nodes b/sitesummary-nodes
index 385359e..231cb4c 100755
--- a/sitesummary-nodes
+++ b/sitesummary-nodes
@@ -304,7 +304,6 @@ sub generate_nagios_config {
389 => { name => 'ldap', package => 'slapd' },
631 => { name => 'cups', package => 'cups' },
4949 => { name => 'munin', package => 'munin-node' },
- 7100 => { name => 'xfs', package => 'xfs' }, # check X font server
);
for my $port (sort { $a <=> $b } keys %tcpservices) {
@@ -326,6 +325,24 @@ sub generate_nagios_config {
if (is_pkg_installed($hostid, "apache") ||
is_pkg_installed($hostid, "apache2"));
+ # Check XFS port only if we can see that it is listening on TCP
+ if (is_pkg_installed($hostid, "xfs")) {
+ my $path = get_filepath_current($hostid, "/system/x11-fs-config");
+ if ( -e $path ) {
+ my $tcp = 1;
+ open (my $fh, "<", $path) || die "unable to read from $path";
+ while (<$fh>) {
+ chomp;
+ s/\#.+$//;
+ $tcp = 0 if m/^no-listen\s*=\s*tcp\s*$/;
+ }
+ close($fh);
+ print_nagios_service_check(0, $hostname, "xfs",
+ "check_tcp", 7100)
+ if ($tcp);
+ }
+ }
+
# The rest of the checks only work if NRPE is installed and configured
next unless ((!$remote && $nagiosclient)
|| ($remote && defined $nrpestatus));