• Willkommen im Linux Club - dem deutschsprachigen Supportforum für GNU/Linux. Registriere dich kostenlos, um alle Inhalte zu sehen und Fragen zu stellen.

Timeperiods in Nagios scheinen nicht richtig zu funktioniere

byron1778

Hacker
Hallo Forum,

leider weiss ich nicht, ob ich hier richtig bin, deswegen bitte verschieben, falls es so sein sollte!

Mein Problem waere:

Ich habe einen Nagios-Server, der checks durchfuehrt fuer gewisse Prozesse, ob sie laufen.
Diese Checks sollten aber nur Montag - Freitag laufen, jedoch habe ich gesehen, dass im Nagios auch Samstag und Sonntag ploetzlich "Uknown Input data" auftritt.
Aber am Wochenende sollten ja lt. Definition keine Checks auftreten.

Kann es sein, wenn das erste Template ( Montag - Freitag ) nicht zutrifft, er das allgemeine Template 7x24h dann verwendet?
bzw. kann ich in der commands Datei ihm das explizite zu verwendende Template mitgeben?

Wenn ja, wie kann ich es bewerkstelligen, dass das Problem nicht mehr auftritt?

Ich moechte nur, dass dieser eine Check von Mo - Fr laeuft, alles andere aber wie gehabt bleibt.

Wenn mir jemand weiterhelfen koennte, danke vielmals!

Code:
services

define service{
use                             generic-service
host_name                       orc1
service_description             E2E OP log probe
notification_period             ope2e_hours
check_period                    ope2e_hours
check_command                   ope2elog_probe
contact_groups                  vbcgrp-mail,trading-sms

timeperiods

define timeperiod{
timeperiod_name ope2e_hours
alias           op_e2e Processtime
monday          08:40-17:50
tuesday         08:40-17:50
wednesday       08:40-17:50
thursday        08:40-17:50
friday          08:40-17:50
}

24x7

define timeperiod{
timeperiod_name 24x7
alias           24 Hours A Day, 7 Days A Week
sunday          00:00-24:00
monday          00:00-24:00
tuesday         00:00-24:00
wednesday       00:00-24:00
thursday        00:00-24:00
friday          00:00-24:00
saturday        00:00-24:00
}

commands

define command {
command_name    ope2elog_probe
command_line    /ITdesign/plugins/itd_check_value.pl -h $HOSTADDRESS$ -s '$SERVICEDESC$' -Cmd '/usr/nagios/check_ope2elog.sh' -q "" -t ssh -w OFF -c eq0 -OkText 'HEJ464 is logged in.' -CriticalText 'HEJ464 is NOT logged in to op_e2e!'
}
 

Leviathan

Hacker
Probiers mal mit:

timeperiod_name ope2e_hours
alias op_e2e Processtime
monday 08:40-17:50
tuesday 08:40-17:50
wednesday 08:40-17:50
thursday 08:40-17:50
friday 08:40-17:50
saturday none
sunday none
}

Gruß Dominik
 
OP
B

byron1778

Hacker
Hallo,

wenn ich es versuche mit Saturday and Sunday zu definieren, dann bekomme ich folgende Fehlermeldung:



  • Error: Could not add timerange for day 6 to timeperiod (No start time minutes) (config file '/usr/local/nagios/etc/timeperiods.cfg', starting on line 77)

Vll. haengt die Fehlermeldung mit der Nagios Version zusammen, ich hab noch die 2er Version ?!?!?!
Vll. noch eine andere Idee, wie ich Nagios davon abhalten kann fuer diesen einen bestimmten Prozess Checks am Wochenende durchzufuehren.
Dieser Check verfaelscht mir leider alle Tatsachen, hab staendig Service Unknown fuer einen bestimmten Zeitraum, heir besonders am Wochenende und von 22:00 - 24:00

Gruss
Bernd
 

whois

Ultimate Guru
Hi Bernd

Hast du die den Config File mal angesehen.
Code:
config file '/usr/local/nagios/etc/timeperiods.cfg', starting on line 77

Beziehungsweise stell ihn doch mal ins Forum.

http://www.nagios-wiki.de/nagios/doku3/timeperiods?rev=1201293670
http://www.it-administrator.de/fachartikel/24429.html

cu
 
OP
B

byron1778

Hacker
Hallo,

