Results 1 to 5 of 5

Thread: remote server monitoring for Solaris

  1. #1
    Junior Member
    Join Date
    Oct 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default remote server monitoring for Solaris

    Hello,

    I need to gather uptime info from different servers (all Solaris). 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

  2. #2
    Senior Member monk's Avatar
    Join Date
    Jan 2005
    Location
    Tibet
    Posts
    643
    Thanks
    5
    Thanked 43 Times in 38 Posts
    Rep Power
    15

    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...

  3. #3
    Junior Member
    Join Date
    Oct 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    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

  4. #4
    Is that all you got? rockdalinux's Avatar
    Join Date
    May 2005
    Location
    Planet Vegeta
    Posts
    987
    Thanks
    27
    Thanked 71 Times in 62 Posts
    Rep Power
    20

    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=$&#40;echo "$S1 < $S2 && $S1 < $S3" | bc&#41;
    if &#91; $T -eq 1 &#93;; 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=$&#40;echo "$S2 < $S1 && $S2 < $S3" | bc&#41;
    if &#91; $T -eq 1 &#93;; then
      echo "Server2 is the best to run"
      exit 0
    fi
    
    T=$&#40;echo "$S3 < $S2 && $S3 < $S1" | bc&#41;
    if &#91; $T -eq 1 &#93;; then
      echo "Server3 is the best to run"
      exit 0
    fi
    Rocky Jr.
    What's wrong? I hope I am not making you uncomfortable...

    Never send a boy to do a mans job.

  5. #5
    Junior Member
    Join Date
    Sep 2005
    Posts
    29
    Thanks
    3
    Thanked 2 Times in 1 Post
    Rep Power
    0

    Default

    Rocky your script is mind blowing!!!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VMware ESX server && Solaris 10 on same PC ??
    By vikas027 in forum Linux software
    Replies: 2
    Last Post: 7th September 2009, 03:03 AM
  2. Remote access to linux server
    By RamPD in forum Linux software
    Replies: 9
    Last Post: 26th May 2008, 07:21 AM
  3. Solaris Disk Monitoring
    By vimalgoel in forum Getting started tutorials
    Replies: 0
    Last Post: 19th December 2007, 04:53 PM
  4. script hangs when a remote server is down
    By vikas027 in forum Shell scripting
    Replies: 2
    Last Post: 11th November 2007, 03:47 PM
  5. Server monitoring (samba,NFS,telnet,ssh,ftp)
    By warren in forum Linux software
    Replies: 11
    Last Post: 26th June 2006, 07:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •