- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- need the script to show via browser if the vpn cli...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-31-2004 12:00 AM
тАО01-31-2004 12:00 AM
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
chris
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-31-2004 05:02 AM
тАО01-31-2004 05:02 AM
SolutionIt is relatively easy to setup i hope.
Go through this perl CGI module page and you can easily set up what you want:
http://stein.cshl.org/WWW/software/CGI/
Hope this helps
vijay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-01-2004 05:35 PM
тАО02-01-2004 05:35 PM
Re: need the script to show via browser if the vpn client is running
There you can write a script that includes ps command with arguments and pipes or just hardcode it in php like this sample shows. there grep -c counts how many lines has hitted so if vpnclient line is found then output has value 1.
$output=shell_exec("ps ax | grep -v grep | grep -c vpnclient");
if ($output != 0) {
echo "VPN client is up and running!
;
} else {
echo "Here what to do then!
"
}
?>
Regards Toni
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-01-2004 08:47 PM
тАО02-01-2004 08:47 PM
Re: need the script to show via browser if the vpn client is running
I tried your script, but I get this error:
parse error, unexpected T_STRING, expecting ',' or ';' in /srv/www/htdocs/coda1.php on line 31
kind regards
chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-01-2004 10:46 PM
тАО02-01-2004 10:46 PM
Re: need the script to show via browser if the vpn client is running
$output=shell_exec("ps ax | grep -v grep | grep -c vpnclient");
if ($output != 0) {
echo "VPN client is up and running!";
} else {
echo "Here what to do then!";
}
?>
now it works well !
regards
chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-01-2004 10:47 PM
тАО02-01-2004 10:47 PM
Re: need the script to show via browser if the vpn client is running
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2004 07:06 PM
тАО02-02-2004 07:06 PM
Re: need the script to show via browser if the vpn client is running
Ah, sorry, every command needs to end with semicolon, since coding is not my main work it seems to be forgotten pretty easely;-) And I have to admit that I didnt test the code before suggesting it. Well it didnt seem to be a problem to you after all so problem solved.
Have a nice day too, Chris!!
Regards,
Toni