Administration Metrologie et Supervision
squidclient -h localhost cache_object://localhost/ mgr:5min|grep -i cpu_usage
cpu_usage = 0.050991%
squidclient -h localhost cache_object://localhost/ mgr:5min|grep client_http.all_median_svc_time
client_http.all_median_svc_time = 0.102812 seconds
squidclient -h localhost cache_object://localhost/ mgr:5min|grep dns.median_svc_time
dns.median_svc_time = 0.032234 seconds
squidclient -h localhost cache_object://localhost/ mgr:5min|grep client_http.requests
client_http.requests = 0.130000/sec
squidclient -h localhost cache_object://localhost/ mgr:counters |grep icp.queries_recv
icp.queries_recv = 0
squidclient -h localhost cache_object://localhost/ mgr:5min|grep -i pa
page_faults = 0.000000/sec
/usr/local/zabbix/sbin/zabbix_server -c /etc/zabbix/zabbix_server.conf -R config_cache_reload
/usr/local/zabbix/sbin/zabbix_proxy -c /etc/zabbix/zabbix_proxy.conf -R config_cache_reload
LogFile=/var/log/zabbix/zabbix_agentd.log
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFileSize=1
EnableRemoteCommands=1
Server=<%= zabbix_server %>
Hostname=<%= zabbix_hostname %>
ListenPort=10050
#ServerPort=10052
AllowRoot=1
BufferSize=1000
#Include userparameters
Include=/usr/local/zabbix/etc/zabbix_agentd.conf.d
UserParameter=apache[*],/etc/zabbix/scripts/zapache.sh \$1
UserParameter=disk.info.discovery,for device in $(cat /proc/partitions | awk -F" " '/sd..$/ {print
$4}'); do devicelist="$devicelist,"'{"{#DEVICE}":"'$device'"}';done; echo '{"data":['${devicelist#,
}']}'
UserParameter=disk.info.read[*],cat /proc/diskstats | awk -F " " '/$1 / {print $$4}'
UserParameter=disk.info.read.rt[*],cat /proc/diskstats | awk -F " " '/$1 / {print $$7}'
UserParameter=disk.info.write[*],cat /proc/diskstats | awk -F " " '/$1 / {print $$8}'
UserParameter=disk.info.write.rt[*],cat /proc/diskstats | awk -F " " '/$1 / {print $$11}'
UserParameter=disk.info.discovery,for device in $(/usr/sbin/lsdev -Cc disk | awk -F " " '/Available
/ {print $1}'); do devicelist="$devicelist,"'{"{#DEVICE}":"'$device'"}';done; echo '{"data":['${dev
icelist#,}']}'
UserParameter=mysql.status[*],(test -f /usr/bin/mysqladmin && mysqladmin -ureadonly extended-status
2>/dev/null | awk '/ $1 /{print $$4}')
UserParameter=mysql.ping,(test -f /usr/bin/mysqladmin && mysqladmin -ureadonly ping | grep alive |
wc -l)
UserParameter=mysql.version,(test -f /usr/bin/mysqladmin && mysqladmin -V)
# PostgreSQL user parameter
#
# Server specific examples
#
# Get the total number of commited transactions
UserParameter=psql.tx_commited[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select sum(xact_commit) from
pg_stat_database"
# Get the total number of rolled back transactions
UserParameter=psql.tx_rolledback[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select sum(xact_rollback) f
rom pg_stat_database"
# Max Connections
UserParameter=psql.server_maxcon[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "show max_connections"
# PostgreSQL is running
UserParameter=psql.running[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select 1" > /dev/null 2>&1 ; echo
$?
# Added by SRA OSS
# Get number of checkpoint count (by checkpoint_timeout)
UserParameter=psql.checkpoints_timed[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select checkpoints_time
d from pg_stat_bgwriter"
# Get number of checkpoint count (by checkpoint_segments)
UserParameter=psql.checkpoints_req[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select checkpoints_req fr
om pg_stat_bgwriter"
# Get the total number of connections
UserParameter=psql.server_connections[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select count(*) from p
g_stat_activity;"
# Get the total number of active (on processing SQL) connections
UserParameter=psql.active_connections[*],ps -edf | grep "postgres:" | grep -v idle | wc -l
# Get the total number of idle connections
UserParameter=psql.idle_connections[*],ps -edf | grep postgres | grep idle | wc -l
# Get the total number of idle in transaction connections
UserParameter=psql.idle_tx_connections[*],ps -edf | grep postgres | grep "idle in transaction" | wc
-l
# Get the total number of lock-waiting connections
UserParameter=psql.locks_waiting[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select count(*) from pg_loc
ks where not granted"
# Get buffer information
UserParameter=psql.buffers_checkpoint[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select buffers_checkpo
int from pg_stat_bgwriter"
UserParameter=psql.buffers_clean[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select buffers_clean from p
g_stat_bgwriter"
UserParameter=psql.maxwritten_clean[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select maxwritten_clean
from pg_stat_bgwriter"
UserParameter=psql.buffers_backend[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select buffers_backend fr
om pg_stat_bgwriter"
UserParameter=psql.buffers_backend_fsync[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select buffers_back
end_fsync from pg_stat_bgwriter"
UserParameter=psql.buffers_alloc[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select buffers_alloc from p
g_stat_bgwriter"
# Get number of slow queries
UserParameter=psql.slow_queries[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select count(*) from pg_stat
_activity where state = 'active' and now() - query_start > '$5 sec'::interval"
UserParameter=psql.slow_select_queries[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select count(*) from
pg_stat_activity where state = 'active' and now() - query_start > '$5 sec'::interval and query ilik
e 'select%'"
UserParameter=psql.slow_dml_queries[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select count(*) from pg_
stat_activity where state = 'active' and now() - query_start > '$5 sec'::interval and query ~* '^(i
nsert|update|delete)'"
#
# Database specific examples
#
# Get the size of a Database (in bytes)
UserParameter=psql.db_size[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select pg_database_size('$5')"
# Get number of active connections for a specified database
UserParameter=psql.db_connections[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select numbackends from pg
_stat_database where datname = '$5'"
# Get number of tuples returned for a specified database
UserParameter=psql.db_returned[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select tup_returned from pg_s
tat_database where datname = '$5'"
# Get number of tuples fetched for a specified database
UserParameter=psql.db_fetched[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select tup_fetched from pg_sta
t_database where datname = '$5'"
# Get number of tuples inserted for a specified database
UserParameter=psql.db_inserted[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select tup_inserted from pg_s
tat_database where datname = '$5'"
# Get number of tuples updated for a specified database
UserParameter=psql.db_updated[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select tup_updated from pg_sta
t_database where datname = '$5'"
# Get number of tuples deleted for a specified database
UserParameter=psql.db_deleted[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select tup_deleted from pg_sta
t_database where datname = '$5'"
# Get number of commited/rolled back transactions for a specified database
UserParameter=psql.db_tx_commited[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select xact_commit from pg
_stat_database where datname = '$5'"
UserParameter=psql.db_tx_rolledback[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select xact_rollback fro
m pg_stat_database where datname = '$5'"
# Cache Hit Ratio
UserParameter=psql.cachehit_ratio[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "SELECT round(blks_hit*100/
(blks_hit+blks_read), 2) AS cache_hit_ratio FROM pg_stat_database WHERE datname = '$5' and blks_rea
d > 0 union all select 0.00 AS cache_hit_ratio order by cache_hit_ratio desc limit 1"
# Added by SRA OSS
# Get number of temp files
UserParameter=psql.db_temp_files[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select temp_files from pg_s
tat_database where datname = '$5'"
# Get temp file size (in bytes)
UserParameter=psql.db_temp_bytes[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select temp_bytes from pg_s
tat_database where datname = '$5'"
# Get percentage of dead tuples of all tables for a specified database
UserParameter=psql.db_dead_tup_ratio[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select round(sum(n_dead
_tup)*100/sum(n_live_tup+n_dead_tup), 2) as dead_tup_ratio from pg_stat_all_tables where n_live_tup
> 0"
# Get number of deadlocks for a specified database (9.2 or later)
UserParameter=psql.db_deadlocks[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select deadlocks from pg_sta
t_database where datname = '$5'"
#
# Table specific examples
#
# Get table cache hit ratio of a specific table
UserParameter=psql.table_cachehit_ratio[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select round(heap_bl
ks_hit*100/(heap_blks_hit+heap_blks_read), 2) as cache_hit_ratio from pg_statio_user_tables where s
chemaname = '$5' and relname = '$6' and heap_blks_read > 0 union all select 0.00 as cache_hit_ratio
order by cache_hit_ratio desc limit 1"
# Get number of sequencial scan of a specific table
UserParameter=psql.table_seq_scan[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select seq_scan from pg_st
at_user_tables where schemaname = '$5' and relname = '$6'"
# Get number of index scan of a specific table
UserParameter=psql.table_idx_scan[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select coalesce(idx_scan,0
) from pg_stat_user_tables where schemaname = '$5' and relname = '$6'"
# Get number of vacuum count of a specific table
UserParameter=psql.table_vacuum_count[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select vacuum_count fr
om pg_stat_user_tables where schemaname = '$5' and relname = '$6'"
# Get number of analyze count of a specific table
UserParameter=psql.table_analyze_count[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select analyze_count
from pg_stat_user_tables where schemaname = '$5' and relname = '$6'"
# Get number of autovacuum count of a specific table
UserParameter=psql.table_autovacuum_count[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select autovacuum_
count from pg_stat_user_tables where schemaname = '$5' and relname = '$6'"
# Get number of autoanalyze count of a specific table
UserParameter=psql.table_autoanalyze_count[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select autoanalyz
e_count from pg_stat_user_tables where schemaname = '$5' and relname = '$6'"
# Get number of tuples of a specific table
UserParameter=psql.table_n_tup_ins[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select n_tup_ins from pg_
stat_user_tables where schemaname = '$5' and relname = '$6'"
UserParameter=psql.table_n_tup_upd[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select n_tup_upd from pg_
stat_user_tables where schemaname = '$5' and relname = '$6'"
UserParameter=psql.table_n_tup_del[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select n_tup_del from pg_
stat_user_tables where schemaname = '$5' and relname = '$6'"
UserParameter=psql.table_seq_tup_read[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select seq_tup_read fr
om pg_stat_user_tables where schemaname = '$5' and relname = '$6'"
UserParameter=psql.table_idx_tup_fetch[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select coalesce(idx_t
up_fetch,0) from pg_stat_user_tables where schemaname = '$5' and relname = '$6'"
UserParameter=psql.table_n_tup_hot_upd[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select n_tup_hot_upd
from pg_stat_user_tables where schemaname = '$5' and relname = '$6'"
UserParameter=psql.table_n_live_tup[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select n_live_tup from p
g_stat_user_tables where schemaname = '$5' and relname = '$6'"
UserParameter=psql.table_n_dead_tup[*],psql -h $1 -p $2 -U $3 -d $4 -t -c "select n_dead_tup from p
g_stat_user_tables where schemaname = '$5' and relname = '$6'"
#
# Discovery Rule
#
# Database Discovery
#UserParameter=db.list.discovery[*],$5/find_dbname.sh $1 $2 $3 $4
#UserParameter=db_table.list.discovery[*],$5/find_dbname_table.sh $1 $2 $3 $4
UserParameter=db.list.discovery[*],GETDB="select datname from pg_database where datistemplate = 'f'
;";for dbname in $(psql -h $1 -p $2 -U $3 -d $4 -t -c "${GETDB}");do dblist="$dblist,"'{"{#DBNAME}"
:"'$dbname'"}';done;echo '{"data":['${dblist#,}' ]}';
#Managed by puppet, modifications will be erased automatically
Server=<%= zabbix_server %>
ServerActive=<%= zabbix_server %>
Hostname=<%= zabbix_hostname %>
ListenPort=10050
StartAgents=5
LogFile=F:\Local\zabbix\zabbix_agentd.log
BufferSize=1000
#ExtraChecks
# Include only available from 2.4
UserParameter=essbase.status[*],echo "show global status where Variable_name='$1';"
UserParameter=essbase.dsize[*],cscript //NoLogo E:\Local\zabbix\DirectorySize.vbs G:\Local\hyperion
\user_projects\epmsystem1\EssbaseServer\essbaseserver1\APP\$1
UserParameter=essbase.dlist[*],cscript //NoLogo E:\Local\zabbix\DirectorySubdir.vbs G:\Local\hyperi
on\user_projects\epmsystem1\EssbaseServer\essbaseserver1\APP\$1
LogFile=/var/log/zabbix/zabbix_agentd.log
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFileSize=1
EnableRemoteCommands=1
<% if ( @zabbixversion !~ /^2\.0/ ) and ( @zabbixversion !~ /^2\.2/ ) -%>
ServerActive=<%= zabbix_server %>:10052
<% end -%>
Server=<%= zabbix_server %>
Hostname=<%= zabbix_hostname %>
ListenPort=10050
#ServerPort=10052
AllowRoot=1
BufferSize=1000
#Include userparameters
Include=/etc/zabbix/zabbix_agentd.conf.d
UserParameter=disk.info.discovery,for device in $(/usr/sbin/lsdev -Cc disk | awk -F " " '/Available/ {print $1}'); do devicelist="$devicelist,"'{"{#DEVICE}":"'$device'"}';done; echo '{"data":['${devicelist#,}']}'