Linux / UNIX Tech Support Forum
This is a discussion on multiple server status script within the Linux software forums, part of the Linux Getting Started category; Good work vivek!...
|
|||||||
| Linux software General questions and discussion about Redhat/Fedora Core/Cent OS, Debian and Ubuntu Linux related to softwares should go here. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
| Sponsored Links | ||
|
|
|
|||
|
Hi,
Is there a way to add a line to the script which will automatically reload the html outout say every 5 minutes? I have tried adding this line to writeHead() { <META HTTP-EQUIV="REFRESH" CONTENT="300;URL=status.html"> but it doesn't seem to work. And another minor thing, the Uptime shows "Uptime: 21days, ". Shouldn't it be 21 days, hour? And the second column displays "Uptime: 1 (hh:mm) " Kind Regards, Marin Micoriciu |
|
||||
|
>Is there a way to add a line to the script which will automatically reload the html outout say every 5 minutes? I have tried adding this line to writeHead() {
Line should be as follows: Code:
echo '<META HTTP-EQUIV="REFRESH" CONTENT="300;URL=status.html">' >And another minor thing, the Uptime shows "Uptime: 21days, ". Shouldn't it be 21 days, hour? >And the second column displays "Uptime: 1 (hh:mm) " Hmm can you upload output somewhere on net? So that i can see what you mean. Sure we can fix if it is a bug
__________________
Vivek Gite Linux Evangelist |
|
|||
|
It's inside the ' ':
echo '<HTML><HEAD><TITLE>Network Status</TITLE><META HTTP-EQUIV="REFRESH" CONTENT="300;URL=index.do"></HEAD>' And it's not working...It's not refreshing. You can see the status here: http://status.hostingzero.com |
|
||||
|
REFRESH must be inside <HEAD> tags
Here is modified writeHead() Code:
writeHead(){
echo '<HTML><HEAD><TITLE>Network Status</TITLE>
<META HTTP-EQUIV="REFRESH" CONTENT="300;URL=index.do">
</HEAD>
<BODY alink="#0066ff" bgcolor="#000000" link="#0000ff" text="#ccddee" vlink="#0033ff">'
echo '<CENTER><H1>'
echo "$MYNETINFO</H1>"
echo "Generated on $NOW"
echo '</CENTER>'
}
__________________
Vivek Gite Linux Evangelist |
|
|||
|
Hello Vivek,
Sorry for the late response. If you go to http://status.hostingzero.com you will notice that the uptime's output is: Uptime: 35days, from the shell, the uptime command shows like: 18:56:40 up 35 days, 8:25, 1 user, load average: 0.78, 0.59, 0.66 Is there a way to output the 8.25 as well? Like: Uptime: 35 days, 8.25? Thanks so much! |
|
||||
|
Try to add $5 in following block in code
Code:
if $(echo $ruptime | grep -E "min|days" >/dev/null); then
x=$(echo $ruptime | awk '{ print $3 $4 $5}')
else
x=$(echo $ruptime | sed s/,//g| awk '{ print $3 " (hh:mm)"}')
fi
__________________
Vivek Gite Linux Evangelist |
|
|||
|
Hi,
I got some error when running the script. =============================================== yntax error on line 1 stdin awk: 0602-512 The string "> \> <img cannot contain a newline character. The source line is 3. The error context is "(" $2 ") <img src=\"indicator.gif\" height=\"4\" width=\"" w "\"> \ >>> <<< Syntax Error The source line is 4. awk: 0602-502 The statement cannot be correctly parsed. The source line is 4. awk: 0602-540 There is a missing } character. ksh: free: not found. ksh: free: not found. ksh: free: not found. =============================================== 1. anyone can help me with the awk error?? 2. "free" is not available in AIX which I'm currently running Btw, anyone can show me the output of the infor.html Thanks in advance |
|
||||
|
I think above url http://status.hostingzero.com/ use same script. Remove free command as it is not available for IBM AIX unix.
Another thing is this script is known to work on GNU/Linux. You need to do little modification to get running it perfectly. Hope this helps |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| hda: status timeout: status=0xd0 { Busy } | surmandal | Linux hardware | 3 | 24-03-2008 08:16 PM |
| single DHCP server with multiple VLAN's | frank | Computer Networking and Internet/broadband | 2 | 07-12-2007 12:38 PM |
| login into multiple servers thru script... | avcert1998 | Shell scripting | 2 | 17-03-2007 03:29 AM |
| Script to add users to multiple servers. | deepakhg | Shell scripting | 0 | 17-03-2007 03:02 AM |
| shell script that parses multiple log files and checks for a | Anonymous | Shell scripting | 1 | 15-11-2006 09:38 PM |