mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
32_SYSSTAT.pm: added snmpCommunity attrute
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@9504 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
4ce8ed373e
commit
2dc6dfc39b
@ -42,7 +42,7 @@ SYSSTAT_Initialize($)
|
|||||||
$hash->{GetFn} = "SYSSTAT_Get";
|
$hash->{GetFn} = "SYSSTAT_Get";
|
||||||
$hash->{AttrFn} = "SYSSTAT_Attr";
|
$hash->{AttrFn} = "SYSSTAT_Attr";
|
||||||
$hash->{AttrList} = "disable:1 disabledForIntervals raspberrycpufreq:1 raspberrytemperature:0,1,2 synologytemperature:0,1,2 stat:1 uptime:1,2 ssh_user ";
|
$hash->{AttrList} = "disable:1 disabledForIntervals raspberrycpufreq:1 raspberrytemperature:0,1,2 synologytemperature:0,1,2 stat:1 uptime:1,2 ssh_user ";
|
||||||
$hash->{AttrList} .= " snmp:1 mibs:textField-long snmpVersion:1,2" if( $SYSSTAT_hasSNMP );
|
$hash->{AttrList} .= " snmp:1 mibs:textField-long snmpVersion:1,2 snmpCommunity" if( $SYSSTAT_hasSNMP );
|
||||||
$hash->{AttrList} .= " filesystems showpercent";
|
$hash->{AttrList} .= " filesystems showpercent";
|
||||||
$hash->{AttrList} .= " useregex:1" if( $SYSSTAT_hasSysStatistics );
|
$hash->{AttrList} .= " useregex:1" if( $SYSSTAT_hasSysStatistics );
|
||||||
$hash->{AttrList} .= " $readingFnAttributes";
|
$hash->{AttrList} .= " $readingFnAttributes";
|
||||||
@ -130,7 +130,7 @@ SYSSTAT_InitSNMP($)
|
|||||||
|
|
||||||
my ( $session, $error ) = Net::SNMP->session(
|
my ( $session, $error ) = Net::SNMP->session(
|
||||||
-hostname => $host,
|
-hostname => $host,
|
||||||
-community => $community,
|
-community => AttrVal($name,"snmpCommunity","public"),
|
||||||
-port => 161,
|
-port => 161,
|
||||||
-version => AttrVal($name,"snmpVersion",1),
|
-version => AttrVal($name,"snmpVersion",1),
|
||||||
);
|
);
|
||||||
@ -220,6 +220,10 @@ SYSSTAT_Attr($$$)
|
|||||||
$hash->{$attrName} = $attrVal;
|
$hash->{$attrName} = $attrVal;
|
||||||
SYSSTAT_InitSNMP( $hash );
|
SYSSTAT_InitSNMP( $hash );
|
||||||
|
|
||||||
|
} elsif( $attrName eq "snmpCommunity" && $SYSSTAT_hasSNMP ) {
|
||||||
|
$hash->{$attrName} = $attrVal;
|
||||||
|
SYSSTAT_InitSNMP( $hash );
|
||||||
|
|
||||||
} elsif ($attrName eq "snmp" && $SYSSTAT_hasSNMP ) {
|
} elsif ($attrName eq "snmp" && $SYSSTAT_hasSNMP ) {
|
||||||
if( $cmd eq "set" && $attrVal ne "0" ) {
|
if( $cmd eq "set" && $attrVal ne "0" ) {
|
||||||
$hash->{USE_SNMP} = $attrVal;
|
$hash->{USE_SNMP} = $attrVal;
|
||||||
@ -841,6 +845,8 @@ SYSSTAT_getStat($)
|
|||||||
If set the entries of the filesystems list are treated as regex.</li>
|
If set the entries of the filesystems list are treated as regex.</li>
|
||||||
<li>ssh_user<br>
|
<li>ssh_user<br>
|
||||||
The username for ssh remote access.</li>
|
The username for ssh remote access.</li>
|
||||||
|
<li>snmpVersion</li>
|
||||||
|
<li>snmpCommunity</li>
|
||||||
<li><a href="#readingFnAttributes">readingFnAttributes</a></li>
|
<li><a href="#readingFnAttributes">readingFnAttributes</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</ul>
|
</ul>
|
||||||
@ -969,6 +975,8 @@ SYSSTAT_getStat($)
|
|||||||
Wenn Wert gesetzt, werden die Einträge der Dateisysteme als regex behandelt.</li>
|
Wenn Wert gesetzt, werden die Einträge der Dateisysteme als regex behandelt.</li>
|
||||||
<li>ssh_user<br>
|
<li>ssh_user<br>
|
||||||
Der Username für den ssh Zugang auf dem entfernten Rechner.</li>
|
Der Username für den ssh Zugang auf dem entfernten Rechner.</li>
|
||||||
|
<li>snmpVersion</li>
|
||||||
|
<li>snmpCommunity</li>
|
||||||
<li><a href="#readingFnAttributes">readingFnAttributes</a></li>
|
<li><a href="#readingFnAttributes">readingFnAttributes</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</ul>
|
</ul>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user