mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
global-functions: $DeviceInfo: add SNMP location and contact
This commit is contained in:
parent
aba4770395
commit
15e347303b
1 changed files with 6 additions and 1 deletions
|
@ -219,16 +219,21 @@
|
|||
:global IfThenElse;
|
||||
:global FormatLine;
|
||||
|
||||
:local License [ /system/license/get ];
|
||||
:local Resource [ /system/resource/get ];
|
||||
:local RouterBoard;
|
||||
:do {
|
||||
:set RouterBoard [[ :parse "/system/routerboard/get" ]];
|
||||
} on-error={ }
|
||||
:local License [ /system/license/get ];
|
||||
:local Snmp [ /snmp/get ];
|
||||
:local Update [ /system/package/update/get ];
|
||||
|
||||
:return ( \
|
||||
[ $FormatLine "Hostname" $Identity ] . "\n" . \
|
||||
[ $IfThenElse ([ :len ($Snmp->"location") ] > 0) \
|
||||
([ $FormatLine "Location" ($Snmp->"location") ] . "\n") ] . \
|
||||
[ $IfThenElse ([ :len ($Snmp->"contact") ] > 0) \
|
||||
([ $FormatLine "Contact" ($Snmp->"contact") ] . "\n") ] . \
|
||||
[ $FormatLine "Board name" ($Resource->"board-name") ] . "\n" . \
|
||||
[ $FormatLine "Architecture" ($Resource->"architecture-name") ] . "\n" . \
|
||||
[ $IfThenElse ($RouterBoard->"routerboard" = true) \
|
||||
|
|
Loading…
Reference in a new issue