NRPE
Autor: Fabio Biancardi | Publicado: 2012-05-29T23:50:00-03:00







O NRPE é um complemento para Nagios, foi criado para possibilitar o monitoramento de máquinas remotas que rodem Linux ou outras variantes de UNIX, o complemento NRPE é desenhado para permitir que seja executado os plugins do nagios em máquinas Linux/Unix, isto permite que não somente consiga monitorar máquinas&nbsp;Linux/Unix, como também consiga fazer com que a maquina monitorada seja capaz de monitorar outras máquinas na rede, num esquema de checagens indiretas.




Exemplos de monitoramento:
&nbsp;* Disco, Carga de CPU, Memória Ram, Memória SWAP, Processos Zombies, quantidade de processamento utilizado, uptime, quantidade de usuários logados, etc...


Efetuando a Instalação:

Pacotes Necessários:

* build-essential libssl-dev

# aptitude update
# aptitude install&nbsp;build-essential libssl-dev

* Xinetd

# aptitude install xinetd

Faça o download do Source do NRPE no site do Nagios

# wget&nbsp;http://prdownloads.sourceforge.net/sourceforge/nagios/nrpe-2.13.tar.gz

Criando Regras no Firewall


Certifique-se de que o firewall local na máquina está instalado e que, sendo assim, permitirá acesso ao daemon NRPE para o(s) servidor(es) de monitoramento, e somente para ele(s). Escreva, na ordem abaixo, as regras do iptables na linha de comando. Certifique-se de repetir a segunda regra para todos os sistemas de monitoramento (ex: Nagios) que queira permitir acesso.

# iptables -I INPUT -p tcp -m tcp --dport 5666 -j DROP
# iptables -I INPUT -s &lt;IP_SERVIDOR_NAGIOS&gt; -p tcp -m tcp --dport 5666 -j ACCEPT&nbsp;

NOTA: Perceba que no segundo comando acima, inserimos o IP do servidor o qual irá fazer a requisição. Embora tenhamos definido anteriormente que o daemon NRPE somente aceitaria requisições para os IPs cadastrados na diretiva 'only_from', é interessante garantir isso também no iptables, tanto por questões de segurança quanto performance | =D |. Nas regras acima, somente o servidor Nagios com o IP cadastrado poderá obter os dados do daemon NRPE instalado.






Descompacte e instale o NRPE:&nbsp;

# tar xzf nrpe-2.13.tar.gz
# cd xzf nrpe-2.13
# ls





# ./configure
# make all
# make install
# make install-daemon
# make install-daemon-config
# make install-xinetd


Agora, instale o plugin do NRPE também no servidor Nagios:

# make install-plugin


Edite o arquivo de configuração do NRPE, adicionando logo após o endereço local do host (127.0.0.1), o endereço ip do servidor Nagios ou a range da rede onde esta o servidor Nagios:

# vim /etc/xinetd.d/nrpe
...
only_from = 127.0.0.1 192.168.1.0
...

Adicione a porta do serviço NRPE ao sistema:

# vim /etc/services
...
nrpe 5666/tcp # NRPE
…

Reinicie o serviço do Xinetd:

# /etc/init.d/xinetd restart

Teste o funcionamento do NRPE:

# /usr/local/nagios/libexec/check_nrpe –H localhost

O retorno deve ser:

NRPE v2.13



Instale o SNMP no servidor Nagios pelo repositório:

# cd..
# apt-get install snmp
# apt-get install snmpd

Teste o funcionamento do plugin no servidor:&nbsp;

# /usr/local/nagios/libexec/check_nrpe –H &lt;ip_do_servidor_&gt;
NRPE v2.13
retornara o resultado acima

Criando uma definição de comando


Será necessário criar uma definição de comando em um de seus arquivos de configuração do Nagios para usar o check_nrpe.

Abra o arquivo de exemplo commands.cfg para edição...

# vi /usr/local/nagios/etc/objects/command.cfg

