diff options
Diffstat (limited to 'munin/boiler_rx')
-rwxr-xr-x | munin/boiler_rx | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/munin/boiler_rx b/munin/boiler_rx deleted file mode 100755 index f794999..0000000 --- a/munin/boiler_rx +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env perl - -use Net::Telnet; -use Data::Dumper; - -sub dump_file($$) { - my ( $name, $guts ) = @_; - - $fh = new IO::File ">" . $name; - return unless defined $fh; - $fh->print($guts); - $fh->close; - undef $fh; -} - -my $timeout = 60; - -my $host = $ARGV[0]; - -my $path = "/var/run/boiler_" . $host; - -mkdir( $path, 0755 ); - -while (1) { - my $telnet = new Net::Telnet( - Timeout => 10, - Telnetmode => 0, - Binmode => 1, - Host => $host, - Port => 2001 - ); - - #$telnet->open($bits[1]); - - my $nodata = 0; - - while ( ( not $telnet->eof ) and ( $nodata < $timeout ) ) { - my $line = $telnet->getline( Timeout => 1, Errmode => 'return' ); - - if ( not defined $line or ( length($line) == 0 ) ) { - $nodata++; - } - else { - $nodata = 0; - } - - chomp $line; - chomp $line; - - $line = uc($line); - - next unless $line =~ /^([TB])(.)(.)(..)(....)/; - - my $fn = $1 . $2 . "x" . $4; - my $c = $1 . $2 . $3 . $4 . $5; - - dump_file( $path . "/" . $fn, $c ); - - } - - $telnet->close; - -} - -exit(0); |