# rather then a string.
#
# methods
-# status( SERVERADDR, HOST, SERVICE, COLOR, SUMMARY, MESSAGE )
+# status( SERVERADDR, HOST, SERVICE, COLOR, SUMMARY, MESSAGE, [TTL] )
package Spong::Status;
$VERSION = 0.01;
sub status {
- my( $addr, $host, $cat, $color, $summary, $message ) = @_;
- my( $sock, $ok );
+ my( $addr, $host, $cat, $color, $summary, $message, $ttl ) = @_;
+ my( $sock, $ok, $ts );
+ if ( defined $ttl ) { $ts = time() . ":$ttl"; } else { $ts = time(); }
$sock = IO::Socket::INET->new( PeerAddr => $addr,
PeerPort => $main::SPONG_UPDATE_PORT,
alarm(30);
$sock->autoflush(1);
- $sock->print("status $host $cat $color " . time(). " $summary\n");
+ $sock->print("status $host $cat $color $ts $summary\n");
$sock->print("$message\n");
undef $sock;