RUT240 - mdcollectdctl not found

Hi,

We are trying to HTTP Post a daily LTE usage of the modem RUT240 and RUT241. We have been looking in the Event Juggler option, which looks pretty good, but we can’t get the data usage.

As we were looking for solutions, we thought in using a script which uses mdcollectdctl as stated in this documentation and send it to our server via Webhook, but after not getting anything via the Juggler (interval trigger, working with another network state values, but not with this script), we found in the integrated CLI that the stated package not exists.

Is any further install needed or it is deprecated?

Firmware version is RUT2M_R_00.07.15.2

At the top of the documentation you provided it says:

The information in this page is updated in accordance with firmware version RUT2XX_R_00.01.14.7.

You are using a way newer firmware version.

You would probably want to use API something like this: https://developers.teltonika-networks.com/reference/rut241/7.15.2/v1.7.2/data-usage#get-data_usage-interval-modem-modem_id-status

You can call API on the device by using /sbin/api application or from a remote/local server by following the tutorials in the website I mentioned above.

Hello, as @pwsh suggested, I would also recommend looking into our API documentation & utilizing it to read the data. Let us know if this solution works for you.

Regards,
M.

Thanks @pwsh and @MatasR!, I was trying the API when I published the post, I see that we can use the /sbin/api to avoid generating the token and so on. That’s really great.

But I get two unexpected errors:
1 - Every call i get this Permission denied almost twice until I get the response from the API
2 - I can’t get a proper response from the data_usage API, while in the dasboard I can see how the usage was registered. Maybe the call is wrong with the timestamp, but I get an empty object.

admin@RUT200:~$ /sbin/api GET /data_usage/day/status                                            
touch: /var/run/board_modem.lock: Permission denied                                             
Can't open /var/run/board_modem.lock                                                            
touch: /var/run/board_modem.lock: Permission denied                                             
Can't open /var/run/board_modem.lock                                                            
touch: /var/run/board_modem.lock: Permission denied                                             
Can't open /var/run/board_modem.lock                                                            
{"http_body":{"success":true,"data":[]},"http_code":200}                                        
admin@RUT200:~$ /sbin/api GET /data_usage/custom/status?from=1749915195&to=1752507195           
admin@RUT200:~$ touch: /var/run/board_modem.lock: Permission denied                             
Can't open /var/run/board_modem.lock                                                            
touch: /var/run/board_modem.lock: Permission denied                                             
Can't open /var/run/board_modem.lock                                                            
touch: /var/run/board_modem.lock: Permission denied                                             
Can't open /var/run/board_modem.lock                                                            
{"http_body":{"success":true,"data":[]},"http_code":200} 

@drit You need to use root user to login to SSH in order to have full permissions. root has the same password as your admin user.

Also you need to add quotation marks to endpoint string so ? and & symbols are not interpreted as shell symbols, command should look like this:

/sbin/api GET "/data_usage/custom/status?from=1749915195&to=1752507195"
1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.