hotsanic |
Subversion Repositories: |
Compare with Previous - Blame - Download
package HotSaNICmod::OSdep;
my $MODNAME;
sub version {
($VERSION = '$Revision: 1.11 $') =~ s/.*(\d+\.\d+).*/$1/;
return "$^O.pm $VERSION";
}
sub sample {
my %args=@_;
my $oid = '.1.3.6.1.2.1.25.4.2.1.2';
# host.hrSWRun.hrSWRunTable.hrSWRunEntry.hrSWRunName
undef my %localapps;
# build local process-table first
#
my $command="/bin/ps -aef -o \"comm\"";
open FILE,"$command|" || HotSaNIClog::error("unable to run '$command': $!");
my @processes=(<FILE>);
close FILE;
foreach my $entry (@{$args{APP}}) {
my ($host,$community,$item,$dbname,$name,$file,$description)=HotSaNICmod::common::get_names($entry);
my $num=0;
if ($host eq "") {
# query local processes
#
for (@processes) { if ( index($_,$item) >= 0 ) { $num++; } }
HotSaNICmod::do_rrd($item,"U",time,$num);
}
}
}
1;