mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-23 06:35:42 +00:00
Filter, line colours match Spotweb categories
This commit is contained in:
parent
7f8ae73b48
commit
63357b6bbf
1 changed files with 15 additions and 9 deletions
|
@ -29,17 +29,17 @@
|
||||||
#
|
#
|
||||||
# [spotweb_cat_average]
|
# [spotweb_cat_average]
|
||||||
# env.period 1800 # The period over wich to check in seconds, default to 30 minutes (1800 seconds)
|
# env.period 1800 # The period over wich to check in seconds, default to 30 minutes (1800 seconds)
|
||||||
# env.countporn = 'no' # Also count porn? Default is 'yes'
|
# env.countporn 'no' # Also count porn? Default is 'yes'
|
||||||
#
|
#
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
|
|
||||||
# Environment variables
|
# Environment variables
|
||||||
my $MYSQL = $ENV{mysql} || "/usr/bin/mysql";
|
my $MYSQL = $ENV{mysql} || "/usr/bin/mysql";
|
||||||
my $MYSQLOPTS = $ENV{mysqlopts} || "";
|
my $MYSQLOPTS = $ENV{mysqlopts} || "";
|
||||||
my $DATABASE = $ENV{database} || "spotweb";
|
my $DATABASE = $ENV{database} || "spotweb";
|
||||||
my $PERIOD = $ENV{period} || 1800;
|
my $PERIOD = $ENV{period} || 1800;
|
||||||
my $COUNTPORN = $ENV{countporn} || "yes";
|
my $COUNTPORN = $ENV{countporn} || "yes";
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,15 +49,19 @@ my $TITLE = "Spotweb spots by Category (".($PERIOD / 60)." minute average)"
|
||||||
|
|
||||||
|
|
||||||
# Output for config
|
# Output for config
|
||||||
if(defined $ARGV[0] && $ARGV[0] eq 'config') {
|
if(defined $ARGV[0] && $ARGV[0] eq 'config') {
|
||||||
print <<EOC
|
print <<EOC
|
||||||
graph_title $TITLE
|
graph_title $TITLE
|
||||||
graph_vlabel Spots
|
graph_vlabel Spots
|
||||||
graph_category spotweb
|
graph_category spotweb
|
||||||
cat0.label Videos/images
|
cat0.label Videos/images
|
||||||
|
cat0.colour 008edf
|
||||||
cat1.label Music
|
cat1.label Music
|
||||||
|
cat1.colour e9a213
|
||||||
cat2.label Games
|
cat2.label Games
|
||||||
|
cat2.colour 00de00
|
||||||
cat3.label Applications
|
cat3.label Applications
|
||||||
|
cat3.colour de2500
|
||||||
EOC
|
EOC
|
||||||
;
|
;
|
||||||
exit 0;
|
exit 0;
|
||||||
|
@ -69,7 +73,9 @@ if($COUNTPORN eq 'yes') {
|
||||||
&print_value(0);
|
&print_value(0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
&print_value(0, " AND subcatd NOT LIKE '%23%' AND subcatd NOT LIKE '%24%' AND subcatd NOT LIKE '%25%' AND subcatd NOT LIKE '%26%'");
|
# 11-04-2011 - New pr0n filters
|
||||||
|
# &print_value(0, " AND subcatd NOT LIKE '%23%' AND subcatd NOT LIKE '%24%' AND subcatd NOT LIKE '%25%' AND subcatd NOT LIKE '%26%'");
|
||||||
|
&print_value(0, " AND subcatz NOT LIKE '%4%' AND subcatd NOT LIKE '%23%' AND subcatd NOT LIKE '%24%' AND subcatd NOT LIKE '%25%' AND subcatd NOT LIKE '%26%' AND subcatd NOT LIKE '%72%' AND subcatd NOT LIKE '%73%' AND subcatd NOT LIKE '%74%' AND subcatd NOT LIKE '%75%' AND subcatd NOT LIKE '%76%' AND subcatd NOT LIKE '%77%' AND subcatd NOT LIKE '%78%' AND subcatd NOT LIKE '%79%' AND subcatd NOT LIKE '%80%' AND subcatd NOT LIKE '%81%' AND subcatd NOT LIKE '%82%' AND subcatd NOT LIKE '%83%' AND subcatd NOT LIKE '%84%' AND subcatd NOT LIKE '%85%' AND subcatd NOT LIKE '%86%' AND subcatd NOT LIKE '%87%' AND subcatd NOT LIKE '%88%' AND subcatd NOT LIKE '%88%' AND subcatd NOT LIKE '%89%'");
|
||||||
}
|
}
|
||||||
&print_value(1);
|
&print_value(1);
|
||||||
&print_value(2);
|
&print_value(2);
|
||||||
|
@ -81,4 +87,4 @@ sub print_value {
|
||||||
my $spots = `$MYSQL $MYSQLOPTS -e "SELECT count(*) as spots FROM $DATABASE.spots WHERE stamp > $FROMSTAMP AND category = $_[0]$_[1];"`;
|
my $spots = `$MYSQL $MYSQLOPTS -e "SELECT count(*) as spots FROM $DATABASE.spots WHERE stamp > $FROMSTAMP AND category = $_[0]$_[1];"`;
|
||||||
$spots =~ /(\d+)/;
|
$spots =~ /(\d+)/;
|
||||||
print "cat".$_[0].".value ".$1."\n";
|
print "cat".$_[0].".value ".$1."\n";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue