nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

remote server monitoring for Solaris

This is a discussion on remote server monitoring for Solaris within the Solaris/OpenSolaris forums, part of the UNIX operating systems category; Hello, I need to gather uptime info from different servers (all Solari . I have a little script running using ...


Go Back   nixCraft Linux Forum > UNIX operating systems > Solaris/OpenSolaris

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 10-12-2005, 04:17 AM
Junior Member
 
Join Date: Oct 2005
Posts: 4
Rep Power: 0
pliu0606
Default remote server monitoring for Solaris

Hello,

I need to gather uptime info from different servers (all Solari. I have a little script running using 'rup', but management require more information and a recommendation of which server to login to do build. Here is the desire output that I am looking for (text output is fine):

>svrload
10-11-2005
server 1 4 users, load average: 0.06, 0.08, 0.09
server 2 4 users, load average: 0.06, 0.08, 0.07
server 3 4 users, load average: 0.01, 0.01, 0.01

Recommendation: server 3

I have tried to use ruptime, and that did not work.

Please help

Thank you,
Philip
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-12-2005, 05:19 AM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
My distro: Debian GNU/Linux
Posts: 482
Rep Power: 5
monk will become famous soon enough monk will become famous soon enough
Default

Well diffrent solution can be provided


(1) Find out info over secure ssh
Do you have sshd server installed on each Solaris box? If so then you can use command like:

Code:
ssh user@server1 uptime
ssh user@server2 uptime
ssh user@server3 uptime

(2) Command ruptime will only work if you have rwhod system status server
installed on each solaris box. It provides the server function for the rwho and ruptime commands.For this purpose you need to enable in.rwhod daemon. Please note in.rwhod daemon can create significant amounts of network traffic. If your network is small then you can use this.

(3)
Try using rstat command. This is a rpc service that you can call to obtain
statistics from a remote server/host. The rstatd daemon must be running on the remote solaris system.

You can use any three of above choice to produce output as you mentioned. Last two service needs additional software on solaris server. Let me know which one you would like to use...
Reply With Quote
  #3 (permalink)  
Old 10-14-2005, 04:27 AM
Junior Member
 
Join Date: Oct 2005
Posts: 4
Rep Power: 0
pliu0606
Default

Thank you for the information.

How can one rank the result? For example:

server 1 4 users, load average: 0.06, 0.08, 0.09
server 2 4 users, load average: 0.06, 0.08, 0.07
server 3 4 users, load average: 0.01, 0.01, 0.01

Recommendation: server 3 is best server to use.

thank you,
Philip
Reply With Quote
  #4 (permalink)  
Old 10-14-2005, 10:42 AM
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

Assuming that your output is as follows:

Code:
server 1 4 users, load average: 0.06, 0.08, 0.09
server 2 4 users, load average: 0.06, 0.08, 0.07
server 3 4 users, load average: 0.01, 0.01, 0.01

And above output stored in three variable as you need to process output to find out the best server, here is the code:
Code:
#!/bin/sh
F="server 1 4 users, load average: 0.06, 0.08, 0.09"
F1="server 2 4 users, load average: 0.06, 0.08, 0.07"
F2="server 3 4 users, load average: 0.01, 0.01, 0.01"

# get server load i.e. 0.09, 0.07 and 0.01 in S1, S2, S3
S1=$(echo $F | awk '{ print $9}')
S2=$(echo $F1 | awk '{ print $9}')
S3=$(echo $F2 | awk '{ print $9}')

# now compare S1 load with S2 and S3
T=$(echo "$S1 < $S2 && $S1 < $S3" | bc)
if [ $T -eq 1 ]; then # if result is TRUE, then this is the best server to run application
  echo "Server1 is the best to run"
  exit 0
fi

T=$(echo "$S2 < $S1 && $S2 < $S3" | bc)
if [ $T -eq 1 ]; then
  echo "Server2 is the best to run"
  exit 0
fi

T=$(echo "$S3 < $S2 && $S3 < $S1" | bc)
if [ $T -eq 1 ]; then
  echo "Server3 is the best to run"
  exit 0
fi
__________________
Rocky Jr.
You may have my body & soul, but you will never touch my pride!

If you have knowledge, let others light their candles at it.

Certified to work on HP-UX / Sun Solaris / RedHat
Reply With Quote
  #5 (permalink)  
Old 10-15-2005, 03:49 PM
Junior Member
User
 
Join Date: Sep 2005
Posts: 25
Rep Power: 0
charvi
Default

Rocky your script is mind blowing!!!
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
Remote access to linux server RamPD Linux software 9 05-26-2008 08:21 AM
Solaris Disk Monitoring vimalgoel Getting started tutorials 0 12-19-2007 05:53 PM
VMware ESX server && Solaris 10 on same PC ?? vikas027 Linux software 1 11-24-2007 11:52 AM
script hangs when a remote server is down vikas027 Shell scripting 2 11-11-2007 04:47 PM
Server monitoring (samba,NFS,telnet,ssh,ftp) warren Linux software 11 06-26-2006 08:10 PM


All times are GMT +5.5. The time now is 09:19 AM.


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