Page 1 of 1

Tune state-history information characters

Posted: Mon Jun 15, 2015 11:55 pm
by michaelli
Hi Box293,

Is it possible to change the state-history "information" field character length?
I find it can display 256 characters in maximum.

Re: Tune state-history information characters

Posted: Tue Jun 16, 2015 12:12 am
by Box293
This will adjust the database:

Code: Select all

echo "use nagios;alter table nagios_statehistory modify output varchar(65535) not null;alter table nagios_statehistory modify long_output varchar(65535) not null;" | mysql -pnagiosxi

Re: Tune state-history information characters

Posted: Tue Jun 16, 2015 2:17 am
by michaelli
Hi Box293,

Thank you so much again. It can display full messages in state-history now.

And Can you teach me how to check how many characters set in the dump screen messages log field and how to set it bigger. Because I increase the max-length in nrpe to 35536. But I find it maximum display no more than 6000 characters.

Sorry for I always make you trouble.

Re: Tune state-history information characters

Posted: Tue Jun 16, 2015 4:21 pm
by tmcdonald
You might need to alter some other tables for that. Check out this post: http://support.nagios.com/forum/viewtop ... 05#p103608

Re: Tune state-history information characters

Posted: Wed Jun 17, 2015 3:32 am
by michaelli
Hi tmcdonald,

I have no right to access below link

"You might need to alter some other tables for that. Check out this post: viewtopic.php?f=16&t=27918&p=103505#p103608"

Actually, Our company has subscription for xi enterprise

Re: Tune state-history information characters

Posted: Wed Jun 17, 2015 9:23 am
by tmcdonald
Relevant post in the thread:
scottwilkerson wrote:This would not need to be changed between upgrades, it would stick.

Other implications could be a slight db performance decrease when searching in these fields. somewhat negligible as you would never find the info searched for if it was truncated...

Yes, 65535 would become the limit for each of these fields.

The default was 255.


I will say, however, there is a bug in the SQL that was posted, and it should read:

Code: Select all

    echo "use nagios;alter table nagios_servicestatus modify output varchar(65535) not null;alter table nagios_servicestatus modify long_output varchar(65535) not null;alter table nagios_servicestatus modify perfdata varchar(65535) not null;" | mysql -pnagiosxi

        echo "use nagios;alter table nagios_hoststatus modify output varchar(65535) not null;alter table nagios_hoststatus modify long_output varchar(65535) not null;alter table nagios_hoststatus modify perfdata varchar(65535) not null;" | mysql -pnagiosxi

        echo "use nagios;alter table nagios_servicechecks modify output varchar(65535) not null;alter table nagios_servicechecks modify long_output varchar(65535) not null;alter table nagios_servicechecks modify perfdata varchar(65535) not null;" | mysql -pnagiosxi

        echo "use nagios;alter table nagios_hostchecks modify output varchar(65535) not null;alter table nagios_hostchecks modify long_output varchar(65535) not null;alter table nagios_hostchecks modify perfdata varchar(65535) not null;" | mysql -pnagiosxi
Or slightly cleaner

Code: Select all

echo "
alter table nagios_servicestatus modify output varchar(65535) not null,modify long_output varchar(65535) not null,modify perfdata varchar(65535) not null;
alter table nagios_hoststatus modify output varchar(65535) not null, modify long_output varchar(65535) not null,modify perfdata varchar(65535) not null;
alter table nagios_servicechecks modify output varchar(65535) not null,modify long_output varchar(65535) not null,modify perfdata varchar(65535) not null;
alter table nagios_hostchecks modify output varchar(65535) not null,modify long_output varchar(65535) not null,modify perfdata varchar(65535) not null;
" | mysql -pnagiosxi nagios
And if you are a current customer, you should speak with [email protected] and make sure they add your forum username to the Customer group so you get access to that forum. Our SLA applies there, so it only makes sense to post there since you're paying for it!