Giter Club home page Giter Club logo

prtg / prtgscheduler Goto Github PK

View Code? Open in Web Editor NEW
15.0 15.0 1.0 631 KB

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.

License: MIT License

PHP 99.48% HTML 0.31% PowerShell 0.16% Hack 0.05%
maintenance paessler prtg prtg-network-monitor recurring-maintenance-windows rrule scheduling

prtgscheduler's People

Contributors

stephaaan avatar stephanlinke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

h3xium

prtgscheduler's Issues

Validation of maintenance windows

The beta version doesn't handle invalid maintenance definitions very well. The following needs to be adressed :

  • Skip defective maintenance windows, no matter what
  • Create a ticket for each defect maintenance definition including a description of what's wrong

Receiving JSON error on sensor.

Manually executing the script doesn't provide any sort of errors. I made sure to go through the install doc multiple times and everything appears to be set correctly. Still receiving the following error on the sensor. XML: The returned XML does not match the expected schema. (code: PE233) -- JSON: The returned JSON does not match the expected structure (Invalid JSON.). (code: PE231)

A PHP Error was encountered

Hello,
when I start the powershell script no mantanance window is found and I get this error message:

A PHP Error was encountered

Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at C:\php\app\application\contr
ollers\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

[27.11.2017 12:59:16]|_ PHP 7.1.12 | CodeIgniter 3.1.5 | PRTG Scheduler 1.0
[27.11.2017 12:59:16]|__ No sensors with configured maintenances found.
[27.11.2017 12:59:16]|__ No devices with configured maintenances found.
[27.11.2017 12:59:16]|__ No groups with configured maintenances found.
[27.11.2017 12:59:16]|__ Maintenance list is empty, creating a new one.
[27.11.2017 12:59:16]|__ Active maintenances couldn't be updated. Error: (0)
[27.11.2017 12:59:16]|__ Maintenance list is empty, creating a new one.
[27.11.2017 12:59:17]|__ Active maintenances couldn't be updated. Error: (0)
[27.11.2017 12:59:17]|__ Maintenance list is empty, creating a new one.
[27.11.2017 12:59:17]|__ Active maintenances couldn't be updated. Error: (0)
{"prtg":{"result":[{"Channel":"Sensor-Wartungsfenster","Value":0},{"Channel":"Ger\u00e4te-Wartungsfenster","Value":0},{
"Channel":"Gruppen-Wartungsfenster","Value":0},{"Channel":"Wartungsfenster","Value":0},{"Channel":"Fehlerhafte Definiti
onen","Value":0}],"text":""}}

I double checked my configuration and I think it is ok. I use a newer php version (7.1.12) because I can't find the recomended version.

Regards,
Ben

Can I still use the integrated maintenance window function?

Yes. The scheduler will only set the maintenances if they are starting within the next five minutes (UTC), hence configured maintenances will not be overwritten if they're not within a scheduled maintenance.

Note that the scheduler will overwrite maintenance windows manually set once a rule matches.
If the object is in a maintenance window right now, nothing will be set (to avoid skipping maintenances).

The threshold can be configured in the settings as disclosed on the installation page.

XML Error

I have setup according to instructions. The sensor gives the following error: "XML: The returned XML does not match the expected schema. (code: PE233) -- JSON: The returned JSON does not match the expected structure (#O2). (code: PE231)."

Please advise on how to get this functioning.

Next Start Not Correct

I have the comments of my sensor setup as follows:
2018-08-23 11_36_35-sla prime _ sensor details _ prtg network monitor
They are two separate maintenance window days, back to back at the same time of day.

However the report shows as follows:
2018-08-23 11_37_27-configuration report_ user accounts and user groups _ prtg network monitor
It shows both days as listed. However, the next start day at the top shows the second day, not the first.

Does this mean that the first day won't go into maintenance mode because the second one is on-deck?
How do I get the first day to be the Next Start and not the second?

Maintenance windows report does not match debug output

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)

Getting unauthorized access

The sensor connects and seems to run successfully but it shows unauthorizedaccess on the sensor. The user has rights to the server and is the same user that all sensors are using. The powershell script runs successfully from both the x84 and x86 powershell prompts. Both are also set to unrestricted executionpolicy.

No configured maintenances found

Debug output:

[31.07.2017 14:46:21]|_ PHP 7.1.7 | CodeIgniter 3.1.5 | PRTG Scheduler 1.0
[31.07.2017 14:46:21]|__ No sensors with configured maintenances found.
[31.07.2017 14:46:21]|__ No devices with configured maintenances found.
[31.07.2017 14:46:21]|__ No groups with configured maintenances found.
[31.07.2017 14:46:21]|__ Maintenance list is empty, creating a new one.
[31.07.2017 14:46:21]|__ Active maintenances couldn't be updated. Error: (0)
[31.07.2017 14:46:21]|__ Maintenance list is empty, creating a new one.
[31.07.2017 14:46:21]|__ Active maintenances couldn't be updated. Error: (0)
[31.07.2017 14:46:21]|__ Maintenance list is empty, creating a new one.
[31.07.2017 14:46:21]|__ Active maintenances couldn't be updated. Error: (0)
{"prtg":{"result":[{"Channel":"Sensor Maintenance(s)","Value":0},{"Channel":"Device Maintenances(s)","Value":0},{"Channel":"Group Maintenances(s)","Value
":0},{"Channel":"Total Maintenances(s)","Value":0},{"Channel":"Erroneous Definition(s)","Value":0}],"text":""}}

This is the output if we query the api directly:
hxxps://our-server/api/table.json?content=sensors&output=json&columns=objid,basetype,name,device,group,status,baselink,probe,comments,parentid,probe,parent&sortby=-objid&filter_comments=@sub(maintenance)&username=prtgscheduler&passhash=removed

{
    "prtg-version": "17.3.32.2339",
    "treesize": 5,
    "sensors": [
        {
            "objid": 36407,
            "basetype": "sensor",
            ...
            "comments": "maintenance[weekly-2-9/06/2017|mo,tu,we,su|all|all|23:00|23:30|Test maintenance]",
            ...
        },
        {
            "objid": 36351,
            "basetype": "sensor",
            ...
            "comments": "maintenance[daily-1-9/08/2017|all|all|all|15:30|16:00|PRTG scheduler test 3]",
            ...
        },
        {
            "objid": 36350,
            "basetype": "sensor",
            ...
            "comments": "maintenance[daily-1-9/06/2017|all|all|all|15:40|16:00|PRTG scheduler test 2]",
            ...
        },
        {
            "objid": 36349,
            "basetype": "sensor",
            ...
            "comments": "maintenance[daily-1-9/06/2017|all|all|all|15:30|16:00|PRTG scheduler test]",
            ...
        },
        {
            "objid": 32774,
            "basetype": "sensor",
            ...
            "comments": "maintenance[weekly-1-9/09/2017|all|all|all|15:30|16:00|PRTG scheduler test 4]",
            ...
        }
    ]
}

Any idea how to troubleshoot further?

Check correct working of PHP??

How can I check that the php part of this application is working correctly?

When I run the powershell script I receive the following inforamtion:
PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\PRTG-Scheduler.ps1

[31.10.2018 19:06:40]|_ PHP 7.2.8 | CodeIgniter 3.1.5 | PRTG Scheduler 1.0
[31.10.2018 19:06:40]|__ No sensors with configured maintenances found.
[31.10.2018 19:06:40]|__ No devices with configured maintenances found.
[31.10.2018 19:06:40]|__ No groups with configured maintenances found.
[31.10.2018 19:06:40]|__ Maintenance list is empty, creating a new one.
[31.10.2018 19:06:40]|__ Active maintenances couldn't be updated. Error: (0)
[31.10.2018 19:06:40]|__ Maintenance list is empty, creating a new one.
[31.10.2018 19:06:40]|__ Active maintenances couldn't be updated. Error: (0)
[31.10.2018 19:06:40]|__ Maintenance list is empty, creating a new one.
[31.10.2018 19:06:40]|__ Active maintenances couldn't be updated. Error: (0)
{"prtg":{"result":[{"Channel":"Sensor Maintenance(s)","Value":0},{"Channel":"Device Maintenances(s)","Value":0},{"Channel":"Group Maintenances(s)","Val
ue":0},{"Channel":"Total Maintenances(s)","Value":0},{"Channel":"Erroneous Definition(s)","Value":0}],"text":""}}

When I enable logging .. no debug file is created..

The Configuration Report: Maintenance Windows is visible but no maintenance entries are listed

I only followed the installation steps on: https://github.com/PRTG/PRTGScheduler/wiki/1.-Installation
Question: Is an extra webserver needed for PHP?  I am running this utlility on the server running the PRTG components.

Please help!

Grtz Fred

Error Install

Hello good afternoon, I have tried to install the PRTG Scheduler following the instructions, but I have two doubts:

  1. The following error appears in the sensor.

XML: The returned XML does not match the expected schema. (code: PE233) - JSON: The returned JSON does not match the expected structure (Invalid JSON.). (code: PE231)

For what is this?

  1. Where is the maintenance syntax entered?

Can the PRTG Scheduler cope with many configured maintenance windows?

The scheduler has been tested with 1,000 schedules defined and the run took about 3 seconds. That was with the RRule caching disabled to make sure they're calculated individually. With the cache enabled, it will probably be a bit faster since some definitions may be duplicates for different objects.

Does PRTGScheduler work with the new webinterface (17.4.35 and later)?

In this version, the javascript files have changed and the models are currently targeting the old javascript files. Please make the following changes in order for the menu entries to appear:

application/models/Maintenance_model.php, line 438:

$jsCustomFile = file_get_contents("C:\Program Files (x86)\PRTG Network Monitor\webroot\javascript\scripts_custom_v2.js");

application/models/Maintenance_model.php, line 444:

file_put_contents("C:\Program Files (x86)\PRTG Network Monitor\webroot\javascript\scripts_custom_v2.js",$jsCustomFile);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.