hier einmal das Config File



  • define timeperiod{
    timeperiod_name 24x7
    alias 24 Hours A Day, 7 Days A Week
    sunday 00:00-24:00
    monday 00:00-24:00
    tuesday 00:00-24:00
    wednesday 00:00-24:00
    thursday 00:00-24:00
    friday 00:00-24:00
    saturday 00:00-24:00
    }

    define timeperiod{
    timeperiod_name workhours
    alias Normal worktime
    monday 07:30-16:30
    tuesday 07:30-16:30
    wednesday 07:30-16:30
    thursday 07:30-17:30
    friday 07:30-16:00
    }
    define timeperiod{
    timeperiod_name morninghour
    alias Morning hour
    monday 07:30-08:30
    tuesday 07:30-08:30
    wednesday 07:30-08:30
    thursday 07:30-08:30
    friday 07:30-08:30
    }
    define timeperiod{
    timeperiod_name e2ehours
    alias E2E worktime
    monday 08:00-19:30
    tuesday 08:00-19:30
    wednesday 08:00-19:30
    thursday 08:00-19:30
    friday 08:00-19:30
    }
    define timeperiod{
    timeperiod_name ope2e_hours
    alias op_e2e Processtime
    monday 08:40-17:50
    tuesday 08:40-17:50
    wednesday 08:40-17:50
    thursday 08:40-17:50
    friday 08:40-17:50
    }
    define timeperiod{
    timeperiod_name orc_cpuhours
    alias Orc CPU normaltime
    monday 07:35-20:00
    tuesday 07:35-20:00
    wednesday 07:35-20:00
    thursday 07:35-20:00
    friday 07:35-20:00
    }
    define timeperiod{
    timeperiod_name orc_hours
    alias Orc Processtime
    monday 07:00-22:00
    tuesday 07:00-22:00
    wednesday 07:00-22:00
    thursday 07:40-22:00
    friday 07:40-22:00
    }
    define timeperiod{
    timeperiod_name otob_hours
    alias Oetob Processtime
    monday 07:01-20:00
    tuesday 07:01-20:00
    wednesday 07:01-20:00
    thursday 07:01-20:00
    friday 07:01-20:00
    }
    define timeperiod{
    timeperiod_name orcgw_hours
    alias OrcGW Processtime
    monday 07:50-18:15
    tuesday 07:50-18:15
    wednesday 07:50-18:15
    thursday 07:50-18:15
    friday 07:50-18:15
    }
    define timeperiod{
    timeperiod_name euwax_hours
    alias Euwax Processtime
    monday 08:00-18:00
    tuesday 08:00-18:00
    wednesday 08:00-18:00
    thursday 08:00-18:00
    friday 08:00-18:00
    }
    define timeperiod{
    timeperiod_name eurex_hours
    alias Eurex Processtime
    monday 07:40-22:00
    tuesday 07:40-22:00
    wednesday 07:40-22:00
    thursday 07:40-22:00
    friday 07:40-22:00
    }
    define timeperiod{
    timeperiod_name bhs_hours
    alias BHS Processtime
    monday 08:50-16:00
    tuesday 08:50-16:00
    wednesday 08:50-16:00
    thursday 08:50-16:00
    friday 08:50-16:00
    }
    define timeperiod{
    timeperiod_name seb_hours
    alias SEB Processtime
    monday 08:30-20:00
    tuesday 08:30-20:00
    wednesday 08:30-20:00
    thursday 08:30-20:00
    friday 08:30-20:00
    }
    define timeperiod{
    timeperiod_name atlantik_hours
    alias Atlantik FIX Processtime
    monday 09:15-15:00
    tuesday 09:15-15:00
    wednesday 09:15-15:00
    thursday 09:15-15:00
    friday 09:15-15:00
    }
    define timeperiod{
    timeperiod_name ba_hours
    alias BA Processtime
    monday 08:05-20:00
    tuesday 08:05-20:00
    wednesday 08:05-20:00
    thursday 08:05-20:00
    friday 08:05-20:00
    }

Bezueglich der Fehlermeldung habe ich folgendes gefunden.
Bei den Versionen Nagios 2.x gibt es noch kein Saturday none und dergleichen, erst ab Version 3.
Ich verwende leider Version 2, Update leider nicht erlaubt ...

mfg
 

whois

Ultimate Guru
Hi

Ich habe lange nicht mehr an einem Nagios gearbeitet aber vielleicht bringt dich dieser Link etwas weiter.
Dort hat ein jemand eine Definition "notworktime" angelegt.
Vielleicht funktioniert das auch bei der der 2er Version.
In dem Config File sehe ich jedenfalls im Moment keinen Fehler.

http://www.nagios-portal.de/wbb/index.php?page=Thread&threadID=6268

cu
 

whois

Ultimate Guru
byron1778 schrieb:
Ok, danke, dann werde ich einmal schauen, ob mir das weiterhilft!

Wirklich schade das du nicht updaten darfst in Nagios3 ist einiges leichter geworden auch das definieren von Ausnahmen. :?
http://www.nagios-wiki.de/nagios/tips/ausnahmen_in_timeperiods_definieren?s=timeperiods

Na ich hoffe das bringt dich deinem Ziel etwas näher.
 
OP
B

byron1778

Hacker
Ja leider, mit Nagios 3 habe ich schon gearbeitet, habe es auch schon vorgeschlagen upzudaten, aber wurde abgelehnt leider.
Mal schaun, was ich aus den Informationen so herausholen kann.
Das Ganze ist schon so verschachtelt, wenn man an einer Schraube dreht, dann bewegt sich irgendwo anders ploetzlich etwas.

Danke Dir vielmals
 
Oben