Exported resource Nagios_host cannot override local resource on node的解决办法

发布时间:2019-08-26编辑:脚本学堂
问题描述:一台服务器更改了hostname nagios服务器,运行puppetd --test时报错 err: Could not retrieve catalog from remote server: Error 400 on SERVER: Exported resource Nagios_host[21.12.15.33] cannot override local resource on node master.test.com

问题描述:
一台服务器更改了hostname

nagios服务器,运行puppetd --test时报错
err: Could not retrieve catalog from remote server: Error 400 on SERVER: Exported resource Nagios_host[21.12.15.33] cannot override local resource on node master.test.com

解决办法:
登陆mysql,use puppet
    delete from resources where restype like 'Nagios_host' and exported=1 and title='21.12.15.33';
    delete from resources where restype like 'Nagios_service' and exported=1 and title like '%21.12.15.33';

client服务器
puppetd --test

nagios服务器
puppetd --test

dashboard
use puppet_dashboard
delete  from nodes where name='xx.xxx.com';

参考文章:
http://yo61.com/error-400-on-server-exported-resource-sshkeyfoo-cannot-override-local-resource-on-node-bar-example-com.html