Sponsored Content
Top Forums Shell Programming and Scripting Python-rrdtool try except rrdtool.error module object has no attribute error Post 302958274 by kaf3773 on Tuesday 20th of October 2015 05:09:27 PM
Old 10-20-2015
Python-rrdtool try except rrdtool.error module object has no attribute error

I have this code that gives this error on Linux and will be grateful if you can help
Code:
import rrdtool

try:      
      ret_asd = rrdtool.update(myfile.rrd,'N:%s:%s' %(metric1, metric2));    
except rrdtool.error, e:
      print e

When i run the above i get the below error
Code:
except rrdtool.error, e:
AttributeError: 'module' object has no attribute 'error'

The code is intended to skip this error while updating the rrd file
Code:
illegal attempt to update using time 1363358441 when last update time is 1363358441 (minimum one second step)

Appreciate if you can help me get a solution for this

Thanks

Last edited by kaf3773; 10-20-2015 at 06:22 PM..
 

5 More Discussions You Might Find Interesting

1. HP-UX

compiling the RRDtool

I tried to compile the RRDtool on HP-UX (IA56). I have gcc-3.4.3 and perl 5.8.0 I got this: Writing Makefile for RRDs cd perl-shared && make /opt/perl/bin/perl /opt/perl/lib/5.8.0/ExtUtils/xsubpp -typemap /opt/perl/lib/5.8.0/ExtUtils/typemap RRDs.xs > RRDs.xsc && mv... (2 Replies)
Discussion started by: Kalin
2 Replies

2. Shell Programming and Scripting

Debian, digitemp, rrdtool

Mit perlscript: #!/usr/bin/perl # # copyright Per Hansen 2009 # # # temp.pl use lib qw(/opt/rrdtool-1.4.1/lib/perl); use RRDs; # sti til rrdtool databases my $rrd = '/var/lib/rrd'; # sti til færdige grafer (1 Reply)
Discussion started by: perhansen
1 Replies

3. UNIX for Dummies Questions & Answers

rrdtool question

Hi, DEF:clients=cccam.rrd:kliensek:AVERAGE DEF:activeclients=cccam_actclient.rrd:activeclients:AVERAGE "LINE1:clients#0000FF:Connected clients" COMMENT:" \n" "LINE2:activeclients#99FF00:Active clients" COMMENT:" \n" GPRINT:clients:LAST:'Current'\%5.0lf%s COMMENT:" \n"... (2 Replies)
Discussion started by: adriankoooo
2 Replies

4. Red Hat

Why do we use RRDtool in MRTG?

Hi Guys, Why do we use RRDtool in MRTG? I have implemented MRTG for some routers, I have read some notes about RRDTOOL also but don't know what is use of these tool. Any one one please explain me the use of RRDTOOL in their own words? (1 Reply)
Discussion started by: manalisharmabe
1 Replies

5. Shell Programming and Scripting

Python rrdtool try catch statement

I have a Python script that updates an rrd file with data it pulls from a database. Here is a snippet of the Python code for i in range(numrowed): row = curred.fetchone() time_stamp = row rx_max = row ret =... (1 Reply)
Discussion started by: kaf3773
1 Replies
RRDDUMP(1)							      rrdtool								RRDDUMP(1)

NAME
rrddump - dump the contents of an RRD to XML format SYNOPSIS
rrdtool dump filename.rrd [filename.xml] [--header|-h {none,xsd,dtd}] [--no-header] [--daemon address] > filename.xml DESCRIPTION
The dump function writes the contents of an RRD in human readable (?) XML format to a file or to stdout. This format can be read by rrdrestore. Together they allow you to transfer your files from one computer architecture to another as well to manipulate the contents of an RRD file in a somewhat more convenient manner. filename.rrd The name of the RRD you want to dump. filename.xml The (optional) filename that you want to write the XML output to. If not specified, the XML will be printed to stdout. --header|-h {none,xsd,dtd} By default RRDtool will add a dtd header to the xml file. Here you can customize this to and xsd header or no header at all. --no-header A shortcut for --header=none. If you want to restore the dump with RRDtool 1.2 you should use the --no-header option since 1.2 can not deal with xml headers. --daemon address Address of the rrdcached daemon. If specified, a "flush" command is sent to the server before reading the RRD files. This allows rrdtool to return fresh data even if the daemon is configured to cache values for a long time. For a list of accepted formats, see the -l option in the rrdcached manual. rrdtool dump --daemon unix:/var/run/rrdcached.sock /var/lib/rrd/foo.rrd EXAMPLES
To transfer an RRD between architectures, follow these steps: 1. On the same system where the RRD was created, use rrdtool dump to export the data to XML format. 2. Transfer the XML dump to the target system. 3. Run rrdtool restore to create a new RRD from the XML dump. See rrdrestore for details. ENVIRONMENT VARIABLES
The following environment variables may be used to change the behavior of "rrdtool dump": RRDCACHED_ADDRESS If this environment variable is set it will have the same effect as specifying the "--daemon" option on the command line. If both are present, the command line argument takes precedence. AUTHOR
Tobias Oetiker <tobi@oetiker.ch> 1.4.7 2009-10-14 RRDDUMP(1)
All times are GMT -4. The time now is 04:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy