Mysql error after offloading to a remote mysql DB

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
kultardotnet
Posts: 8
Joined: Tue Aug 05, 2014 1:39 pm

Mysql error after offloading to a remote mysql DB

Post 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\$\"''
jomann
Development Lead
Posts: 611
Joined: Mon Apr 22, 2013 10:06 am
Location: Nagios Enterprises

Re: Mysql error after offloading to a remote mysql DB

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
kultardotnet
Posts: 8
Joined: Tue Aug 05, 2014 1:39 pm

Re: Mysql error after offloading to a remote mysql DB

Post 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
jomann
Development Lead
Posts: 611
Joined: Mon Apr 22, 2013 10:06 am
Location: Nagios Enterprises

Re: Mysql error after offloading to a remote mysql DB

Post 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?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
kultardotnet
Posts: 8
Joined: Tue Aug 05, 2014 1:39 pm

Re: Mysql error after offloading to a remote mysql DB

Post 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.
kultardotnet
Posts: 8
Joined: Tue Aug 05, 2014 1:39 pm

Re: Mysql error after offloading to a remote mysql DB

Post by kultardotnet »

adjusting the datatype to text resolved the error.

hopefully i didn't run into any unwarranted side affects
Locked