Please bear with us as we work to restore functionality to dotfiles.org.
rndm_luser
/.conky/.../conns_per_host.pl
Get connections per host from Linksys WRT54G wireless router.
#!/usr/bin/perl
#use strict;
use warnings;
use HTTP::Request::Common qw(POST);
use LWP::UserAgent;
my $url = "http://192.168.1.32/Diagnostics.asp";
my $cmd = "sed -n 's%.* src=\(192.168.[0-9.]*\).*%\1%p' /proc/net/ip_conntrack | sort | uniq -c";
my $user = "root";
my $password = "admin";
my $ua = LWP::UserAgent->new( timeout => 10 );
#print "Fetching $url ...\n";
my $req = POST $url;
$req->authorization_basic($user, $password);
my $content = $ua->request($req)->as_string;
my @conns = $content =~ m/\d+\s\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/g;
#print "Connections per host\n";
foreach $conn (@conns) {
print "$conn\n";
}