Login

Home Forum
Welcome, Guest
Please Login or Register.    Lost Password?

Newline in command argument
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Newline in command argument
#55
Newline in command argument 2 Years, 2 Months ago Karma: 0
The notify-by-email command includes an argument that should logically include several newlines. When those are entered directly in the misccommands.cfg file, and that file is imported to NagiosQL - but not written back - they work as expected. But if I view the command in NagiosQL, the newline escape sequences, "\n", have been changed to just "n". If the file is then written back and Nagios is restarted, notifications appear on a single line with spurious embedded "n" characters.

Looking at MySQL directly, the newline escapes are present. It is only when the cfg file is written out or displayed by NagiosQL that they are lost.

This is with NagiosQL 2.0.2.
DaveClose
Fresh Boarder
Posts: 7
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2008/05/28 03:14 By DaveClose.
The administrator has disabled public write access.
 
#57
Re:Newline in command argument 2 Years, 2 Months ago Karma: 2
Could you please check your php magic_quotes_gpc settings? In version 2.x they should be set to "on".
rouven
NagiosQL Developer
Posts: 255
graphgraph
User Offline Click here to see the profile of this user
47315142 Gender: Male NagiosQL Location: Hamburg, Germany Birthday: 03/19
Last Edit: 2008/05/28 09:16 By rouven.
The administrator has disabled public write access.
 
#59
Re:Newline in command argument 2 Years, 2 Months ago Karma: 0
Yes, magic_quotes_gpc was set to Off. I've now changed it to On but the problem has not changed. The newlines are still converted to plain "n" when viewing the command and when writing out the misccommands.cfg file.
DaveClose
Fresh Boarder
Posts: 7
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#60
Re:Newline in command argument 2 Years, 2 Months ago Karma: 4
Have you reboot your webserver after changing the magig_quote_gpc settings? Have you change it in your webservers php.ini - some system have a /etc/php5/apache/php.ini?

Normally, something must be different if you change the settings of magic_quotes_gpc - that all will be the same is strange.

What shows the edit form? /n or n? And after saving and reopen the edit form has something changed?
martin
NagiosQL Founder
Posts: 303
graph
User Offline Click here to see the profile of this user
Last Edit: 2008/05/29 11:04 By martin.
The administrator has disabled public write access.
 
#63
Re:Newline in command argument 2 Years, 2 Months ago Karma: 0
martin wrote:

> Have you reboot your webserver after changing the magig_quote_gpc
> settings? Have you change it in your webservers php.ini - some
> system have a /etc/php5/apache/php.ini?

> Normally, something must be different if you change the settings
> of magic_quotes_gpc - that all will be the same is strange.

> What shows the edit form? /n or n? And after saving and reopen
> the edit form has something changed?

I did restart Apache. Then I copied a saved good copy of misccommands.cfg and imported it to NagiosQL. Looking at it after the import, the "\n"s were changed to "n"s. Saving it resulted in the corrupted file. This is why I thought the problem was not fixed.

Today I edited the command within NagiosQL, then saved the file. This time, the file was correct and the command is displayed correctly. So it appears now that the only problem is when importing a file. Perhaps there is some other php.ini setting which needs to be changed?
DaveClose
Fresh Boarder
Posts: 7
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#64
Re:Newline in command argument 2 Years, 2 Months ago Karma: 4
What's about the database? Have you a tool like phpMySql to check the database entries? Are they correct after an import or a copy? In which case the entry will be stored with missing characters?
martin
NagiosQL Founder
Posts: 303
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1