mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
Whitespace cleanup
* remove trailing whitespace * remove empty lines at the end of files
This commit is contained in:
parent
ef851f0c34
commit
17f784270a
604 changed files with 2927 additions and 2945 deletions
|
@ -7,18 +7,18 @@
|
|||
# Version: 1.0
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2
|
||||
# it under the terms of the GNU General Public License version 2
|
||||
# as published by the Free Software Foundation.
|
||||
#
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
#
|
||||
#
|
||||
# Prerequistes:
|
||||
# 1) env.ORACLE_HOME set in munin-node
|
||||
|
@ -44,7 +44,7 @@
|
|||
# dbport : port used by the monitored instance (notice: numeric value)
|
||||
# dbname : database to be monitored
|
||||
# dbhost : host or ip address of db instance
|
||||
#
|
||||
#
|
||||
#
|
||||
#%# family=auto
|
||||
#%# capabilities=autoconf
|
||||
|
@ -72,7 +72,7 @@ end
|
|||
#
|
||||
# Queries
|
||||
#
|
||||
pga_target_query = "SELECT TO_CHAR(ROUND(decode(unit,'bytes',(value)/(1024*1024),value),2)) pga_target
|
||||
pga_target_query = "SELECT TO_CHAR(ROUND(decode(unit,'bytes',(value)/(1024*1024),value),2)) pga_target
|
||||
from V$PGASTAT where name = 'aggregate PGA target parameter'"
|
||||
|
||||
pga_query = "SELECT TO_CHAR(ROUND(decode(unit,'bytes',(value)/(1024*1024),value),2)) pga
|
||||
|
@ -97,7 +97,7 @@ if ARGV[0] == "autoconf"
|
|||
# config definition
|
||||
#
|
||||
elsif ARGV[0] == "config"
|
||||
puts "graph_args --base 1024k -r --lower-limit 0"
|
||||
puts "graph_args --base 1024k -r --lower-limit 0"
|
||||
puts "graph_title Oracle PGA from #{dbname}"
|
||||
puts "graph_category db"
|
||||
puts "graph_info This graph shows the PGA memory usage (in MB)"
|
||||
|
|
|
@ -7,18 +7,18 @@
|
|||
# Version: 1.0
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2
|
||||
# it under the terms of the GNU General Public License version 2
|
||||
# as published by the Free Software Foundation.
|
||||
#
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
#
|
||||
#
|
||||
# Prerequistes:
|
||||
# 1) env.ORACLE_HOME set in munin-node
|
||||
|
@ -43,7 +43,7 @@
|
|||
# dbport : port used by the monitored instance (notice: numeric value)
|
||||
# dbname : database to be monitored
|
||||
# dbhost : host or ip address of db instance
|
||||
#
|
||||
#
|
||||
#
|
||||
#%# family=auto
|
||||
#%# capabilities=autoconf
|
||||
|
@ -71,7 +71,7 @@ end
|
|||
#
|
||||
# Queries
|
||||
#
|
||||
shared_pool_query = "SELECT TO_CHAR(ROUND(SUM(decode(pool, 'shared pool',
|
||||
shared_pool_query = "SELECT TO_CHAR(ROUND(SUM(decode(pool, 'shared pool',
|
||||
decode(name, 'library cache',0,
|
||||
'dictionary chace',0,
|
||||
'free memory',0,
|
||||
|
@ -96,7 +96,7 @@ large_pool_query = "SELECT TO_CHAR(ROUND(SUM(decode(pool, 'large pool', (bytes)/
|
|||
|
||||
log_buffer_query = "SELECT TO_CHAR(ROUND(SUM(decode(pool, NULL,
|
||||
decode(name, 'log_buffer', (bytes)/(1024*1024),0),0)),2)) sga_lbuffer
|
||||
from V$SGASTAT"
|
||||
from V$SGASTAT"
|
||||
|
||||
|
||||
memory_components = { "fixed_area" => fixed_area_query,
|
||||
|
@ -122,7 +122,7 @@ if ARGV[0] == "autoconf"
|
|||
# config definition
|
||||
#
|
||||
elsif ARGV[0] == "config"
|
||||
puts "graph_args --base 1024k -r --lower-limit 0"
|
||||
puts "graph_args --base 1024k -r --lower-limit 0"
|
||||
puts "graph_title Oracle SGA from #{dbname}"
|
||||
puts "graph_category db"
|
||||
puts "graph_info This graph shows the SGA memory usage (in MB)"
|
||||
|
@ -138,7 +138,7 @@ elsif ARGV[0] == "config"
|
|||
# make sure fixed_area is at the bottom of the stack
|
||||
if ( m == 'fixed_area' )
|
||||
puts "#{m}.draw AREA"
|
||||
else
|
||||
else
|
||||
puts "#{m}.draw STACK"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
# 'oracle'. Anyway, Munin must be told which user
|
||||
# this plugin should be run as.
|
||||
# dbpass - The corresponding password, if
|
||||
# applicable. Default to undef.
|
||||
# applicable. Default to undef.
|
||||
#
|
||||
# showusers - If set to 1 show usernames and num. of connections.
|
||||
# Default is not show users (0).
|
||||
|
@ -137,9 +137,9 @@ if ( $showusers ) {
|
|||
$sth->execute();
|
||||
my $total = 0;
|
||||
while ( my ($datname,$curr_conn) = $sth->fetchrow_array ) {
|
||||
print "$datname.value $curr_conn\n";
|
||||
print "$datname.value $curr_conn\n";
|
||||
$total = $total+$curr_conn;
|
||||
}
|
||||
}
|
||||
print "total.value $total\n";
|
||||
} else {
|
||||
my $sql = "select count(username) from v\$session where username is not null";
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
# 'oracle'. Anyway, Munin must be told which user
|
||||
# this plugin should be run as.
|
||||
# oracle_pass - The corresponding password, if
|
||||
# applicable. Default to undef.
|
||||
# applicable. Default to undef.
|
||||
#
|
||||
# SHOW_ORACLE_USERS - If set to 1 show usernames and num. of connections.
|
||||
# Default is not show users (0).
|
||||
|
@ -119,21 +119,21 @@ EOF`
|
|||
set pagesize 0
|
||||
select username, count(username) from v\$session where username is not null group by username;
|
||||
EOF
|
||||
echo $WARN_CRIT| awk '{ print "total.warning " $1 "\ntotal.critical " $2 }'
|
||||
echo $WARN_CRIT| awk '{ print "total.warning " $1 "\ntotal.critical " $2 }'
|
||||
else
|
||||
echo "connections.label active connections"
|
||||
echo "connections.info active connections"
|
||||
echo "connections.type GAUGE"
|
||||
echo $WARN_CRIT| awk '{ print "connections.warning " $1 "\nconnections.critical " $2 }'
|
||||
echo $WARN_CRIT| awk '{ print "connections.warning " $1 "\nconnections.critical " $2 }'
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [ $SHOW_ORACLE_USERS -eq 1 ]
|
||||
if [ $SHOW_ORACLE_USERS -eq 1 ]
|
||||
then
|
||||
sqlplus -s ${oracle_user}/${oracle_pass}@$ORACLE_SID << EOF | \
|
||||
grep -v '^$'|awk 'BEGIN { total=0 } {
|
||||
print $1 ".value " $2
|
||||
print $1 ".value " $2
|
||||
total=total+$2 } END { print "total.value " total }'
|
||||
set pagesize 0
|
||||
select username, count(username) from v\$session where username is not null group by username;
|
||||
|
@ -145,7 +145,7 @@ set pagesize 0
|
|||
select count(username) from v\$session where username is not null;
|
||||
EOF
|
||||
fi
|
||||
|
||||
|
||||
echo "max_connections.value" "`sqlplus -s ${oracle_user}/${oracle_pass}@$ORACLE_SID << EOF | \
|
||||
grep -v '^$' | awk '{print $1 }'
|
||||
set pagesize 0
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
default: asmusage
|
||||
|
||||
Module name(s) to exclude seperated by white-space.
|
||||
By default, asmusage module is excluded because another privilege
|
||||
By default, asmusage module is excluded because another privilege
|
||||
is necessary to connect ASM instance.
|
||||
|
||||
env.include_module:
|
||||
|
@ -92,21 +92,21 @@
|
|||
default: none
|
||||
|
||||
Module name(s) to include seperated by white-space.
|
||||
If both include_module and exclude_module are set, exclude will be
|
||||
If both include_module and exclude_module are set, exclude will be
|
||||
ignored.
|
||||
|
||||
env.plugin_name:
|
||||
env.plugin_name:
|
||||
example: env.plugin_name oracle_sysstat_2
|
||||
default: program name (usually oracle_sysstat)
|
||||
|
||||
Used for internal graph name.
|
||||
Used for internal graph name.
|
||||
It will be useful to monitor multi-instance databases.
|
||||
|
||||
env.db_name:
|
||||
env.db_name:
|
||||
example: env.db_name dbname
|
||||
default: none
|
||||
|
||||
Used for graph title.
|
||||
Used for graph title.
|
||||
It will be useful to monitor multi-instance databases.
|
||||
|
||||
=head1 NOTES
|
||||
|
@ -133,7 +133,7 @@
|
|||
. "${MUNIN_LIBDIR:-}/plugins/plugin.sh"
|
||||
is_multigraph "$@"
|
||||
|
||||
# Like perl 'use strict;'
|
||||
# Like perl 'use strict;'
|
||||
set -o nounset
|
||||
|
||||
# Global variables
|
||||
|
@ -661,7 +661,7 @@ sqlplus_variables="
|
|||
set numwidth 30
|
||||
"
|
||||
|
||||
# Functions
|
||||
# Functions
|
||||
|
||||
autoconf() {
|
||||
if which sqlplus >/dev/null ; then
|
||||
|
@ -688,7 +688,7 @@ fetch() {
|
|||
do_config() {
|
||||
local label_max_length=45
|
||||
local field type draw label
|
||||
local fields=
|
||||
local fields=
|
||||
|
||||
getfield
|
||||
echo "multigraph ${plugin_name}_${module}"
|
||||
|
@ -697,7 +697,7 @@ do_config() {
|
|||
echo "${global_attrs[$module]}" | sed -e 's/^ *//' -e '/^$/d'
|
||||
|
||||
# print data source attributes
|
||||
# split line into field,type,draw,label
|
||||
# split line into field,type,draw,label
|
||||
while read -r field type draw label
|
||||
do
|
||||
[ -z "$field" ] && continue
|
||||
|
@ -731,7 +731,7 @@ module_list() {
|
|||
echo "$include_module"
|
||||
else
|
||||
for i in $exclude_module
|
||||
do
|
||||
do
|
||||
# remove excluded modules
|
||||
unset -v "global_attrs[$i]"
|
||||
done
|
||||
|
@ -768,8 +768,8 @@ getvalue_sysstat() {
|
|||
echo "${sqlplus_variables}
|
||||
VAR vf VARCHAR2(64)
|
||||
VAR vl VARCHAR2(64)
|
||||
EXEC :vf := '${field}'
|
||||
EXEC :vl := '${label}'
|
||||
EXEC :vf := '${field}'
|
||||
EXEC :vl := '${label}'
|
||||
SELECT
|
||||
:vf || '.value ' || value
|
||||
FROM
|
||||
|
@ -789,8 +789,8 @@ getvalue_sgainfo() {
|
|||
echo "${sqlplus_variables}
|
||||
VAR vf VARCHAR2(64)
|
||||
VAR vl VARCHAR2(64)
|
||||
EXEC :vf := '${field}'
|
||||
EXEC :vl := '${label}'
|
||||
EXEC :vf := '${field}'
|
||||
EXEC :vl := '${label}'
|
||||
SELECT
|
||||
:vf || '.value ' || bytes
|
||||
FROM
|
||||
|
@ -810,8 +810,8 @@ getvalue_pgastat() {
|
|||
echo "${sqlplus_variables}
|
||||
VAR vf VARCHAR2(64)
|
||||
VAR vl VARCHAR2(64)
|
||||
EXEC :vf := '${field}'
|
||||
EXEC :vl := '${label}'
|
||||
EXEC :vf := '${field}'
|
||||
EXEC :vl := '${label}'
|
||||
SELECT
|
||||
:vf || '.value ' || value
|
||||
FROM
|
||||
|
@ -831,8 +831,8 @@ getvalue_cputime() {
|
|||
echo "${sqlplus_variables}
|
||||
VAR vf VARCHAR2(64)
|
||||
VAR vl VARCHAR2(64)
|
||||
EXEC :vf := '${field}'
|
||||
EXEC :vl := '${label}'
|
||||
EXEC :vf := '${field}'
|
||||
EXEC :vl := '${label}'
|
||||
SELECT
|
||||
:vf || '.value ' || ROUND( value / 1000000 )
|
||||
FROM
|
||||
|
@ -853,11 +853,11 @@ FROM
|
|||
WHERE
|
||||
name = 'physical reads cache'
|
||||
;
|
||||
SELECT
|
||||
SELECT
|
||||
'buf_logical.value ' || ( sd.value + sc.value )
|
||||
FROM
|
||||
v\$sysstat sd, v\$sysstat sc
|
||||
WHERE
|
||||
FROM
|
||||
v\$sysstat sd, v\$sysstat sc
|
||||
WHERE
|
||||
sd.name = 'db block gets from cache' AND sc.name = 'consistent gets from cache'
|
||||
;
|
||||
SELECT 'lib_pins.value ' || SUM(pins) FROM v\$librarycache;
|
||||
|
@ -892,7 +892,7 @@ ${sqlplus_variables}
|
|||
SELECT
|
||||
REGEXP_REPLACE( du.username, '^[^A-Za-z_]|[^A-Za-z0-9_]', '_' ) || '.value ' ||
|
||||
count(vs.username)
|
||||
FROM
|
||||
FROM
|
||||
( SELECT
|
||||
username
|
||||
FROM
|
||||
|
@ -952,7 +952,7 @@ FROM
|
|||
) en
|
||||
LEFT JOIN v\$session se
|
||||
ON
|
||||
en.wait_class = se.wait_class AND
|
||||
en.wait_class = se.wait_class AND
|
||||
se.username is not null AND
|
||||
se.wait_time = 0
|
||||
GROUP BY
|
||||
|
@ -1010,12 +1010,12 @@ getfield_eventwait2() {
|
|||
data_attrs[$module]=$( ${sqlplus} "${oracle_auth}" <<EOF
|
||||
${sqlplus_variables}
|
||||
VAR vl VARCHAR2(64)
|
||||
EXEC :vl := '${waitclass}'
|
||||
EXEC :vl := '${waitclass}'
|
||||
SELECT
|
||||
REGEXP_REPLACE( name, '^[^A-Za-z_]|[^A-Za-z0-9_]', '_' ) ||
|
||||
' DERIVE LINE ' || name
|
||||
FROM
|
||||
v\$event_name
|
||||
v\$event_name
|
||||
WHERE
|
||||
wait_class = :vl
|
||||
ORDER BY
|
||||
|
@ -1030,9 +1030,9 @@ getvalue_eventwait2() {
|
|||
${sqlplus} "${oracle_auth}" <<EOF
|
||||
${sqlplus_variables}
|
||||
VAR vl VARCHAR2(64)
|
||||
EXEC :vl := '${waitclass}'
|
||||
EXEC :vl := '${waitclass}'
|
||||
SELECT
|
||||
REGEXP_REPLACE( en.name, '^[^A-Za-z_]|[^A-Za-z0-9_]', '_' ) || '.value ' ||
|
||||
REGEXP_REPLACE( en.name, '^[^A-Za-z_]|[^A-Za-z0-9_]', '_' ) || '.value ' ||
|
||||
NVL( se.time_waited_micro, 0 )
|
||||
FROM
|
||||
v\$event_name en LEFT JOIN v\$system_event se
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue