Next Topic

Previous Topic

Book Contents

Creating a Custom SNMP Test

This is an example of creating a custom SNMP test by specifying the OID directly via the API.

my $obj = new Zyrion::Provisioning(Host => "localhost");
my %param = ();
$param{deviceName} = "my test device";
$param{address} = "192.168.200.50";
$param{locationName} = "Local Network";
$param{snmpCid} = "public";
$param{comment} = "my workstation";
$param{devicetype} = "unix";
$obj->[CreateDevice](%param);
%param = ();
$param{'deviceName'} = "my test device";
$param{'testType'} = "snmp";
$param{'subType'} = "disk";
$param{'testName'} = "Disk / Space Util";
$param{'interval'} = "300"; # seconds
$param{'units'} = "%";   # suitable unit
$param{'warningThreshold'} = "80";
$param{'criticalThreshold'} = "95";
$param{'snmpOId'} = ".1.3.6.1.2.1.25.2.3.1.6.1";
$param{'resultMultiplier'} = "1";
$param{'maxValue'} = "2048";
# 0=rate, 1=percent, 2=delta, 3=rate
# 4=deltapct, 5=ratepct
$param{'resultProcessDirective'} = "1";
$obj->[CreateTest](%param);