Open PeterSpiegler opened 5 years ago
In the https://www.naemon.org/documentation/usersguide/macrolist.html I found
$LASTSERVICECHECK$: This is a timestamp in time_t format (seconds since the UNIX epoch) indicating the time at which a check of the service was last performed.
/opt/omd/sites/test/etc/nagflux/nagios_nagflux.cfg I changed to:
service_perfdata_file_template=DATATYPE::SERVICEPERFDATA\tTIMET::$LASTSERVICECHECK$\tHOSTNAME::$HOSTNAME$\tSERVICEDESC::$SERVICEDESC$\tSERVICEPERFDATA::$SERVICEPERFDATA$\tSERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$\tSERVICESTATE::$SERVICESTATE$\tSERVICESTATETYPE::$SERVICESTATETYPE$
and now is service-perfdata correct and also the chart:
~$ echo "[1566573100] PROCESS_SERVICE_CHECK_RESULT;host1;weather;0;OK|temp=10degC">/opt/omd/sites/test/tmp/run/naemon.cmd
~$ cat var/pnp4nagios/service-perfdata
DATATYPE::SERVICEPERFDATA TIMET::1566573100 HOSTNAME::host1 SERVICEDESC::weather SERVICEPERFDATA::temp=10degC SERVICECHECKCOMMAND::check_dummy HOSTSTATE::UP HOSTSTATETYPE::HARD SERVICESTATE::OK SERVICESTATETYPE::HARD
Is this modification secure without unexpected side effects?
I want import historical performance data with passive checks, example:
echo "[1566572900] PROCESS_SERVICE_CHECK_RESULT;host1;weather;0;OK|rainintensity=5.000mm/h">/opt/omd/sites/test/tmp/run/naemon.cmd
for time 23.08.2019 - 17:08:20But in the nagflux database the entry has the actual time. I assume the reason is the macro $TIMET$ in nagios_nagflux.cfg
etc/nagflux/nagios_nagflux.cfg: service_perfdata_file_template=DATATYPE::SERVICEPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tSERVICEDESC::$SERVICEDESC$\tSERVICEPERFDATA::$SERVICEPERFDATA$\tSERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$\tSERVICESTATE::$SERVICESTATE$\tSERVICESTATETYPE::$SERVICESTATETYPE$
the resulting data is
var/pnp4nagios/service-perfdata: DATATYPE::SERVICEPERFDATA TIMET::1566639139 HOSTNAME::host1 SERVICEDESC::weather SERVICEPERFDATA::rainintensity=5.000mm/h SERVICECHECKCOMMAND::check_dummy HOSTSTATE::UP HOSTSTATETYPE::HARD SERVICESTATE::OK SERVICESTATETYPE::HARD
1566639139 was the actual time: 24.08.2019 - 11:32:19How can the service_perfdata_file_template changed to use the provided timestamp of the passive service check?
I use the OMD-Labs 3.1.