RRDClean - now at V0.36

Announcements concerning Plugins for Cacti

Moderators: Developers, Moderators

ceyounger
Posts: 44
Joined: Fri Feb 10, 2006 2:59 pm
Location: Orange County, CA
Contact:

Re: RRDcleaner console entry

Post by ceyounger »

bodo.bach wrote:Hi,

I am using 0.87b, PA2.1 and after installing RRDcleaner V0.36 (last version from SVN) via Plugin Management the rrdcleaner apears in console menu, but when i disable it in user-realms, its NOT deleted in console-menu, but access is denied.

is this OK ?

Thanxs for an answer

Ralf
Go to User Management and re-add RRDClean to your user. If you upgraded it reset authorization.

Chris
sasifras
Cacti User
Posts: 58
Joined: Tue Nov 18, 2008 6:57 am

RRDClean - too many inodes?

Post by sasifras »

We have been using RRDClean for some time to keep up with the housecleaning of files. We've somewhat recently discovered that the plugin is no longer functional. For instance, when you select the rrd cleaner menu option, the system "spins" for a bit and the displays a page with just the RRD Cleaner header and the table header (file name, last modified, etc). No files are listed (but I know there are several to be removed. My initial guess is that the number of inodes in the rra directory is now too big (although I am not sure how to prove it). For instance, if you go into our rra directory and do a ls -la co*, you get the following error: bash: /bin/ls: "Argument list too long" (exceeded kernel limits).

There are 80,774 .rrd files in our /rra location on this server.

We then downloaded/installed the SVN'd version of rrdclean(er) and find the "error" is somewhat worse. Instead of displaying the header, the browser attempts to "download" the rrdcleaner.php file (FFv3) - note that the contents are empty. My guess is that something errored out in the PHP. Can someone offer help on how to best work through the PHP code to find the error or problem? What other information is relevant to helping fix this situation?

Found this in the apache logs (error):

HP Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/cacti/plugins/rrdclean/rrdcleaner.php on line 83

This is the get_files() function from what I can tell...
DannyXR6T
Posts: 2
Joined: Mon Nov 24, 2008 7:24 pm

Post by DannyXR6T »

Possible bug?

After countless hours of encountering "unable to delete", or "unable to move to" for the archive / delete folders, and messing with rra file permissions.

I discovered what was wrong! It was looking right at me in the cacti.log file. It was attempting to erase from wrong folder.. let me explain

In my cacti globals.php, "rra_path" is set to /var/lib/cacti/rra however, rrdclean was attempting to erase from "base_path" . "/rra", which enumerates to /usr/share/cacti/site/rra.

This would indicate to me, this part of the code is not correctly refrencing cacti's global.php in version 0.36

if (isset ($config["rra_path"])) {
$rra_path = $config["rra_path"];
} else {
$rra_path = $config["base_path"] . "/rra";
}

To fix my problem, I replaced the code with the following in both rrd's php files

$rra_path = "/var/lib/cacti/rra";

Its now working.

I understand i've hard coded the path, but my php knowledge is not great enough to understand what i need to do to make this work correctly.

Danny.
DannyXR6T
Posts: 2
Joined: Mon Nov 24, 2008 7:24 pm

Post by DannyXR6T »

Also, as some feedback,

I've swapped the Delete and Archive appearance order in the combo box.. I would rather it say Archive and have a backup just in case I remove one that I will require later.

This involved change the ds_action array, as well as the case statement in the rrdmove.php file
User avatar
TFC
Cacti Pro User
Posts: 739
Joined: Wed Apr 09, 2003 2:17 am
Location: Izmir/Turkey

Post by TFC »

Just perfect..
Actually delicious :P
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

DannyXR6T wrote:Possible bug?

After countless hours of encountering "unable to delete", or "unable to move to" for the archive / delete folders, and messing with rra file permissions.

I discovered what was wrong! It was looking right at me in the cacti.log file. It was attempting to erase from wrong folder.. let me explain

In my cacti globals.php, "rra_path" is set to /var/lib/cacti/rra however, rrdclean was attempting to erase from "base_path" . "/rra", which enumerates to /usr/share/cacti/site/rra.

This would indicate to me, this part of the code is not correctly refrencing cacti's global.php in version 0.36

