This file is indexed.

/usr/share/doc/libsnmp-perl/examples/pingmib.pl is in libsnmp-perl 5.7.2~dfsg-8.1ubuntu3.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env perl

# Ping a host via the CISCO-PING-MIB. For more information about the
# CISCO-PING-MIB, see also
# http://tools.cisco.com/Support/SNMP/do/BrowseMIB.do?local=en&mibName=CISCO-PING-MIB.

use strict;
use SNMP;

my $target = shift || die "no ping target supplied\n"; # numeric ip address
my $host = shift || 'localhost';
my $community = shift || 'private';

{
        my $sess = new SNMP::Session (DestHost => $host,
				      Community => $community,
				      Retries => 1);

        my $dec = pack("C*",split /\./, $target);
        my $oid = ".1.3.6.1.4.1.9.9.16.1.1.1";
        my $row = "300";
        my $res;

        $res = $sess->set([
                ["$oid.16", $row, 6, "INTEGER"],
                ["$oid.16", $row, 5, "INTEGER"],
                ["$oid.15", $row, "MoNDS", "OCTETSTR"],
                ["$oid.2", $row, 1, "INTEGER"],
                ["$oid.4", $row, 20, "INTEGER"],
                ["$oid.5", $row, 150, "INTEGER"],
                ["$oid.3", $row, $dec, "OCTETSTR"]]);
        defined($res) || die "row creation failed";
                
        $res = $sess->set([["$oid.16", $row, 1, "INTEGER"]]);
        defined($res) || die "row activation failed";

        sleep 30;
        my ($sent, $received, $low, $avg, $high, $completed) = $sess->get([
                ["$oid.9", $row], ["$oid.10", $row], ["$oid.11", $row],
                ["$oid.12", $row], ["$oid.13", $row], ["$oid.14", $row]]);

        printf "Packet loss: %d% (%d/%d)\n", (100 * ($sent-$received)) / $sent,
                $received, $sent;
        print "Average delay $avg (low: $low high: $high)\n";
        $sess->set(["$oid.16", $row, 6, "INTEGER"]);
}