Killspike integration in webinterface

Anything that you think should be in Cacti.

Moderators: Developers, Moderators

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

Post by leonardo_gyn »

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
leonardo_gyn
Cacti User
Posts: 85
Joined: Sat Jan 22, 2005 4:51 pm

Post by leonardo_gyn »

Forget it ...... i found the plugin architeture and install instructions, i think i can handle it :D
eddievenus
Cacti User
Posts: 60
Joined: Mon Jul 18, 2005 7:01 pm

has this been shot down yet?

Post by eddievenus »

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

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

Post by eddievenus »

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
YoMarK
Cacti User
Posts: 89
Joined: Fri Feb 02, 2007 8:36 am
Location: Eindhoven/The Netherlands

Post by YoMarK »

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
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

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
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

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

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;
}
Reinhard
User avatar
inetquestion
Cacti User
Posts: 67
Joined: Wed Feb 01, 2006 11:13 am
Location: Charlotte NC

return to original page

Post by inetquestion »

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

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

Post by Findarato »

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
ruud
Cacti User
Posts: 64
Joined: Tue Aug 22, 2006 3:07 am
Location: Rotterdam, The Netherlands
Contact:

Post by ruud »

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.
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
gninja
Cacti User
Posts: 371
Joined: Tue Aug 24, 2004 5:02 pm
Location: San Francisco, CA
Contact:

no icon?

Post by gninja »

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

Post by mcutting »

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

Thanks
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
User avatar
TFC
Cacti Pro User
Posts: 739
Joined: Wed Apr 09, 2003 2:17 am
Location: Izmir/Turkey

Post by TFC »

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
Alice
Cacti User
Posts: 111
Joined: Tue Oct 28, 2003 4:54 pm
Location: Bucharest, RO.

Post by Alice »

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:

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;
          }
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=http://www.x-graphs.com/]http://www.x-graphs.com[/url] [color=red]X[/color]-[color=blue]graphs[/color] :: All kind of graphs
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

A plugin has been released a while ago: http://forums.cacti.net/viewtopic.php?t=31420
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests