Hi,
I’m making a script that colect the traffic of simple queues using snmp.
I need to reset all counters (set the counter to zero) of the simple queues after reding the queues but I’m no able to do this remotly.
I’m trying to use the Router OS API (PHP) like bellow without success:
$API = new routeros_api();
$API->debug = false;
if ($API->connect(‘192.168.33.1’, ‘admin’, ‘xxxxxx’)) {
$API->write(“/queue/simple/reset-counters-all”);
$API->disconnect();
}
Can someone help me?
Thank in advance!
Fabrício
janisk
April 6, 2010, 11:38am
2
please check precise syntax you have to use to execute this sentence in PHP API implementation, as command itself looks ok.
maybe it’s good to read the result before disconnecting?..
I checked the PHP API and it’s ok, I couldn’t reset the counter using the API and I don’t know why.
I’m able to read the counters but not to reset then.
Best regards
by “command itself looks ok” i meant, that i ran command and reset the counters without any problems.
so, api sentence
/queue/simple/reset-counters-all
is working
It’s strange, I couldn’t reset the counters using the API with PHP.
Everthing works fine (I can add a simple queue, an address-list, etc) but I can’t reset the counters… it’s strange.
I’m looking for a form to collect data of the clients traffic to create reports of usage than I think in read the simple queues (I’ve one queue for each customer).
Regards
Fabrício
check if you are using correct function to send this command to the router.