Re: [Nagios-users-br] Procura-se plugin para monitorar log de backup

2011-08-22 Thread Jose Oliveira
E ai Diramos??

Conseguiu monitorar os logs do jeito que voce queria???

Te uma outra opção interessante: Mandar os logs do event viewer do Windows
para o syslog de um servidor linux. No linux voce poderia usar muita coisa
pra futucar este log, desde scripts simples, o check_logs.pl que te mandei e
até o splunk...

O unico senão é saber se o seu software de backup informa alguma coisa no
event viewer...

[]s
JGeraldo


Em 12 de agosto de 2011 16:23, Jose Oliveira jotag...@gmail.com escreveu:

 Oi Diramos

 O check_logs.pl precisa rodar no servidor onde está o log...

 O nsclient++ tem dentro dele, os dois protocolos: nsclient o nrpe. É só
 habilitar a dll necessária, liberar as portas nos firewall e configurar as
 entradas no nsclient.ini, similares às do nrpe.cfg.

 Eu uso bastante este opçao em conjunto com os utilitários do djgpp. O djgpp
 é um port da maioria dos binarios de linux pra windows, de maneira que
 passamos a ter bash, grep, sed, awk e tudo que voce pensar dentro de uma
 janela dos...

 Em Linux eu consigo rodar um script quando chamo uma OID snmp. Talvez no
 Windows oce consiga fazer algo similar... Eu conheco muito pouco de
 windows...

 []s


 Em 12 de agosto de 2011 12:34, benedito.ra...@caixa.gov.br escreveu:

 Jotagera,
 Obrigado pelo pronto retorno.
 Analisei suas opções, mas é o seguinte:
 Minha idéia inicial é não usar o NSCA
 Já até instalei o NSCA e coloquei uma linha no final do .bat prá enviar ao
 Nagios a mensagem de retorno do script de backup.
 Mas, se, por exemplo, o servidor windows cair no meio da execução do .bat,
 ele interrompe o script e não manda a mensagem pro Nagios via NSCA. Aí,
 teríamos que configurar o tal de freshness pro nagios alertar que não
 terminou o backup, etc. Meio enrolado isso, a meu ver. A não ser que você me
 prove o contrário, aí eu aceito. rsrsrsrs
 Então, o que eu queria, preferencialmente, é fazer checagem ativa a partir
 do Nagios.
 Me interessou muito essa idéia do NSClient++. Já até instalei ele em
 alguns servidores. E fiz testes.
 Mas como eu parti prá fazer todas as minhas checagens via SNMP, acabei não
 precisando usar mais o NSClient++.
 E suas colocações me despertou uma dúvida: achei que o tal de NRPE
 checasse somente máquinas Unix/Linux. Ele checa também máquinas
 Windows?!?!?!? Achei que prá Windows fosse só o check_nt.
 Se o NRPE funfar prá Windows, pode ser essa a nossa solução.
 Outra dúvida: esse check_logs.pl roda no servidor nagios ou no cliente
 windows. Pelo que expus acima, pretendo achar um script que rode no Nagios,
 de forma ativa.
 Poderia dar retorno?

 Diramos


 -Mensagem original-
 De: Jose Oliveira [mailto:jotag...@gmail.com]
 Enviada em: sexta-feira, 12 de agosto de 2011 10:49
 Para: Unofficial Brazilian (Portuguese) Nagios Users List
 Assunto: Re: [Nagios-users-br] Procura-se plugin para monitorar log de
 backup

 Diramos

 O script chama-se check_logs.pl

 Eis o cabeçalho do mesmo:
 # Log file regular expression detector for Nagios.
 # Written by Serge Sergeev (serge at ocslab.com)
 # Based on check_log2.pl written by Aaron Bostick (
 abost...@mydoconline.com)
 # Last modified: 06-07-2005
 #
 # Usage: check_logs -c configuration_file
 # For usage detiles: check_logs --help
 #
 # Description:
 # This plugin will scan arbitrary text files looking for regular
 expression
 # matches.


 []s



 Em 11 de agosto de 2011 23:16, Jose Oliveira jotag...@gmail.com
 escreveu:

  Diramos
 
  Lembrei de outra coisa.
 
  O ntbackup roda dentro da janela do bat ou seja, o bat espera o ntbackup
  terminar?
 
  Se o bat esperar o ntbackup, voce pode testar o return code do ntbackup
 e,
  se for diferente de zero, mandar uma mensagem via email ou pro Nagios
 via
  nsca.
 
  Eu uso um script em perl que se chama sendEmail.pl que é um cliente de
  email na linha de comando. Massa demais... Com ele contornei o problema
 de
  PCI que eram os sendmail rodando nos *Nix (Linux, Solaris e AIX).
 
  Voce pode chamar este script de dentro do bat pra mandar email direto
 pro
  seu MTA.
 
  []s
 
 
 
  Em 11 de agosto de 2011 14:24, benedito.ra...@caixa.gov.br escreveu:
 
  Honoráveis Mestres,
 
 
  Tenho servidores Windows 2003 Server que, através de script .bat, fazem
  backup de arquivos em determinada hora da madrugada.
  O script usa o aplicativo ntbackup, nativo do próprio Windows.
  Ele faz o backup e gera um arquivo de log, que no final tem linhas do
  seguinte tipo:
 
  Backup completed on 06/08/2011 at 05:11.
  Directories: 55894
  Files: 199166
  Bytes: 103.522.032.192
  Time:  5 hours,  55 minutes, and  19 seconds
 
  --
 
  Esse arquivo é gerado no diretório de logs no servidor Windows 2003.
  Então, o que eu preciso é de um plugin que acesse o servidor Wiondows
  remoto, leia essas últimas linhas, analise se o backup foi feito com
 sucesso
  e mande pro Nagios o resultado.
 
  Alguém tem idéia de como fazer?
  Lembrando que tenho que acessar o servidor remoto Windows a partir do
  servidor Nagios.
 

