Re: [osol-discuss] system info

2009-12-02 Thread Tomas Bodzar
Mmm no one mentioned Sun Explorer http://docs.sun.com/app/docs/doc/819-6613 and 
maybe better in OpenSolaris similar app written in Dtrace 
http://hub.opensolaris.org/bin/view/Community+Group+dtrace/dexplorer
-- 
This message posted from opensolaris.org
___
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org


[osol-discuss] system info

2009-12-01 Thread Harry Putnam
I wondered about a home made system info reporter that would report
some basic info about the OS and hardware

   format (show Disks in use)
   zpool list
   zfs list -r
   /bin/df -h

Come to mind as probably most useful in the event the sytem becomes
unusable. 

I'm thinking to script something that posts that info to my website on
a daily basis so I'll always have at least yesterdays info.

There are probably tools that do this or at least collect the info.
Any pointers on that are welcome.

If not though, I wondered if someone could coach me a bit with
`format'

When `format' is run with no args it lists all disks and prompts for a
command. 

It appears there is no simple way to get the output by scripting,
since `format' doesn't close by itself.  Its probably dead easy to run
it with a `quit' or `exit' somewhere but I'm not sure how that might
be done.

I tried formats' `-f file' option which makes `format' read commands from
the specified `file'. So maybe just putting `quit' in a file might do
it.  Something like: 

   `echo quit  file  format -f file ' 

might work in a script but it does not.. I just get the --help output.


___
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org


Re: [osol-discuss] system info

2009-12-01 Thread Tim Bell
Harry Putnam wrote:
 :
 :
 If not though, I wondered if someone could coach me a bit with
 `format'
 
 When `format' is run with no args it lists all disks and prompts for a
 command. 
 
 It appears there is no simple way to get the output by scripting,
 since `format' doesn't close by itself.  Its probably dead easy to run
 it with a `quit' or `exit' somewhere but I'm not sure how that might
 be done.

This works on my home system (OpenSolaris snv_127):

% pfexec format  /dev/null
Searching for disks...done


AVAILABLE DISK SELECTIONS:
   0. c5t0d0 DEFAULT cyl 30397 alt 2 hd 255 sec 63
  /p...@0,0/pci108e,6...@5/d...@0,0
   1. c5t1d0 ATA-ST3750330AS-SD1A-698.64GB
  /p...@0,0/pci108e,6...@5/d...@1,0
   2. c6t0d0 ATA-ST3750330AS-SD1A-698.64GB
  /p...@0,0/pci108e,6...@5,1/d...@0,0
   3. c6t1d0 ATA-ST3750330AS-SD1A-698.64GB
  /p...@0,0/pci108e,6...@5,1/d...@1,0
Specify disk (enter its number):
%

HTH -

Tim
___
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org


Re: [osol-discuss] system info

2009-12-01 Thread Harry Putnam
Tim Bell tim.b...@sun.com writes:

[...]

Harry wrote:
 It appears there is no simple way to get the output by scripting,
 since `format' doesn't close by itself.  Its probably dead easy to run
 it with a `quit' or `exit' somewhere but I'm not sure how that might
 be done.

 This works on my home system (OpenSolaris snv_127):

 % pfexec format  /dev/null
 Searching for disks...done


 AVAILABLE DISK SELECTIONS:
0. c5t0d0 DEFAULT cyl 30397 alt 2 hd 255 sec 63
   /p...@0,0/pci108e,6...@5/d...@0,0
1. c5t1d0 ATA-ST3750330AS-SD1A-698.64GB
   /p...@0,0/pci108e,6...@5/d...@1,0
2. c6t0d0 ATA-ST3750330AS-SD1A-698.64GB
   /p...@0,0/pci108e,6...@5,1/d...@0,0
3. c6t1d0 ATA-ST3750330AS-SD1A-698.64GB
   /p...@0,0/pci108e,6...@5,1/d...@1,0
 Specify disk (enter its number):
 %

Fails miserably here:

