Killspike integration in webinterface
Moderators: Developers, Moderators
-
- Cacti User
- Posts: 85
- Joined: Sat Jan 22, 2005 4:51 pm
-
- Cacti User
- Posts: 85
- Joined: Sat Jan 22, 2005 4:51 pm
-
- Cacti User
- Posts: 60
- Joined: Mon Jul 18, 2005 7:01 pm
has this been shot down yet?
I am no evil coding genius, though sometimes I can see how that would be nice, but I think I have found a solution to some of the troubles people have had with this plugin.
In particular the troubles where your graphs disappear after you run this killspike plugin on it. My solution may be too simple to be affective mainstream but for anyone who is already changing the perl script file it should be OK.
Simply add a chown command in the perl script to change the owner of the chagned file back to the owner it should be. This is a static thing, I do not know how to change it in a dynamic fashion. Here is what I mean.
This is the last section of the removespikes.pl file
I am running this on a CactiEZ install with Cacti 8.6i and a whole slew of plugins. My apache user is the one that Cacti runs as, so I used that user but you can use whatever user you need to of course.
Now when I run the script it does not start the file over again, it works like Alice inteneded it to.
It is a good thing I am no evil coding genius too since if I were I would have shared. Plus this would have been way more complicated too, and would have likely helped me take over the world one cacti user at a time. <cue maniacal laughter>
EddieVenus
In particular the troubles where your graphs disappear after you run this killspike plugin on it. My solution may be too simple to be affective mainstream but for anyone who is already changing the perl script file it should be OK.
Simply add a chown command in the perl script to change the owner of the chagned file back to the owner it should be. This is a static thing, I do not know how to change it in a dynamic fashion. Here is what I mean.
This is the last section of the removespikes.pl file
please make note of the line in bold as it was not there in the original file. That is the only change I have made.###########################################################################
# Cleanup and move new file to the place of original one
# and original one gets backed up.
if ($cont == 0) { print "No peaks found!<BR>"; }
else {
rename($ARGV[0],"$ARGV[0].old");
$lino="rrdtool restore $tempfile.xml $ARGV[0]";
system($lino);
chown apache, apache $ARGV[0];
die "$0: Unable to execute the rrdtool restore on $ARGV[0] - $! - $@\n" if $? != 0;
}
# cleans up the files created
unlink("$tempfile");
unlink("$tempfile.xml");
I am running this on a CactiEZ install with Cacti 8.6i and a whole slew of plugins. My apache user is the one that Cacti runs as, so I used that user but you can use whatever user you need to of course.
Now when I run the script it does not start the file over again, it works like Alice inteneded it to.
It is a good thing I am no evil coding genius too since if I were I would have shared. Plus this would have been way more complicated too, and would have likely helped me take over the world one cacti user at a time. <cue maniacal laughter>
EddieVenus
-
- Cacti User
- Posts: 60
- Joined: Mon Jul 18, 2005 7:01 pm
I want to say that I have been using this now for a day, cleaning up misc graphs from various sources and I have to say that it is the single greatest addition to Cacti yet.
I am not kidding, this should have been core functionality from the get go. The fact that it was not is not important, what is is that many people contributed to the effort of fixing that glarring shortcoming and producing what I have to say is the best plugin created to date.
Sure other plugins are great and I use them often, but this is the first one that I have actually hoped would some day be created.
So to all who made this plugin possible, thank you.
EddieVenus
I am not kidding, this should have been core functionality from the get go. The fact that it was not is not important, what is is that many people contributed to the effort of fixing that glarring shortcoming and producing what I have to say is the best plugin created to date.
Sure other plugins are great and I use them often, but this is the first one that I have actually hoped would some day be created.
So to all who made this plugin possible, thank you.
EddieVenus
While this might be a very handy addon, IMO this wouldn't be needed at all if data templates were properly defined; i.e. correctly set max/min data sources. Those of you who experience spikes in graphs from server reboots, should modify the existing data templates and rrd files so they don't occur again.
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Please replace killspike_draw_navigation_text by this code to avoid
Reinhard
errors:PHP Notice: Undefined index: killspike.php: in /var/www/html/workspace/cacti-plugins/lib/functions.php on line 1432, referer: http://localhost/workspace/cacti-plugin ... first=true
Code: Select all
function killspike_draw_navigation_text ($nav) {
$nav["killspike.php:"] = array("title" => "Kill Spikes", "mapping" => "graph_view.php:,?,graph.php:view", "url" => "", "level" => "3");
$nav["killspike.php:kill"] = array("title" => "This Graph", "mapping" => "killspike.php:", "url" => "killspike.php", "level" => "1");
return $nav;
}
- inetquestion
- Cacti User
- Posts: 67
- Joined: Wed Feb 01, 2006 11:13 am
- Location: Charlotte NC
return to original page
I haven't seen this modification, but it seemed like a necessary evil unless you like looking at output.
Code: Select all
print "<BR><B><a href=\"javascript:history.go(-1)\">Back</a></b>";
print "<script type=\"text/javascript\">";
print "<!--\n";
print "window.location = \"javascript:history.go(-1)\"\n";
print "//-->\n";
print "</script>";
- ruud
- Cacti User
- Posts: 64
- Joined: Tue Aug 22, 2006 3:07 am
- Location: Rotterdam, The Netherlands
- Contact:
Thought i had the same problem but solved it.. Perhaps you have the same problem as me ? :
I did copy the killspike plugin from my previous cacti installation but forgot to copy the removespikes.pl script to the scripts directory.
Hence : killspike runs but does nothing..
Killspike works now but with some hickups :
- The rights on the rra files are changed from my cactiuser to apache, this was the case on my old install as well.
- Killspike used to give a nice account of the actions it took, now it just spits out a bunch of "Chopped at Chopped at chopped at" lines.
I did copy the killspike plugin from my previous cacti installation but forgot to copy the removespikes.pl script to the scripts directory.
Hence : killspike runs but does nothing..
Killspike works now but with some hickups :
- The rights on the rra files are changed from my cactiuser to apache, this was the case on my old install as well.
- Killspike used to give a nice account of the actions it took, now it just spits out a bunch of "Chopped at Chopped at chopped at" lines.
Server #1 : Cacti 0.8.7b | cmd.php | HP Proliant DL380 G5 (Dual Core Xeon 3.2 GHz, 14 Gb, 2x73 Gb RAID1 - System + 3x73 Gb RAID5 - SQL/RRA) | Gentoo Linux
_________SYSTEM STATS: Time:114.6022 Method:cmd.php Processes:8 Threads:N/A Hosts:408 HostsPerProcess:51 DataSources:32276 RRDsProcessed:16148
_________SYSTEM STATS: Time:114.6022 Method:cmd.php Processes:8 Threads:N/A Hosts:408 HostsPerProcess:51 DataSources:32276 RRDsProcessed:16148
no icon?
I've installed it, and clicked the checkbox in the user realm page.. But I'm still not seeing the icon next to the graph.
file permissions all look fine...
Any ideas?
file permissions all look fine...
Any ideas?
FreeBSD/RHEL
cacti-0.8.7i, spine 0.8.7i, PIA 3.1+boost 5.1
MySQL 5.5/InnoDB
RRDtool 1.2.27, PHP 5.1.6
cacti-0.8.7i, spine 0.8.7i, PIA 3.1+boost 5.1
MySQL 5.5/InnoDB
RRDtool 1.2.27, PHP 5.1.6
As I said in the last post of the 2nd page: "The removespikes.pl script is not made by me!. "
I've just wrapped it in a plugin.
I've lost half a day just to figure out how this thing works:
I couldn't.
Want to debug the perl file and see how it works? fine. Want to share it? fine.
Want to blame it on me for not working ? That's NOT fine!
I've just wrapped it in a plugin.
I've lost half a day just to figure out how this thing works:
Code: Select all
for ($lino=0;$lino<=$#dump-1;$lino++) { # for each DS:
if ($dump[$lino]=~/\d\.\d+e.(\d+)\s/) { # grab number (and not a NaN)
$a=$1*1; # and exponent
$b=substr("0$lino",-2).":$1"; # calculate the max percentage of this DS
if ($por{$b}< $LIMIT) { # if this line represents less than $LIMIT
$linea=$tstamp.$linbak; # we dump it.
$cdo=1;
$tresto=$linbak;
}
Want to debug the perl file and see how it works? fine. Want to share it? fine.
Want to blame it on me for not working ? That's NOT fine!
[url=http://www.x-graphs.com/]http://www.x-graphs.com[/url] [color=red]X[/color]-[color=blue]graphs[/color] :: All kind of graphs
A plugin has been released a while ago: http://forums.cacti.net/viewtopic.php?t=31420
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
Who is online
Users browsing this forum: No registered users and 1 guest