Custom Service Configuration


#1

Hello All.
I have a short question: I have plugin, which runs longer than service_check_timeout=60. It takes almost 100% CPU, when it’s running. I want to run it only once a day in the midnight. Is this ok?

define timeperiod{ timeperiod_name once-a-day alias Once a Day sunday-monday 00:00-00:10 ; } define service { use local-service host_name localhost service_description My Service check_command test_service check_period once-a-day check_interval 8 }


#2

I have some doubts as to whether that will do what you want it to consistently as the nagios check sheduling seems a little too ‘fluid’ to ensure you can always fire off such a check at midnight… I suggest you might want to consider running your check through an external script which is called via Cron instead, and submit the result passively. Take a look at
nagios.sourceforge.net/docs/3_0/ … hecks.html

HTH

/S


#3

I need to edit only cfg file. I don’t want to add anything to Cron. I’m running Nagios Server and A few Clients. I want to run Sercive oly once at a 00:00 on CLIENT Side. Client sends me info about his state through nsca already. Maybe Should I change configs to:

define timeperiod{ timeperiod_name once-a-day alias Once a Day sunday-monday 00:00-00:30 } define service { use local-service host_name localhost service_description My Service check_command test_service check_period once-a-day check_interval 15 }

I can run it max two times. And I also should propabry chane service_check_timeout to at least 120.


#4

I did it in this way and it’s working :slight_smile:

define service{ use local-service host_name localhost service_description HIFLEX: number of crashes check_command hiflex_check_crashes check_period once-a-day check_interval 20 } define timeperiod{ timeperiod_name once-a-day alias Once a Day monday 23:00-23:59 tuesday 23:00-23:59 wednesday 23:00-23:59 thursday 23:00-23:59 friday 23:00-23:59 saturday 23:00-23:59 sunday 23:00-23:59 }