jablonka.czprosek.czf

hotsanic

Subversion Repositories:
[/] [branches/] [HotSaNIC-0.5.0-pre6/] [modules/] [apps/] [platform/] [solaris.pm] - Blame information for rev 32

 

Line No. Rev Author Line
11simandlpackage HotSaNICmod::OSdep;
2 
3my $MODNAME;
4 
5sub version {
6 ($VERSION = '$Revision: 1.11 $') =~ s/.*(\d+\.\d+).*/$1/;
7 return "$^O.pm $VERSION";
8 }
9 
10sub sample {
11 my %args=@_;
12 
13 my $oid = '.1.3.6.1.2.1.25.4.2.1.2';
14 # host.hrSWRun.hrSWRunTable.hrSWRunEntry.hrSWRunName
15 
16 undef my %localapps;
17 
18 # build local process-table first
19 #
20 my $command="/bin/ps -aef -o \"comm\"";
21 open FILE,"$command|" || HotSaNIClog::error("unable to run '$command': $!");
22 my @processes=(<FILE>);
23 close FILE;
24 
25 foreach my $entry (@{$args{APP}}) {
26 my ($host,$community,$item,$dbname,$name,$file,$description)=HotSaNICmod::common::get_names($entry);
27 
28 my $num=0;
29 if ($host eq "") {
30 # query local processes
31 #
32 for (@processes) { if ( index($_,$item) >= 0 ) { $num++; } }
33 HotSaNICmod::do_rrd($item,"U",time,$num);
34 }
35 }
36 }
37 
381;
39 

Powered by WebSVN 2.2.1