pfexec format /dev/null
-bash: /dev/null .. no such file or directory

From your PS1 symbol it looks like you might be using tsch or even
csh?

Wonder if that makes a difference

___
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org


Re: [osol-discuss] system info

2009-12-01 Thread Harry Putnam

About `failing miserably': Total pilot error... The shell I ran the
command in was ssh'ed into a linux machine

format /dev/null works just fine one the pilot gets his head out of
his behind.

___
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org


Re: [osol-discuss] system info

2009-12-01 Thread Paul Gress

Harry Putnam wrote:

Tim Bell tim.b...@sun.com writes:

[...]

Harry wrote:
  

It appears there is no simple way to get the output by scripting,
since `format' doesn't close by itself.  Its probably dead easy to run
it with a `quit' or `exit' somewhere but I'm not sure how that might
be done.
  

This works on my home system (OpenSolaris snv_127):

% pfexec format  /dev/null
Searching for disks...done


AVAILABLE DISK SELECTIONS:
   0. c5t0d0 DEFAULT cyl 30397 alt 2 hd 255 sec 63
  /p...@0,0/pci108e,6...@5/d...@0,0
   1. c5t1d0 ATA-ST3750330AS-SD1A-698.64GB
  /p...@0,0/pci108e,6...@5/d...@1,0
   2. c6t0d0 ATA-ST3750330AS-SD1A-698.64GB
  /p...@0,0/pci108e,6...@5,1/d...@0,0
   3. c6t1d0 ATA-ST3750330AS-SD1A-698.64GB
  /p...@0,0/pci108e,6...@5,1/d...@1,0
Specify disk (enter its number):
%



Fails miserably here:

pfexec format /dev/null
-bash: /dev/null .. no such file or directory

From your PS1 symbol it looks like you might be using tsch or even
csh?

Wonder if that makes a difference


  


Works here:

bash-4.0$ pfexec /usr/sbin/format  /dev/null
Searching for disks...done


AVAILABLE DISK SELECTIONS:
  0. c8t0d0 DEFAULT cyl 15563 alt 2 hd 255 sec 63
 /p...@0,0/pci1558,9...@1f,2/d...@0,0
  1. c8t1d0 ATA-OCZ-VERTEX-1.3-238.47GB
 /p...@0,0/pci1558,9...@1f,2/d...@1,0
  2. c8t2d0 ATA-INTEL SSDSA2MH16-8820-149.05GB
 /p...@0,0/pci1558,9...@1f,2/d...@2,0
Specify disk (enter its number):
bash-4.0$

I had to specify the location for format explicitly, and it looks like 
you didn't add a space between  and /dev/null (maybe it was a 
typo?).  Try it again with copy and paste.


Paul
___
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org


Re: [osol-discuss] system info

2009-12-01 Thread Gopi Desaboyina
try echo | format
-- 
This message posted from opensolaris.org
___
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org


Re: [osol-discuss] system info

2009-12-01 Thread Harry Putnam
Gopi Desaboyina
gopidesaboy...@yahoo.com writes:

 try echo | format

Nice, another good one.

___
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org


Re: [osol-discuss] system info

2009-12-01 Thread Anon Y Mous
If all you want is basic hardware info (like what stick of RAM is in what slot 
on the motherboard and what device is in what slot) OpenSolaris has these three 
commands which I really love:

   pfexec prtdiag -v

   pfexec psrinfo -pv

   pfexec scanpci

However, I always thought it was kind of retarded (for shell scripting 
purposes) that Solaris doesn't have a non-user interactive disk listing command 
that is the equivalent of fdisk -l in Linux.

For example, on Red Hat Enterprise Linux you can just put this line in your 
shell script:

  fdisk -l | grep -i disk

and you will get this kind of easy to read / easy to parse output:

Disk /dev/sda: 500.1 GB, 500107862016 bytes
Disk /dev/sdb: 250.0 GB, 250059350016 bytes
Disk /dev/sdc: 320.0 GB, 320072933376 bytes


