diff options
author | Christian Hesse <mail@eworm.de> | 2023-12-04 09:28:59 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2023-12-04 09:33:24 +0100 |
commit | 15e347303bfb1d8dc600dd8c1a6cd6e8bbe6268f (patch) | |
tree | 448091c22dc87e4e532dd9a87a854a69bfeaa856 | |
parent | aba477039518dd3806a7f19c40735f0433fb7467 (diff) |
global-functions: $DeviceInfo: add SNMP location and contact
-rw-r--r-- | global-functions.rsc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/global-functions.rsc b/global-functions.rsc index d4f5ebf..6167348 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -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) \ |