diff --git a/src/ipmi.c b/src/ipmi.c
index c0a2c5f1d36c1e91d066a441f28bd7a86564c1c2..95b3dbf5625fcd4c09aef04d2a880c5ca85d2ae8 100644 (file)
--- a/src/ipmi.c
+++ b/src/ipmi.c
static void sensor_read_handler (ipmi_sensor_t *sensor,
int err,
enum ipmi_value_present_e value_present,
- unsigned int raw_value,
+ unsigned int __attribute__((unused)) raw_value,
double value,
- ipmi_states_t *states,
+ ipmi_states_t __attribute__((unused)) *states,
void *user_data)
{
value_t values[1];
}
}
}
+ else if (IPMI_IS_IPMI_ERR(err) && IPMI_GET_IPMI_ERR(err) == IPMI_NOT_SUPPORTED_IN_PRESENT_STATE_CC)
+ {
+ INFO ("ipmi plugin: sensor_read_handler: Sensor %s not ready",
+ list_item->sensor_name);
+ }
else
{
- INFO ("ipmi plugin: sensor_read_handler: Removing sensor %s, "
- "because it failed with status %#x.",
- list_item->sensor_name, err);
+ if (IPMI_IS_IPMI_ERR(err))
+ INFO ("ipmi plugin: sensor_read_handler: Removing sensor %s, "
+ "because it failed with IPMI error %#x.",
+ list_item->sensor_name, IPMI_GET_IPMI_ERR(err));
+ else if (IPMI_IS_OS_ERR(err))
+ INFO ("ipmi plugin: sensor_read_handler: Removing sensor %s, "
+ "because it failed with OS error %#x.",
+ list_item->sensor_name, IPMI_GET_OS_ERR(err));
+ else if (IPMI_IS_RMCPP_ERR(err))
+ INFO ("ipmi plugin: sensor_read_handler: Removing sensor %s, "
+ "because it failed with RMCPP error %#x.",
+ list_item->sensor_name, IPMI_GET_RMCPP_ERR(err));
+ else if (IPMI_IS_SOL_ERR(err))
+ INFO ("ipmi plugin: sensor_read_handler: Removing sensor %s, "
+ "because it failed with RMCPP error %#x.",
+ list_item->sensor_name, IPMI_GET_SOL_ERR(err));
+ else
+ INFO ("ipmi plugin: sensor_read_handler: Removing sensor %s, "
+ "because it failed with error %#x. of class %#x",
+ list_item->sensor_name, err & 0xff, err & 0xffffff00);
sensor_list_remove (sensor);
}
return;
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "ipmi", sizeof (vl.plugin));
* Entity handlers
*/
static void entity_sensor_update_handler (enum ipmi_update_e op,
- ipmi_entity_t *entity,
+ ipmi_entity_t __attribute__((unused)) *entity,
ipmi_sensor_t *sensor,
- void *user_data)
+ void __attribute__((unused)) *user_data)
{
/* TODO: Ignore sensors we cannot read */
* Domain handlers
*/
static void domain_entity_update_handler (enum ipmi_update_e op,
- ipmi_domain_t *domain,
+ ipmi_domain_t __attribute__((unused)) *domain,
ipmi_entity_t *entity,
- void *user_data)
+ void __attribute__((unused)) *user_data)
{
int status;
return (0);
} /* int thread_init */
-static void *thread_main (void *user_data)
+static void *thread_main (void __attribute__((unused)) *user_data)
{
int status;
os_handler_t *os_handler = NULL;
else if (strcasecmp ("IgnoreSelected", key) == 0)
{
int invert = 1;
- if ((strcasecmp ("True", value) == 0)
- || (strcasecmp ("Yes", value) == 0)
- || (strcasecmp ("On", value) == 0))
+ if (IS_TRUE (value))
invert = 0;
ignorelist_set_invert (ignorelist, invert);
}
else if (strcasecmp ("NotifySensorAdd", key) == 0)
{
- if ((strcasecmp ("True", value) == 0)
- || (strcasecmp ("Yes", value) == 0)
- || (strcasecmp ("On", value) == 0))
+ if (IS_TRUE (value))
c_ipmi_nofiy_add = 1;
}
else if (strcasecmp ("NotifySensorRemove", key) == 0)
{
- if ((strcasecmp ("True", value) == 0)
- || (strcasecmp ("Yes", value) == 0)
- || (strcasecmp ("On", value) == 0))
+ if (IS_TRUE (value))
c_ipmi_nofiy_remove = 1;
}
else if (strcasecmp ("NotifySensorNotPresent", key) == 0)
{
- if ((strcasecmp ("True", value) == 0)
- || (strcasecmp ("Yes", value) == 0)
- || (strcasecmp ("On", value) == 0))
+ if (IS_TRUE (value))
c_ipmi_nofiy_notpresent = 1;
}
else