source: trunk/debathena/debathena/larvnet/debian/busyd @ 23126

Revision 23126, 600 bytes checked in by ghudson, 16 years ago (diff)
Add larvnet client-side monitoring package.
  • Property svn:executable set to *
Line 
1#!/usr/bin/perl
2
3use strict;
4
5# Determine if the machine is busy.  Unfortunately, this test only
6# works for root.  Perhaps there is a better one which would allow
7# this daemon to run as nobody.
8my @result = glob("/var/lib/gdm/*.Xservers");
9my $busy = (scalar @result > 0) ? 1 : 0;
10
11# Collect some basic information about the machine.
12my $hostname = `hostname --fqdn`;
13my $arch = `machtype -c`;
14chomp $hostname;
15chomp $arch;
16
17# Read the packet.
18my $addr = recv(STDIN, my $dummy, 1, 0);
19
20# Reply with the status packet.
21my $msg = $busy . $hostname . "\0" . $arch . "\0";
22send(STDIN, $msg, 0, $addr);
Note: See TracBrowser for help on using the repository browser.