Page 1 of 1

Availability Report need in Human-readable format

Posted: Mon Feb 21, 2022 2:12 am
by yogeshpatel
Hello Experts,

I am using Nagios Core 4.4.5. And Have configured the network devices as per requirements. Here the main issue is the Availability Report's uptime as a CSV is coming in Seconds. I need that uptime in Human-readable format.
e.g Nagios shows the report as 86400 Seconds. I need it as 1d 0h 0m 0s.

So what changes should be done in the file(s) so that I can achieve my task. So No more manual work by calculating seconds into Hours, Days, Minutes, Seconds format.

Re: Availability Report need in Human-readable format

Posted: Tue Feb 22, 2022 2:00 pm
by gormank
The avail.cgi file is a binary so your best bet is probably to make a script that runs the report, grabs the CSV output, converts the time column from seconds to whatever you prefer and then saves the file.

Re: Availability Report need in Human-readable format

Posted: Wed Feb 23, 2022 12:31 am
by yogeshpatel
Hello,

Thanks for the reply.

Can you guide me for creating the shell script for report? As I am newbie in Nagios. If possible can't we directly change in avail.c file? and then compile the Nagios.

Thanks
Yogesh P.