Truncate table using ssh

Development questions: create new plugins, add new features...
paul
Posts: 62
Joined: Tue Dec 09, 2014 9:53 am

Truncate table using ssh

Post by paul » Mon Feb 27, 2017 10:21 am

Hi Libelium,

We can´t access to the Manager System (3G, wifi and Ethernet), because the MeshliumDB is full.

Warning: session_write_close() [function.session-write-close]: write failed: No space left on device (28) in /mnt/lib/var/www/ManagerSystem/login.php on line 42

Warning: session_write_close() [function.session-write-close]: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/mnt/user/php5) in /mnt/lib/var/www/ManagerSystem/login.php on line 42

Warning: Cannot modify header information - headers already sent by (output started at /mnt/lib/var/www/ManagerSystem/login.php:42) in /mnt/lib/var/www/ManagerSystem/login.php on line 43

Using ssh,

NodoCentral:~# df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 1.5G 910M 491M 65% /
udev 10M 2.7M 7.4M 27% /dev
/dev/disk/by-label/ROOT_FS
1.5G 910M 491M 65% /
tmpfs 125M 20M 105M 16% /lib/init/rw
varrun 125M 84K 125M 1% /var/run
varlock 125M 4.0K 125M 1% /var/lock
tmpfs 125M 4.0K 125M 1% /dev/shm
/dev/hda3 4.9G 4.7G 0 100% /mnt/user
tmpfs 125M 892K 125M 1% /tmp
tmpfs 125M 20M 105M 16% /var/log
tmpfs 125M 20M 105M 16% /var/tmp
/dev/mapper/lib 887M 42M 801M 5% /mnt/lib

We need to truncate the sensorParser data (is not necesary preserve). But when we try to access mysql we get this answer,

NodoCentral:~# mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Thanks,

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: Truncate table using ssh

Post by libelium-dev » Mon Feb 27, 2017 10:47 am

Hi paul,

Please check size of the logs executing:

Code: Select all

du -ah --max-depth=1 /mnt/user/logs/ | sort -h
Try to empty some logs, restart your Meshlium and try to access to the Manager System.

Regards

paul
Posts: 62
Joined: Tue Dec 09, 2014 9:53 am

Re: Truncate table using ssh

Post by paul » Mon Feb 27, 2017 11:27 am

I obtained this,

NodoCentral:~# du -ah --max-depth=1 /mnt/user/logs/ | sort -h
sort: invalid option -- h
Try `sort --help' for more information.

paul
Posts: 62
Joined: Tue Dec 09, 2014 9:53 am

Re: Truncate table using ssh

Post by paul » Mon Feb 27, 2017 11:29 am

And this without last part command part,

NodoCentral:~# du -ah --max-depth=1 /mnt/user/logs/
18M /mnt/user/logs/frame.log
4.0K /mnt/user/logs/check_connection.log
228K /mnt/user/logs/http_parser.log
4.4G /mnt/user/logs/syncDB.log
46M /mnt/user/logs/get_gps.log
32K /mnt/user/logs/sensorParser.log
4.0K /mnt/user/logs/boot_connection.log
18M /mnt/user/logs/sensor.log
4.4G /mnt/user/logs/

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: Truncate table using ssh

Post by libelium-dev » Mon Feb 27, 2017 11:55 am

Hi Paul,

The synchronization log is too big. Please, execute this command to empty the content:

Code: Select all

>  /mnt/user/logs/syncDB.log
restart the meshlium and try to access to the Manager System

Regards

paul
Posts: 62
Joined: Tue Dec 09, 2014 9:53 am

Re: Truncate table using ssh

Post by paul » Mon Feb 27, 2017 1:17 pm

Thanks for the quickness, the problem is solved.

Two questions about that,

What generates the syncDB.log file data? It is possible to control this?
Can be deleted/controlled from the System Manager (or another place) or only by ssh?

Thanks again.

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: Truncate table using ssh

Post by libelium-dev » Mon Feb 27, 2017 3:45 pm

Hi Paul,

You are welcome. You have edit the file:

Code: Select all

/mnt/lib/cfg/DBsync/setup.ini
The value "log" of the section "Daemon" set the level of log production. Set it to "0" if you want to stop producing logs.

Regards

paul
Posts: 62
Joined: Tue Dec 09, 2014 9:53 am

Re: Truncate table using ssh

Post by paul » Mon Mar 13, 2017 6:15 pm

Hi Libelium,

We have another problem with this meshlium, with 3G connections (static IP). Since 2 days ago the remote is imposible (in another LAN using the static IP), but we can access using the static IP when we are connected on the Meshlium Wifi.

Using programs like workbench, we can access remotely using the static IP, but we cant ejecute any commands (blocks or timeouts).

Thanks.

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: Truncate table using ssh

Post by libelium-dev » Tue Mar 14, 2017 10:20 am

Hi paul,

If we understand well, you can't access to your Meshlium using the 3G static IP provided in the initial connection, and when you are connected with your Meshlium using the WiFi the problem.

We recommend you checking the IP that your Meshlium has assigned when you are connected to the WiFi. You can go to Manager System Interfaces > 3G/GPRS, and see the IP you have in the green box, or you can type

Code: Select all

ifconfig
in the terminal and see the ppp0 interface

Code: Select all

ppp0 Link encap:Point-to-Point Protocol 
inet addr:xxx.xxx.xxx.xxx ....
Ensure that this IP is public, some mobile providers gives a private IP inside its network and with this one, it is not possible to access outside its network.

You can also type in the terminal

Code: Select all

route
to see if all the entries are well configured.

Let us know this information to check your status.

Best regards,

paul
Posts: 62
Joined: Tue Dec 09, 2014 9:53 am

Re: Truncate table using ssh

Post by paul » Tue Mar 14, 2017 6:07 pm

Hi,

After check those commands, the parameters are OK, surely the problem is in the SIM card, We are going to talk with the operator.

Thanks

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest