Combining different data in one gprint or comment

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
wvr120364
Posts: 16
Joined: Tue May 06, 2003 7:48 am

Combining different data in one gprint or comment

Post by wvr120364 »

Hello,
I've written a perl script that feeds the following data into cacti:

Code: Select all

uptime_sec:12345678 days:2 hrs:14 min:32
So far so good, i created the data source for uptime_sec and graphed it with a cdef funtion to display the uptime in days.

My question is, is there a way to combine the other values into one comment or gprint so the uptime is readable in the following way:

Code: Select all

Uptime (syslog): 2 days, 14 hrs. and 32 min.
I searched the forum for this and could not find a solution for Windows, just a patch for *nix.

Thanks,
Wietze
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

There's a Template for Generic - Uptime on the forum. It solves this issue by converting the seconds to days, minutes, seconds using three different CDEFs and printing the according GPRINTS in a single line. Not exactly what you asked for, but a possible workaround ...
Reinhard
wvr120364
Posts: 16
Joined: Tue May 06, 2003 7:48 am

Post by wvr120364 »

Thank you Reinhard, I'll give it a try.

Wietze
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest