Syslog plugin not displaying complete message

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
philipz
Cacti User
Posts: 100
Joined: Tue Sep 22, 2009 7:46 am

Syslog plugin not displaying complete message

Post by philipz »

All,

I am having a last issue (I hope) before the syslog plugin is fully functional. I am logging with rsyslog, this is the entry in the database:
| local6 | notice | 2012-03-01 | 13:06:32 | RASserver | Group <SSLPolicy> User <philip> IP <10.20.30.40> SVC Message: 16/NOTICE: The user has requested to disconnect the connection..

However when the syslog plugin is displaying the data from the database, it filters out the group and username:
RASserver 2012-03-01 13:06:32 Group User IP <10.20.30.40> SVC Message: 16/NOTICE: The user has requested to disconnect the connection.. Local6 Notice

Maybe syslog plugin parses that as a wildcard? Any ideas?

Thanks,

Philip

edit:
An export is working properly:
RASserver,"Local6","Notice","2012-03-01 13:06:32"," Group <SSLPolicy> User <philip> IP <10.20.30.40> SVC Message: 16/NOTICE: The user has requested to disconnect the connection.."

edit2:
The browser considers the policy and user as html code:
<td> Group <SSLPolicy> User <philip> IP <10.20.30.40> SVC Message: 16/NOTICE: The user has requested to disconnect the connection..</td>
Strange that the IP address is not considered as HTML... Anything in the code that I could change to get this displayed properly?
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Syslog plugin not displaying complete message

Post by noname »

philipz wrote: edit2:
The browser considers the policy and user as html code:
<td> Group <SSLPolicy> User <philip> IP <10.20.30.40> SVC Message: 16/NOTICE: The user has requested to disconnect the connection..</td>
Strange that the IP address is not considered as HTML... Anything in the code that I could change to get this displayed properly?
As a workaround, try to add this code into around line 1290:

Code: Select all

if (sizeof($syslog_messages) > 0) {
	foreach ($syslog_messages as $syslog_message) {
		$syslog_message["message"] = htmlspecialchars($syslog_message["message"]);  // <-- THIS LINE
		$title   = ...
But unfortunately it doesn't work on tooltip.. :(

Image
philipz
Cacti User
Posts: 100
Joined: Tue Sep 22, 2009 7:46 am

Re: Syslog plugin not displaying complete message

Post by philipz »

noname wrote: As a workaround, try to add this code into around line 1290:

Code: Select all

if (sizeof($syslog_messages) > 0) {
	foreach ($syslog_messages as $syslog_message) {
		$syslog_message["message"] = htmlspecialchars($syslog_message["message"]);  // <-- THIS LINE
		$title   = ...
But unfortunately it doesn't work on tooltip.. :(
Edit:
I just implemented it again, it works now, thanks for the fix, really appreciated!
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests