Fork me on GitHub
Suzf  Blog

Tag faq

FAQ_Puppet: 常见问题 【持续更新中】

Q1:最近测试3.7.1 的版本出现了一个问题:The package type's allow_virtual parameter will be changing its default value from false to true in a future release

A1:

[[email protected] ~]# puppet --version
3.7.1

[[email protected] ~]# puppet agent --test --server master.jeffery.com --noop
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Caching catalog for agent1.jeffery.com
Warning: The package type's allow_virtual parameter will be changing its default value from false to true in a future release. If you do not want to allow virtual packages, please explicitly set allow_virtual to false.
(at /usr/lib/ruby/site_ruby/1.8/puppet/type/package.rb:430:in `default')
Info: Applying configuration version '1413249918'

Notice: Finished catalog run in 0.11 seconds

出现一个警告,但不影响执行的结果,有群友说是版本有问题,最终我也不知道是神码问题的。。

可以在服务器端的 pp文件中的package 中加入 :allow_virtual => false, 来解决出现的警告。

检查文件的正确性spacer.gif

测试

Q2:

puppet Error 400 on SERVER Permission denied

Error: /Stage[main]/Ssh::Config/File[/etc/ssh/sshd_config]: Could not evaluate: Error 400 on SERVER: Permission denied - /etc/puppet/modules/ssh/files/sshd_config Could not retrieve file metadata for puppet:///modules/ssh/sshd_config: Error 400 on SERVER: Permission denied - /etc/puppet/modules/ssh/files/sshd_config

A2: chmod -R ./ssh/files/*

Q3:

What causes the error “Could not retrieve catalog from remote server: execution expired” in Puppet

This can be caused when the load on the Puppet Master server is too high to send compiled catalogs to the agents.
Start by checking if any services are using all the available resources, or if the server is under-powered for the requests it is getting. If all agents run at the same time, edit the cron job that controls their run time to spread it out.
If all else fails, allowing the agents to take longer to receive the catalog may work. This can be done by adding the configtimeout setting to the puppet.conf file (/etc/puppet/puppet.conf) and increasing the value. It defaults to "2m", meaning two minutes.

Q4:

Error: Could not retrieve catalog from remote server: Connection refused - connect(2)
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
Error: Could not send report: Connection refused - connect(2)

此错误是没有启动puppet master服务 或是没有绑定主机名/DNS 未得到正确解析

[14:37:04][[email protected] ~]$ cat /etc/hosts | grep 192
#192.168.9.10     master01.ocean.org   master01
#192.168.9.20     agent01.ocean.org    agent01

取消注释 再次执行 问题解决

 

FAQ_Zabbix:解决模板收集到的数据和真实数据有偏差

前不久定制了一个Sanfor的模板,后发现 发现内存图形呈现的数据太不靠谱了。和真是数据相差近千倍。

使用snmpwalk 抓取数据后发现单位是kb , 靠懵了和 交换、路由的单位不太一样

查看了一下官方手册 ,在 item 有一个选项是 Use custom multiplier 可以转换单位

https://www.zabbix.com/documentation/2.0/manual/config/items/item