mirror of
https://github.com/Cacti/cacti.git
synced 2026-11-08 21:16:17 +09:00
git-svn-id: svn+ssh://repo.cacti.net/var/data/svnroot/cacti/trunk/cacti@2 860744bd-22fc-0310-8c96-e9fe5004b5ca
14 lines
219 B
Perl
14 lines
219 B
Perl
#!/usr/bin/perl
|
|
|
|
#gets inbound and outbound tcp connections
|
|
|
|
if ($ARGV[0] eq "tcp") {
|
|
$conn = `netstat -n | grep -c \":\"`;
|
|
chomp $conn;
|
|
}else{
|
|
$conn = `netstat -na | grep -c LISTEN`;
|
|
}
|
|
|
|
$conn =~ s/ //;
|
|
|
|
print $conn; |