Page 2 of 3

Re: schedule downtime issue

Posted: Wed Feb 03, 2016 6:37 pm
by slater86
Logged in this morning to cause some more errors in log files and have discovered the downtime now mysteriously works as expected on both machines....bizarre (they're not even at the same site).

Big thanks everyone for your help.

--Matt

For the sake of completeness (and in case it helps anyone else), here are the only changes that have been made to both boxes over the last week (as far back as the log rotation goes).

[root@daihatsu ~]# cat /var/log/yum.log
Jan 27 12:52:42 Updated: 1:openssl-libs-1.0.1e-51.el7_2.2.x86_64
Jan 27 12:52:42 Updated: openssh-6.6.1p1-23.el7_2.x86_64
Jan 27 12:52:42 Updated: libldb-1.1.20-1.el7_2.2.x86_64
Jan 27 12:52:42 Updated: samba-libs-4.2.3-11.el7_2.x86_64
Jan 27 12:52:42 Updated: samba-common-tools-4.2.3-11.el7_2.x86_64
Jan 27 12:52:42 Updated: samba-common-4.2.3-11.el7_2.noarch
Jan 27 12:52:42 Updated: libwbclient-4.2.3-11.el7_2.x86_64
Jan 27 12:52:43 Updated: samba-client-libs-4.2.3-11.el7_2.x86_64
Jan 27 12:52:43 Updated: samba-common-libs-4.2.3-11.el7_2.x86_64
Jan 27 12:52:43 Updated: ntpdate-4.2.6p5-22.el7.centos.1.x86_64
Jan 27 12:52:43 Updated: nss-3.19.1-19.el7_2.x86_64
Jan 27 12:52:43 Updated: nss-sysinit-3.19.1-19.el7_2.x86_64
Jan 27 12:52:43 Updated: 1:grub2-tools-2.02-0.34.el7.centos.x86_64
Jan 27 12:52:43 Updated: kernel-tools-libs-3.10.0-327.4.5.el7.x86_64
Jan 27 12:52:43 Updated: libidn2-0.10-2.el7.x86_64
Jan 27 12:52:43 Updated: jwhois-4.0-44.el7.x86_64
Jan 27 12:52:43 Updated: kernel-tools-3.10.0-327.4.5.el7.x86_64
Jan 27 12:52:43 Updated: 1:grub2-efi-2.02-0.34.el7.centos.x86_64
Jan 27 12:52:44 Updated: nss-tools-3.19.1-19.el7_2.x86_64
Jan 27 12:52:44 Updated: ntp-4.2.6p5-22.el7.centos.1.x86_64
Jan 27 12:52:44 Updated: samba-4.2.3-11.el7_2.x86_64
Jan 27 12:52:44 Updated: openssh-server-6.6.1p1-23.el7_2.x86_64
Jan 27 12:52:44 Updated: openssh-clients-6.6.1p1-23.el7_2.x86_64
Jan 27 12:52:44 Updated: 1:openssl-devel-1.0.1e-51.el7_2.2.x86_64
Jan 27 12:52:44 Updated: 1:openssl-1.0.1e-51.el7_2.2.x86_64
Jan 27 12:52:44 Updated: kernel-headers-3.10.0-327.4.5.el7.x86_64
Jan 27 12:52:45 Updated: gnutls-3.3.8-14.el7_2.x86_64
Jan 27 12:52:48 Installed: kernel-3.10.0-327.4.5.el7.x86_64
Jan 27 12:52:48 Updated: python-perf-3.10.0-327.4.5.el7.x86_64
Jan 28 09:39:27 Installed: mlocate-0.26-5.el7.x86_64
Feb 02 10:39:32 Updated: 32:bind-license-9.9.4-29.el7_2.2.noarch
Feb 02 10:39:32 Updated: 32:bind-libs-9.9.4-29.el7_2.2.x86_64
Feb 02 10:39:32 Updated: 32:bind-utils-9.9.4-29.el7_2.2.x86_64
Feb 02 10:39:32 Updated: 32:bind-libs-lite-9.9.4-29.el7_2.2.x86_64

Here are the outputs requested but I'm not sure how useful they are now (also substituted for mariadb).

[root@daihatsu ~]# echo 'select * from nagios_scheduleddowntime ;' | mysql -t -pnagiosxi nagios
+----------------------+-------------+---------------+-----------+---------------------+-------------+------------------------------------+----------------------+-----------------+----------+----------+----------------------+---------------------+-------------+---------------------+------------------------+
| scheduleddowntime_id | instance_id | downtime_type | object_id | entry_time | author_name | comment_data | internal_downtime_id | triggered_by_id | is_fixed | duration | scheduled_start_time | scheduled_end_time | was_started | actual_start_time | actual_start_time_usec |
+----------------------+-------------+---------------+-----------+---------------------+-------------+------------------------------------+----------------------+-----------------+----------+----------+----------------------+---------------------+-------------+---------------------+------------------------+
| 9209 | 1 | 1 | 371 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 1 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9208 | 1 | 1 | 385 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 2 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9207 | 1 | 1 | 403 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 3 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9206 | 1 | 1 | 387 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 4 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9205 | 1 | 1 | 400 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 5 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9204 | 1 | 1 | 388 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 6 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9203 | 1 | 1 | 373 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 7 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9202 | 1 | 1 | 498 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 8 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9201 | 1 | 1 | 409 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 9 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9200 | 1 | 1 | 410 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 10 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9199 | 1 | 1 | 411 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 11 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9198 | 1 | 1 | 412 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 12 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9197 | 1 | 1 | 413 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 13 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9196 | 1 | 1 | 414 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 14 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9195 | 1 | 1 | 415 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 15 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9194 | 1 | 1 | 416 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 16 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9193 | 1 | 1 | 417 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 17 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9192 | 1 | 1 | 418 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 18 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9191 | 1 | 1 | 419 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 19 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9190 | 1 | 1 | 420 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 20 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9189 | 1 | 1 | 421 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 21 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9188 | 1 | 1 | 422 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 22 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9187 | 1 | 1 | 423 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 23 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9186 | 1 | 1 | 424 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 24 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9185 | 1 | 1 | 425 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 25 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9184 | 1 | 1 | 386 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 26 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9183 | 1 | 1 | 408 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 27 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9182 | 1 | 1 | 407 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 28 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9181 | 1 | 1 | 370 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 29 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9180 | 1 | 1 | 389 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 30 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9179 | 1 | 1 | 406 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 31 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9178 | 1 | 1 | 394 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 32 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9177 | 1 | 1 | 426 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 33 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9176 | 1 | 1 | 427 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 34 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9175 | 1 | 1 | 395 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 35 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9174 | 1 | 1 | 384 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 36 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9173 | 1 | 1 | 398 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 37 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9172 | 1 | 1 | 372 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 38 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9171 | 1 | 1 | 401 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 39 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9170 | 1 | 1 | 404 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 40 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9169 | 1 | 1 | 397 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 41 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9168 | 1 | 1 | 396 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 42 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9167 | 1 | 1 | 390 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 43 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9166 | 1 | 1 | 393 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 44 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9165 | 1 | 1 | 392 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 45 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9164 | 1 | 1 | 391 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 46 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9163 | 1 | 1 | 405 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 47 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9162 | 1 | 1 | 382 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 48 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9161 | 1 | 1 | 383 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 49 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9160 | 1 | 1 | 378 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 50 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9159 | 1 | 1 | 375 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 51 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9158 | 1 | 1 | 376 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 52 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9157 | 1 | 1 | 379 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 53 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9156 | 1 | 1 | 374 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 54 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9155 | 1 | 1 | 381 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 55 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9154 | 1 | 1 | 380 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 56 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9153 | 1 | 1 | 377 | 2016-01-10 22:23:54 | Matt | Reboot for Windows Patches | 57 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
| 9152 | 1 | 2 | 369 | 2016-01-10 22:24:17 | Matt | Reboot for Windows Patches | 58 | 0 | 1 | 32767 | 2016-10-01 22:23:09 | 2016-11-01 00:30:00 | 0 | 0000-00-00 00:00:00 | 0 |
+----------------------+-------------+---------------+-----------+---------------------+-------------+------------------------------------+----------------------+-----------------+----------+----------+----------------------+---------------------+-------------+---------------------+------------------------+


[root@daihatsu ~]# echo 'desc nagios_scheduleddowntime ;' | mysql -t -pnagiosxi nagios
+------------------------+--------------+------+-----+---------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------------------+--------------+------+-----+---------------------+----------------+
| scheduleddowntime_id | int(11) | NO | PRI | NULL | auto_increment |
| instance_id | smallint(6) | NO | MUL | 0 | |
| downtime_type | smallint(6) | NO | | 0 | |
| object_id | int(11) | NO | | 0 | |
| entry_time | datetime | NO | | 0000-00-00 00:00:00 | |
| author_name | varchar(64) | NO | | | |
| comment_data | varchar(255) | NO | | | |
| internal_downtime_id | int(11) | NO | | 0 | |
| triggered_by_id | int(11) | NO | | 0 | |
| is_fixed | smallint(6) | NO | | 0 | |
| duration | smallint(6) | NO | | 0 | |
| scheduled_start_time | datetime | NO | | 0000-00-00 00:00:00 | |
| scheduled_end_time | datetime | NO | | 0000-00-00 00:00:00 | |
| was_started | smallint(6) | NO | | 0 | |
| actual_start_time | datetime | NO | | 0000-00-00 00:00:00 | |
| actual_start_time_usec | int(11) | NO | | 0 | |
+------------------------+--------------+------+-----+---------------------+----------------+


[root@daihatsu ~]# tail -50 /var/log/mariadb/mariadb.log
Version: '5.5.44-MariaDB' socket: '/var/lib/mysql/mysql.sock' port: 3306 MariaDB Server
160127 13:15:31 [Note] /usr/libexec/mysqld: Normal shutdown

160127 13:15:31 [Note] Event Scheduler: Purging the queue. 0 events
160127 13:15:31 InnoDB: Starting shutdown...
160127 13:15:31 InnoDB: Waiting for 7 pages to be flushed
160127 13:15:32 InnoDB: Shutdown completed; log sequence number 14369364815
160127 13:15:32 [Note] /usr/libexec/mysqld: Shutdown complete

160127 13:15:32 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended
160127 13:15:33 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
160127 13:15:33 [Note] /usr/libexec/mysqld (mysqld 5.5.44-MariaDB) starting as process 15526 ...
160127 13:15:33 InnoDB: The InnoDB memory heap is disabled
160127 13:15:33 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160127 13:15:33 InnoDB: Compressed tables use zlib 1.2.7
160127 13:15:33 InnoDB: Using Linux native AIO
160127 13:15:33 InnoDB: Initializing buffer pool, size = 128.0M
160127 13:15:33 InnoDB: Completed initialization of buffer pool
160127 13:15:33 InnoDB: highest supported file format is Barracuda.
160127 13:15:33 InnoDB: Waiting for the background threads to start
160127 13:15:34 Percona XtraDB (http://www.percona.com) 5.5.43-MariaDB-37.2 started; log sequence number 14369364815
160127 13:15:34 [Note] Plugin 'FEEDBACK' is disabled.
160127 13:15:34 [Note] Server socket created on IP: '0.0.0.0'.
160127 13:15:34 [Note] Event Scheduler: Loaded 0 events
160127 13:15:34 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.5.44-MariaDB' socket: '/var/lib/mysql/mysql.sock' port: 3306 MariaDB Server
160127 13:16:16 [Note] /usr/libexec/mysqld: Normal shutdown

160127 13:16:16 [Note] Event Scheduler: Purging the queue. 0 events
160127 13:16:16 InnoDB: Starting shutdown...
160127 13:16:17 InnoDB: Shutdown completed; log sequence number 14369389336
160127 13:16:17 [Note] /usr/libexec/mysqld: Shutdown complete

160127 13:16:17 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended
160127 13:16:20 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
160127 13:16:20 [Note] /usr/libexec/mysqld (mysqld 5.5.44-MariaDB) starting as process 16760 ...
160127 13:16:20 InnoDB: The InnoDB memory heap is disabled
160127 13:16:20 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160127 13:16:20 InnoDB: Compressed tables use zlib 1.2.7
160127 13:16:20 InnoDB: Using Linux native AIO
160127 13:16:20 InnoDB: Initializing buffer pool, size = 128.0M
160127 13:16:20 InnoDB: Completed initialization of buffer pool
160127 13:16:20 InnoDB: highest supported file format is Barracuda.
160127 13:16:20 InnoDB: Waiting for the background threads to start
160127 13:16:21 Percona XtraDB (http://www.percona.com) 5.5.43-MariaDB-37.2 started; log sequence number 14369389336
160127 13:16:21 [Note] Plugin 'FEEDBACK' is disabled.
160127 13:16:21 [Note] Server socket created on IP: '0.0.0.0'.
160127 13:16:21 [Note] Event Scheduler: Loaded 0 events
160127 13:16:21 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.5.44-MariaDB' socket: '/var/lib/mysql/mysql.sock' port: 3306 MariaDB Server

Re: schedule downtime issue

Posted: Thu Feb 04, 2016 3:32 pm
by tgriep
That is strange. If the servers were rebooted after the updates, that could of fixed it. Hard to say.
Shall we close the post then?

Re: schedule downtime issue

Posted: Thu Feb 04, 2016 6:24 pm
by slater86
Hi All,

Downtime has broken again this morning on both boxes and I think I've figured out why.
I can reliably fix and reproduce the issue by toggling the date format back to the default US standard in preferences.
(I'm from Australia where we use DD/MM/YYYY)
Nagios System Settings2.png
It seems the date format is being changed in the frontend interface but not being interpreted correctly in the backend.
This also explains why the problem is being corrected/broken occasionally on two completely independent servers at different sites.

It's also worth noting that the downtime dialog box gives no error feedback on a hopelessly incorrect date (like putting in 99/99/9999 12:00:00) which is why it was allowing me to put in downtime for 30/02/2015 (where 30 indicated as the 30th month) and then silently failing to process.

Re: schedule downtime issue

Posted: Fri Feb 05, 2016 1:27 pm
by hsmith
There are some known issues with this, and the development team is aware of them. I'm do not have an ETA for the next release, but I believe it should be fixed in there.

Re: schedule downtime issue

Posted: Mon Feb 08, 2016 5:46 pm
by slater86
Thanks hsmith,
I'll keep an eye out for the next release and post back my findings.

Re: schedule downtime issue

Posted: Mon Feb 08, 2016 5:53 pm
by ssax
This is for XI 5.2.3.

*** Note: This will get reverted if you upgrade and will need to be reimplemented.
*** Make sure that you have known-good backups/vm snapshots before making any modifications


Edit this file:

Code: Select all

    /usr/local/nagiosxi/html/includes/components/xicore/downtime.php
Around line 615 you will find this code:

Code: Select all

        $start_time = date('m-d-Y H:i:s', strtotime($start_time));
        $end_time = date('m-d-Y H:i:s', strtotime($end_time));
Replace it with this code:

Code: Select all

        // Get timezone datepicker format
        if (isset($_SESSION['date_format']))
            $format = $_SESSION['date_format'];
        else {
            if (is_null($format = get_user_meta(0, 'date_format')))
                $format = get_option('default_date_format');
        }

        // Set the date format to the user's preference so we can convert properly
        if ($format == DF_ISO8601) {
            $date_format = 'Y-m-d H:i:s';
        } else if ($format == DF_US) {
            $date_format = 'm/d/Y H:i:s';
        } else if ($format == DF_EURO) {
            $date_format = 'd/m/Y H:i:s';
        }

        $start_date = date_create_from_format("$date_format", "$start_time");
        $end_date = date_create_from_format("$date_format", "$end_time");
        $start_time = date_format($start_date, 'm-d-Y H:i:s');
        $end_time = date_format($end_date, 'm-d-Y H:i:s');
That should make it work properly according to your date preferences.

Let me know if this works for you and if you run into any problems.

Thank you

Re: schedule downtime issue

Posted: Tue Feb 09, 2016 6:49 pm
by slater86
Hi ssax,

Patched as requested (see below) and all seems to work as expected.
Nice work :-)

--Matt

Update: Whoa, spoke too soon. The notification text went into the comments section on the host but the downtime never triggered (received down/up notices instead of downtime)?

Update 2: failed to capture all code when copying into the post (was on the server). Corrected.
[root@OldServer ~]# diff ~/downtime.php.bak /usr/local/nagiosxi/html/includes/components/xicore/downtime.php
615,616c615,649
< $start_time = date('m-d-Y H:i:s', strtotime($start_time));
< $end_time = date('m-d-Y H:i:s', strtotime($end_time));
---
> ###################
> # Start Patch
> ###################
> #
> # $start_time = date('m-d-Y H:i:s', strtotime($start_time));
> # $end_time = date('m-d-Y H:i:s', strtotime($end_time));
> #
> # Added to fix dates until a proper update is available --Matt 09/02/2016
> # https://support.nagios.com/forum/viewto ... 68#p171168
>
> // Get timezone datepicker format
> if (isset($_SESSION['date_format']))
> $format = $_SESSION['date_format'];
> else {
> if (is_null($format = get_user_meta(0, 'date_format')))
> $format = get_option('default_date_format');
> }
>
> // Set the date format to the user's preference so we can convert properly
> if ($format == DF_ISO8601) {
> $date_format = 'Y-m-d H:i:s';
> } else if ($format == DF_US) {
> $date_format = 'm/d/Y H:i:s';
> } else if ($format == DF_EURO) {
> $date_format = 'd/m/Y H:i:s';
> }
>
> $start_date = date_create_from_format("$date_format", "$start_time");
> $end_date = date_create_from_format("$date_format", "$end_time");
> $start_time = date_format($start_date, 'm-d-Y H:i:s');
> $end_time = date_format($end_date, 'm-d-Y H:i:s');
>
> ###################
> # End Patch
> ###################
[root@OldServer ~]#

Re: schedule downtime issue

Posted: Wed Feb 10, 2016 2:36 pm
by ssax
Hmm, what does the output of this command show for the one you submitted? (you may need to create another)

Code: Select all

echo "select scheduleddowntime_id,entry_time,comment_data,scheduled_start_time,scheduled_end_time from nagios_scheduleddowntime \G;" | mysql -pnagiosxi nagios

Re: schedule downtime issue

Posted: Wed Feb 10, 2016 7:40 pm
by slater86
Hi ssax,

I've created another with the details below.

(modified to find the comment easier)
[root@OldServer ~]# echo "select scheduleddowntime_id,entry_time,comment_data,scheduled_start_time,scheduled_end_time from nagios_scheduleddowntime where comment_data='Testing Downtime' \G;" | mysql -u root -p nagios
Enter password:
*************************** 1. row ***************************
scheduleddowntime_id: 277881
entry_time: 2016-02-11 10:38:29
comment_data: Testing Downtime
scheduled_start_time: 2016-11-02 10:36:35
scheduled_end_time: 2016-11-02 12:36:35
[root@OldServer ~]#


The only error in /var/log/httpd/error_log is the following (shows up every few minutes, pretty sure its unrelated)
PHP Notice: unserialize(): Error at offset 0 of 1 bytes in /usr/local/nagiosxi/html/includes/components/helpsystem/helpsystem.inc.php on line 281
PHP Notice: unserialize(): Error at offset 0 of 1 bytes in /usr/local/nagiosxi/html/includes/components/helpsystem/helpsystem.inc.php on line 281
PHP Notice: unserialize(): Error at offset 0 of 1 bytes in /usr/local/nagiosxi/html/includes/components/helpsystem/helpsystem.inc.php on line 281

Downtime is set
Nagios System Settings4.png
Device turned off and detected
Nagios System Settings3.png
Device not in downtime
Nagios System Settings5.png

Re: schedule downtime issue

Posted: Thu Feb 11, 2016 5:42 pm
by ssax
You are using XI 5.2.3, right?

Please send me your /usr/local/nagiosxi/html/includes/components/xicore/downtime.php file so that I can compare it to mine, I'm unable to replicate it.