월요일, 5월 27, 2024
HomeLinuxsnmpnetstat Invalid version

snmpnetstat Invalid version

snmpnetstat Invalid version error && cacti SNMP – Get TCP Connection Status graph data 0

perl /scripts/lvm_netstat_tcp.pl

#!perl -w

# ————————————————–
# ARGV[0] = required
# ARGV[1] = required
# ARGV[2] = required
# ARGV[3] = required
# ARGV[4] = required
# ————————————————–
$in_hostname = $ARGV[0] if defined $ARGV[0];
$in_version = $ARGV[1] if defined $ARGV[1];
$in_community = $ARGV[2] if defined $ARGV[2];
$in_port = $ARGV[3] if defined $ARGV[3];
$in_timeout = $ARGV[4] if defined $ARGV[4];

if ($in_version eq “2”)
{
$in_version = “2c”;
}

# my $_cmd = “snmpnetstat -v $in_version -c $in_community -t $in_timeout -n -P tcp $in_hostname:$in_port”;
my $_cmd = “snmpnetstat -v $in_version -c $in_community -t $in_timeout -Cn -Cp tcp $in_hostname:$in_port”;

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Time limit exceeded. Please complete the captcha once again.

Most Popular