Adicione a seguinte definição para o arquivo:
...
define command
{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
...



Criando Definições de Serviços e de Hosts




No Nagios podemos definir modelos para serviços, hosts, padrões de monitoramento etc. Vamos criar um novo modelo que identifique sistemas Linux, monitorados por NRPE. Para isso, edite o arquivo templates.cfg:&nbsp;



# vi /usr/local/nagios/etc/objects/templates.cfg&nbsp;



Crie agora uma definição como a escrita abaixo:&nbsp;

...

define host{

&nbsp; &nbsp;name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;linux-nrpe &nbsp;; Nome do modelo de host

&nbsp; &nbsp;use &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; generic-host ; Herda valores padrão de...

&nbsp; &nbsp;check_period &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 24x7

&nbsp; &nbsp;check_interval &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;5

&nbsp; &nbsp;retry_interval &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1

&nbsp; &nbsp;max_check_attempts &nbsp; &nbsp; &nbsp; &nbsp; 10

&nbsp; &nbsp;check_command &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;check-host-alive

&nbsp; &nbsp;notification_period &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 24x7

&nbsp; &nbsp;notification_interval &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;30

&nbsp; &nbsp;notification_options &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; d,r

&nbsp; &nbsp;contact_groups &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; admins

&nbsp; &nbsp;register &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0 ; NÃO REGISTRAR - ISTO É UM MODELO

}

...




Crie o Arquivo de Configuração



No diretorio /usr/local/nagios/etc/objects#


para isso:

# cd /usr/local/nagios/etc/objects#
# &gt; servidor.cfg

Edite o arquivo: e insira o que quer monitorar - abaixo um exemplo
# vi servidor.cfg
####################

# Servico Monitoramento#
####################

define host{
&nbsp; &nbsp; &nbsp; &nbsp; use linux-nrpe
&nbsp; &nbsp; &nbsp; &nbsp; host_name zeus
&nbsp; &nbsp; &nbsp; &nbsp; alias debian server
&nbsp; &nbsp; &nbsp; &nbsp; address IP_que_ira_monitorar
}



### CPU LOAD ###
define service{
&nbsp; &nbsp; &nbsp; &nbsp; host_name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; zeus
&nbsp; &nbsp; &nbsp; &nbsp; service_description &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CPU Load
&nbsp; &nbsp; &nbsp; &nbsp; check_command &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; check_nrpe!check_load
&nbsp; &nbsp; &nbsp; &nbsp; max_check_attempts &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2
&nbsp; &nbsp; &nbsp; &nbsp; normal_check_interval &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1
&nbsp; &nbsp; &nbsp; &nbsp; retry_check_interval &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1
&nbsp; &nbsp; &nbsp; &nbsp; check_period &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;24x7
&nbsp; &nbsp; &nbsp; &nbsp; notification_interval &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;30
&nbsp; &nbsp; &nbsp; &nbsp; notification_period &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 24x7
&nbsp; &nbsp; &nbsp; &nbsp; notification_options &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; w,c,r
&nbsp; &nbsp; &nbsp; &nbsp; contact_groups &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; admins
}



salve o arquivo acima :wq


root@zeus:/usr/local/nagios/etc/linux# ls -l
total 8
-rw-r--r-- 1 root nagios 1952 Mai 29 23:31 servidor.cfg



Apos o processo acima acesse o diretório onde se encontra o arquivo de configuração do Nagios



# cd /usr/local/nagios/etc







edite o arquivo nagios.cfg e adicione o arquivo criado acima servidor.cfg como exemplo abaixo, para o nagios monitorar

# vi nagios.cfg

cfg_file=/usr/local/nagios/etc/objects/servidor.cfg

salve o arquivo acima :wq


O comando abaixo testa as configurações do arquivo de configuração

# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg



Checking for circular paths between hosts...

Checking for circular host and service dependencies...

Checking global event handlers...

Checking obsessive compulsive processor commands...

Checking misc settings...



Total Warnings: 13

Total Errors: &nbsp; 0




Apos terminar de testar as configurações acima reinicie o serviço do nagios



# /etc/init.d/nagios restart



Visualização de telas de monitoramento:























Tipos de monitoramento que podem ser usados




# Local HDD

define command{

&nbsp; &nbsp; &nbsp; &nbsp; command_name &nbsp; &nbsp;check_local_disk

&nbsp; &nbsp; &nbsp; &nbsp; command_line &nbsp; &nbsp;$USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$

&nbsp; &nbsp; &nbsp; &nbsp; }



# LOAD

define command{

&nbsp; &nbsp; &nbsp; &nbsp; command_name &nbsp; &nbsp;check_local_load

&nbsp; &nbsp; &nbsp; &nbsp; command_line &nbsp; &nbsp;$USER1$/check_load -w $ARG1$ -c $ARG2$

&nbsp; &nbsp; &nbsp; &nbsp; }



# PROCESS

define command{

&nbsp; &nbsp; &nbsp; &nbsp; command_name &nbsp; &nbsp;check_local_procs

&nbsp; &nbsp; &nbsp; &nbsp; command_line &nbsp; &nbsp;$USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$

&nbsp; &nbsp; &nbsp; &nbsp; }



# USERS

define command{

&nbsp; &nbsp; &nbsp; &nbsp; command_name &nbsp; &nbsp;check_local_users

&nbsp; &nbsp; &nbsp; &nbsp; command_line &nbsp; &nbsp;$USER1$/check_users -w $ARG1$ -c $ARG2$

&nbsp; &nbsp; &nbsp; &nbsp; }



# SWAP

define command{

&nbsp; &nbsp;command_name &nbsp; check_local_swap

&nbsp; &nbsp;command_line &nbsp; $USER1$/check_swap -w $ARG1$ -c $ARG2$

&nbsp; &nbsp;}



# MRTGTRAF

define command{

&nbsp; &nbsp;command_name &nbsp; check_local_mrtgtraf

&nbsp; &nbsp;command_line &nbsp; $USER1$/check_mrtgtraf -F $ARG1$ -a $ARG2$ -w $ARG3$ -c $ARG4$ -e $ARG5$

&nbsp; &nbsp;}





# FTP

define command{

&nbsp; &nbsp; &nbsp; &nbsp; command_name &nbsp; &nbsp;check_ftp

&nbsp; &nbsp; &nbsp; &nbsp; command_line &nbsp; &nbsp;$USER1$/check_ftp -H $HOSTADDRESS$ $ARG1$

&nbsp; &nbsp; &nbsp; &nbsp; }



# HPJD

define command{

&nbsp; &nbsp; &nbsp; &nbsp; command_name &nbsp; &nbsp;check_hpjd

&nbsp; &nbsp; &nbsp; &nbsp; command_line &nbsp; &nbsp;$USER1$/check_hpjd -H $HOSTADDRESS$ $ARG1$

&nbsp; &nbsp; &nbsp; &nbsp; }



# SNMP

define command{

&nbsp; &nbsp; &nbsp; &nbsp; command_name &nbsp; &nbsp;check_snmp

&nbsp; &nbsp; &nbsp; &nbsp; command_line &nbsp; &nbsp;$USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$

&nbsp; &nbsp; &nbsp; &nbsp; }



# HTTP

define command{

&nbsp; &nbsp; &nbsp; &nbsp; command_name &nbsp; &nbsp;check_http

&nbsp; &nbsp; &nbsp; &nbsp; command_line &nbsp; &nbsp;$USER1$/check_http -I $HOSTADDRESS$ $ARG1$

&nbsp; &nbsp; &nbsp; &nbsp; }



# SSH

define command{

&nbsp; &nbsp;command_name &nbsp; check_ssh

&nbsp; &nbsp;command_line &nbsp; $USER1$/check_ssh $ARG1$ $HOSTADDRESS$

&nbsp; &nbsp;}



# DHCP

define command{

&nbsp; &nbsp;command_name &nbsp; check_dhcp

&nbsp; &nbsp;command_line &nbsp; $USER1$/check_dhcp $ARG1$

&nbsp; &nbsp;}



# PING

define command{

&nbsp; &nbsp;command_name &nbsp; &nbsp;check_ping

&nbsp; &nbsp;command_line &nbsp; &nbsp;$USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5

&nbsp; &nbsp; &nbsp; &nbsp; }



# PING GOOGLE

define command{

&nbsp; &nbsp;command_name &nbsp; check_google

&nbsp; &nbsp;command_line &nbsp; $USER1$/check_ping -H www.google.com.br -w 60,70% -c 80,90%

&nbsp; &nbsp;}



# POP

define command{ &nbsp; &nbsp;command_name &nbsp; &nbsp;check_pop

&nbsp; &nbsp;command_line &nbsp; &nbsp;$USER1$/check_pop -H $HOSTADDRESS$ $ARG1$

&nbsp; &nbsp; &nbsp; &nbsp; }



# IMAP

define command{

&nbsp; &nbsp;command_name &nbsp; &nbsp;check_imap

&nbsp; &nbsp;command_line &nbsp; &nbsp;$USER1$/check_imap -H $HOSTADDRESS$ $ARG1$

&nbsp; &nbsp; &nbsp; &nbsp; }



# SMTP

define command{

&nbsp; &nbsp;command_name &nbsp; &nbsp;check_smtp

&nbsp; &nbsp;command_line &nbsp; &nbsp;$USER1$/check_smtp -H $HOSTADDRESS$ $ARG1$

&nbsp; &nbsp; &nbsp; &nbsp; }



# TCP

define command{

&nbsp; &nbsp;command_name &nbsp; check_tcp



command_line &nbsp; $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$

&nbsp; &nbsp;}



# UDP

define command{

&nbsp; &nbsp;command_name &nbsp; check_udp

&nbsp; &nbsp;command_line &nbsp; $USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$

&nbsp; &nbsp;}



# NT

define command{

&nbsp; &nbsp;command_name &nbsp; check_nt

&nbsp; &nbsp;command_line &nbsp; $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$

&nbsp; &nbsp;}









# SNMP



define command{

&nbsp; &nbsp;command_name check_snmp_load_v1

&nbsp; &nbsp;command_line $USER1$/check_snmp_load.pl -H $HOSTADDRESS$ $USER7$ -T $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$

&nbsp; &nbsp;}



define command{

&nbsp; &nbsp;command_name check_snmp_int_v1

&nbsp; &nbsp;command_line $USER1$/check_snmp_int.pl -H $HOSTADDRESS$ $USER7$ -n $ARG1$ $ARG2$

&nbsp; &nbsp;}



define command{

&nbsp; &nbsp;command_name check_snmp_mem_v1

&nbsp; &nbsp;command_line $USER1$/check_snmp_mem.pl -H $HOSTADDRESS$ $USER7$ $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$

&nbsp; &nbsp;}



define command{

&nbsp; &nbsp;command_name check_snmp_storage_v1

&nbsp; &nbsp;command_line $USER1$/check_snmp_storage.pl -H $HOSTADDRESS$ $USER7$ -m $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$

&nbsp; &nbsp;}



define command{

&nbsp; &nbsp;command_name check_snmp_hpux_storage_v1

&nbsp; &nbsp;command_line $USER1$/check_snmp_hpux_storage.pl -H $HOSTADDRESS$ $USER7$ -m $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$

&nbsp; &nbsp;}



define command{

&nbsp; &nbsp;command_name check_snmp_hpux_mem_v1

&nbsp; &nbsp;command_line $USER1$/check_snmp_hpux_mem.sh $USER8$ $HOSTADDRESS$ $ARG1$ $ARG2$ $ARG3$ $ARG4$

&nbsp; &nbsp;}



define command{

&nbsp; &nbsp;command_name check_snmp_v1

&nbsp; &nbsp;command_line $USER1$/check_snmp -H $HOSTADDRESS$ $USER7$ -o $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$

&nbsp; &nbsp;}



define command{

&nbsp; &nbsp;command_name check_snmp_process_v1

&nbsp; &nbsp;command_line $USER1$/check_snmp_process.pl -H $HOSTADDRESS$ $USER7$ -n $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$

&nbsp; &nbsp;}



define command{

&nbsp; &nbsp;command_name check_win

&nbsp; &nbsp;command_line $USER1$/check_snmp_win.pl -H $HOSTADDRESS$ $USER7$ -n $ARG1$ $ARG2$

&nbsp; &nbsp;}



## FIM SNMP ################



# DISCO

define command{

&nbsp; &nbsp;command_name check_disk

&nbsp; &nbsp;command_line $USER1$/check_disk -w limit -c limit -t 5

&nbsp; &nbsp;}

# IMPRESSORA HP

define command{

&nbsp; &nbsp;command_name check_hp_print

&nbsp; &nbsp;command_line $USER1$/check_hp_print -H $HOSTADDRESS$ $ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$ $ARG6$

&nbsp; &nbsp;}



# TERMINAL SERVICE

define command{

&nbsp; &nbsp;command_name check_ts

&nbsp; &nbsp;command_line $USER$/check_ts -H $HOSTADDRESS$ -p 3389

&nbsp; &nbsp;}



# PRINTERS

define command{

&nbsp; &nbsp;command_name check_printer

&nbsp; &nbsp;command_line $USER1$/check_printer $HOSTADDRESS$ $USER8$ $ARG1$ $ARG2$ $ARG3$ $ARG4$

&nbsp; &nbsp;}



# WIRETEMP

define command{

&nbsp; &nbsp;command_name check_1-wiretemp

&nbsp; &nbsp; &nbsp; &nbsp;command_line $USER1$/custom/check_1-wiretemp -c $ARG1$ -w $ARG2$ -W$ARG3$ -C$ARG4$ -i $ARG5$ -o $ARG6$

&nbsp; &nbsp; }



# NRPE

define command{

&nbsp; &nbsp;command_name check_nrpe

&nbsp; &nbsp;command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$

}



# OPENVPN

define command{

&nbsp; &nbsp;command_name check_openvpn

&nbsp; &nbsp;command_line /usr/lib/nagios/plugins/check_openvpn -t $ARG1$ -p $ARG2$ -n $ARG3$

}



# SQUID

define command{

&nbsp; &nbsp;command_name check_squid

&nbsp; &nbsp;command_line $USER1$/check_squid.pl -u http://www.google.com.br -p $HOSTADDRESS$ -l 8080 -o usuario -m senha -e 200

&nbsp; &nbsp; &nbsp; &nbsp; }



# SAMBA

define command{

&nbsp; &nbsp;command_name check_samba

&nbsp; &nbsp;command_line $USER1$/check_samba -L $HOSTADDRESS$

}



# WINTEMP

define command{

&nbsp; &nbsp;command_name check_snmp_wintemp

&nbsp; &nbsp;command_line $USER1$/check_snmp_wintemp -L $HOSTADDRESS$

}



# 3COM

define command{

&nbsp; &nbsp;command_name check_3com

&nbsp; &nbsp;command_line $USER1$/check_3com.pl -H $HOSTADDRESS$ -C $ARG1$ -u $ARG2$

&nbsp; &nbsp; &nbsp; &nbsp; }



# SWITCH UPTIME

define command {

&nbsp; &nbsp;command_name check_switch_uptime

&nbsp; &nbsp;command_line $USER1$/check_switch_uptime.pl -H $HOSTADDRESS$ -C $ARG1$ -w $ARG2$ -c $ARG3$

}



# MEMORIA

define command {

&nbsp; &nbsp;command_name check_mem

&nbsp; &nbsp;command_line $USER1$/check_mem -w $ARG1$ -c $ARG2$

}



# MRTG

define command {

&nbsp; &nbsp;command_name check_mrtgtraf

&nbsp; &nbsp;command_line $USER1$/check_mrtgtraf -F $ARG1$ -a $ARG2$ -w $ARG3$ -c $ARG4$ -e $ARG5$

}&nbsp;



# NAGIOSGRAPHER

define command{

&nbsp; &nbsp;command_name process-service-perfdata-file

&nbsp; &nbsp;command_line mv /usr/local/nagios/var/service-perfdata /usr/local/nagios/var/service-perfdata.$TIMET$

}

Monitorando Impressoras de Rede no Nagios (por Rafael Oliveira)




# DEFINICAO DA IMPRESSORA
define host{
&nbsp; &nbsp;use &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; generic-printer
&nbsp; &nbsp;host_name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hp_producao
&nbsp; &nbsp;alias &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Impressora HP Producao
&nbsp; &nbsp;address &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 172.16.130.100 
&nbsp; &nbsp;parents &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3Com_4200
&nbsp; &nbsp;check_interval &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1
retry_check_interval &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 10
check_period &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; workhours
notification_interval &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 120
notification_period &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;workhours
notification_options &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;d,u,r
contact_groups &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;admins
&nbsp; &nbsp;hostgroups &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;network-printers &nbsp; 
&nbsp; &nbsp;}

# CHECAGEM DOS SERVICOS
#
# PING
define service{
&nbsp; &nbsp;use &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; generic-service
&nbsp; &nbsp;host_name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hp_producao
&nbsp; &nbsp;service_description &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PING
&nbsp; &nbsp;check_command &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;check_ping!3000.0,80%!5000.0,100%
&nbsp; &nbsp;normal_check_interval &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1
&nbsp; &nbsp;retry_check_interval &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 10
&nbsp; max_check_attempts &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;notification_interval &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;120
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;notification_options &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;c,r
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;contact_groups &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;admins
&nbsp; &nbsp;notification_period &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; workhours
&nbsp; &nbsp; &nbsp; &nbsp; }

# FOLHAS IMPRESSAS
define service{
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;use &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; generic-service
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;host_name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hp_producao
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;service_description &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Folhas Impressas
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;check_command &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;check_printer!counter 1
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;normal_check_interval &nbsp; &nbsp; &nbsp; &nbsp; 1
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;retry_check_interval &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;10
&nbsp; &nbsp;max_check_attempts &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; notifications_enabled &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0
&nbsp; &nbsp;}

# Parts Status
define service{
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;use &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; generic-service
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;host_name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hp_producao
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;service_description &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Parts Status
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;check_command &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;check_printer!parts 1
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;normal_check_interval &nbsp; &nbsp; &nbsp;1
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;retry_check_interval &nbsp; &nbsp; &nbsp; &nbsp; 10
&nbsp; &nbsp;max_check_attempts &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;notifications_enabled &nbsp; &nbsp; &nbsp; &nbsp; 0
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}

# Port Status
define service{
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;use &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;generic-service
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;host_name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hp_producao
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; service_description &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Port Status
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;check_command &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; check_printer!parts 2
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;normal_check_interval &nbsp; &nbsp; 1
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;retry_check_interval &nbsp; &nbsp; &nbsp; &nbsp;10
&nbsp; &nbsp;max_check_attempts &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;notifications_enabled &nbsp; &nbsp; &nbsp; &nbsp;0
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }

# Toners Status
## Cyano
define service{
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;use &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;generic-service
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;host_name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hp_producao
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;service_description &nbsp; &nbsp; &nbsp; &nbsp;Toner Cyano
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;check_command &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; check_printer!toner/ink 1!0.5,0.8
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;normal_check_interval &nbsp; 1
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;retry_check_interval &nbsp; &nbsp; &nbsp;10
&nbsp; &nbsp;max_check_attempts &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;notifications_enabled &nbsp; &nbsp; &nbsp;0
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}

## Magenta
define service{
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;use &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;generic-service
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;host_name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hp_producao
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;service_description &nbsp; &nbsp; &nbsp; &nbsp;Toner Magenta
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;check_command &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; check_printer!toner/ink 2!0.5,0.8
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;normal_check_interval &nbsp; 1
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;retry_check_interval &nbsp; &nbsp; &nbsp; 10
&nbsp; &nbsp;max_check_attempts &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;notifications_enabled &nbsp; &nbsp; &nbsp;0
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}

## Amarelo
define service{
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;use &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;generic-service
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;host_name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hp_producao
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;service_description &nbsp; &nbsp; &nbsp; &nbsp;Toner Amarelo
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;check_command &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; check_printer!toner/ink 3!0.5,0.8
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;normal_check_interval &nbsp; 1
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;retry_check_interval &nbsp; &nbsp; &nbsp;10
&nbsp; &nbsp;max_check_attempts &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;notifications_enabled &nbsp; &nbsp; &nbsp;0
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }

## Preto
define service{
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;use &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;generic-service
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;host_name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hp_producao
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;service_description &nbsp; &nbsp; &nbsp; &nbsp;Toner Preto
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;check_command &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; check_printer!toner/ink 4!0.5,0.8
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;normal_check_interval &nbsp; 1
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;retry_check_interval &nbsp; &nbsp; &nbsp;10
&nbsp; &nbsp;max_check_attempts &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;notifications_enabled &nbsp; &nbsp; 0
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}

# Reservatorio de Residuos
define service{
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;use &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;generic-service
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;host_name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hp_producao
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;service_description &nbsp; &nbsp; &nbsp; &nbsp;Reservatorio de Residuos
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;check_command &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; check_printer!toner/ink 5!0.5,0.8
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;normal_check_interval &nbsp; 1
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;retry_check_interval &nbsp; &nbsp; &nbsp;10
&nbsp; &nbsp;max_check_attempts &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;notifications_enabled &nbsp; &nbsp; &nbsp;0
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}