On OpenSolaris if you try putting format -e in your shell script, then your 
shell script will hang at the:

Specify disk (enter its number):

prompt which is a real shame. There should be a format -l command for shell 
script use that lists disks without requiring user interaction. I have found a 
temporary workaround where I put:

   pfexec format  /dev/null

in a shell script and it works in terms of giving me a list of disks with out 
hanging while it waits for user input, but the output is still kind of clunky 
compared to fdisk -l in linux or the atacontrol list command on FreeBSD and 
the output needs to be worked over very heavily with awk, grep and sed to parse 
the info out that my shell script needs (i.e. the drive name and how many 
gigabytes of total space there is on the drive).

However, typing in something like pfexec format  /dev/null is still much 
better than some of the really scary pfiles based solutions I have come up with 
as a substitute for what I usually use lsof -ni for on BSD to keep track of 
what pid is bound to what tcp port / tcp connection in the /proc directory  
(some of my pfiles scripts are up to 20 lines long and they take forever to 
give output that I could get with one line of text in much less time using 
lsof -i on FreeBSD).
-- 
This message posted from opensolaris.org
___
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org


Re: [osol-discuss] system info

2009-12-01 Thread Anon Y Mous
If all you want is basic hardware info (like what stick of RAM is in what slot 
on the motherboard and what device is in what slot) OpenSolaris has these three 
commands which I really love:

   pfexec prtdiag -v

   pfexec psrinfo -pv

   pfexec scanpci

However, I always thought it was kind of retarded (for shell scripting 
purposes) that Solaris doesn't have a non-user interactive disk listing command 
that is the equivalent of fdisk -l in Linux.

For example, on Red Hat Enterprise Linux you can just put this line in your 
shell script:

  fdisk -l | grep -i disk

and you will get this kind of easy to read / easy to parse output:

Disk /dev/sda: 500.1 GB, 500107862016 bytes
Disk /dev/sdb: 250.0 GB, 250059350016 bytes
Disk /dev/sdc: 320.0 GB, 320072933376 bytes


On OpenSolaris if you try putting format -e in your shell script, then your 
shell script will hang at the:

Specify disk (enter its number):

prompt which is a real shame. There should be a format -l command for shell 
script use that lists disks without requiring user interaction. I have found a 
temporary workaround where I put:

   pfexec format  /dev/null

in a shell script and it works in terms of giving me a list of disks with out 
hanging while it waits for user input, but the output is still kind of clunky 
compared to fdisk -l in linux or the atacontrol list command on FreeBSD and 
the output needs to be worked over very heavily with awk, grep and sed to parse 
the info out that my shell script needs (i.e. the drive name and how many 
gigabytes of total space there is on the drive).

However, typing in something like pfexec format  /dev/null is still much 
better than some of the really scary pfiles based solutions I have come up with 
as a substitute for what I usually use lsof -ni for on BSD to keep track of 
what pid is bound to what tcp port / tcp connection in the /proc directory  
(some of my pfiles scripts are up to 20 lines long and they take forever to 
give output that I could get with one line of text in much less time using 
lsof -i on FreeBSD).
-- 
This message posted from opensolaris.org
___
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org


Re: [osol-discuss] system info

2009-12-01 Thread Anon Y Mous
If all you want is basic hardware info (like what stick of RAM is in what slot 
on the motherboard and what device is in what slot) OpenSolaris has these three 
commands which I really love:

   pfexec prtdiag -v

   pfexec psrinfo -pv

   pfexec scanpci

However, I always thought it was kind of retarded (for shell scripting 
purposes) that Solaris doesn't have a non-user interactive disk listing command 
that is the equivalent of fdisk -l in Linux.

For example, on Red Hat Enterprise Linux you can just put this line in your 
shell script:

  fdisk -l | grep -i disk

and you will get this kind of easy to read / easy to parse output:

