|
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.
|
|
|
|
Last Edit: 2008/05/28 03:14 By DaveClose.
|
|
|
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".
|
|
|
|
Last Edit: 2008/05/28 09:16 By rouven.
|
|
|
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.
|
|
|
|
|
|
|
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
|
|
Last Edit: 2008/05/29 11:04 By martin.
|
|
|
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?
|
|
|
|
|
|
|
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
|
|
|
|
|