我正在尝试在我的服务器上使用puppet和我的自定义shell脚本来安装Nagios。所有的东西都能正常工作,但是我在puppet脚本执行结束时看到一个错误,如下所示:
[root@localhost tmp]# /usr/local/bin/puppet --verbose nagiosscript.pp .... .... Lines of verbose output .... info: Scope(Class[main]): installing Nagios agent in /usr/local/nagios info: Applying configuration version '1016779459' notice: /Stage[main]//Exec[/tmp/check_server.sh]/returns: executed successfully notice: /Stage[main]//File[/tmp/temporary_mount]/ensure: created notice: /Stage[main]//Exec[mount]/returns: executed successfully notice: /Stage[main]//Exec[retrieve_nagios_install_script]/returns: executed successfully notice: /Stage[main]//File[/var/tmp/nagios_install.sh]/mode: mode changed '644' to '700' err: /Stage[main]//Exec[/var/tmp/nagios_install.sh]/returns: change from notrun to 0 failed: Command exceeded timeout at /tmp/nagiosscript.pp:34 notice: Finished catalog run in 332.42 seconds
我不确定这个错误是什么意思,但是安装过程很顺利。
这是一个已知的事实
默认情况下,木偶等待300秒完成工作,否则只有你看到像上面的错误。 你可以在你的木偶脚本中定义超时值。 在你的木偶剧本中使用以下内容
timeout => 0,
从木偶文件:
Timeout The maximum time the command should take. If the command takes longer than the timeout, the command is considered to have failed and will be stopped. The timeout is specified in seconds. The default timeout is 300 seconds and you can set it to 0 to disable the timeout.