473,394 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Realtime server status page - slow on refresh

I'm new to perl. And I studied it because I really need to use CGI on my project. I have a website which pings my 10 VMware servers, now I display the status of the servers on a webpage. (online or offline) ..I use autorefresh on the page but it loads too long.

1.) Is there anyway to resolve this? Is there anyway that I can just loop the ping commands and not refresh the whole page?

2.) through the site, also I want to run a bat file on my webserver. The bat file will open or close my VMware servers. Is this possible?

Any comments/suggestions is very much appreciated. Thanks much.. =)
Jul 5 '07 #1
6 2279
KevinADC
4,059 Expert 2GB
How or where does perl come into the problem? You mention CGI, but that is not perl. How are you currently pinging your servers?
Jul 5 '07 #2
I studied CGI because I need to run a remote file, and most common tutorials in CGI used perl programming.. So I practiced some perl and used it to ping my servers. Specifically, Net::Ping.. Here is my code.

use Net::Ping;

my $ip1 = 'xxx.xxx.xxx.xxx';
my $p = Net::Ping->new();
print "Server Online\n"
if $p->ping($ip1);
$p->close();
print "Server Offline\n"
unless $p->ping($ip1);
$p->close();

It works for me but I'm not really sure if I'm doing it right. I'm still a beginner with perl. Another is running a remote file. Is there a way to do that in perl? Thanks again.
Jul 6 '07 #3
KevinADC
4,059 Expert 2GB
The pinging looks OK to me. As far as running a remote file goes, you can look into stuff like Telnet and SSH, both of which you will find on CPAN in the NET class of modules, just like ping.
Jul 6 '07 #4
miller
1,089 Expert 1GB
I understand that this is probably beyond the scope of your experience, but what you have to realize is that pinging a server is a time intensive operation. Especially if you're doing a lot of them, or if even one doesn't respond.

If you want the webpage to be responsive, you're going to have to have to create a separate process that will cache the results of the status checks so that the website only has to display the lastest checked status.

- Miller
Jul 6 '07 #5
Hi Guys,
Thanks for the reply. Yes, I made a separate process.
Works a lot better now. Thanks for the help everyone.
Jul 18 '07 #6
miller
1,089 Expert 1GB
Kudos. Well done.

- Miller
Jul 18 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Michele | last post by:
Hi all, I have developed a PHP-based website where a "planner" user can make up schedules of activities to be performed, storing them into MySQL tables. Afterwards, other "watcher" users can...
5
by: Bryan Field-Elliot | last post by:
We're designing a web app in which some operations will take a long time to complete (maybe two minutes). Because it's a high-volume application, we don't want browser connections hanging open for...
15
by: Michael Rybak | last post by:
hi, everyone. I'm writing a 2-players game that should support network mode. I'm now testing it on 1 PC since I don't have 2. I directly use sockets, and both client and server do...
1
by: rawCoder | last post by:
Hi, (NOTE: For the following post, please Only Consider HTTP Via WebBrowser) Data Publishing over HTTP is 'pull' based, i.e. the browser has to request(refresh) to get data. Is there any...
3
by: Matt | last post by:
Is there a way to execute server code without doing a complete page refresh in .Net? I have an ASP page to convert that uses XMLHTTP and I'm wondering if I should continue to use it in ASPX or do...
3
by: Marc Castrechini | last post by:
Forgive me on the lack of specifics but I am not a "server" guy. We just rolled our code out to a 2003 Server from Win2k Server and for some reason our pages are painfully slow. It appears the...
1
by: Henrik H | last post by:
Hi all, Is there a way, to show data on a web-page, and not get the refresh sound, when data is updated/refreshed?? My data should refreash every 15 secound, so I would be pleased no to hear...
1
by: CptDondo | last post by:
OK, let me explain what I am trying to do. I have an embedded PC that runs a httpd+php server and controls a machine. I have a browser front end that provides the HMI (human machine interface)...
4
by: =?Utf-8?B?YXVsZGg=?= | last post by:
hello, i'm not sure if this is possible. i have a small VS 2005 C# windows application. it has a textbox and a button. once the user presses the button it fires off many tasks. i want to use the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.