if (isset ($config["rra_path"])) {
$rra_path = $config["rra_path"];
} else {
$rra_path = $config["base_path"] . "/rra";
}

To fix my problem, I replaced the code with the following in both rrd's php files

$rra_path = "/var/lib/cacti/rra";

Its now working.

I understand i've hard coded the path, but my php knowledge is not great enough to understand what i need to do to make this work correctly.

Danny.
That's a good catch. RRDCleaner still relates to the hard coded rra dir of the past. It is not yet modified to the new "rra_path" config variable.
Reinhard
charlesdf23
Cacti User
Posts: 77
Joined: Thu Nov 13, 2008 2:30 pm

Post by charlesdf23 »

After installing this plugin, I can't seem to access any of the data. I let the plugin run all night and nothing seemed to show up.

I'm running the latest PIA (2.4) and the latest Cacti as well.

Any help in troublehshooting would be greatly appreciated.
cahonis
Cacti User
Posts: 123
Joined: Fri Jun 06, 2008 5:50 am

Post by cahonis »

I've installed rrdcleaner 0.36 but it is not displaying within Cacti.

I have an rrdclean folder in the plugins folder.
I have added the relevant line to global.php.

I'm running Cacti 0.8.7b & PIA 2.1.

When I go into User Management there is no tick box for RRDCleaner to enable it.
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

You will need do the following

Go to Plugin Management > locate RRD Cleaner > Install > Enable

Then go to User Management and you should see a box where you can place a tick so you can use the plugin.

For info, there is no tab - RRD Cleaner sits as the bottom of the left hand menu.

Hope this helps.
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
cahonis
Cacti User
Posts: 123
Joined: Fri Jun 06, 2008 5:50 am

Post by cahonis »

I don't have Plugin Management anywhere on the console screen, never have had it either.

Is it something in a newer version of cacti?
User avatar
browniebraun
Developer
Posts: 791
Joined: Tue Jun 13, 2006 1:17 am
Location: Cologne, Germany

Post by browniebraun »

Did you forget to import the sql file (pa.sql) for the plugin architecture?

Best regards
-Andreas-
Hat das Blümchen einen Knick, war der Schmetterling zu dick! ;)
reportit v0.7.5a
SNMPAgent v0.2.3
Download ReportIt | Download SNMPAgent | ReportIt SVN | ReportIt Templates | Wish list
cahonis
Cacti User
Posts: 123
Joined: Fri Jun 06, 2008 5:50 am

Post by cahonis »

PIA 2.1 was installed about 6 months ago so can't remember but I do have numerous other plugins installed without issue so I would say it was imported.
User avatar
browniebraun
Developer
Posts: 791
Joined: Tue Jun 13, 2006 1:17 am
Location: Cologne, Germany

Post by browniebraun »

Go to Utilities->User Management. Select your account and check if the flag "Plugin Management" has been activated in section "Realm Permissions".

Best regards
-Andreas-
Hat das Blümchen einen Knick, war der Schmetterling zu dick! ;)
reportit v0.7.5a
SNMPAgent v0.2.3
Download ReportIt | Download SNMPAgent | ReportIt SVN | ReportIt Templates | Wish list
cahonis
Cacti User
Posts: 123
Joined: Fri Jun 06, 2008 5:50 am

Post by cahonis »

It hasn't - I presume that means that the pa.sql file hasn't been imported into the MySQL database?

Does this have to be done via command line or can it be achieved via the MySQL GUI? (forgive my ignorance, I don't have much MySQL knowledge)

/edit
google is my friend, imported the .sql file, all OK now.

Thanks for your help, much appreciated :)
User avatar
browniebraun
Developer
Posts: 791
Joined: Tue Jun 13, 2006 1:17 am
Location: Cologne, Germany

Post by browniebraun »

I prefer to use the CLI:

/mysql/bin/mysql -ucactiuser -pcactipwd cactidb < pa.sql


But it should also be possible to import it via phpMyAdmin or something else.

Best regards
-Andreas-
Hat das Blümchen einen Knick, war der Schmetterling zu dick! ;)
reportit v0.7.5a
SNMPAgent v0.2.3
Download ReportIt | Download SNMPAgent | ReportIt SVN | ReportIt Templates | Wish list
Locked

Who is online

Users browsing this forum: No registered users and 2 guests