newdevice: Added detection for Hirschmann Railswitch #6161 (#6207)

* Added detection for Hirschmann Railswitch

* Update AUTHORS.md

I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md.

* Fixes for PR 6207 requested changes

* Fixes for PR 6207 requested changes

* Fixes for PR 6207 requested changes

* Fix for PR 6207 requested changes

* Fix for PR 6207 requested changes

* Fix for PR 6207 requested changes (old states and temperatures directories removal)

* fix for PR 6207 : state fileupdated
This commit is contained in:
InfraTeam
2017-03-23 20:36:25 +01:00
committed by Tony Murray
parent 4a705ea7e3
commit bc14b9137e
15 changed files with 10379 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
<?php
if ($device['os'] == 'hirschmann') {
$mem_allocated = snmp_get($device, 'HMPRIV-MGMT-SNMP-MIB::hmMemoryAllocated.0', '-OvQU');
$mem_free = snmp_get($device, 'HMPRIV-MGMT-SNMP-MIB::hmMemoryFree.0', '-OvQU');
$perc = $mem_allocated / ($mem_allocated + $mem_free) * 100;
$mempool['perc'] = $perc;
$mempool['total'] = ($mem_allocated + $mem_free);
$mempool['used'] = $mem_allocated;
$mempool['free'] = $mem_free;
echo '(U: '.$mempool['used'].' T: '.$mempool['total'].' F: '.$mempool['free'].') ';
}