Show
Ignore:
Timestamp:
07/07/00 18:23:17 (14 years ago)
Author:
merlin
Message:

Updated so that sensord will syslog alarm occurrences at level
ALERT so you can pick them up in syslog.conf and fire them to
the console, etc. Added support for scanning only for alarms
in addition to scanning regular values, etc. Updated the man
file to reflect the new options, etc. Operation as "sensors"
command is undocumented.
-- merlin

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/prog/sensord/sensord.c

    r828 r835  
    6969(void) { 
    7070  int ret = 0; 
     71  int scanValue = 0, logValue = 0; 
    7172 
    7273  sensorLog (LOG_INFO, "sensord started"); 
     
    7576    if (ret == 0) 
    7677      ret = reloadLib (); 
    77     if (ret == 0) 
     78    if ((ret == 0) && scanTime) { 
     79      ret = scanChips (); 
     80      if (scanValue <= 0) 
     81        scanValue += scanTime; 
     82    } 
     83    if ((ret == 0) && logTime && (logValue <= 0)) { 
    7884      ret = readChips (); 
    79     if (!done && (ret == 0)) 
     85      logValue += logTime; 
     86    } 
     87    if (!done && (ret == 0)) { 
     88      int sleepTime; 
     89      if (!logTime) { 
     90        sleepTime = scanValue; 
     91      } else if (!scanTime) { 
     92        sleepTime = logValue; 
     93      } else { 
     94        sleepTime = (scanValue < logValue) ? scanValue : logValue; 
     95      } 
    8096      sleep (sleepTime); 
     97      scanValue -= sleepTime; 
     98      logValue -= sleepTime; 
     99    } 
    81100  } 
    82101 
     
    147166    undaemonize (); 
    148167  } else { 
    149     ret = readChips (); 
     168    if (doSet) 
     169      ret = setChips (); 
     170    else if (doScan) 
     171      ret = scanChips (); 
     172    else 
     173      ret = readChips (); 
    150174  } 
    151175