Skip to main content

Hello,

I had a centreon 21.04 with event log page not working. I upgraded to 22.10 and noticed the bug is still here.

I tried a fresh install with vmware ova and yet the bug persist.

When you use the page /centreon/main.php?p=20301 it is not working at all.

 

Filters using host name or service name or time ranges or non functionnal. All you can get is the list of all events not filtered, but when you click on next page, it ends up on blank page.

The logs are here, you can see them on the Resources status page, but event log page is not working as intended.

 

I made a video trying to explain this, if anyone has an idea.

 

https://vimeo.com/781757064

Ok I found something

 

in /usr/share/centreon/www/include/eventLogs/xml/data.php

 

$inputGet =  
'lang' => isset($_GETG'lang']) ? \HtmlAnalyzer::sanitizeAndRemoveTags($_GETG'lang']) : null,
'id' => isset($_GETG'lang']) ? \HtmlAnalyzer::sanitizeAndRemoveTags($_GETG'lang']) : null,




AND just after, same mistake :



$inputPost =
'lang' => isset($_POSTO'lang']) ? \HtmlAnalyzer::sanitizeAndRemoveTags($_POSTO'lang']) : null,
'id' => isset($_POSTO'lang']) ? \HtmlAnalyzer::sanitizeAndRemoveTags($_POSTO'lang']) : null,



 

I corrected to :

 

$inputGet = e
'lang' => isset($_GET$'lang']) ? \HtmlAnalyzer::sanitizeAndRemoveTags($_GET$'lang']) : null,
'id' => isset($_GET$'id']) ? \HtmlAnalyzer::sanitizeAndRemoveTags($_GET$'id']) : null,



b...]


$inputPost = s
'lang' => isset($_POST_'lang']) ? \HtmlAnalyzer::sanitizeAndRemoveTags($_POST_'lang']) : null,
'id' => isset($_POST_'id']) ? \HtmlAnalyzer::sanitizeAndRemoveTags($_POST_'id']) : null,

 

Now the filter by host or service works

 

The “period” still seems buggy, some typo in code somwhere I guess, I try to find where is the problem

edit:

 

About the period:

If you select “From” and “To” dates, then select a “Log period”, it clears the “From” and “To” fields BUT they are not cleared, when you analyse request URLs, the from and to are still here and overrides the “Log Period” you selected, even if you can’t see them.


Hi there,

I have the same issue in 22.10.2.

The services filter is not working in Event Logs page even with @tntteam fix


Sorry it is not working for you, did you double check the modified code or file path ?

I see no reason this would work for me but not for you :(

 

About time period, the problem is, say, you select from 01/12 to 16/12, press “apply period” and eerything is fine, here is the requested uri

 

centreon/include/eventLogs/xml/data.php?output=&oh=false&warning=true&unknown=true&critical=true&ok=true&unreachable=true&down=true&up=true&num=0&error=1&alert=true&notification=false&search_H=&search_S=&period=&StartDate=12/01/2022&EndDate=12/16/2022&StartTime=00:00&EndTime=24:00&limit=30&id=HH_47
 

But if you select a period, the from date and to date are visually emptied, but are still present in the request (in addition to the period now being populated). I guess the from / to takes over the “period” argument and then it’s never taken in account :

 

centreon/include/eventLogs/xml/data.php?output=&oh=false&warning=true&unknown=true&critical=true&ok=true&unreachable=true&down=true&up=true&num=0&error=1&alert=true&notification=false&search_H=&search_S=&period=5184000&StartDate=12/01/2022&EndDate=12/16/2022&StartTime=00:00&EndTime=24:00&limit=30&id=HH_47
 

You can press 50 times the apply period, it is never applied :( 

 

 

 

 

About the buttons for “next page” of results, here is what the requested uri looks like :

 

centreon/include/eventLogs/xml/data.php?output=&oh=false&warning=true&unknown=true&critical=true&ok=true&unreachable=true&down=true&up=true&num=1&error=1&alert=true&notification=false&search_H=&search_S=&period=&StartDate=12/01/2022&EndDate=12/16/2022&StartTime=00:00&EndTime=24:00&limit=30&id=-1

 

 

 

 


Hi @tntteam,

about the code I belive the only thing to change is the index lang by id for arrays $_GET and $_POST at data.php

My query request has the service present in the payload as following:

but the response displays every services of all hosts

 


Hi,

 

I don't know if it can be useful , but recently we started a thread very similar to this one

 

https://thewatch.centreon.com/platform-7/event-log-stop-working-after-upgrade-to-22-10-2-1321

 

Shortly, after the upgrade of our centreon 21.04 to 22.10.2 , "event log"and "system logs" stopped working.

The only difference with this thread is that on our old version, all worked fine. 

 

We tried to follow your tips (modifying data.php) without being able to solve the problem.

The only thing that allowed us to make everything work back was to take the whole old file

(/usr/share/centreon/www/include/eventLogs/xml/data.php)

of version 21.04 and put it on the 22.10.2.

 

It's a dirty fix, we know it, but right now it's the only possible workaround for us.

"event log" and "system logs" are back and even the "next page" now works.

 

Data.php is not a very big file.

I noticed some differences between the two (of course) but not having many skills as a programmer I don't know how to fix it.

 

If anyone has any advice we would appreciate it.

 


Ok I found something

 

in /usr/share/centreon/www/include/eventLogs/xml/data.php

 

$inputGet =  
'lang' => isset($_GETG'lang']) ? \HtmlAnalyzer::sanitizeAndRemoveTags($_GETG'lang']) : null,
'id' => isset($_GETG'lang']) ? \HtmlAnalyzer::sanitizeAndRemoveTags($_GETG'lang']) : null,




AND just after, same mistake :



$inputPost =
'lang' => isset($_POSTO'lang']) ? \HtmlAnalyzer::sanitizeAndRemoveTags($_POSTO'lang']) : null,
'id' => isset($_POSTO'lang']) ? \HtmlAnalyzer::sanitizeAndRemoveTags($_POSTO'lang']) : null,



 

I corrected to :

 

$inputGet = e
'lang' => isset($_GET$'lang']) ? \HtmlAnalyzer::sanitizeAndRemoveTags($_GET$'lang']) : null,
'id' => isset($_GET$'id']) ? \HtmlAnalyzer::sanitizeAndRemoveTags($_GET$'id']) : null,



b...]


$inputPost = s
'lang' => isset($_POST_'lang']) ? \HtmlAnalyzer::sanitizeAndRemoveTags($_POST_'lang']) : null,
'id' => isset($_POST_'id']) ? \HtmlAnalyzer::sanitizeAndRemoveTags($_POST_'id']) : null,

 

Now the filter by host or service works

 

The “period” still seems buggy, some typo in code somwhere I guess, I try to find where is the problem

edit:

 

About the period:

If you select “From” and “To” dates, then select a “Log period”, it clears the “From” and “To” fields BUT they are not cleared, when you analyse request URLs, the from and to are still here and overrides the “Log Period” you selected, even if you can’t see them.

 

There is also the period line to adjust. Just change “num” by “period” in both $inputGet and $inputPost

 


Reply