Closed stephanlinke closed 6 years ago
I made the the changes but still no maintenance report in the menu.
# Add the entry to Reports > System Reports public function checkPrtgMenu() { $jsCustomFile = file_get_contents("C:\Program Files (x86)\PRTG Network Monitor\webroot\javascript\scripts_custom_v2.js"); $pattern ="/(\/\/.PRTG.Scheduler.menu.entry)/"; $line = "$('#main_menu > li:nth-child(7) > ul > li:nth-child(4) > ul > li:nth-child(3)').after('<li><a href=\"/config_report_maintenances.htm\" class=\"nohjax\" target=\"_blank\">".$this->lang->line('menu_entry')."</a></li>'); // PRTG Scheduler menu entry"; if(!(preg_match($pattern,$jsCustomFile))){ $this->log('Writing Maintenance Windows menu entry',1); $jsCustomFile .= PHP_EOL.$line; file_put_contents("C:\Program Files (x86)\PRTG Network Monitor\webroot\javascript\scripts_custom_v2.js",$jsCustomFile); } }
The scripts_custom_v2.js is on the right location.
And does it contain the menu entry? It actually only updates when the sensor executes - strange. You could also add the following manually:
$('#main_menu > li:nth-child(7) > ul > li:nth-child(4) > ul > li:nth-child(3)').after('<li><a href=\"/config_report_maintenances.htm\" class=\"nohjax\" target=\"_blank\">".$this->lang->line('menu_entry')."</a></li>'); // PRTG Scheduler menu entry
Strange, yesterday I ran the scheduler sensor a few times and nothing happens. Today I see the report entry.
Great! :) Closing issue.
Hi Stephan,
Having same issue, report not coming up in menu. Installed as per instructions, devices are going into paused state as they should, and coming back. But no report in the menu. Added the line directly into the scripts_custom_v2.js file, and after that the javascript menu's stopped responding (copied and pasted from above).
On version 18.2.39.1661.
regards Shaun
Sorry, I totally missed that one :/ Could you post the complete content of your scripts_custom_v2.js, please?
Currently it has nothing in it, just the comments...
/
// You can use this file to modify the appearance of the PRTG web interface
// as described in https://kb.paessler.com/en/topic/33
//
// Please note that you are using an unsupported and deprecated feature.
// Your changes will be broken or removed with future PRTG updates.
//
// If you modify this file, PLEASE LET US KNOW what you're changing and why!
// Just drop an email to support@paessler.com and help us understand your
// needs. Thank you!
/
When I tried to add the line manually at the end, as other's did above, the menu's stopped responding in the PRTG interface, so I undid it. In light of the comments above, does it still work in the 18.2.39.1661 x64 version, which is what we are still running? Unless I copied and pasted some wrong characters somehow.
Please note was using Chrome browser in Windows 10 if that makes any difference
I can run the report directly by typing in the URL, so it's not the end of the world if it doesn't work, but it's a nice to have :)
hello, where is the maintenance status configured?
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:
$jsCustomFile = file_get_contents("C:\Program Files (x86)\PRTG Network Monitor\webroot\javascript\scripts_custom_v2.js");
file_put_contents("C:\Program Files (x86)\PRTG Network Monitor\webroot\javascript\scripts_custom_v2.js",$jsCustomFile);