Page 1 of 1

Mysql error after offloading to a remote mysql DB

Posted: Tue Aug 05, 2014 3:33 pm
by kultardotnet
Hey All,

Getting XI up and running to evaluate. Due to constraints as to OS, this is a manual install. Everything is up and running, except I receive the following error in /var/log/messages.

Any suggestions on a path I can take to resolve this? I've verified that the DB on the remote host is identical to the initial local db. Everything is looking identical, not sure why it's erring as such though.

Code: Select all

ndo2db: mysql_error: 'Data too long for column 'command_line' at row 1'
ndo2db: Error: mysql_query() failed for 'INSERT INTO nagios_commands SET instance_id='1', object_id='113', config_type='1', command_line='/usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification\.php --notification-type=host --contact=\"\$CONTACTNAME\$\" --contactemail=\"\$CONTACTEMAIL\$\" --type=\$NOTIFICATIONTYPE\$ --escalated=\"\$NOTIFICATIONISESCALATED\$\" --author=\"\$NOTIFICATIONAUTHOR\$\" --comments=\"\$NOTIFICATIONCOMMENT\$\" --host=\"\$HOSTNAME\$\" --hostaddress=\"\$HOSTADDRESS\$\" --hostalias=\"\$HOSTALIAS\$\" --hostdisplayname=\"\$HOSTDISPLAYNAME\$\" --hoststate=\$HOSTSTATE\$ --hoststateid=\$HOSTSTATEID\$ --lasthoststate=\$LASTHOSTSTATE\$ --lasthoststateid=\$LASTHOSTSTATEID\$ --hoststatetype=\$HOSTSTATETYPE\$ --currentattempt=\$HOSTATTEMPT\$ --maxattempts=\$MAXHOSTATTEMPTS\$ --hosteventid=\$HOSTEVENTID\$ --hostproblemid=\$HOSTPROBLEMID\$ --hostoutput=\"\$HOSTOUTPUT\$\" --longhostoutput=\"\$LONGHOSTOUTPUT\$\" --datetime=\"\$LONGDATETIME\$\"' ON DUPLICATE KEY UPDATE instance_id='1', object_id='113', config_type='1', command_line='/usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification\.php --notification-type=host --contact=\"\$CONTACTNAME\$\" --contactemail=\"\$CONTACTEMAIL\$\" --type=\$NOTIFICATIONTYPE\$ --escalated=\"\$NOTIFICATIONISESCALATED\$\" --author=\"\$NOTIFICATIONAUTHOR\$\" --comments=\"\$NOTIFICATIONCOMMENT\$\" --host=\"\$HOSTNAME\$\" --hostaddress=\"\$HOSTADDRESS\$\" --hostalias=\"\$HOSTALIAS\$\" --hostdisplayname=\"\$HOSTDISPLAYNAME\$\" --hoststate=\$HOSTSTATE\$ --hoststateid=\$HOSTSTATEID\$ --lasthoststate=\$LASTHOSTSTATE\$ --lasthoststateid=\$LASTHOSTSTATEID\$ --hoststatetype=\$HOSTSTATETYPE\$ --currentattempt=\$HOSTATTEMPT\$ --maxattempts=\$MAXHOSTATTEMPTS\$ --hosteventid=\$HOSTEVENTID\$ --hostproblemid=\$HOSTPROBLEMID\$ --hostoutput=\"\$HOSTOUTPUT\$\" --longhostoutput=\"\$LONGHOSTOUTPUT\$\" --datetime=\"\$LONGDATETIME\$\"''

Re: Mysql error after offloading to a remote mysql DB

Posted: Tue Aug 05, 2014 4:35 pm
by jomann
It looks like a very long command... it is very possible that the command_line column isn't big enough... if it's varchar and not text it may not be able to fix the whole command line into the column. Changing the column type to "text" or changing how big the column is should resolve that error.

Re: Mysql error after offloading to a remote mysql DB

Posted: Tue Aug 05, 2014 4:53 pm
by kultardotnet
I was hesitant to do that as there are several more columns that are experiencing this issue.

I'll adjust it to type text tomorrow, then see if that resolves it.


Thanks
K

Re: Mysql error after offloading to a remote mysql DB

Posted: Tue Aug 05, 2014 5:05 pm
by jomann
I didn't see the section where it says ON DUPLICATE KEY UPDATE... You probably do not need to change the column size... It is set to VARCHAR(255) and looks like that is a pretty standard command_line column. I actually took a look and mine is:

/usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php --notification-type=service --contact="$CONTACTNAME$" --contactemail="$CONTACTEMAIL$" --type=$NOTIFICATIONTYPE$ --escalated="$NOTIFICATIONISESCALATED$" --author="$NOTIFICATIONAUTH

So it looks like it already has the data in the database and it isn't able to insert it. Does the error message come up all the time?

Re: Mysql error after offloading to a remote mysql DB

Posted: Wed Aug 06, 2014 9:42 am
by kultardotnet
Hey There,

The error comes up every time, and i'm only seeing errors for nagios_commands -- command_line, and nagios_configfilevariables -- varvalue

I'm going to change the datatype to text and see if that helps it out.

Re: Mysql error after offloading to a remote mysql DB

Posted: Wed Aug 06, 2014 9:52 am
by kultardotnet
adjusting the datatype to text resolved the error.

hopefully i didn't run into any unwarranted side affects