diff options
Diffstat (limited to 'sitesummary-nodes')
-rwxr-xr-x | sitesummary-nodes | 19 |
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)); |