Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
No such thing as a small change
 
PerlMonks  

Hot! Hot! Hot! (a slight variation on "Watching mail queues")

by bronto (Priest)
on Nov 12, 2004 at 12:42 UTC ( #407340=CUFP: print w/ replies, xml ) Need Help??

Our Computers Room is too hot today...

Similar problem as before, but with an important variation: I had to match just a small range of lines in the output of a command. This one-liner now runs on a Sun Ultra-Enterprise host running Solaris 8, and a monitoring software reads and reports the temperatures of the system boards.

/usr/platform/sun4u/sbin/prtdiag -v | perl -ne 'BEGIN { print "TABLE temperature\nSTART_SAMPLE_PERIOD\n" } ; END { print join ("NEXT_SAMPLE\n",@samples),"END_SAMPLE_PERIOD\nEND_TABLE\nSLEEP\n" } ; if (/^System Temperatures/../^$/) { next unless /^(CLK|\s*\d+)/ ; ($b,$t) = (split)[0,2] ; push @samples,"board=$b\ntemp=$t\n" }'

Have fun

Ciao!
--bronto


In theory, there is no difference between theory and practice. In practice, there is.

Comment on Hot! Hot! Hot! (a slight variation on "Watching mail queues")
Download Code
Re: Hot! Hot! Hot! (a slight variation on "Watching mail queues")
by elwarren (Curate) on Nov 12, 2004 at 23:33 UTC
    Wow bronto! These little utilities you write are so tight, you could print them on a label and attach them to the monitor in the server room. Then we'd never have an excuse for not checking up on the temp or the mail queues :-)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: CUFP [id://407340]
Approved by dada
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2014-04-18 23:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (473 votes), past polls