- Thread Starter
- #26
Your work did indeed enter "55" correctly in my rrd database. Thanks So Much.
Now that worked without error. I took and stripped it down(Sorry I need to look at it in small chunks first).
The reason I don't need timestamp with rrdupdate is this I am trying to pass this value to rrd >>N:55<<
I changed timetemp to this. It signifies N(TIME NOW) and 55 is a database value(fake temp for testing).
In the future I need help making "55" a variable like ${tval} from the previous work plugged into the database.
So I need to pass it like this I guess??
char *updateparams[] = {"rrdupdate", "ow_temp.rrd", "N:${tval}", NULL}
Code:
#include <stdio.h>
#iinclude <unistd.h>
#include <sys/sysctl.h>
#include <rrd.h>
char *updateparams[] = {"rrdupdate", "ow_temp.rrd", "N:55", NULL};
int main(int argc, const char *argv[])
{
rrd_clear_error();
int rc = rrd_update(3, updateparams);
if (rc != 0)
{
printf("RRD Update failed with result code %d\n", rc);
return rc;
}
return 0;
}
Now that worked without error. I took and stripped it down(Sorry I need to look at it in small chunks first).
The reason I don't need timestamp with rrdupdate is this I am trying to pass this value to rrd >>N:55<<
I changed timetemp to this. It signifies N(TIME NOW) and 55 is a database value(fake temp for testing).
In the future I need help making "55" a variable like ${tval} from the previous work plugged into the database.
So I need to pass it like this I guess??
char *updateparams[] = {"rrdupdate", "ow_temp.rrd", "N:${tval}", NULL}