aboutsummaryrefslogtreecommitdiffstats
path: root/sitesummary-nodes
diff options
context:
space:
mode:
authorPetter Reinholdtsen <pere@hungry.com>2010-01-23 14:08:06 +0000
committerPetter Reinholdtsen <pere@hungry.com>2010-01-23 14:08:06 +0000
commit98b5d608f8075a36f58d3ed2e984b9cd66bd7ab3 (patch)
tree679463a7aa0f7a4ce29f45ff317cdf9b3e2ea32a /sitesummary-nodes
parentbd56ea5ad1833e5fc823663e93410c45c51379cd (diff)
downloadsitesummary-98b5d608f8075a36f58d3ed2e984b9cd66bd7ab3.tar.gz
sitesummary-98b5d608f8075a36f58d3ed2e984b9cd66bd7ab3.tar.bz2
sitesummary-98b5d608f8075a36f58d3ed2e984b9cd66bd7ab3.tar.xz
Only generate TCP port check for xfs if /etc/X11/fs/config state
that it is listening on TCP.
Diffstat (limited to 'sitesummary-nodes')
-rwxr-xr-xsitesummary-nodes19
1 files changed, 18 insertions, 1 deletions
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));