Recurring downtime scheduling for wrong dates

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Fred Kroeger
Posts: 588
Joined: Wed Oct 19, 2011 11:36 pm
Location: Perth, Western Australia
Contact:

Re: Recurring downtime scheduling for wrong dates

Post by Fred Kroeger »

Hmm... soemthing has changed since last week - I now get a message showing that the Downtime request was successful - however it still doesn't get scheduled.

The user account I was testing with had Admin Privileges, so I logged in with a User Account with Advanced Features and tried to schedule Downtime again.
Same problem - even though it says it added it successfully, it did not schedule it.

As all my user accounts are configured for DD-MM-YYYY, I then tried Willems suggestion and changed the User account with Advanced Features to use YYYY-MM-DD and I can confirm that the Scheduled downtime now works!

Note that during my testing, I never tried to change the date/time of the downtime - I always used the default 2 hrs.

Thinking out aloud here, one of the differences from last week is that the date I tried was 29th Jan (29/01/16) and today is 1st Feb (01/02/16).
I know that in the US you show MM-DD-YYYY , so if you have swapped around the days & months, 29/01 would have been an illegal date where as today , 01/02 is a legal date (2nd Jan in US).
So this may explain why last week it showed that it was unsuccessful and today it shows as successful (even though it doesn't schedule it).

So the problem definitely is related to the User Date format setting. On a related note, this has always bugged me that even though our users are configured for DD-MM-YYYY, the setting & displaying of downtime is always in the YYYY-MM-DD format.

Willem - Many thanks for your help here
Ludmil - looks like you have some more info for your testing.

regards... Fred
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Recurring downtime scheduling for wrong dates

Post by tgriep »

Can you provide a screen capture of the Admin > System Settings screen after clicking on the User Defaults tab and post it here?
Also, can you go to Admin > Manage users, edit the user account and provide a screen capture of that screen?

I tried to recreate what you are seeing with the date format settings but couldn't do so.
Can you provide the process you used to create the error?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Fred Kroeger
Posts: 588
Joined: Wed Oct 19, 2011 11:36 pm
Location: Perth, Western Australia
Contact:

Re: Recurring downtime scheduling for wrong dates

Post by Fred Kroeger »

I have tried scheduling downtime direct from the Scheduled Downtime link in the main menu and also from the host itself via the Advanced Tab on the Host details screen.
Both fail to add the scheduled downtime if the user account has DD-MM-YYYY in their settings. I proved this by then changing the date setting for that user to MM-DD-YYYY and I was able to schedule downtime successfully.

As to the error message (Invalid Command submitted) , that occurred at the end of last month with a user set for DD-MM-YYYY. This week (new month) the error message does not appear even though the downtime still fails to be scheduled - so I would suggest this is not related. If my theory above is correct, then the Error Message will reappear from the 13th Feb onwards.
User-Defaults.PNG
This is the user account - if I change the date settings to MM-DD-YYYY, then I am able to schedule downtime
User1-Settings.PNG
You do not have the required permissions to view the files attached to this post.
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Recurring downtime scheduling for wrong dates

Post by WillemDH »

Tom,

This is a known bug. Ask Sean.

Grtz

Willem
Nagios XI 5.8.1
https://outsideit.net
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Recurring downtime scheduling for wrong dates

Post by tgriep »

The date format bug should of been fixed in XI 5.2.3 but the incorrect day of the month should be in the next version.

On my 5.2.3 system, I set the system and user date format to DD-MM-YYYY and it scheduled downtime just fine.
I didn't specify a day of the month but it worked.

Fred, can you do a simple test by setting the date format to DD-MM-YYYY and schedule a host or service for 10 minutes of recurring downtime and see if that works for you?
If it fails, can you post this log file?

Code: Select all

/usr/local/nagiosxi/var/recurringdowntime.log
Be sure to check out our Knowledgebase for helpful articles and solutions!
Fred Kroeger
Posts: 588
Joined: Wed Oct 19, 2011 11:36 pm
Location: Perth, Western Australia
Contact:

Re: Recurring downtime scheduling for wrong dates

Post by Fred Kroeger »

Sorry - we've got our wires crossed here.... This is not a problem with Recurring Downtime - it is a problem with Scheduled downtime
That's my fault for hijackng my own thread..... I only added this problem as an enquiry if the patch that you supplied for recurring downtime had caused this problem with scheduled downtime.

But according to Willem - this is a known bug - thanks Willem for jumping in.
So the next question is .... what is being done about this - because all my users here are configured for DD-MM-YYYY

regards.. Fred
Fred Kroeger
Posts: 588
Joined: Wed Oct 19, 2011 11:36 pm
Location: Perth, Western Australia
Contact:

Re: Recurring downtime scheduling for wrong dates

Post by Fred Kroeger »

Definitely a bug
I'm set for DD-MM-YYYY - when I go to schedule downtime it shows the right format for today - 04/02/2016
If I change the date to 02/04/2016 then it will schedule it for today.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Recurring downtime scheduling for wrong dates

Post by tgriep »

Thanks, I thought I was going nuts. Sorry for the confusion on my part.
That bug looks like it will be fixed in the next release of XI.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Recurring downtime scheduling for wrong dates

Post by WillemDH »

Fred,

You could try this sql query to update the date format for all users. (I got it from Sean) It's only a temporary workaroound of course, but at least yor users can schedule downtime again..

But please know that I can't guarantee it works for you. Use at own risk. Test first on a QA server... Snapshot your server before you try this.. Make sure you have a recent backup... You probably know the drill.. ;)

Start by logging into mysql with:

Code: Select all

psql nagiosxi nagiosxi
List all Nagios XI Users

Code: Select all

select * from xi_users;
Show the date_format data in xi_usermeta

Code: Select all

select * from xi_usermeta where keyname = 'date_format';
usermeta_id | user_id | keyname | keyvalue | autoload
-------------+---------+-------------+----------+----------
405 | 18 | date_format | 3 | 1
455 | 50 | date_format | 1 | 1

Update all date_format records to YYYY-MM-DD

Code: Select all

update xi_usermeta set keyvalue = '1' where keyname = 'date_format';
EDIT: I noticed the 'code' doesn't show the _ in date format. Make sure you use 'date_format'

Or you could wait for the patch.

Grtz

Willem
Nagios XI 5.8.1
https://outsideit.net
Fred Kroeger
Posts: 588
Joined: Wed Oct 19, 2011 11:36 pm
Location: Perth, Western Australia
Contact:

Re: Recurring downtime scheduling for wrong dates

Post by Fred Kroeger »

Thanks for the workaround Willem.
However, I'm going to have to wait for the fix.

regards... Fred
Locked