FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
214 views 0 comments
by anonymous
Hello,

currently, I get log by going to CLI and type "logread". Is there a way to send these logs by SMS or Email when I send a SMS command to my routeur ?

I heard that log are remove when the router are restart. Can we avoid that ?

Thank You !

Thomas

1 Answer

0 votes
by anonymous

Hi,

Unfortunately there is no base function for that, but you could try exporting logread output into a file that would be held somewhere in /etc folder of your router.

Use logread > /etc/log.txt 

This will save the output in /etc/log.txt and the file should not be gone after the restart.

About sending it through SMS or email - I don't think that would be possible because of the character limit.

You could use this command in the script to send emails through CLI

#!/bin/sh

echo -e "subject:test\nfrom:email@gmail.com\n\ntestestestestest" | sendmail -v -H "exec openssl s_client -quiet -connect smtp.gmail.com:587 -tls1 -starttls smtp" -f email@gmail.com -au"receiver@gmail.com" -ap"lalalal" email@teltonika.lt

EB.

Best answer