PRTG / PRTGScheduler

With PRTG Scheduler, you can configure customized maintenance windows for every PRTG object (Sensors, Devices, and Groups). It allows for various ways of occurrences, like every first Sunday in January, February and March, or only the first week of every month.
MIT License
15 stars 1 forks source link

Maintenance windows report does not match debug output #17

Closed Manimi-Chart closed 6 years ago

Manimi-Chart commented 6 years ago

I updated the maintenance window on my sensor but the report did not reflect the change. I enabled debug mode and ran it manually in PowerShell. That does have the updated window:

PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\PRTG-Scheduler.ps1

A PHP Error was encountered

Severity:    Warning
Message:     Cannot modify header information - headers already sent by (output started at C:\PHP\app\application\controllers\PrtgScheduler.php:36)
Filename:    C:\PHP\app\application\controllers\PrtgScheduler.php
Line Number: 38

Backtrace:
    File: C:\PHP\app\application\controllers\PrtgScheduler.php
    Line: 38
    Function: header

    File: C:\PHP\app\index.php
    Line: 315
    Function: require_once

[17.10.2018 22:21:41]|_ PHP 7.2.9 | CodeIgniter 3.1.5 | PRTG Scheduler 1.0
[17.10.2018 22:21:43]|__ Found 1 sensors with maintenance windows configured.
[17.10.2018 22:21:43]|____ Checking maintenances for SLA Prime (11729), located on the device 'Probe Device' in the group 'HQ (MLX-EMAPRTGP001 - Local Probe)' on the p
robe 'HQ (MLX-EMAPRTGP001 - Local Probe)'
[17.10.2018 22:21:43]|______ Found 2 configured maintenance window(s). Analyzing...
[17.10.2018 22:21:43]|_______ Setup: 
[17.10.2018 22:21:43]|__________ ID: 3ef7efe1a182c622dd958f4782cf2310
[17.10.2018 22:21:43]|__________ Disabled: false
[17.10.2018 22:21:43]|__________ Type: Once
[17.10.2018 22:21:43]|__________ Description: Maintenance Window
[17.10.2018 22:21:43]|__________ Timezone: America/Denver
[17.10.2018 22:21:43]|__________ DateSort: 20102018070000
[17.10.2018 22:21:43]|__________ Next Start (UTC): 20/10/2018 07:00
[17.10.2018 22:21:43]|__________ Next End (UTC)  : 20/10/2018 12:00
[17.10.2018 22:21:43]|__________ Duration        : 5 Hour(s)
[17.10.2018 22:21:43]|_______ Setup: 
[17.10.2018 22:21:43]|__________ ID: 1bb1767684e6ea52c7071a4b4e75aecb
[17.10.2018 22:21:43]|__________ Disabled: false
[17.10.2018 22:21:43]|__________ Type: Once
[17.10.2018 22:21:43]|__________ Description: Maintenance Window
[17.10.2018 22:21:43]|__________ Timezone: America/Denver
[17.10.2018 22:21:43]|__________ DateSort: 21102018070000
[17.10.2018 22:21:43]|__________ Next Start (UTC): 21/10/2018 07:00
[17.10.2018 22:21:43]|__________ Next End (UTC)  : 21/10/2018 12:00
[17.10.2018 22:21:43]|__________ Duration        : 5 Hour(s)
[17.10.2018 22:21:43]|______ Next Maintenance: 20/10/2018, 07:00 - 20/10/2018, 12:00. Duration: 5 Hour(s)
[17.10.2018 22:21:43]|__ No devices with configured maintenances found.
[17.10.2018 22:21:43]|__ No groups with configured maintenances found.
[17.10.2018 22:21:43]|__ Maintenance list is empty, creating a new one.
[17.10.2018 22:21:43]|____ Maintenance windows are configured to be set on demand. Checking time diff of 3ef7efe1a182c622dd958f4782cf2310 until start.
[17.10.2018 22:21:43]|____ Maintenance Window 3ef7efe1a182c622dd958f4782cf2310 not near enough (3394 more minutes). Skipping for now.
[17.10.2018 22:21:43]|__ Active maintenances have been updated (0)
[17.10.2018 22:21:43]|__ Maintenance list is empty, creating a new one.
[17.10.2018 22:21:43]|__ Active maintenances have been updated (0)
[17.10.2018 22:21:43]|__ Maintenance list is empty, creating a new one.
[17.10.2018 22:21:43]|__ Active maintenances have been updated (0)
{"prtg":{"result":[{"Channel":"Sensor Maintenance(s)","Value":1},{"Channel":"Device Maintenances(s)","Value":0},{"Channel":"Group Maintenances(s)","Value":0},{"Channel
":"Total Maintenances(s)","Value":1},{"Channel":"Erroneous Definition(s)","Value":0}],"text":""}}
![2018-10-17 16_39_04-configuration report_ user accounts and user groups _ prtg network monitor mlx-](https://user-images.githubusercontent.com/32491745/47120248-36d2a000-d22b-11e8-8ed5-79629e3350c0.png)            
Manimi-Chart commented 6 years ago

Here is the current maintenance window. 2018-10-17 16_39_04-configuration report_ user accounts and user groups _ prtg network monitor mlx-

stephanlinke commented 6 years ago

Something's wrong here. Is the PRTG Sensor still the same (i.e. updated with new entries in its comments)?

Manimi-Chart commented 6 years ago

That's right.

On Thu, Oct 18, 2018, 1:51 AM Stephan Linke notifications@github.com wrote:

Something's wrong here. Is the PRTG Sensor still the same (i.e. updated with new entries in its comments)?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PRTG/PRTGScheduler/issues/17#issuecomment-430910444, or mute the thread https://github.com/notifications/unsubscribe-auth/Ae_I4fbsBoOh7sBQFepO_e1_oOMpHw6nks5umDMMgaJpZM4Xqa7M .

stephanlinke commented 6 years ago

No write permissions on the report file, i.e. is the powershell script run with administrative credentials (in the security context)?

Manimi-Chart commented 6 years ago

When I run it manually I do not use Run as Administrator. Not sure how PRTG runs it.

On Thu, Oct 18, 2018, 7:10 AM Stephan Linke notifications@github.com wrote:

No write permissions on the report file, i.e. is the powershell script run with administrative credentials (in the security context)?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PRTG/PRTGScheduler/issues/17#issuecomment-431002246, or mute the thread https://github.com/notifications/unsubscribe-auth/Ae_I4TnvFjGoH_hCYE3WqhTF1_T6jBBcks5umH3KgaJpZM4Xqa7M .

stephanlinke commented 6 years ago

I'd like to check this via TeamViewer. Could you open up a support request via support@paessler.com referring to that issue? Please state your timezone within the case, so we can schedule accordingly :)

stephanlinke commented 6 years ago

I can confirm that this seemingly is broken in the current code. I'm currently implementing this add-on in Ruby and it will most likely be a lot easier to maintain/configure/install. I hope to have a running version in the next two weeks, please bear with me for the time being :) I'll publish it here when it's ready.