An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

It's still not exactly clear what is is you're trying to do. I'll answer this question directly:

rohithroki wrote:Yes.can we able to merge RRD.

Yes, you can merge RRD files. @Box293's Performance Data Tool (** THIS WILL NOT WORK IN NAGIOS CORE. IT WAS DESIGNED FOR NAGIOS XI.) does this with the push of a button in Nagios XI. Here's the underlying script responsible for that action, which should work with pnp4nagios generated RRDs:

# Copyright 2010 Javier Ruere# Copyright 2011 Christian Theune <ct@gocept.com>## This program is free software: you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation, either version 3 of the License, or# (at your option) any later version.## This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU General Public License for more details.## You should have received a copy of the GNU General Public License# along with this program. If not, see <http://www.gnu.org/licenses/>.

if write_xml: xml = open(rrd_or_xml_fn, 'w') else: xml = tempfile.NamedTemporaryFile() try: # XXX There must be a way to do this correctly. xml.write('<?xml version="1.0" encoding="utf-8"?>\n') et.write(xml, encoding="utf-8")

def database2dict(row_elems, total, lastupdate, step, sparse=False): """Create a dict with the non NaN data from database.""" times = xrange(lastupdate - total * step, lastupdate + step, step) data = {} for time, row_elem in izip(times, row_elems): for value_elem in row_elem: # This is useful for sparse files (which is my case). # XXX Could be avoided for mostly full files for a speedup. if 'NaN' not in value_elem.text: data[time] = row_elem break return data

def get_xml(*rrd_or_xml_fns): """Returns an ElementTree of the dump of each given filename.

Using the extension, the file type is inferred. If the file is an XML, it is read directly. If it's an RRD, it's dumped and then read. """ xml_streams = [] for rrd_or_xml_fn in rrd_or_xml_fns: if rrd_or_xml_fn.lower().endswith('.xml'): xml_streams.append(open(rrd_or_xml_fn)) else: if not rrd_or_xml_fn.lower().endswith('.rrd'): LOGGER.warn('Unknown file type. Guessing it is an RRD.')

Who is online

Users browsing this forum: No registered users and 13 guests

Nagios, the Nagios logo, and Nagios graphics are the servicemarks, trademarks, or registered trademarks owned by Nagios Enterprises. All other servicemarks and trademarks are the property of their respective owner.