quick question, I'm trying to get an array script to monitor my sfp signals, if any interface defined in my array is higher than -16 to log info as a test, however, I cant seem to get it working and my syntax seems correct, perhaps someone can guide me in the right direction?
Below is my code:
Thanks in advance.#Hugh's SFP script
:global thisbox [/system identity get name];
:global thistime [/system clock get time];
:global thisdate [/system clock get date];
:global sfplist [:toarray "sfp1,sfp3,sfp7,sfp8,sfp12"];
:global sfpsignal;
:global sfpmonitor;
:foreach i in=$sfplist do={
:set $sfpmonitor [/interface monitor-traffic $i as-value once];
:set $sfpsignal [:put ($sfpmonitor->"sfp-rx-power")];
:if ($sfpsignal<"-16000") do={log warning "there is an issue with $i signal is at $sfpsignal"
} else={log warning "no issue found on $i"}
Hugh