Solaris / OpenSolarisThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
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
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
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
"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.
"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
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
Quote:
Originally Posted by 1300
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:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.