Hello guys, it might be a little bit complicated to help me since I don't know the problem.
I've built a script which send the tx-bytes and rx-bytes for each interfaces to a remote php web server. The server then do some transformation/calculations on it to use them with Grafana for monitoring.
The script:
when I run the script, because of the debug statement I've set, I can see that it is sending everything, for example:
Such as:
Any idea is very welcome.
I've built a script which send the tx-bytes and rx-bytes for each interfaces to a remote php web server. The server then do some transformation/calculations on it to use them with Grafana for monitoring.
The script:
Code:
:local interfaces [/interface find];:local interfaceName "LoopBr" ;:local routerIP [ip address get [find interface=$interfaceName] address];:put ("Router IP: " . $routerIP);:local tx;:local rx;#:put $interfaces;:foreach interface in=$interfaces do={ :local intName [/interface get $interface name]; #:put ("Debug: " . $intName); :put ("Interface: " . $intName); :local softTx ([/interface get [find name=$intName] tx-byte]); :local softRx ([/interface get [find name=$intName] rx-byte]); #:set tx ($tx + $softTx); #:set rx ($rx + $softRx); :local data ("routerIP=" . $routerIP . "&intName=" . $intName . "&tx=" . $softTx . "&rx=" . $softRx); :local response [/tool fetch url="http://172.16.20.41/receiver_data.php" http-method=post http-data=$data as-value]; :put ("sending data from interface: " . $intName); :put ($response->"data"); :delay 1000ms; #:put $tx; #:put $rx;};
Thinking about the fact that it could be the server which could not send the different value to the database quickly enough, I add a delay (first it was at 4s). But whatever I'm doing I don't see every interface on my base, and always the same one's.Interface: ether1-10.144
sending data from interface: ether1-10.144
Interface: ether2-172.16.20
sending data from interface: ether2-172.16.20
Interface: ether3-ONT
sending data from interface: ether3-ONT
Interface: ether4-TR
sending data from interface: ether4-TR
Interface: ether5-TR
sending data from interface: ether5-TR
Interface: ether6-TR
sending data from interface: ether6-TR
Interface: ether7-TR
sending data from interface: ether7-TR
Such as:
The problem might be from my web server, but since there's no error logs I can't see anything... I can provide some parts of the php code if needed.| 10.211.0.11 | ether12-PiMGMT |
| 10.211.0.11 | LoopBr |
| 10.211.0.11 | TE-0002 |
| 10.211.0.11 | TE-0003 |
| 10.211.0.11 | TE-0004 |
| 10.211.0.11 | TE-0005 |
Any idea is very welcome.
Statistics: Posted by codi639 — Wed Feb 14, 2024 6:15 pm