Disk /dev/sda: 500.1 GB, 500107862016 bytes
Disk /dev/sdb: 250.0 GB, 250059350016 bytes
Disk /dev/sdc: 320.0 GB, 320072933376 bytes


On OpenSolaris if you try putting format -e in your shell script, then your 
shell script will hang at the:

Specify disk (enter its number):

prompt which is a real shame. There should be a format -l command for shell 
script use that lists disks without requiring user interaction. I have found a 
temporary workaround where I put:

   pfexec format  /dev / null

in a shell script and it works in terms of giving me a list of disks with out 
hanging while it waits for user input, but the output is still kind of clunky 
compared to fdisk -l in linux or the atacontrol list command on FreeBSD and 
the output needs to be worked over very heavily with awk, grep and sed to parse 
the info out that my shell script needs (i.e. the drive name and how many 
gigabytes of total space there is on the drive).

However, typing in something like pfexec format  /dev/null is still much 
better than some of the really scary pfiles based solutions I have come up with 
as a substitute for what I usually use lsof -ni for on BSD to keep track of 
what pid is bound to what tcp port / tcp connection in the /proc directory  
(some of my pfiles scripts are up to 20 lines long and they take forever to 
give output that I could get with one line of text in much less time using 
lsof -i on FreeBSD).
-- 
This message posted from opensolaris.org
___
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org


Re: [osol-discuss] system info

2009-12-01 Thread Anon Y Mous
If all you want is basic hardware info (like what stick of RAM is in what slot 
on the motherboard and what device is in what slot) OpenSolaris has these three 
commands which I really love:

   pfexec prtdiag -v

   pfexec psrinfo -pv

   pfexec scanpci

However, I always thought it was kind of retarded (for shell scripting 
purposes) that Solaris doesn't have a non-user interactive disk listing command 
that is the equivalent of fdisk -l in Linux.

For example, on Red Hat Enterprise Linux you can just put this line in your 
shell script:

  fdisk -l | grep -i disk

and you will get this kind of easy to read / easy to parse output:

Disk /dev/sda: 500.1 GB, 500107862016 bytes
Disk /dev/sdb: 250.0 GB, 250059350016 bytes
Disk /dev/sdc: 320.0 GB, 320072933376 bytes


On OpenSolaris if you try putting format -e in your shell script, then your 
shell script will hang at the:

Specify disk (enter its number):

prompt which is a real shame. There should be a format -l command for shell 
script use that lists disks without requiring user interaction. I have found a 
temporary workaround where I put:

   pfexec format  /dev/null

in a shell script and it works in terms of giving me a list of disks with out 
hanging while it waits for user input, but the output is still kind of clunky 
compared to fdisk -l in linux or the atacontrol list command on FreeBSD and 
the output needs to be worked over very heavily with awk, grep and sed to parse 
the info out that my shell script needs (i.e. the drive name and how many 
gigabytes of total space there is on the drive).

However, typing in something like pfexec format  /dev/null is still much 
better than some of the really scary pfiles based solutions I have come up with 
as a substitute for what I usually use lsof -ni for on BSD to keep track of 
what pid is bound to what tcp port / tcp connection in the /proc directory  
(some of my pfiles scripts are up to 20 lines long and they take forever to 
give output that I could get with one line of text in much less time using 
lsof -i on FreeBSD).
-- 
This message posted from opensolaris.org
___
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org


Re: [osol-discuss] system info

2009-12-01 Thread Anon Y Mous
Ok, I really need to apologize for this quadruple post, I'm trying to type in 
greater than and less than signs to symbolize input and output redirection 
in BASH and KSH and for some reason the OpenSolaris forums interpret greater 
than and less than signs as HTML tags or something similar and garble up my 
message.

I'm trying to post:

  pfexec format less than symbol /dev/null 

but everything after the less than symbol disappears when I type that in. If 
anyone else wants to see the bug for themselves, just type in a less than 
symbol (shown below) followed by /dev/null and everything after it disappears 
for some strange reason:


-- 
This message posted from opensolaris.org
___
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org