summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 65b7908)
raw | patch | inline | side by side (parent: 65b7908)
author | octo <octo> | |
Thu, 8 Jun 2006 17:57:43 +0000 (17:57 +0000) | ||
committer | octo <octo> | |
Thu, 8 Jun 2006 17:57:43 +0000 (17:57 +0000) |
src/apcups.c | patch | blob | history |
diff --git a/src/apcups.c b/src/apcups.c
index a2eacb8b7223200873b06c30becd37dda0497395..566c642119b4212db49c44c70158d56c9728a987 100644 (file)
--- a/src/apcups.c
+++ b/src/apcups.c
};
static int charge_ds_num = 1;
-static char *time_file_template = "apcups/time.rrd";
+static char *time_file_template = "apcups/timeleft.rrd";
static char *time_ds_def[] =
{
"DS:timeleft:GAUGE:"COLLECTD_HEARTBEAT":0:100",
return (-1);
}
+ DBG ("Done opening a socket: %i", sd);
+
return (sd);
} /* int net_open (char *host, char *service, int port) */
printf ("net_recv = `%s';\n", recvline);
#endif /* if APCMAIN */
- tokptr = strtok (recvline, ":");
+ tokptr = strtok (recvline, " :\t");
while (tokptr != NULL)
{
key = tokptr;
- if ((tokptr = strtok (NULL, " \t")) == NULL)
+ if ((tokptr = strtok (NULL, " :\t")) == NULL)
continue;
value = atof (tokptr);
+
PRINT_VALUE (key, value);
+ DBG ("key = %s; value = %f;", key, value);
if (strcmp ("LINEV", key) == 0)
apcups_detail->linev = value;
if ((status < 1) || (status >= 512))
return;
+ DBG ("plugin_submit (%s, %s, %s);", type, inst, buf);
plugin_submit (type, inst, buf);
}
* zeros. We want rrd files to have NAN.
*/
if (status != 0)
+ {
+ DBG ("apc_query_server (%s, %i) = %i",
+ global_host == NULL
+ ? APCUPS_DEFAULT_HOST
+ : global_host,
+ global_port, status);
return;
+ }
apc_submit (&apcups_detail);
} /* apcups_read */