- /*
- * if we did not connect then do not bother submitting
- * zeros. We want rrd files to have NAN.
- */
- if (status != 0)
- return;
-
- apcups_submit (host, &apcups_detail);
- apc_bvolt_submit (host, &apcups_detail);
- apc_load_submit (host, &apcups_detail);
- apc_charge_submit (host, &apcups_detail);
- apc_temp_submit (host, &apcups_detail);
- apc_time_submit (host, &apcups_detail);
- apc_freq_submit (host, &apcups_detail);
-}
-
-
-static void apcups_write (char *host, char *inst, char *val)
-{
- char file[512];
- int status;
-
- status = snprintf (file, 512, volt_file_template, inst);
- if (status < 1)
- return;
- else if (status >= 512)
- return;
-
- rrd_update_file (host, file, val, volt_ds_def, volt_ds_num);
-}
-
-static void apc_bvolt_write (char *host, char *inst, char *val)
-{
- char file[512];
- int status;
-
- status = snprintf (file, 512, bvolt_file_template, inst);
- if (status < 1)
- return;
- else if (status >= 512)
- return;
-
- rrd_update_file (host, file, val, bvolt_ds_def, bvolt_ds_num);
-}
-
-static void apc_load_write (char *host, char *inst, char *val)
-{
- char file[512];
- int status;
-
- status = snprintf (file, 512, load_file_template, inst);
- if (status < 1)
- return;
- else if (status >= 512)
- return;
-
- rrd_update_file (host, file, val, load_ds_def, load_ds_num);
-}
-
-static void apc_charge_write (char *host, char *inst, char *val)
-{
- char file[512];
- int status;
-
- status = snprintf (file, 512, charge_file_template, inst);
- if (status < 1)
- return;
- else if (status >= 512)
- return;
-
- rrd_update_file (host, file, val, charge_ds_def, charge_ds_num);
-}
-
-static void apc_temp_write (char *host, char *inst, char *val)
-{
- char file[512];
- int status;
-
- status = snprintf (file, 512, temp_file_template, inst);
- if (status < 1)
- return;
- else if (status >= 512)
- return;
-
- rrd_update_file (host, file, val, temp_ds_def, temp_ds_num);
-}