int disk_minor;
char disk_name[64];
+ static complain_t complain_obj;
+
/* Get the list of all disk objects. */
if (IOServiceGetMatchingServices (io_master_port,
IOServiceMatching (kIOBlockStorageDriverClass),
&disk_list) != kIOReturnSuccess)
{
- syslog (LOG_ERR, "disk-plugin: IOServiceGetMatchingServices failed.");
+ plugin_complain (LOG_ERR, &complain_obj, "disk plugin: "
+ "IOServiceGetMatchingServices failed.");
return;
}
+ else if (complain_obj.interval != 0)
+ {
+ plugin_relief (LOG_NOTICE, &complain_obj, "disk plugin: "
+ "IOServiceGetMatchingServices succeeded.");
+ }
while ((disk = IOIteratorNext (disk_list)) != 0)
{
diskstats_t *ds, *pre_ds;
+ static complain_t complain_obj;
+
if ((fh = fopen ("/proc/diskstats", "r")) == NULL)
{
if ((fh = fopen ("/proc/partitions", "r")) == NULL)
+ {
+ plugin_complain (LOG_ERR, &complain_obj, "disk plugin: Failed to open /proc/{diskstats,partitions}.");
return;
+ }
/* Kernel is 2.4.* */
fieldshift = 1;
}
+ plugin_relief (LOG_NOTICE, &complain_obj, "disk plugin: Succeeded to open /proc/{diskstats,partitions}.");
+
while (fgets (buffer, 1024, fh) != NULL)
{
numfields = strsplit (buffer, fields, 32);