Community


All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Have to reinstall client on Ubuntu64 every time
PostPosted: Mon Aug 30, 2010 11:42 am 
Offline

Joined: Mon Aug 30, 2010 11:39 am
Posts: 1
If my Ubuntu64 machine loses its connection to the server ( server is Windows), my machine no longer connects automatically to the server and I cannot re-connect using nrclient. I have to (every single time) reinstall the client on the Ubuntu machine, then use nrclient to connect back to the server. There must be a way to fix this.


Top
 Profile  
 
 Post subject: Re: Have to reinstall client on Ubuntu64 every time
PostPosted: Mon Aug 30, 2010 12:40 pm 
Offline

Joined: Sun Nov 16, 2008 6:41 am
Posts: 1862
Hi Lobotron,

NeoRouter client service (nrservice) should have reconnected to the NeoRouter server automatically if it's not crashed or gets killed for some reasons. So please check if the service is running (ps aux|grep nrservice). If you can collect log file of the nrservice, we'd like to help you figure out the issue.

One the other hand, I'd like to post scripts here, which can be used for monitoring the specified process and restart it. Hope it helps.

1. To monitor and automatically restart NeoRouter service on Linux:
Code:
It will check the nrservice process once a minute, if it's down, it will restart it.

a.sudo vi /usr/local/ZebraNetworkSystems/NeoRouter/CheckService.sh
b.put the following lines in the script

#!/bin/sh
SERVICE='nrservice'
LOGFILE='/dev/null'
if [ "$( ps ax | grep -v grep | grep $SERVICE)" != "" ]; then
  echo "$SERVICE is running" >> $LOGFILE
  date >> $LOGFILE
else
  echo "$SERVICE is down" >> $LOGFILE
  date >> $LOGFILE
  /sbin/start-stop-daemon --start --background -m --pidfile /var/run/nrservice.pid --exec /usr/bin/nrservice >> $LOGFILE
fi

c.save it and make it executable
sudo chmod 755 /usr/local/ZebraNetworkSystems/NeoRouter/CheckService.sh

d.sudo crontab -e
e.add line
*/1 * * * * /usr/local/ZebraNetworkSystems/NeoRouter/CheckService.sh

f.restart cron
sudo service cron stop
sudo service cron start



2. To monitor and automatically restart NRServer if it's down on linux
Code:
It will check the nrserver process once a minute, if it's down, it will restart it.

a.sudo vi /usr/local/ZebraNetworkSystems/NeoRouter/CheckServer.sh
b.put the following lines in the script

#!/bin/sh
SERVICE='nrserver'
LOGFILE='/dev/null'
if [ "$( ps ax | grep -v grep | grep $SERVICE)" != "" ]; then
  echo "$SERVICE is running" >> $LOGFILE
  date >> /tmp/nrserver.log
else
  echo "$SERVICE is down" >> $LOGFILE
  date >> /tmp/nrserver.log
  /sbin/start-stop-daemon --start --background -m --pidfile /var/run/nrserver.pid --exec /usr/bin/nrserver >> $LOGFILE
fi

c.save it and make it executable
sudo chmod 755 /usr/local/ZebraNetworkSystems/NeoRouter/CheckServer.sh

d.sudo crontab -e
e.add line
*/1 * * * * /usr/local/ZebraNetworkSystems/NeoRouter/CheckServer.sh

f.restart cron
sudo service cron stop
sudo service cron start


Top
 Profile  
 
 Post subject: Re: Have to reinstall client on Ubuntu64 every time
PostPosted: Fri Sep 16, 2016 12:30 pm 
Offline

Joined: Fri Oct 30, 2015 3:25 pm
Posts: 16
Will this script works with CentOS?


Top
 Profile  
 
 Post subject: Re: Have to reinstall client on Ubuntu64 every time
PostPosted: Fri Sep 16, 2016 4:34 pm 
Offline

Joined: Sun Nov 16, 2008 6:41 am
Posts: 1862
Hi johnny2000,

No, it cannot run on CentOS/RH, as some commands may be different, but the main logic should be same. You may need to replace some commands with the equivalent on CentOS.

Thanks,
KevinZ - NeoRouter team


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: