Page 1 of 1

Getting raw perf data from Nagios

Posted: Thu Mar 01, 2018 3:00 pm
by krobertson71
I have a customer who needs a CSV file for CPU MEM DISK from Nagios. I have tried exporting using the csv function from the reports but the data that spits out is not what we need.

Is there a way, or a query, I can use to extract DATETIME - HOSTNAME - CPU - PERFDATA

Nagios 5.4.3 Red Hat Linux 7

Re: Getting raw perf data from Nagios

Posted: Thu Mar 01, 2018 6:33 pm
by awilson
We had to use RRDTool commands to extract the data then transform the export to csv files.

Re: Getting raw perf data from Nagios

Posted: Fri Mar 02, 2018 10:42 am
by scottwilkerson
There is a utility called rrd2csv located in the nagiosxi/tools directory that you can use. Typical call to rrd2csv is:

Code: Select all

cd /usr/local/nagiosxi/tools
./rrd2csv.php --host=localhost --service='Current_Load' > Current_Load.csv

Code: Select all

[root@localhost tools]# ./rrd2csv.php -h

Nagios XI RRD To CSV Tool
Copyright (c) 2011 Nagios Enterprises, LLC

Usage: ./rrd2csv.php --host=<host> [--service='<service>'] [--start=<start>] [--end=<end>]

Options:
  <host>     = Host name [required]
  <service>  = Service description: Use single quotes if spaces in name
  <start>    = Start time. Defaults to 'today.' Accepts -12h, -3d, or YYYYMMDD format.
  <end>      = End time. Defaults to 'today.' Accepts -12h, -3d, or YYYYMMDD format.

This utility creates host and service definitions for use in testing.