1 | 1 | simandl | package HotSaNICmod::common; |
2 | | | |
3 | | | sub version { |
4 | | | ($VERSION = '$Revision: 1.4 $') =~ s/.*(\d+\.\d+).*/$1/; |
5 | | | return "common.pm $VERSION"; |
6 | | | } |
7 | | | |
8 | | | sub configure { |
9 | | | return HotSaNICparser::get_moduleconfig(".",(SENSOR=>"array")); |
10 | | | } |
11 | | | |
12 | | | sub get_names { |
13 | | | my $entry=shift || ","; |
14 | | | my $host=""; |
15 | | | my $community=""; |
16 | | | |
17 | | | my ($item,$dbname,$description,$num,$scalefactor,$add,$unit,$min,$max)=split /,/,$entry; |
18 | | | if (! defined $method) { $method=""; } |
19 | | | if( index($item, "SNMP:") >= 0) { (undef,$host,$community,$item) = split /:/, $item; } |
20 | | | if ($host ne "") { $name="$host:$dbname"; } |
21 | | | else { $name="$dbname"; } |
22 | | | $file=$dbname; |
23 | | | |
24 | | | return ($host,$community,$item,$dbname,$name,$file,$description,$num,$scalefactor,$add,$unit,$min,$max); |
25 | | | } |
26 | | | 1; |
27 | | | |