heartbeat

Simple server monitor system using encrypted messages over udp
git clone https://noulin.net/git/heartbeat.git
Log | Files | Refs | README

commit 76e47c4007d8a656248a608001bfde848cafd40b
parent a9044730ec921acc1e7086674c37cf97b5338863
Author: Remy Noulin <loader2x@gmail.com>
Date:   Fri,  7 Jul 2023 14:10:34 +0200

initialize only existing probes

heartbeat.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)

Diffstat:
Mheartbeat.c | 12+++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/heartbeat.c b/heartbeat.c @@ -363,11 +363,13 @@ void probe(char *cfgfile) { setG(d, "rebooted", FALSE); setG(d, "lastBoot", startTime); cleanFinishSmallArrayP(probes) = getG(d, rtSmallArrayt, "probes"); - iter(probes, P) { - cast(smallDictt*,p,P); - setG(p, "state", FALSE); - setG(p, "last", startTime); - setPG(probes, iI(probes), p); + if (probes) { + iter(probes, P) { + cast(smallDictt*,p,P); + setG(p, "state", FALSE); + setG(p, "last", startTime); + setPG(probes, iI(probes), p); + } } setPG(completeCfg, iK(completeCfg), d); }