Notification Macro limit

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Notification Macro limit

Post 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
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Notification Macro limit

Post 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:

Code: Select all

_NEWLINE	"test <BR> test"
Previous Nagios employee
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Notification Macro limit

Post 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:

Code: Select all

_NEWLINE	"test <BR> test"
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!
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Notification Macro limit

Post 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.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Notification Macro limit

Post 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.
Previous Nagios employee
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Notification Macro limit

Post by BanditBBS »

Perfect, exactly what I needed, increased to 1000 though. Thanks!!!!!!

Lock it up :)
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
Locked