LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Solaris / OpenSolaris (https://www.linuxquestions.org/questions/solaris-opensolaris-20/)
-   -   status script for solaris10 and 11 (https://www.linuxquestions.org/questions/solaris-opensolaris-20/status-script-for-solaris10-and-11-a-4175613767/)

1300 09-14-2017 01:27 AM

status script for solaris10 and 11
 
Good Day Gents,,

I need a script which collect all status data from solaris10 & 11

is there any famous script to do so?

jlliagre 09-14-2017 02:12 AM

Code:

svcs -a
would be a good start.

For something more verbose, you might try this ksh script:

Code:

for service in $(svcs -a -o FMRI); do
  case $service in
  (*FMRI*): ;;
  (lrc:*):
    echo ==== [$service] ====
    svcs -v $service|tail +2
    ;;
  (*)
    echo ==== [$service] ====
    # svcs -o STATE $service|tail +2
    svcs -l $service
    (
      logfile=$(svcs -l $service|grep logfile|sed 's/.*logfile[ \t]*//')
      for i in $logfile; do
        echo == $i ==
        tail $i
      done
    )
    ;;
  esac
done


GentleThotSeaMonkey 09-14-2017 03:57 AM

Is the old FAMOUS 'Explorer' still around?

Added: I think you could download it (a script!), and use pieces!

jlliagre 09-14-2017 04:26 AM

Yes it is: https://docs.oracle.com/cd/E35557_01...2_explorer.htm

1300 09-17-2017 02:38 AM

Quote:

Originally Posted by jlliagre (Post 5758614)
Code:

svcs -a
would be a good start.

For something more verbose, you might try this ksh script:

Code:

for service in $(svcs -a -o FMRI); do
  case $service in
  (*FMRI*): ;;
  (lrc:*):
    echo ==== [$service] ====
    svcs -v $service|tail +2
    ;;
  (*)
    echo ==== [$service] ====
    # svcs -o STATE $service|tail +2
    svcs -l $service
    (
      logfile=$(svcs -l $service|grep logfile|sed 's/.*logfile[ \t]*//')
      for i in $logfile; do
        echo == $i ==
        tail $i
      done
    )
    ;;
  esac
done


svcs -a
is just to display services status

and the second script is showing the same I guess but with extra information, that will be brilliant to trouble shooting.

What I need actually is a script to collect particular data like disk utilization and error entries from "dmesg" from /var/log/messages

jlliagre 09-17-2017 06:45 AM

"collect all status data" was vague, if your Solaris box is under service contract, you can download and use the explorer utility which does what you want.

1300 09-18-2017 04:53 AM

Quote:

Originally Posted by jlliagre (Post 5759716)
"collect all status data" was vague, if your Solaris box is under service contract, you can download and use the explorer utility which does what you want.

If i have a service contract I wouldnt be asking here

I just wanted to check disk utilization through a crontab entry and any error MSG appearing in dmesg then to be sent to a specific location for reporting

till now I found the following to filter disk usage percentage

# df -k | egrep "([70,80,90][0-9]|100)%"

not so sure about it, but it is doing what i need so far

-now I will take all error MSGs through grepping "dmesg"

-then to automate this on three servers, using RSA key for easy access

-script plan
gathering info ---> generating a local report ----> sending the report to a specific location

jlliagre 09-19-2017 11:09 AM

Quote:

Originally Posted by 1300 (Post 5760011)
I just wanted to check disk utilization through a crontab entry and any error MSG appearing in dmesg then to be sent to a specific location for reporting

Better to state it in the first place instead of "I need a script which collect all status data from solaris10 & 11".

Quote:

till now I found the following to filter disk usage percentage

# df -k | egrep "([70,80,90][0-9]|100)%"

not so sure about it, but it is doing what i need so far
It works a little bit by accident, should really be:

Code:

# df -k | egrep "([789][0-9]|100)%"

1300 09-28-2017 12:46 AM

Quote:

Originally Posted by jlliagre (Post 5760541)
Better to state it in the first place instead of "I need a script which collect all status data from solaris10 & 11".



It works a little bit by accident, should really be:

Code:

# df -k | egrep "([789][0-9]|100)%"

lol yes, because this is all what it matters at the moment if I am confident about my HW. maybe thats why I didnt ask the question properly

thanks anyway


All times are GMT -5. The time now is 05:06 PM.