[Nagios-users] Special characters

2011-08-22 Thread Mark Campbell
I am trying to set a special character in a variable called $USER12$.   
This is then used in a command definition  check_blah -H $HOSTADDRESS$ 
-u $USER11$ -p $USER12$ -l hello -s read -w $ARG1$ -c $ARG2$


The Var definition looks like this   $USER12$=s1t\\@Home


I have also tried s1t\@Home and 's1t@Home'  and s1t@Home.  All have 
failed.

Has anyone made this work in the past?

Thanks

Mark



--
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null


Re: [Nagios-users] Special characters

2011-08-22 Thread Marc Deop i Argemí
On 22/08/2011 16:43, Mark Campbell wrote:
 I have also tried s1t\@Home and 's1t@Home'  and s1t@Home.  All have 
 failed.
what exactly has failed?

And what's exactly what you are trying to get into the variable?

--
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null


Re: [Nagios-users] Special characters

2011-08-22 Thread Allan Clark
On Mon, Aug 22, 2011 at 07:43, Mark Campbell mcc...@psu.edu wrote:
 I am trying to set a special character in a variable called $USER12$.
 This is then used in a command definition  check_blah -H $HOSTADDRESS$
 -u $USER11$ -p $USER12$ -l hello -s read -w $ARG1$ -c $ARG2$


 The Var definition looks like this   $USER12$=s1t\\@Home


 I have also tried s1t\@Home and 's1t@Home'  and s1t@Home.  All have
 failed.

 Has anyone made this work in the past?

It's difficult to know what you're actually trying to get as the value
-- are you trying for a value with \@ or @ in it, for example?

This may be a case of the layers of scripting and passing -- the
various escaping might get ripped off at each layer.  In that case,
the following debugging wrapper might add another layer to work with,
but it might help show what's actually getting use in your plugin
call, which can help you randomize to find the right value:

