am using Chaos Calmer and syslog not working. I need to send the log file from my router to cloud. So kindly help to collect the logs from openwrt .
Topic: how to collect the logs?
The content of this topic has been archived on 3 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.
Luci --> System --> System
Click on the Logging tab
Specify the remote syslog server IP address and port
Save and apply
Thanks dl....i plan to send the log file from the router to cloud. So following script will create a log file(AP_logs), so that i can post it to cloud, is that possible?
#!/bin/sh
uci set system.@system[0].log_size=4096
uci set system.@system[0].log_type=file
uci set system.@system[0].cronloglevel=5
uci set system.@system[0].log_file= /etc/AP_Logs
uci set wireless.radio0.log_level=1
uci commit system
uci commit wireless
exit 0
Thanks dl....i plan to send the log file from the router to cloud. So following script will create a log file(AP_logs), so that i can post it to cloud, is that possible?
#!/bin/sh
uci set system.@system[0].log_size=4096
uci set system.@system[0].log_type=file
uci set system.@system[0].cronloglevel=5
uci set system.@system[0].log_file= /etc/AP_Logs
uci set wireless.radio0.log_level=1
uci commit system
uci commit wirelessexit 0
No, no, no.
Why are you trying to log to /etc? The correct place is /var/log
The method I described sends log messages using the UDP syslog protocol to a remote syslog server. It DOES NOT upload files to some cloud drive. There is not out-of-the-box solution for uploading files to a cloud drive.
Get a USB memory stick. Format it with an ext4 file system. Mount it somewhere (/var is probably the best place, but you will first need to delete the symbolic link from /var to /tmp/var, then create a /var folder, then mount the USB on /var). Once you have a USB installed and mounted on /var then write the logs to /var/log
If you want easy access from a Windows PC you can install Samba and share the USB drive using Samba
Oh..Ok....is it possible to port "AWS SDK for C++" in openwrt code.....so that i can send some logs to aws-cloud....
If it is Linux based then it can be compiled for OpenWrt. You'll need to download the OpenWrt SDK and do a lot of reading to understand how the buildroot environment works.
Saying this in the nicest possible way, your questions so far indicate that you have a lot of learning to do before you would be able to cross-compile a new package for OpenWrt. If you cannot compile a normal package on a standard Linux system, then you have almost no chance of being able to cross-compile a package for OpenWrt.
You will also need to understand exactly how Linux systems and OpenWrt work, and for this you should read the wiki articles that explain the system layout.
I suggest starting with the following wiki articles:
https://wiki.openwrt.org/doc/howto/obtain.firmware.sdk
https://wiki.openwrt.org/doc/howto/buildroot.exigence
https://wiki.openwrt.org/doc/howto/build
If you don't have a remote syslog server you could try sshfs to mount a remote directory. I was playing around with this a while back for other purposes.
mkdir /tmp/mount
echo password | sshfs user@my.aws.com:/var/log/ /tmp/mount -o workaround=rename -o password_stdin
#used with reconnect to keep sshfs tunnels open
echo 'ServerAliveInterval 15' >>/etc/ssh/ssh_config
echo 'ServerAliveCountMax 3' >> /etc/ssh/ssh_config
The discussion might have continued from here.