Start monitoring the hardware monitor (temperature).
int fd
Please specify handle acquired by MT_Open function.
PMONITORPARAMEX pmonitor
Specify settings for monitoring.
The MONITORPARAMEX structure is as follows.
typedef struct {
unsigned char ucCPUth1; //cpu temperature threshold 1
unsigned char ucCPUth2; //cpu temperature threshold 2
unsigned char ucMBth1; //M/B temperature threshold 1
unsigned char ucMBth2; //M/B temperature threshold 2
long lScanIntervalHWM; /*CPU, M/B Time interval to check Temporal
interval specified in units of 1 ms
(specified as 2000 - 60000 [ms]).*/
unsigned char ucEventLog[5]; //syslog output setting
char ident[128]; //Setting of system name at syslog output
struct sockaddr_un sa; //Unix domain socket used for sending messages
} MONITORPARAMEX, *PMONITORPARAMEX;
The items of "ucEventLog[0-4]" correspond to cpu th1, cpu th2, M/B th1 and M/B th2, respectively,
regarding the syslog output setting (priority setting at log output) of "unsigned char ucEventLog[5]".
The following settings are valid for each item.
set 0 ... no output
1 ... emerge
2 ... alert
3 ... crit
4 ... err
5 ... warn
6 ... notice
7 ... info
8 ... debug
If the function succeeds, NO_ERROR is returned.
If the function fails, a code other than NO_ERROR is returned.
The other errors : Error code details
It monitors with the specified time interval (long lScanIntervalHWM).
If ucEventLog is a valid value other than 0 when the temperature threshold is exceeded, a message will be output to syslog.
We use UNIX domain socket for message transmission when abnormality occurs in temperature monitoring.
For details on Unix domain socket, socket communication etc, please refer to relevant Linux document, books etc.
The sockaddr_un structure is shown below by reference.
#define UNIX_PATH_MAX 108
struct sockaddr_un {
sa_family_t sun_family; /* AF_UNIX */
char sun_path[UNIX_PATH_MAX]; /* pathname */
};
If you do not want to send a message, please set so that the character string length of sun_path is 0.
If the character string length of sun_path is 0, message transmission is not performed.
The message issued when the setting threshold is exceeded is as follows.
The following definition values are stored in the received message, so you can check which error occurred. When multiple abnormalities occur, the logical sum of the definition values is stored.
| Definition | bit position | Meaning |
|---|---|---|
| CPU_TH1 | bit0 | CPU temperature threshold 1 exceeded occurrence |
| CPU_TH2 | bit1 | CPU temperature threshold 2 exceeded occurrence |
| MB_TH1 | bit2 | M/B temperature threshold 1 exceeded occurrence |
| MB_TH2 | bit3 | M/B temperature threshold 2 exceeded occurrence |