http://www.waggy.at/nagios/capture_plugin.htm

Allan


-- 
all...@chickenandporn.com  金鱼 http://linkedin.com/in/goldfish

--
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null

Re: [Nagios-users] Special characters

2011-08-22 Thread Mark Campbell
I am trying to pass s1t@Home (or at least something similar)  to a 
check_blah script.





On 8/22/2011 12:16 PM, Marc Deop i Argemí wrote:
 On 22/08/2011 16:43, Mark Campbell wrote:
 I have also tried s1t\@Home and 's1t@Home'  and s1t@Home.  All have
 failed.
 what exactly has failed?

 And what's exactly what you are trying to get into the variable?

 --
 uberSVN's rich system and user administration capabilities and model
 configuration take the hassle out of deploying and managing Subversion and
 the tools developers use with it. Learn more about uberSVN and get a free
 download at:  http://p.sf.net/sfu/wandisco-dev2dev
 ___
 Nagios-users mailing list
 Nagios-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/nagios-users
 ::: Please include Nagios version, plugin version (-v) and OS when reporting 
 any issue.
 ::: Messages without supporting info will risk being sent to /dev/null



--
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null


Re: [Nagios-users] Special characters

2011-08-22 Thread Mark Campbell
So trying to get s1t@Home (or something similar with an @ symbol in it) 
to a check_blah command.




On 8/22/2011 12:33 PM, Allan Clark wrote:
 On Mon, Aug 22, 2011 at 07:43, Mark Campbellmcc...@psu.edu  wrote:
 I am trying to set a special character in a variable called $USER12$.
 This is then used in a command definition  check_blah -H $HOSTADDRESS$
 -u $USER11$ -p $USER12$ -l hello -s read -w $ARG1$ -c $ARG2$


 The Var definition looks like this   $USER12$=s1t\\@Home


 I have also tried s1t\@Home and 's1t@Home'  and s1t@Home.  All have
 failed.

 Has anyone made this work in the past?
 It's difficult to know what you're actually trying to get as the value
 -- are you trying for a value with \@ or @ in it, for example?

 This may be a case of the layers of scripting and passing -- the
 various escaping might get ripped off at each layer.  In that case,
 the following debugging wrapper might add another layer to work with,
 but it might help show what's actually getting use in your plugin
 call, which can help you randomize to find the right value:

 http://www.waggy.at/nagios/capture_plugin.htm

 Allan





--
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null


[Nagios-users] $NOTIFICATIONRECIPIENTS$ macro contents inaccurate

2011-08-22 Thread Paul M. Dubuc
Nagios 3.2.3 documentation says the notification macro:

$NOTIFICATIONRECIPIENTS$ is A comma-separated list of the short names of all 
contacts that are being notified about the host or service.

Instead this macro contains all contacts for the host or service regardless of 
whether the particular notification is actually being sent to them.  I have 
one contact for all services that only gets CRITICAL (c) notifications 
according to its service_notification_options setting, but the 
$NOTIFICATIONRECIPIENTS$ macro includes this contact along with others that 
get WARNING notifications when the WARNING notification is sent.  This would 
imply that the critical only contact also got the notification but this isn't 
true.

Paul Dubuc

--
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null


Re: [Nagios-users] Special characters

2011-08-22 Thread Michel van der Voort
I beleive it just as simple as putting ' and ' before and after the whole 
character string
I've also used this with check_nt and servicenames with $ sign in it

Verstuurd vanaf mijn iPhone

