nixCraft Linux Forum

nixCraft

Linux 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; Hello, Does anyone know a script which can gather information like uptime, disk usage, cpu usage, etc. from multiple servers ...


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

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-07-2005, 06:42 AM
Junior Member
User
 
Join Date: Feb 2005
Posts: 23
Rep Power: 0
marinm
Default multiple server status script

Hello,

Does anyone know a script which can gather information like uptime, disk usage, cpu usage, etc. from multiple servers and output the information on a single server (the one being accessed from)?

Just like http://netsaint.kirenet.com

Thank you,
Marin Micoriciu
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-07-2005, 06:12 PM
rockdalinux's Avatar
Contributors
User
 
Join Date: May 2005
Location: Bangalore
My distro: RHEL, HP-UX, Solaris, FreeBSD, Ubuntu
Posts: 581
Rep Power: 7
rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough
Default

Sure one can write such script, but ulr http://netsaint.kirenet.com uses diffrent software and not scripting... here is what i do to find out uptime and what users are doing between multiple server

RH1-box1

RH2-box2

Suse-box3

Debian-mysystem


At Debian-mysystem i have script like
Code:
#!/bin/sh
BOX="IP1 IP2 IP3 IP4"
USR="jadmin"
for ip in $BOX
do
echo "Server Uptime and Load @ $ip"
 ssh $USR@$ip uptime 
 ssh $USR@$ip w
echo "-----------------------------------------------------------"
done
Note that I have ssh keys for user jadmin from my Debian-mysystem

This is just simple script you can modify it to send output to /var/www/mydomain.com/status dir in plain or html format
Reply With Quote
  #3 (permalink)  
Old 06-25-2005, 09:16 AM
Junior Member
User
 
Join Date: Feb 2005
Posts: 23
Rep Power: 0
marinm
Default

Can I gather information like uptime, disk usage? Memory usage? All that? from 3-4 servers and output them on one server? Can you help me, please? Any suggestions are much appreciated.

This website rocks!

Thanks guys,

Marin Micoriciu
Reply With Quote
  #4 (permalink)  
Old 06-25-2005, 09:12 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Ubuntu
Posts: 1,060
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

Yes it is possible, do you have sshd installed on all servers? Or atleast if you shoud allow it as follows:

main-server -> ssh -> Rest of all servers

Let me know then we can create small script for job! Do you like to see output in text or html format?
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
  #5 (permalink)  
Old 06-26-2005, 06:43 AM
Junior Member
User
 
Join Date: Feb 2005
Posts: 23
Rep Power: 0
marinm
Default

Hi Vivek!

Yes, I have ssh access on each of the servers and yes, if possible I'd like it in html format so I can design it a bit, not just simple text output.

I'd really appreciate if you could help me out with this!

This website and you guys are awesome! Keep up great work!

Kind Regards,

Marin Micoriciu
Reply With Quote
  #6 (permalink)  
Old 06-27-2005, 12:11 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Ubuntu
Posts: 1,060
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

Okay I have done some work and uploaded file aka script @ http://bash.cyberciti.biz/monitoring...ation.bash.php have a look it at script and try it. You need to setup Following for all your ips:
Code:
Q_HOST="192.168.1.2 127.0.0.1"
It creates HTML code but i'm not good at web or fancy effect.. you can modify it as per your needs. Let me know if you need any other stuff into it.

You need to setup the ssh keys based authentication to avoid the password prompt see http://www.cyberciti.biz/nixcraft/vi...entication.php

Once done that you can run the script as follows

geninfo.bash > /var/www/html/output.html

And test it into browser using http://www.mydom/output.html

Hope this helps!
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
  #7 (permalink)  
Old 06-27-2005, 04:17 AM
Junior Member
User
 
Join Date: Feb 2005
Posts: 23
Rep Power: 0
marinm
Default

OMG It works WONDERFUL! I had to copy id_rsa.pub to authorized_keys2 on localhost (127.0.0.1) but it works wonderfully! Thank you sooo much Vivek!

I thought it would be easy to modify the html layout, but it's not quite easy. Would it be too much if I'd ask how can I output this in a table with 3 columns? (I have 3 server.

Something like

Quote:
| Server 1 | | Server 2 | | Server 3 |
------------- ------------- -------------
| Uptime info| | Uptime info| | Uptime info|
-------------- -------------- -------------
| Ping status | | Ping status | | Ping status |
-------------- ------------- -------------
| etc etc etc | | etc etc etc | | etc etc etc |
I hope you know what I mean and hopefully this can be done.

Thank you so much!!
Reply With Quote
  #8 (permalink)  
Old 06-28-2005, 01:17 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Ubuntu
Posts: 1,060
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

Okay done

See url http://cyberciti.biz/tmp/geninfo.bash.txt
And download files http://cyberciti.biz/tmp/graph.gif
http://cyberciti.biz/tmp/indicator.gif

Rest of the info is same!

Let me know if this works or not!

Enjoy!!!
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
  #9 (permalink)  
Old 06-28-2005, 06:45 AM
Junior Member
User
 
Join Date: Feb 2005
Posts: 23
Rep Power: 0
marinm
Default

IT WORKS! I can't believe I finally have a status script the way I like it! Thank you so much!!!! If you wish, I can PM you the statistics URL so you see it!

Thank you again Vivek! You rock!
Reply With Quote
  #10 (permalink)  
Old 06-28-2005, 04:26 PM
Member
User
 
Join Date: Jun 2005
Posts: 78
Rep Power: 0
jerry
Default

Script looks quite complicated to me? How it digs out information from other hosts? Will it works with FreeBSD or Solaris UNIX?
Reply With Quote
Reply

Bookmarks


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 On

Similar Threads

Thread Thread Starter Forum Replies Last Post
hda: status timeout: status=0xd0 { Busy } surmandal Linux hardware 3 03-24-2008 09:16 PM
single DHCP server with multiple VLAN's frank Computer Networking and Internet/broadband 2 12-07-2007 01:38 PM
login into multiple servers thru script... avcert1998 Shell scripting 2 03-17-2007 04:29 AM
Script to add users to multiple servers. deepakhg Shell scripting 0 03-17-2007 04:02 AM
shell script that parses multiple log files and checks for a Anonymous Shell scripting 1 11-15-2006 10:38 PM


All times are GMT +5.5. The time now is 09:25 PM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

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