nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

multiple server status script

This is a discussion on multiple server status script within the Linux software forums, part of the Linux Getting Started category; Good work vivek!...


Go Back   nixCraft Linux Forum > Linux Getting Started > Linux software

Linux answers from nixCraft.


Linux software General questions and discussion about Redhat/Fedora Core/Cent OS, Debian and Ubuntu Linux related to softwares should go here.

Reply

 

LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 28-06-2005, 07:13 PM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
OS: Debian GNU/Linux
Posts: 506
Thanks: 0
Thanked 8 Times in 6 Posts
Rep Power: 7
monk has a spectacular aura about monk has a spectacular aura about
Default

Good work vivek!
Reply With Quote
  #12 (permalink)  
Old 28-06-2005, 08:08 PM
Junior Member
User
 
Join Date: Feb 2005
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
marinm
Default

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
Reply With Quote
  #13 (permalink)  
Old 28-06-2005, 11:04 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,710
Thanks: 11
Thanked 244 Times in 183 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

>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
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #14 (permalink)  
Old 29-06-2005, 01:14 AM
Junior Member
User
 
Join Date: Feb 2005
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
marinm
Default

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
Reply With Quote
  #15 (permalink)  
Old 29-06-2005, 01:31 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,710
Thanks: 11
Thanked 244 Times in 183 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

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>'
}
Above should fix this problem.. and what was other problem? Days or something is that wrong or it should be something else? Let me know... if this works or not
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #16 (permalink)  
Old 12-07-2005, 05:28 AM
Junior Member
User
 
Join Date: Feb 2005
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
marinm
Default

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!
Reply With Quote
  #17 (permalink)  
Old 13-07-2005, 01:27 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,710
Thanks: 11
Thanked 244 Times in 183 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

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
Let me know if this works or not..
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #18 (permalink)  
Old 31-07-2005, 02:23 PM
cj
Guest
 
Posts: n/a
Default

Just like to say *THANK YOU FOR SCRIPT* and this site

--cj
Reply With Quote
  #19 (permalink)  
Old 02-08-2006, 04:42 PM
Junior Member
User
 
Join Date: Aug 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
tungsten
Default

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
Reply With Quote
  #20 (permalink)  
Old 02-08-2006, 06:33 PM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
OS: Debian GNU/Linux
Posts: 506
Thanks: 0
Thanked 8 Times in 6 Posts
Rep Power: 7
monk has a spectacular aura about monk has a spectacular aura about
Default

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
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

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


All times are GMT +5.5. The time now is 02:17 AM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38