Reoccurring scheduled downtime - Core 3.2.3

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
bud21
Posts: 10
Joined: Fri Jan 31, 2014 8:56 am

Re: Reoccurring scheduled downtime - Core 3.2.3

Post by bud21 »

Hi slansing,

Thanks for confirming where to put the cron.

The problem is I don't know how to write the cron to initiate the scheduled downtime so no notifications are sent for a specific host during the 2 hour window so any help or even an example of what this cron should look like would be very much appreciated.

Thanks,

Bud21
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Reoccurring scheduled downtime - Core 3.2.3

Post by abrist »

Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
bud21
Posts: 10
Joined: Fri Jan 31, 2014 8:56 am

Re: Reoccurring scheduled downtime - Core 3.2.3

Post by bud21 »

Hi abrist,

Thanks again for your replies and for those links! They have scared the hell out of me!

Link two probably is the one that would suit our environment as I am used to editing the sdp_host file and the sdp_services file when I want to add or remove a server from Nagios

Ok, now down to business!! I'd like to schedule downtime for a server called Ladon from 5:30am to 7:30 am every Monday morning so could you please point out to me which part of the schedule_host_downtime.txt file I need to edit to fulfil my requirements and do I then copy that file to the to the cron.weekly folder for it to work.

Do I need to do anything with the schedule_svc_downtime.txt file or will the schedule_host_downtime.txt file be sufficient?

There is a lot of lines in that schedule_host_downtime.txt file and I'm not really sure which bits of the file is the lines that I need to edit to put in my details to allow the scheduled downtime to work so again a bit of further guidance would be very much appreciated.

Sorry for being so naive with this, it really is a big learning curve for me.

Thanks again,

Bud21
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Reoccurring scheduled downtime - Core 3.2.3

Post by slansing »

Hey bud,

Link two contains both a shell script for hosts and services, if you run them on your Nagios server they should output usage that will guide you in what you need to do, you can also open them up and see that same usage held within 'echo's'.

e.g: Usage: $0 <hostname> <service desc> <start time> <end time> <fixed> <duration> <user> <comment>"
bud21
Posts: 10
Joined: Fri Jan 31, 2014 8:56 am

Re: Reoccurring scheduled downtime - Core 3.2.3

Post by bud21 »

Hi slansing,

Thanks for your reply!

To be honest I'd be afraid to run those script jobs on the Nagios server in case it stops the system running or causes issues with the current config.

I'll maybe ask about here and see can I get someone with more Unix/Linux experience to look at the scripts with me and see can we progress my requirement.

Any other ideas welcome thought!

Thanks again everyone for all of your help with this one.

Regards,

Bud21
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Reoccurring scheduled downtime - Core 3.2.3

Post by slansing »

Sure! If you need help with them let us know, we all like getting our hands dirty with bash now and then, it is likely easier than you think!
bud21
Posts: 10
Joined: Fri Jan 31, 2014 8:56 am

Re: Reoccurring scheduled downtime - Core 3.2.3

Post by bud21 »

Thanks slansing, much appreciated!

Basically my problem is I don't know how to edit the 2 given files to fulfil my requirements, which are: -

* A server called Ladon
* Is going to be rebooted every Monday morning
* At 05:30, so I need the 2 files edited so that every Monday morning a scheduled downtime is in place on the Nagios server, say fixed for 2 hours from 05:20 to 07:20 so alerts aren't produced when the server reboots.

I would be most grateful if you would, as you say get your hands dirty and could construct the two files for me so the above requirements are met and I can pop it onto the cron.weekly folder and test it.

I hope this isn't asking too much and would very much appreciate your help.

Thanks,

Bud21
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Reoccurring scheduled downtime - Core 3.2.3

Post by slansing »

I'm sorry, but that's not something we do on the support side.... If you really want to have someone build them for you, you can contact [email protected] to see if we can do it, though fair warning we probably won't as custom development is generally only done for Nagios XI customers. Besides, the learning process from creating your first few shell scripts is great!
bud21
Posts: 10
Joined: Fri Jan 31, 2014 8:56 am

Re: Reoccurring scheduled downtime - Core 3.2.3

Post by bud21 »

Fair enough slansing - I'll see how I get on and hope I don't break anything when I execute the files on the Nagios server !!

Thanks again for all of your help,

Regards,

Bud21
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Reoccurring scheduled downtime - Core 3.2.3

Post by slansing »

It's always a good idea to set up a testing VM and snapshot it, so if you break anything, it's not in production, and you can reliably revert. :)
Locked