summaryrefslogtreecommitdiffstats
path: root/src/collectors/freeipmi.plugin/freeipmi_plugin.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/collectors/freeipmi.plugin/freeipmi_plugin.c')
-rw-r--r--src/collectors/freeipmi.plugin/freeipmi_plugin.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/collectors/freeipmi.plugin/freeipmi_plugin.c b/src/collectors/freeipmi.plugin/freeipmi_plugin.c
index 4d942f85c..38fb1d19b 100644
--- a/src/collectors/freeipmi.plugin/freeipmi_plugin.c
+++ b/src/collectors/freeipmi.plugin/freeipmi_plugin.c
@@ -1120,7 +1120,7 @@ static void netdata_update_ipmi_sel_events_count(struct netdata_ipmi_state *stt,
}
int netdata_ipmi_collect_data(struct ipmi_monitoring_ipmi_config *ipmi_config, IPMI_COLLECTION_TYPE type, struct netdata_ipmi_state *stt) {
- errno = 0;
+ errno_clear();
if(type & IPMI_COLLECT_TYPE_SENSORS) {
stt->sensors.collected = 0;
@@ -1652,6 +1652,10 @@ int main (int argc, char **argv) {
bool debug = false;
+ // TODO: Workaround for https://github.com/netdata/netdata/issues/17931
+ // This variable will be removed once the issue is fixed.
+ bool restart_every = true;
+
// ------------------------------------------------------------------------
// parse command line parameters
@@ -1672,6 +1676,10 @@ int main (int argc, char **argv) {
debug = true;
continue;
}
+ else if(strcmp("no-restart", argv[i]) == 0) {
+ restart_every = false;
+ continue;
+ }
else if(strcmp("sel", argv[i]) == 0) {
netdata_do_sel = true;
continue;
@@ -1922,7 +1930,7 @@ int main (int argc, char **argv) {
collector_error("%s(): ignoring parameter '%s'", __FUNCTION__, argv[i]);
}
- errno = 0;
+ errno_clear();
if(freq_s && freq_s < update_every)
collector_info("%s(): update frequency %d seconds is too small for IPMI. Using %d.",
@@ -2100,7 +2108,7 @@ int main (int argc, char **argv) {
"END\n");
// restart check (14400 seconds)
- if (now_monotonic_sec() - started_t > IPMI_RESTART_EVERY_SECONDS) {
+ if (restart_every && (now_monotonic_sec() - started_t > IPMI_RESTART_EVERY_SECONDS)) {
collector_info("%s(): reached my lifetime expectancy. Exiting to restart.", __FUNCTION__);
fprintf(stdout, "EXIT\n");
plugin_exit(0);