Na cca 6 AP mám tento script. Na 4 běží dle předpokladu - pošle mi mailem přenesená data klientů.
Na jednom AP mi to ale do mailu vypíše 2x a na dalším dokonce asi 6x.
Kód: Vybrat vše
:local name [/system identity get name];
:local telo
:log info "Starting Data_Sum Script..."
:set telo ("Suma prenesenych dat za klienty Download / Upload [MB]" . "\n")
/queue simple
:foreach i in=[find] do={
:local totalcurrent ([get $i bytes])
:local pos5 [:find $totalcurrent "/"]
:local pos6 [:len $totalcurrent]
:local bytesupcurrent ([:pick $totalcurrent 0 ($pos5)])
:local bytesdowncurrent ([:pick $totalcurrent ($pos5+1) $pos6])
:local megsupcurrent ($bytesupcurrent / 1048576)
:local megsdowncurrent ($bytesdowncurrent / 1048576)
:set telo ($telo . [get $i name] . " - " . [get $i target-addresses] )
:set telo ($telo . ": " . $megsdowncurrent . " / " . $megsupcurrent . "\n" )
}
/tool e-mail send to="knapek@mmsw.cz" subject=($name . " - Data_Sum_Compact") body=$telo
Výpis v e-mailu pak vypadá asi takto:
Suma prenesenych dat za klienty Download / Upload [MB]
p2p - : 0 / 0
User1 - 192.168.203.214/32: 0 / 0
User2 - 192.168.206.46/32: 0 / 0
...
,Suma prenesenych dat za klienty Download / Upload [MB]
p2p - : 0 / 0
User1 - 192.168.203.214/32: 0 / 0
User2 - 192.168.206.46/32: 0 / 0
...
Na konci požadovaného výpisu se objeví čárka a znova se výpis zopakuje.
ROS verze 5.21, RB 333, 433, 600, 800
Moc děkuji, neb jsem v koncích
Mirek