Page 1 of 1
Notification Macro limit
Posted: Mon Feb 13, 2017 10:55 am
by BanditBBS
Trying to add a couple custom notification macros following:
https://assets.nagios.com/downloads/nag ... iables.pdf
1.) Is there a limit to character length? Dumb question, as I already know the answer, is there a way to increase this? i.e. increase DB field length?
2.) Is there a way to insert a new line into the macro? If I have spaces in it I have to enclose in single quote to display the entire thing, but I'll gladly replace spaces with _ or something if there is some way to include a new line
Re: Notification Macro limit
Posted: Mon Feb 13, 2017 3:10 pm
by avandemore
1. You seem to indicate you know of a limit. I know no such thing. DB field length is not necessarily a correlation to a custom macro. Perhaps if you provide some real world info we can provide firmer answers.
2. Exact what context to you mean by "newline"? If you look at the existing macro's they expand to newlines just fine using <br>. Is there something special about yours? It depends on your event handler, but this works with the default:
Re: Notification Macro limit
Posted: Mon Feb 13, 2017 3:35 pm
by BanditBBS
avandemore wrote:1. You seem to indicate you know of a limit. I know no such thing. DB field length is not necessarily a correlation to a custom macro. Perhaps if you provide some real world info we can provide firmer answers.
2. Exact what context to you mean by "newline"? If you look at the existing macro's they expand to newlines just fine using <br>. Is there something special about yours? It depends on your event handler, but this works with the default:
Yeah, mine definitely cutoff at a point and if I had space it caused issues. Will run some better tests with more information and post back!
Re: Notification Macro limit
Posted: Mon Feb 13, 2017 4:00 pm
by BanditBBS
Thanks, the <br> usage works for me and great help.
That being said, the custom macro seems to have a field definition in the database or 256 characters, as after you save and go back in it is cutoff at 256. I'd love to be able to change that to a larger number(yes, I know it'd increase DB size) but want to know if I can and if so, if it'll work.
Re: Notification Macro limit
Posted: Mon Feb 13, 2017 4:40 pm
by avandemore
The nagiosql database table tbl_variabledefinition has a column called value. You can change it using something like this:
Code: Select all
# mysql -uroot -pnagiosxi nagiosql -e "ALTER TABLE tbl_variabledefinition MODIFY value VARCHAR(10000);"
In very basic testing, this seemed to work.
Re: Notification Macro limit
Posted: Mon Feb 13, 2017 4:52 pm
by BanditBBS
Perfect, exactly what I needed, increased to 1000 though. Thanks!!!!!!
Lock it up
