Killspike integration in webinterface

Anything that you think should be in Cacti.

Moderators: Moderators, Developers

Cacti User
Posts: 82
Joined: Sat Jan 22, 2005 4:51 pm

#46 Post by leonardo_gyn » Thu Jun 21, 2007 5:07 am

OK, i have figured that. The question was if i need to apply some patch for getting plugin support, if plugin support is present in some 'beta' cacti version, if it's already only on development branch (SVN), etc etc

Cacti User
Posts: 82
Joined: Sat Jan 22, 2005 4:51 pm

#47 Post by leonardo_gyn » Thu Jun 21, 2007 5:22 am

Forget it ...... i found the plugin architeture and install instructions, i think i can handle it :D

Cacti User
Posts: 60
Joined: Mon Jul 18, 2005 7:01 pm

has this been shot down yet?

#48 Post by eddievenus » Mon Jul 02, 2007 3:19 pm

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 file
# 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 {
$lino="rrdtool restore $tempfile.xml $ARGV[0]";
chown apache, apache $ARGV[0];
die "$0: Unable to execute the rrdtool restore on $ARGV[0] - $! - [email protected]\n" if $? != 0;

# cleans up the files created
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.

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>


Cacti User
Posts: 60
Joined: Mon Jul 18, 2005 7:01 pm

#49 Post by eddievenus » Tue Jul 03, 2007 11:19 am

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.


Cacti User
Posts: 78
Joined: Fri Feb 02, 2007 8:36 am
Location: Eindhoven/The Netherlands

#50 Post by YoMarK » Wed Sep 19, 2007 5:49 am

Great plugin!
Removed some ugly spikes in SQL Server,Exchange and Blackberry graphs(from WMI, occurring mostly when rebooting the servers).

Running it on windows, works fine with the edits suggested by cjennings_c.

User avatar
Cacti Moderator
Posts: 12160
Joined: Sat May 08, 2004 12:44 pm
Location: USA

#51 Post by BSOD2600 » Wed Sep 19, 2007 10:16 am

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.

User avatar
Posts: 22375
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany

#52 Post by gandalf » Sat Oct 20, 2007 5:50 am

Please replace killspike_draw_navigation_text by this code to avoid
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;

User avatar
Cacti User
Posts: 67
Joined: Wed Feb 01, 2006 11:13 am
Location: Charlotte NC

return to original page

#53 Post by inetquestion » Tue Nov 27, 2007 2:08 pm

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>";

Posts: 29
Joined: Wed Feb 06, 2008 2:56 pm

#54 Post by Findarato » Tue Mar 04, 2008 10:58 am

I seem to have an issue, Its the same install, but after upgrading to v2 of PIA and 8.7b of Cacti the script runs but the spikes are still showing up in the graph.

Btw it worked fine with 8.7a and 1.4PIA

User avatar
Cacti User
Posts: 64
Joined: Tue Aug 22, 2006 3:07 am
Location: Rotterdam, The Netherlands

#55 Post by ruud » Wed Apr 09, 2008 5:32 am

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 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

User avatar
Cacti User
Posts: 371
Joined: Tue Aug 24, 2004 5:02 pm
Location: San Francisco, CA

no icon?

#56 Post by gninja » Fri Apr 18, 2008 2:32 pm

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?
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 Guru User
Posts: 1874
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom

#57 Post by mcutting » Fri Jul 04, 2008 6:21 am

Does anyone have a version of killspike that works with Windows ?

Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b

User avatar
Cacti Pro User
Posts: 722
Joined: Wed Apr 09, 2003 2:17 am
Location: Izmir/Turkey

#58 Post by TFC » Wed Nov 19, 2008 4:39 am

I think this plugin is completely wrong..
Because its developer cant give any solution.
Plugind says Removing spikes for: /var/www/cacti/rra/btg3640_traffic_in_17.rrd
but nothing change..
Permissions are ok..

User avatar
Cacti User
Posts: 107
Joined: Tue Oct 28, 2003 4:54 pm
Location: Bucharest, RO.

#59 Post by Alice » Wed Apr 22, 2009 11:35 am

As I said in the last post of the 2nd page: "The 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:

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.
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!
[url=][/url] [color=red]X[/color]-[color=blue]graphs[/color] :: All kind of graphs

User avatar
Cacti Moderator
Posts: 12160
Joined: Sat May 08, 2004 12:44 pm
Location: USA

#60 Post by BSOD2600 » Wed Apr 22, 2009 12:30 pm

A plugin has been released a while ago:

Post Reply