Hi All, I am using vms on gogrid and rackspace completely. I am decent but still learning puppet. The biggest problem with vms, especially where I cant control the Host is ntp time and date sync to be good. Here is my config to sync ntp. Please dont tailor my code just help me fix the problem. This code works 99% of the servers its on except for 2 centos 5 machines. class base { class { ''timezone'': timezone => ''PST8PDT'', ensure => present, autoupgrade => true, } package { ''ntp'': ensure => installed, } service { ''ntpd'': ensure => running, enable => true, hasstatus => true, hasrestart => true, } } node default { include base } Now when I run puppet agent on these 2 specific vms, it "looks" fine and completes, updates whatever. Well when you run command: *date* it doesnt fix the date as it should. I was wondering, is there a way to have puppet check that *date* command displays the correct time for that timezone. My timezone is Los Angeles/ PDT/ PST. I want puppet when completing the run to verify that the time is what PST timezone should be and if not, to alert me or something so I know. We have had it work a few times but of course, stupid vms fail to keep the time perfect. This is why I would like the check. If not worth doing or possible in Puppet, any Nagios plugins good for this that you have set up before? or any other solution? FYI, *class timezone* is a template I got for ntp and seems to update tzdata. Thanks in advance, Tony. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
On 21 October 2013 22:54, Tony Caffe <anthony@woboinc.com> wrote:> > Now when I run puppet agent on these 2 specific vms, it "looks" fine and > completes, updates whatever. >I assume by that, you mean that the puppet agent run completes without issues, and that the NTP configuration looks as you would expect it to following the successful run?> Well when you run command: *date* it doesnt fix the date as it should. >Do you mean the time is incorrect, or the timezone is incorrect?> I was wondering, is there a way to have puppet check that *date* command > displays the correct time for that timezone. My timezone is Los Angeles/ > PDT/ PST. >One issue with ntpd is that, if the time is too far off your time source, then if the ''-x'' option is given to ntpd, it will not ''jump'' the time forward or back. A manual ''ntpdate your.ntp.server'' is required then to jump it to the correct time. If you run the following on one of your failing hosts, what does it output? ntpdate -q your.ntp.server On a correctly syncing server here, I see: server my.ntp.server, stratum 2, offset 0.008437, delay 0.05721 22 Oct 12:34:27 ntpdate[25978]: adjust time server my.ntp.server offset 0.008437 sec ntpd(8) is enlightening as to how quickly/slowly, if at all, the clock will be adjusted in various situations. Regards, Matt. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Hi, Thanks for the response. Yes, the puppet agent runs correctly and looks fine, ntp shows as ''set'' in the run but no change to time. So Yes, the time is not correct. On one its an hour fast of what it should be and shows PST as zone. The other Server shows 22 hours faster than it should be and is also PST. So the time just doesnt match up, though the zone is technically correct. I dont use a NTPD server locally, I use default ntp servers. When I force time change by stopping ntpd, then running ntpdate {time server}, then ntpd start, it syncs up to correct time. After a while though, it drifts away. Thanks Matthew Burgess for your response and I hope my response helps you understand better what I need help with. -Tony On Tuesday, October 22, 2013 4:43:43 AM UTC-7, Matthew Burgess wrote:> > On 21 October 2013 22:54, Tony Caffe <ant...@woboinc.com <javascript:>>wrote: > >> >> Now when I run puppet agent on these 2 specific vms, it "looks" fine and >> completes, updates whatever. >> > > I assume by that, you mean that the puppet agent run completes without > issues, and that the NTP configuration looks as you would expect it to > following the successful run? > > > >> Well when you run command: *date* it doesnt fix the date as it should. >> > > Do you mean the time is incorrect, or the timezone is incorrect? > > > >> I was wondering, is there a way to have puppet check that *date* command >> displays the correct time for that timezone. My timezone is Los Angeles/ >> PDT/ PST. >> > > One issue with ntpd is that, if the time is too far off your time source, > then if the ''-x'' option is given to ntpd, it will not ''jump'' the time > forward or back. A manual ''ntpdate your.ntp.server'' is required then to > jump it to the correct time. > > If you run the following on one of your failing hosts, what does it output? > > ntpdate -q your.ntp.server > > On a correctly syncing server here, I see: > > server my.ntp.server, stratum 2, offset 0.008437, delay 0.05721 > 22 Oct 12:34:27 ntpdate[25978]: adjust time server my.ntp.server offset > 0.008437 sec > > ntpd(8) is enlightening as to how quickly/slowly, if at all, the clock > will be adjusted in various situations. > > Regards, > > Matt. >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Hi, Thanks for the response. Yes, the puppet agent runs correctly and looks fine, ntp shows as ''set'' in the run but no change to time. So Yes, the time is not correct. On one its an hour fast of what it should be and shows PST as zone. The other Server shows 22 hours faster than it should be and is also PST. So the time just doesnt match up, though the zone is technically correct. I dont use a NTPD server locally, I use default ntp servers. When I force time change by stopping ntpd, then running ntpdate {time server}, then ntpd start, it syncs up to correct time. After a while though, it drifts away. Thanks Matthew Burgess for your response and I hope my response helps you understand better what I need help with. -Tony -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.