My apologies, it seems I got distracted between composing the message
and clicking "Send". Here's the text I intended to copy and paste
into my last message:
# new functions
def get_temp( item ):
global reversedict, statusdict
item_string = reversedict[ item ].split( ":" )
item_key = string_to_key( item_string )
item_value = int( statusdict[ item_key ] ) / 65536
return item_value
def string_to_key( string ):
key = str( string[ 0 ] ) + ":" \
+ str( string[ 1 ] ) + ":" \
+ str( string[ 2 ] ) + ":" \
+ str( string[ 3 ] ) + ":" \
+ str( string[ 4 ] ) + \
":current-value"
return key
# changed code
cpu1inlet = get_temp( "\"CPU 1 Inlet\"" )
cpu1ambient = get_temp( "\"CPU 1 Ambient\"" )
cpu1internal = get_temp( "\"CPU 1 Internal\"" )
cpu2inlet = get_temp( "\"CPU 2 Inlet\"" )
cpu2ambient = get_temp( "\"CPU 2 Ambient\"" )
cpu2internal = get_temp( "\"CPU 2 Internal\"" )
between = get_temp( "\"Between the Processors\"" )
systemcontrollerambient = get_temp( "\"System Controller Ambient\"" )
systemcontrollerinternal = get_temp( "\"System Controller Internal\"" )
behinddimms = get_temp( "\"Behind the DIMMs\"" )
pcislots = get_temp( "\"PCI Slots\"" )
On Thu, 24 Feb 2005 17:54:31 -0800, Todd Dailey <email@hidden> wrote:
> Yeah, seconded, if you post the changes I would be glad to incorporate
> them along with Andrew's warn/fail stats.
>
> I was coding for functionality, not for beauty. :) There was
> certainly enough repetition in there to make function calls useful.
>
> I've been thinking of making a similar, slightly more complex script
> that will create nice-looking HTML page with all the stats (temp and
> everything else) in one place. Server Monitor is nice and all, but it
> would be good to have similar output available through a web page so
> that an admin can get a quick pulse on a server.
>
> - Todd
>
> On Feb 24, 2005, at 3:59 PM, Andrew Hankinson wrote:
>
> > Could you post your modifications? If you need hosting space, e-mail
> > it to me directly, and I'll put it up. Thx!
> >
> > Andrew
> >
> >
> > On Thu, 24 Feb 2005 14:04:43 -0600, David Sowder
> > <email@hidden> wrote:
> >> I tweaked my copy a bit for simplicity. Moved the complexity in to a
> >> couple of functions and then changed up the individual temperature
> >> grabbing code for simplicity and easy to read code. This might even
> >> save a couple of bytes of bandwidth for Mr. Dailey's hosting should
> >> this idea go into his code.
--
David R. Sowder
University of Texas at Arlington
Department of Modern Languages
Language Acquisition Center Supervisor
Work: email@hidden
Personal: email@hidden
Testing: email@hidden
http://david.sowder.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macos-x-server mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/macos-x-server/email@hidden
This email sent to email@hidden