Showing posts with label Monitoramento. Show all posts
Showing posts with label Monitoramento. Show all posts

8/05/2016

Instalando SARG ubuntu 14.04

Instalando SARG ubuntu 14.04

10/25/2015

Munin Ubuntu 12.04

Munin



Para instalar







sudo apt-get install munin


Configurar







sudo vim /etc/munin/munin.conf


Arquivo do munin.conf







# Example configuration file for Munin, generated by 'make build'

# The next three variables specifies where the location of the RRD

# databases, the HTML output, logs and the lock/pid files. They all

# must be writable by the user running munin-cron. They are all

# defaulted to the values you see here.

#

dbdir /var/lib/munin

htmldir /var/www/munin

logdir /var/log/munin

rundir /var/run/munin

#

# Where to look for the HTML templates

# tmpldir /etc/munin/templates

# (Exactly one) directory to include all files from.

#

includedir /etc/munin/munin-conf.d

# Make graphs show values per minute instead of per second

#graph_period minute

# Graphics files are normaly generated by munin-graph, no matter if

# the graphs are used or not. You can change this to

# on-demand-graphing by following the instructions in

# http://munin.projects.linpro.no/wiki/CgiHowto

#

#graph_strategy cgi

# munin-cgi-graph is invoked by the web server up to very many times at the

# same time. This is not optimal since it results in high CPU and memory

# consumption to the degree that the system can thrash. Again the default is

# 6. Most likely the optimal number for max_cgi_graph_jobs is the same as

# max_graph_jobs.

#

#munin_cgi_graph_jobs 6

# If the automatic CGI url is wrong for your system override it here:

#

#cgiurl_graph /cgi-bin/munin-cgi-graph

# munin-graph runs in parallel, the number of concurrent processes is

# 6. If you want munin-graph to not be parallel set to 0. If set too

# high it will slow down munin-graph. Some experiments are needed to

# determine how many are optimal on your system. On a multi-core

# system with good SCSI disks the number can probably be quite high.

#

#max_graph_jobs 6

# Drop somejuser@fnord.comm and anotheruser@blibb.comm an email everytime

# something changes (OK -> WARNING, CRITICAL -> OK, etc)

#contact.someuser.command mail -s "Munin notification" somejuser@fnord.comm

#contact.anotheruser.command mail -s "Munin notification" anotheruser@blibb.comm

#

# For those with Nagios, the following might come in handy. In addition,

# the services must be defined in the Nagios server as well.

#contact.nagios.command /usr/bin/send_nsca nagios.host.comm -c /etc/nsca.conf

# a simple host tree

[localhost.localdomain]

address 127.0.0.1

use_node_name yes

#

# A more complex example of a host tree

#

## First our "normal" host.

# [fii.foo.com]

# address foo

#

## Then our other host...

# [fay.foo.com]

# address fay

#

## Then we want totals...

# [foo.com;Totals] #Force it into the "foo.com"-domain...

# update no # Turn off data-fetching for this "host".

#

# # The graph "load1". We want to see the loads of both machines...

# # "fii=fii.foo.com:load.load" means "label=machine:graph.field"

# load1.graph_title Loads side by side

# load1.graph_order fii=fii.foo.com:load.load fay=fay.foo.com:load.load

#

# # The graph "load2". Now we want them stacked on top of each other.

# load2.graph_title Loads on top of each other

# load2.dummy_field.stack fii=fii.foo.com:load.load fay=fay.foo.com:load.load

# load2.dummy_field.draw AREA # We want area instead the default LINE2.

# load2.dummy_field.label dummy # This is needed. Silly, really.

#

# # The graph "load3". Now we want them summarised into one field

# load3.graph_title Loads summarised

# load3.combined_loads.sum fii.foo.com:load.load fay.foo.com:load.load

# load3.combined_loads.label Combined loads # Must be set, as this is

# # not a dummy field!

#

## ...and on a side note, I want them listen in another order (default is

## alphabetically)

#

# # Since [foo.com] would be interpreted as a host in the domain "com", we

# # specify that this is a domain by adding a semicolon.

# [foo.com;]

# node_order Totals fii.foo.com fay.foo.com

#


Arquivo apache.conf







sudo vim /etc/munin/apache.conf


Configurações do arquivo.







Alias /munin /var/www/munin

<Directory /var/www/munin>

Order allow,deny

# Allow from localhost 127.0.0.0/8 ::1

Allow from all

Options None

# This file can be used as a .htaccess file, or a part of your apache

# config file.

#

# For the .htaccess file option to work the munin www directory

# (/var/cache/munin/www) must have "AllowOverride all" or something

# close to that set.

#

# AuthUserFile /etc/munin/munin-htpasswd

# AuthName "Munin"

# AuthType Basic

# require valid-user

# This next part requires mod_expires to be enabled.

#

# Set the default expiration time for files to 5 minutes 10 seconds from

# their creation (modification) time. There are probably new files by

# that time.

#

<IfModule mod_expires.c>

ExpiresActive On

ExpiresDefault M310

</IfModule>

</Directory>


Criar a pasta e dar a permissão correta a pasta








sudo mkdir /var/www/munin

sudo chown munin:munin /var/www/munin



Reiniciar os serviços








sudo service munin-node restart

sudo service apache2 restart



Instalação Plugins

Check os plugins quem servidor tem ativo







ls /etc/munin/plugins


Confira os plugins que o servidor tem disponível







ls /usr/share/munin/plugins/









Plugin | Used | Suggestions

------ | ---- | -----------

