Has anyone been able to read a global variable using a remote server ?
I have a modified system voltage variable on the RB and would like to read it from a remote Zabbix instance.
First prize would be a snmp get OID for global variables.
/interface bridge
add comment="used just for read remotely the valiable-value" name=variable-value
[rex@net] > /interface print oid where comment="used just for read remotely the valiable-value" Flags: D - dynamic, X - disabled, R - running, S - slave 0 R ;;; used just for read remotely the valiable-value name=.1.3.6.1.2.1.2.2.1.2.14 actual-mtu=.1.3.6.1.2.1.2.2.1.4.14 mac-address=.1.3.6.1.2.1.2.2.1.6.14 admin-status=.1.3.6.1.2.1.2.2.1.7.14 oper-status=.1.3.6.1.2.1.2.2.1.8.14 bytes-in=.1.3.6.1.2.1.31.1.1.1.6.14 packets-in=.1.3.6.1.2.1.31.1.1.1.7.14 discards-in=.1.3.6.1.2.1.2.2.1.13.14 errors-in=.1.3.6.1.2.1.2.2.1.14.14 bytes-out=.1.3.6.1.2.1.31.1.1.1.10.14 packets-out=.1.3.6.1.2.1.31.1.1.1.11.14 discards-out=.1.3.6.1.2.1.2.2.1.19.14 errors-out=.1.3.6.1.2.1.2.2.1.20.14name=.1.3.6.1.2.1.2.2.1.2.14
/interface bridge set [find where comment="used just for read remotely the valiable-value"] name=$globalvar
Cool trick. Will this have any impact on CPU/firewall performance however? Maybe there's (should be!) a better way to do this than having to create a whole bridge just for a single variable?put the value in the name of one fake bridge...
I understand the script OID is dynamically assigned. Is there any way of ensuring that a script will always get the same OID, ie can the required output script be put first so it will "always" get the same OID. (1.3.6.1.4.1.14988.1.1.18.1.1.2.1) I want to deploy the same script to several routers and use one Zabbix template for all, just changing the IP.There is a capability to setup scripts that you can run from an SNMP object... see:
https://wiki.mikrotik.com/wiki/Manual:SNMP#Run_Script
When you have a script that outputs something you can run that script and read that output via SNMP.
This requires that you setup a community with write permission, it does not work on the default "public".