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 | |
---|
3 | use 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. |
---|
8 | my @result = glob("/var/lib/gdm/*.Xservers"); |
---|
9 | my $busy = (scalar @result > 0) ? 1 : 0; |
---|
10 | |
---|
11 | # Collect some basic information about the machine. |
---|
12 | my $hostname = `hostname --fqdn`; |
---|
13 | my $arch = `machtype -c`; |
---|
14 | chomp $hostname; |
---|
15 | chomp $arch; |
---|
16 | |
---|
17 | # Read the packet. |
---|
18 | my $addr = recv(STDIN, my $dummy, 1, 0); |
---|
19 | |
---|
20 | # Reply with the status packet. |
---|
21 | my $msg = $busy . $hostname . "\0" . $arch . "\0"; |
---|
22 | send(STDIN, $msg, 0, $addr); |
---|
Note: See
TracBrowser
for help on using the repository browser.