acpi | no | no [cannot read /proc/acpi/thermal_zone/*/temperature]

amavis | no | no

apache_accesses | yes | yes

apache_processes | no | no

apache_volume | yes | yes

apc_envunit_ | no | no [no units to monitor]

bonding_err_ | no | no [No /proc/net/bonding]

courier_mta_mailqueue | no | no [spooldir not found]

courier_mta_mailstats | no | no [could not find executable]

courier_mta_mailvolume | no | no [could not find executable]

cps_ | no | no

cpu | yes | yes

cpuspeed | no | no [missing /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state]

cupsys_pages | no | no [could not find logdir]

df | yes | yes

df_inode | yes | yes

diskstats | yes | yes

entropy | yes | yes

exim_mailqueue | no | no [no exiqgrep]

exim_mailstats | no | no [logdir does not exist]

fail2ban | no | no [/usr/bin/fail2ban-client not found]

forks | yes | yes

fw_conntrack | no | yes

fw_forwarded_local | no | yes

fw_packets | yes | yes

hddtemp_smartctl | no | no [smartctl not found]

http_loadtime | yes | yes

if_ | yes | yes (eth0 eth1)

if_err_ | yes | yes (eth0 eth1)

interrupts | yes | yes

iostat | yes | yes

iostat_ios | yes | yes

ip_ | no | yes

ipmi_ | no | no [no /usr/bin/ipmitool]

irqstats | yes | yes

jmx_ | no | no [java runtime not found at /usr/bin/java]

load | yes | yes

lpstat | no | no [lpstat not found]

memory | yes | yes

munin_stats | yes | yes

mysql_ | no | no

netstat | no | no

nfs4_client | no | no [no /proc/net/rpc/nfs]

nfs_client | no | no

nfsd | no | no [no /proc/net/rpc/nfsd]

nfsd4 | no | no [no /proc/net/rpc/nfsd]

nginx_request | no | no [no nginx status on http://srv205/nginx_status]

nginx_status | no | no [no nginx status on http://localhost/nginx_status]

ntp_kernel_err | no | no

ntp_kernel_pll_freq | no | no

ntp_kernel_pll_off | no | no

ntp_offset | no | no [no ntpq program]

nvidia_ | no | no [no nvclock executable at /usr/bin/nvclock, please configure]

open_files | yes | yes

open_inodes | yes | yes

postfix_mailqueue | no | no

postfix_mailvolume | no | no [postfix not found]

postgres_bgwriter | no | no

postgres_cache_ | no | no

postgres_checkpoints | no | no

postgres_connections_ | no | no

postgres_connections_db | no | no

postgres_locks_ | no | no

postgres_querylength_ | no | no

postgres_scans_ | no | no

postgres_size_ | no | no

postgres_transactions_ | no | no

postgres_tuples_ | no | no

postgres_users | no | no

postgres_xlog | no | no

proc_pri | yes | yes

processes | yes | yes

ps_ | no | no

qmailqstat | no | no

selinux_avcstat | no | no [missing /selinux/avc/cache_stats file]

sendmail_mailqueue | no | no

sendmail_mailstats | no | no [no mailstats command]

sendmail_mailtraffic | no | no [no mailstats command]

slapd_ | no | no [Net::LDAP not found]

slapd_bdb_cache_ | no | no [Can't execute db_stat file '/usr/bin/db4.6_stat']

slony_lag_ | no | no [DBD::Pg not found, and cannot do psql yet]

smart_ | no | no [smartmontools not found]

snort_alerts | no | no [/var/snort/snort.stats not readable]

snort_bytes_pkt | no | no [/var/snort/snort.stats not readable]

snort_drop_rate | no | no [/var/snort/snort.stats not readable]

snort_pattern_match | no | no [/var/snort/snort.stats not readable]

snort_pkts | no | no [/var/snort/snort.stats not readable]

snort_traffic | no | no [/var/snort/snort.stats not readable]

squeezebox_ | no | no [no connection on localhost port 9090]

squid_cache | yes | no [could not connect: Connection refused]

squid_objectsize | yes | no [could not connect: Connection refused]

squid_requests | yes | no [could not connect: Connection refused]

squid_traffic | yes | no [could not connect: Connection refused]

swap | yes | yes

threads | yes | yes

tomcat_ | no | no

uptime | yes | yes

users | no | no

varnish_ | no | no [which varnishstat returns blank]

vmstat | yes | yes

vserver_cpu_ | no | no [/proc/virtual/info not found]

vserver_loadavg | no | no [/proc/virtual/info not found]

vserver_resources | no | no [/proc/virtual/info not found]

yum | no | no

zimbra_ | no | no [No Text::CSV_XS]


Para instalar os plugins basta fazer um atalho a pasta de plugin







sudo ln -s /usr/share/munin/plugins/nome de plugin /etc/munin/plugins/ nome de plugin


Instalando os plugins







sudo ln -s /usr/share/munin/plugins/mysql_ /etc/munin/plugins/mysql_

sudo ln -s /usr/share/munin/plugins/squid_cache /etc/munin/plugins/squid_cache

sudo ln -s /usr/share/munin/plugins/squid_icp /etc/munin/plugins/squid_icp

sudo ln -s /usr/share/munin/plugins/traffic /etc/munin/plugins/traffic

sudo ln -s /usr/share/munin/plugins/openvpn /etc/munin/plugins/openvpn

sudo ln -s /usr/share/munin/plugins/squid_objectsize /etc/munin/plugins/squid_objectsize


Após a instalação execute o restart.







sudo /etc/init.d/munin-node restart

sudo /etc/init.d/apache2 restart