MRTG - HD, Mem, Proc. [RESOLVIDO]

1. MRTG - HD, Mem, Proc. [RESOLVIDO]

William Maggi Pardalz
pardalz

(usa Debian)

Enviado em 23/04/2014 - 09:13h

Bom dia caros colegas, Eu tenho o MRTG já configurado com as Interfaces ETH0 e ETH1, está funcionando legal.
o que eu estou tentando fazer é o seguinte, quero colocar o MRTG para gerar gráficos de CPU, Memória e HD. Pesquisando muito , consegui chegar aos comandos que me retornam as informações que eu quero, só que quando eu jogo no MRTG, parece que ele não está pegando a informação que eu quero. Se eu digitar o comando:

"cat /proc/meminfo |grep Active: |awk -F':' '{print $2}' |awk '{print $1}'; cat /proc/meminfo |grep MemTotal: |awk -F':' '{print $2}' |awk '{print $1}'; uptime |awk -F':' '{print $3}' |awk '{print $3}'; echo Server"

Ele vai me dar o seguinte retorno:
683500
3600072
64
Server

sendo:
683500 # Memória sendo Utilizada
3600072 # Memória Total
64 # Uptime
Server # Server Name

Já procurei vários artigos que ensinam fazer, mas não sei onde estou errando.
segue abaixo o meu mrtg.conf (dentro de /etc/mrtg/)
se alguém puder dar uma olhada e me auxiliar eu ficaria muito grato.

######################################################################
# Multi Router Traffic Grapher -- Sample Configuration File
######################################################################
# This file is for use with mrtg-2.5.4c
# Global configuration
WorkDir: /var/www/mrtg
Htmldir: /var/www/mrtg
icondir: images/
Refresh: 300
Interval: 5
Language: portuguese
RunAsDaemon: yes
WriteExpires: Yes

Title[^]: Traffic Analysis for

# 128K leased line
# ----------------
#Title[leased]: a 128K leased line
#PageTop[leased]: <H1>Our 128K link to the outside world</H1>
#Target[leased]: 1:public@router.localnet
#MaxBytes[leased]: 16000

##
# ETH0
##
Target[eth0]: `cat /proc/net/dev |grep eth0 |awk -F':' '{print $2}' |awk '{print $1}'; cat /proc/net/dev |grep eth0 | awk -F':' '{print $2}' |awk '{print $9}'; uptime |awk -F':' '{print $3}' |awk '{print $3}'; echo Server`
MaxBytes[eth0]: 1250000
Title[eth0]: eth0 - Utilizacao eth0
PageTop[eth0]: <H1>Estatisticas das interfaces<BR>Utilizacao interface interna (eth0)</H1>
Options[eth0]: growright

#
# ETH1
#
Target[eth1]: `cat /proc/net/dev |grep eth1 |awk -F':' '{print $2}' |awk '{print $1}'; cat /proc/net/dev |grep eth1 | awk -F':' '{print $2}' |awk '{print $9}'; uptime |awk -F':' '{print $3}' |awk '{print $3}'; echo Server`
MaxBytes[eth1]: 1250000
Title[eth1]: eth1 - Utilizacao eth1
PageTop[eth1]: <H1>Estatisticas das interfaces<BR>Utilizacao interface Externa (eth1)</H1>
Options[eth1]: growright
#
# HD
#
Target[hd]: `df -h | grep sda1 | awk '{ print $3 }' | cut -c 1-2; df -k | grep sda1 | awk '{ print $2 }' | cut -c 1-3; uptime |awk -F':' '{print $3}' |awk '{print $3}'; echo Server`
#Target[hd]: `/etc/mrtg/hd.sh`
MaxBytes[hd]: 151225248
#HTML output settings
Title[hd]: DISK Usage
PageTop[hd]: <H1>Uso de HD <BR> Utilizacao do Disco Rigido</H1>
Suppress[hd]: ym
#Graph output settings
Options[hd]: growright,nopercent
PNGTitle[hd]: Marispan
YLegend[hd]: Disk used
ShortLegend[hd]:bytes
kMG[hd]: G
#YLegend[hd]: Bytes
Legend1[hd]: Bytes Usados
Legend2[hd]: Total
#Legend3[hd]: Max bytes load
#Legend4[hd]: Max Users
#LegendI[hd]: &nbsp;sda1:

#
#Memoria
#
Target[memo]: `cat /proc/meminfo |grep Active: |awk -F':' '{print $2}' |awk '{print $1}'; cat /proc/meminfo |grep MemTotal: |awk -F':' '{print $2}' |awk '{print $1}'; uptime |awk -F':' '{print $3}' |awk '{print $3}'; echo Server`
MaxBytes[memo]: 4000000
#HTML output settings
Title[memo]: Mem Usage
PageTop[memo]: <H1>Memoria <BR> Utilizacao da Memoria</H1>
Suppress[memo]: ym
#Graph output settings
Options[memo]: growright
PNGTitle[memo]: Marispan
YLegend[memo]: Memory Used
ShortLegend[memo]: KBytes
kMG[memo]: K
#YLegend[memo]: Bytes
Legend1[memo]: KBytes Usados
Legend2[memo]: Total
#Legend3[memo]: Max bytes load
#Legend4[memo]: Max Users
#LegendI[memo]: &nbsp;sda1



  


2. Resolvido

William Maggi Pardalz
pardalz

(usa Debian)

Enviado em 25/04/2014 - 12:47h

Resolvi o problema, faltava a Opção gauge.
postei o conf aqui: http://www.vivaolinux.com.br/etc/mrtgconf/






Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts