Go Down

Topic: Linino Locks up after ~12-24 hours Running php Script every minute (Read 19605 times) previous topic - next topic

whisprer

I have a project that logs data from Arduino to a sqlite3 database on Linino:
http://forum.arduino.cc/index.php?topic=227344.0

I have solved some issues with help from people here, but am now experiencing a recurring problem. I run a php script on Linino via a cronjob that runs every minute. This php script syncs data from the local sqlite3 database to a remote MySQL database for web access. The problem is that after about 12 hours (almost exactly on some occasions), but sometimes after 24 hours, the dbSync.php script no longer runs (the data doesn't make it to my webserver). In the meantime, it appears that the sqlite3 command run through the bridge still works. After I reset Linino I see that all the data during the time when the php script was not running was saved locally. After this reboot the script syncs all the missing data.

Furthermore, I can still see the Yun on my router, but cannot access it via HTTP config access or SSH. Any idea what might be going on here? It appears parts of Linino become non-functional, but that the OS is still running somehow (since it can execute shell commands via the bridge). I suspect I will get asked for the PHP script, which I will provide in the morning. In the meantime, any ideas? Since this is a remote application, are there any other suggestions on how I can try to communicate with/reset the Yun remotely?

Thanks

sonnyyu

Nagios (opensource) is a powerful monitoring system that enables organizations to identify and resolve IT infrastructure problems before they affect critical business processes. Nagios is installed a Linux host machine.


  • Monitoring

  • Alerting

  • Response

  • Reporting

  • Maintenance

  • Planning



NRPE - Nagios Remote Plugin Executor, load NRPE at Yun that allow you monitor network connection, cpu usage, memory usage..., and send out alert via email or sms once threshold is reached.

Setting up Nagios to remotely monitor an openwrt router ( Arduino Yun)





whisprer


NRPE - Nagios Remote Plugin Executor, load NRPE at Yun that allow you monitor network connection, cpu usage, memory usage..., and send out alert via email or sms once threshold is reached.

Setting up Nagios to remotely monitor an openwrt router ( Arduino Yun)


Thanks, this is a great suggestion. I will get it up and running. In the meantime, any suggestions on how to access or reboot my partially locked up Yun that is in the field?

sonnyyu

#3
Mar 22, 2014, 02:31 pm Last Edit: Mar 22, 2014, 02:34 pm by sonnyyu Reason: 1
Re: Measuring if the Yun is internet connected

http://forum.arduino.cc/index.php?topic=209412.msg1541242#msg1541242

Modify the code and make it run once only and reboot linino when no internet. then put it at cronjob that runs every ~10 minutes.

B.T.W. Nagios support response which means once no network then auto reboot.

whisprer

#4
Mar 22, 2014, 04:32 pm Last Edit: Mar 22, 2014, 04:40 pm by whisprer Reason: 1

NRPE - Nagios Remote Plugin Executor, load NRPE at Yun that allow you monitor network connection, cpu usage, memory usage..., and send out alert via email or sms once threshold is reached.

Setting up Nagios to remotely monitor an openwrt router ( Arduino Yun)


I have tried installing this both from Luci and from SSH command line and cannot, for some strange reason. In Luci I was able to Update Packages and install 'nrpe' package, but not 'nagios-plugins'. I can view the 'nagios-plugins' package when I search for it in Luci, but when I try to install I get a 'Bad Gateway - The process did not produce any response' page after timing out. I should mention that during the process of installing, my Yun lost internet connection, so I checked 'netstat -nr' and added '/sbin/rout add -net 0.0.0.0 gw 192.168.1.1 eth1'. My Yun is now able to connect to internet and obtain package list, but I cannot install anything. Any idea what went wrong? This is frustrating because it is diverting me from the initial issue of this post. Thanks for the help!

Code: [Select]
root@yun01:~# netstat -n -r
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 eth1
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 eth1
192.168.240.0   0.0.0.0         255.255.255.0   U         0 0          0 wlan0

sonnyyu

Quote
...
but when I try to install I get a 'Bad Gateway - The process did not produce any response' page after timing out. I should mention that during the process of installing, my Yun lost internet connection, so I checked 'netstat -nr' and added '/sbin/rout add -net 0.0.0.0 gw 192.168.1.1 eth1'. My Yun is now able to connect to internet and obtain package list, but I cannot install anything. Any idea what went wrong? This is frustrating because it is diverting me from the initial issue of this post.
...


http://forum.arduino.cc/index.php?topic=203754.msg1507343#msg1507343


DHCP patch is needed.

whisprer


Quote
...
but when I try to install I get a 'Bad Gateway - The process did not produce any response' page after timing out. I should mention that during the process of installing, my Yun lost internet connection, so I checked 'netstat -nr' and added '/sbin/rout add -net 0.0.0.0 gw 192.168.1.1 eth1'. My Yun is now able to connect to internet and obtain package list, but I cannot install anything. Any idea what went wrong? This is frustrating because it is diverting me from the initial issue of this post.
...


http://forum.arduino.cc/index.php?topic=203754.msg1507343#msg1507343


DHCP patch is needed.


Even if I have a static IP setup in the router I hook the Yun to with eth1? And even if I am still able to ping other web locations?

whisprer



Quote
...
but when I try to install I get a 'Bad Gateway - The process did not produce any response' page after timing out. I should mention that during the process of installing, my Yun lost internet connection, so I checked 'netstat -nr' and added '/sbin/rout add -net 0.0.0.0 gw 192.168.1.1 eth1'. My Yun is now able to connect to internet and obtain package list, but I cannot install anything. Any idea what went wrong? This is frustrating because it is diverting me from the initial issue of this post.
...


http://forum.arduino.cc/index.php?topic=203754.msg1507343#msg1507343


DHCP patch is needed.


Even if I have a static IP setup in the router I hook the Yun to with eth1? And even if I am still able to ping other web locations?


I implemented the fix you linked to and it did nothing to solve the problem. I essentially implemented this manually via SSH already. On top of this, I haven't had any issues over the past months with this before.

These shell commands work sometimes, but are flaky. I cannot install nagios-plugins.
Code: [Select]
opkg update
and
opkg install


I cannot update packages from Luci or install anything (Bad Gateway). I have restored the Yun to factory defaults and implemented your fix, and it still does not correct the issue. There is either something seriously wrong with my Yun now or something wrong with the linino server. Any insights? Thanks!

sonnyyu

Quote
Even if I have a static IP setup in the router I hook the Yun to with eth1? And even if I am still able to ping other web locations?


No need DHCP patch for static IP , post the output of

Code: [Select]
cat /etc/config/network

sonnyyu

Start from fresh (backup your own file!):

Code:
Code: [Select]
/usr/bin/reset-to-factory-anyway
reboot


whisprer


Quote
Even if I have a static IP setup in the router I hook the Yun to with eth1? And even if I am still able to ping other web locations?


No need DHCP patch for static IP , post the output of

Code: [Select]
cat /etc/config/network


Code: [Select]
root@yun01:~# cat /etc/config/network

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config interface 'lan'
        option proto 'static'
        option ipaddr '192.168.240.1'
        option netmask '255.255.255.0'

config interface 'wan'
        option ifname 'eth1'
        option proto 'dhcp'
        option metric '10'

whisprer


Start from fresh (backup your own file!):

Code:
Code: [Select]
/usr/bin/reset-to-factory-anyway
reboot




Is this the exact same as holding the WLAN RST button for >30 seconds?

sonnyyu



Start from fresh (backup your own file!):

Code:
Code: [Select]
/usr/bin/reset-to-factory-anyway
reboot




Is this the exact same as holding the WLAN RST button for >30 seconds?


Same, but software is the way I prefer.

sonnyyu

Quote
config interface 'wan'
        option ifname 'eth1'
        option proto 'dhcp'
        option metric '10'


You are on DHCP,  the patch  might help.

whisprer


Quote
config interface 'wan'
        option ifname 'eth1'
        option proto 'dhcp'
        option metric '10'


You are on DHCP,  the patch  might help.



Yes, I set up the router give the Yun a static IP on it's network, but didn't change anything within the Yun's network settings. I have applied the fix anyways, even before my previous 2 posts, and I still cannot install packages. I am able to update the package list sometimes, but cannot install nagios-plugins or other packages I try. At one point I was luckily able to install nano. Any idea why I can no longer install packages? (Bad Gateway - the process did not produce any response)

Go Up