public EventRecord query ( String s ) throws Exception { StringBuffer sb ; //sb = Environment.runCommand("sensors -A"); sb = Environment . runCommand ( "cat sensors.out" ) ; EventRecord retval = new EventRecord ( InetAddress . getLocalHost ( ) . getCanonicalHostName ( ) , InetAddress . getAllByName ( InetAddress . getLocalHost ( ) . getHostName ( ) ) , Calendar . getInstance ( ) , "lm-sensors" , "Unknown" , "sensors -A" , "-" ) ; readGroup ( retval , sb , "fan" ) ; readGroup ( retval , sb , "in" ) ; readGroup ( retval , sb , "temp" ) ; readGroup ( retval , sb , "Core" ) ; return retval ; }
Reads and parses the output of the sensors command and creates an appropriate EventRecord that holds the desirable information .