Browse Source

modules that exist in python or inside netdata require to be forced

Costa Tsaousis (ktsaou) 8 years ago
parent
commit
25c6fb7dc7
2 changed files with 56 additions and 14 deletions
  1. 32 11
      conf.d/charts.d.conf
  2. 24 3
      plugins.d/charts.d.plugin

+ 32 - 11
conf.d/charts.d.conf

@@ -29,14 +29,35 @@
 # -----------------------------------------------------------------------------
 
 # the default enable/disable for all charts.d collectors
-#enable_all_charts="yes"
-
-# per charts.d collector enable/disable
-#nut=yes
-#squid=yes
-#postfix=yes
-#sensors=yes
-#cpufreq=yes
-#mysql=yes
-#example=yes
-#load_average=yes
+# the default is "yes"
+# enable_all_charts="yes"
+
+# BY DEFAULT ENABLED MODULES
+# ap=yes
+# nut=yes
+# opensips=yes
+
+# -----------------------------------------------------------------------------
+# THESE NEED TO BE SET TO "force" TO BE ENABLED
+
+# Nothing useful.
+# Just an example charts.d plugin you can use as a template.
+# example=force
+
+# OLD MODULES THAT ARE NOW SERVED BY python.d.plugin
+# apache=force
+# cpufreq=force
+# exim=force
+# hddtemp=force
+# mysql=force
+# nginx=force
+# phpfpm=force
+# postfix=force
+# sensors=force
+# squid=force
+# tomcat=force
+
+# OLD MODULES THAT ARE NOW SERVED BY NETDATA DAEMON
+# cpu_apps=force
+# mem_apps=force
+# load_average=force

+ 24 - 3
plugins.d/charts.d.plugin

@@ -305,8 +305,26 @@ all_charts() {
 	ls *.chart.sh | sed "s/\.chart\.sh$//g"
 }
 
+declare -A charts_enable_keyword=(
+	      ['apache']="force"
+	    ['cpu_apps']="force"
+	     ['cpufreq']="force"
+	     ['example']="force"
+	        ['exim']="force"
+	     ['hddtemp']="force"
+	['load_average']="force"
+	    ['mem_apps']="force"
+	       ['mysql']="force"
+	       ['nginx']="force"
+	      ['phpfpm']="force"
+	     ['postfix']="force"
+	     ['sensors']="force"
+	       ['squid']="force"
+	      ['tomcat']="force"
+	)
+
 all_enabled_charts() {
-	local charts= enabled=
+	local charts= enabled= required=
 
 	# find all enabled charts
 
@@ -318,9 +336,12 @@ all_enabled_charts() {
 			enabled="${enable_all_charts}"
 		fi
 
-		if [ ! "${enabled}" = "yes" ]
+		required="${charts_enable_keyword[${chart}]}"
+		[ -z "${required}" ] && required="yes"
+
+		if [ ! "${enabled}" = "${required}" ]
 		then
-			echo >&2 "$PROGRAM_NAME: '$chart' is NOT enabled. Add a line with $chart=yes in $myconfig to enable it (or remove the line that disables it)."
+			echo >&2 "$PROGRAM_NAME: '$chart' is NOT enabled. Add a line with $chart=$required in $myconfig to enable it (or remove the line that disables it)."
 		else
 			[ $debug -eq 1 ] && echo >&2 "$PROGRAM_NAME: '$chart' is enabled."
 			local charts="$charts $chart"