LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-31-2004, 07:18 AM   #1
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,623

Rep: Reputation: 51
need the script to show via browser if the vpn client is running


hi

I have cisco vpnclient-linux-3.7.3.A-k9
installed on linux server SuSE 8.2.
This server is also the proxy server
for 300 clients.
So all our users have vpn connection
via proxy and I don't need install
any vpn clients at the workstations.

But sometimes the vpn client is going down,
so I wrote the php script to start it
via browser.
The problem is, that sometimes the remote server goes down
and the vpn client cannot establish connection and user don't know
where the problem is.

I need the second PHP or Perl script to show
in browser if the VPN client is running or not.
So if I am not in the office, users can check it.
I thought, to check the proces:

# ps ax | grep vpnclient | grep -v grep
11153 ? S 0:00 /usr/local/bin/vpnclient

and show via browser:

"VPN Client is up and running"

any idea ?

kind regards
cccc
 
Old 01-31-2004, 04:10 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
What about:
Code:
#!/usr/bin/perl
print "content-type:text/html\n\n";
$out=`ps ax | grep vpnclient | grep -v grep`;
if($out=~/vpnclient/){print "VPN Client is up and running"}
else{print "VPN Client is down"}
exit;
 
Old 01-31-2004, 06:39 PM   #3
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,623

Original Poster
Rep: Reputation: 51
thank you very much

it works well !

this forum is really fantastic and helpful.

kind regards
cccc

Last edited by cccc; 01-31-2004 at 06:44 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
keep linux cisco vpn client up and running cccc Linux - Networking 5 04-18-2006 07:54 PM
Permission denied on client when running install script residing on NFS server dstotz Linux - Newbie 2 12-11-2004 02:10 PM
svg image doesn't show up in the browser eantoranz Programming 1 11-24-2004 12:28 PM
Apache CGI Problem : Browser not running script Zaknafien Linux - Software 3 12-31-2003 01:16 PM
How do i connect Ciscos VPN client to Checkpoint VPN server Klas Linux - Networking 1 11-29-2003 08:00 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration