@Saul Ramirez
Looks like your Public_hostname for the agent is not right. As we see thsat the public_hostname is being taken as :
\'publicHostname\': \'<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">\\r\
<html xmlns="http://www.w3.org/1999/xhtml">\\r\
<head>\\r\
<meta content="text/html; charset=utf-8" http-equiv="content-type" />\\r\
<meta content="no-cache" http-equiv="pragma" />\\r\
<title>waiting...</title>\\r\
<script type="text/javascript">\\r\
.
Thats why you are getting too long column value for public_hostname
org.eclipse.persistence.exceptions.DatabaseException\
Internal Exception: org.postgresql.util.PSQLException: ERROR: el valor es demasiado largo para el tipo character varying(255)\
Error Code: 0\
Call: UPDATE hosts SET total_mem = ?, host_attributes = ?, public_host_name = ? WHERE (host_id = ?)\
\\tbind => [4 parameters bound]\
.
Can you please run the following command on yourt host which you re trying to add to see if it is returning correct FQDN?
# hostname -f
You can refer to the following Article which i wrote sometime back to fidn the difference between Public_hostname and hostname and how to fix it:
https://community.hortonworks.com/content/kbentry/42872/why-ambari-host-might-have-different-public-host-n.html