Op 22 aug. 2011 om 19:16 heeft Mark Campbell mcc...@psu.edu het volgende 
geschreven:

 So trying to get s1t@Home (or something similar with an @ symbol in it) 
 to a check_blah command.
 
 
 
 
 On 8/22/2011 12:33 PM, Allan Clark wrote:
 On Mon, Aug 22, 2011 at 07:43, Mark Campbellmcc...@psu.edu  wrote:
 I am trying to set a special character in a variable called $USER12$.
 This is then used in a command definition  check_blah -H $HOSTADDRESS$
 -u $USER11$ -p $USER12$ -l hello -s read -w $ARG1$ -c $ARG2$
 
 
 The Var definition looks like this   $USER12$=s1t\\@Home
 
 
 I have also tried s1t\@Home and 's1t@Home'  and s1t@Home.  All have
 failed.
 
 Has anyone made this work in the past?
 It's difficult to know what you're actually trying to get as the value
 -- are you trying for a value with \@ or @ in it, for example?
 
 This may be a case of the layers of scripting and passing -- the
 various escaping might get ripped off at each layer.  In that case,
 the following debugging wrapper might add another layer to work with,
 but it might help show what's actually getting use in your plugin
 call, which can help you randomize to find the right value:
 
 http://www.waggy.at/nagios/capture_plugin.htm
 
 Allan
 
 
 
 
 
 --
 uberSVN's rich system and user administration capabilities and model 
 configuration take the hassle out of deploying and managing Subversion and 
 the tools developers use with it. Learn more about uberSVN and get a free 
 download at:  http://p.sf.net/sfu/wandisco-dev2dev
 ___
 Nagios-users mailing list
 Nagios-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/nagios-users
 ::: Please include Nagios version, plugin version (-v) and OS when reporting 
 any issue. 
 ::: Messages without supporting info will risk being sent to /dev/null

--
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null


Re: [Nagios-users] problem with checks being rescheduled outside their timeperiod

2011-08-22 Thread Brian Murphy
Hmmm well I have found my problem but have not got a solution.

NTP is changing the time on the system, and then

[1313911134.718762] [001.0] [pid=14714] compensate_for_system_time_change() 
start
[1313911134.718767] [008.0] [pid=14714] Detected a backwards time change of 0d 
0h 0m 1s.
[1313911134.718833] [001.0] [pid=14714] adjust_timestamp_for_time_change()
[1313911134.718841] [001.0] [pid=14714] adjust_timestamp_for_time_change()

the adjust_timestamp_for_time_change() (in events.c) does not check the 
timeperiod for the check, it just applies the time change to it, therefore 
often moving it out of its timeperiod and causing it not to run, and to be 
rescheduled for the next day.

[1313504998.099400] [016.0] [pid=2285] Attempting to run scheduled check of 
service 'DAILY JOB' on host 'host': check options=0, latency=0.099000
[1313504998.099408] [001.0] [pid=2285] run_async_service_check()
[1313504998.099412] [001.0] [pid=2285] check_service_check_viability()
[1313504998.099417] [001.0] [pid=2285] check_time_against_period()
[1313504998.099439] [016.2] [pid=2285] This is not a valid time for this 
service to be actively checked.
[1313504998.099445] [001.0] [pid=2285] check_service_dependencies()
[1313504998.099451] [016.1] [pid=2285] Unable to run scheduled service check at 
this time
[1313504998.099455] [001.0] [pid=2285] get_next_valid_time()
[1313504998.099459] [001.0] [pid=2285] check_time_against_period()
[1313504998.099471] [001.0] [pid=2285] check_time_against_period()
[1313504998.099484] [016.1] [pid=2285] Rescheduled next service check for Thu 
Aug 18 02:30:00 2011

that is the next day, that 02:30:00 time is going outside the timeperiod if 
there is a second lost in the next 24 hours too.

There seems to be something unrequired here, the checks have been scheduled for 
a time time x, the real time, time y, has been adjusted but we still want the 
check to run at time x! Or to catch up as much as required running checks 
scheduled in the new past!

Anyway, apart from not having the Virtual time move around on me, has anyone 
got any suggestions to stop the time rescheduling going outside the timeperiods?

Brian
-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de

--
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null