LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 09-14-2017, 01:27 AM   #1
1300
Member
 
Registered: Nov 2011
Posts: 68

Rep: Reputation: Disabled
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?
 
Old 09-14-2017, 02:12 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Tribblix, Ubuntu/WSL
Posts: 9,761

Rep: Reputation: 459Reputation: 459Reputation: 459Reputation: 459Reputation: 459
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
 
Old 09-14-2017, 03:57 AM   #3
GentleThotSeaMonkey
Member
 
Registered: Dec 2016
Posts: 61
Blog Entries: 2

Rep: Reputation: 27
Is the old FAMOUS 'Explorer' still around?

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

Last edited by GentleThotSeaMonkey; 09-20-2017 at 07:15 PM.
 
Old 09-14-2017, 04:26 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Tribblix, Ubuntu/WSL
Posts: 9,761

Rep: Reputation: 459Reputation: 459Reputation: 459Reputation: 459Reputation: 459
Yes it is: https://docs.oracle.com/cd/E35557_01...2_explorer.htm
 
Old 09-17-2017, 02:38 AM   #5
1300
Member
 
Registered: Nov 2011
Posts: 68

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jlliagre View Post
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

Last edited by 1300; 09-17-2017 at 05:49 AM.
 
Old 09-17-2017, 06:45 AM   #6
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Tribblix, Ubuntu/WSL
Posts: 9,761

Rep: Reputation: 459Reputation: 459Reputation: 459Reputation: 459Reputation: 459
"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.
 
1 members found this post helpful.
Old 09-18-2017, 04:53 AM   #7
1300
Member
 
Registered: Nov 2011
Posts: 68

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jlliagre View Post
"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
 
Old 09-19-2017, 11:09 AM   #8
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Tribblix, Ubuntu/WSL
Posts: 9,761

Rep: Reputation: 459Reputation: 459Reputation: 459Reputation: 459Reputation: 459
Quote:
Originally Posted by 1300 View Post
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)%"
 
Old 09-28-2017, 12:46 AM   #9
1300
Member
 
Registered: Nov 2011
Posts: 68

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jlliagre View Post
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] dzen2 status bar script sycamorex Linux - General 19 10-23-2010 03:10 PM
A script called by another script would always give exit status other than Zero(0) vandana Linux - General 2 03-22-2010 04:26 AM
Implement status for my init.d script ashok449 Linux - General 1 07-04-2008 06:24 AM
Script for Machine Status?? ajeetraina Linux - Server 3 12-10-2007 08:37 AM
writing a server status script thebored Linux - Software 2 07-22-2005 01:25 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 05:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration