Have to update time on server every day to login
Have to update time on server every day to login
I get the NSP: Sorry Dave, I can't let you do that" error every time i reboot and try to login.
Each time before i reboot i need to force a time update, and then it works.
Is there a way to fix this perm?
Also it is setup to use dhcp, how do i cange it to static? can this be done within the interface or only CLI?
I would also need to add IP, subnet, GW, and dns.
I used ifconfig, but it reverted back to dhcp on reboot.
Each time before i reboot i need to force a time update, and then it works.
Is there a way to fix this perm?
Also it is setup to use dhcp, how do i cange it to static? can this be done within the interface or only CLI?
I would also need to add IP, subnet, GW, and dns.
I used ifconfig, but it reverted back to dhcp on reboot.
Re: Have to update time on server every day to login
I'm not sure what you're asking here. What do you do when you force a time update? Have you installed NTP on your VM CentOS?bretlevi wrote:Each time before i reboot i need to force a time update, and then it works.
Is there a way to fix this perm?
There sure is, I can give you the CLI procedure. Also, make sure your network is ready to take a static IP.bretlevi wrote:Also it is setup to use dhcp, how do i cange it to static? can this be done within the interface or only CLI?
You're going to edit your ifcfg-eth0, which in CentOS is located in /etc/sysconfig/network-scripts/, to edit put in the following command
Code: Select all
nano /etc/sysconfig/network-scripts/ifcfg-eth0Code: Select all
DEVICE=eth0
BOOTPROTO=none [<---notice this changed to none]
HWADDR=XX:XX:XX:XX:XX:XX [don't change this hex address]
ONBOOT=yes
USERCTL=no
PEERDNS=yes
NETMASK=[insert the netmask you want here]
IPADDR=[insert the IP address you want here]
GATEWAY=[insert your gateway here]Then go to /etc/ directory and
Code: Select all
nano resolv.confNicholas Scott
Former Nagios employee
Former Nagios employee
Re: Have to update time on server every day to login
For the time issue are you running the VM with VMWare player, VM on ESX, or using a manual install of XI? I know that when a virtual server gets powered off or rebooted the time needs to be resynced, which can be done by the following:
You may also need to hold shift and reload the login page on the browser to refresh the javascript cache and clear the stored session data.
Code: Select all
yum install ntp
ntpdate pool.ntp.org Re: Have to update time on server every day to login
Himguthrie wrote:For the time issue are you running the VM with VMWare player, VM on ESX, or using a manual install of XI? I know that when a virtual server gets powered off or rebooted the time needs to be resynced, which can be done by the following:
You may also need to hold shift and reload the login page on the browser to refresh the javascript cache and clear the stored session data.Code: Select all
yum install ntp ntpdate pool.ntp.org
I just installed ntp, but I still get the wrong timezone. What am I doing wrong? Can I choose my timezone somewhere? I've set:
Code: Select all
date.timezone = Etc/GMT+1
service httpd restart/Ditlev
Ditlev - Nagios newbie
Nagios XI, 2011R1.6, 32bit
Operating system
LSB Version: :core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch
CentOS release 5.6 (Final)
Nagios XI, 2011R1.6, 32bit
Operating system
LSB Version: :core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch
CentOS release 5.6 (Final)
-
tonyyarusso
- Posts: 1128
- Joined: Wed Mar 03, 2010 12:38 pm
- Location: St. Paul, MN, USA
- Contact:
Re: Have to update time on server every day to login
For the timezone, there are two separate settings - the system timezone and the PHP timezone. The PHP timezone is set in the php.ini as you indicated. The system timezone is set in /etc/sysconfig/clock combined with copying the relevant file from /usr/share/zoneinfo/ to /etc/localtime. So in your case, you would want to do this:
As far as NTP goes, note that there are two modes of operation. The 'ntpdate' utility does a one-time correction when called, and is useful for quick corrections on an as-needed basis. The 'ntpd' daemon will run continuously, keeping your clock in sync all the time. You will likely want to set up the latter, or check your virtualization platform's documentation for what approach is recommended for you.
Code: Select all
cp /usr/share/zoneinfo/Etc/GMT+1 /etc/localtime
sed -i 's%.*ZONE.*%ZONE="Etc/GMT+1"%' /etc/sysconfig/clock
sed -i 's%.*date\.timezone.*%date\.timezone = Etc/GMT+1%' /etc/php.ini
service httpd restart
Re: Have to update time on server every day to login
Hi, and thanks for your replytonyyarusso wrote:For the timezone, there are two separate settings - the system timezone and the PHP timezone. The PHP timezone is set in the php.ini as you indicated. The system timezone is set in /etc/sysconfig/clock combined with copying the relevant file from /usr/share/zoneinfo/ to /etc/localtime. So in your case, you would want to do this:As far as NTP goes, note that there are two modes of operation. The 'ntpdate' utility does a one-time correction when called, and is useful for quick corrections on an as-needed basis. The 'ntpd' daemon will run continuously, keeping your clock in sync all the time. You will likely want to set up the latter, or check your virtualization platform's documentation for what approach is recommended for you.Code: Select all
cp /usr/share/zoneinfo/Etc/GMT+1 /etc/localtime sed -i 's%.*ZONE.*%ZONE="Etc/GMT+1"%' /etc/sysconfig/clock sed -i 's%.*date\.timezone.*%date\.timezone = Etc/GMT+1%' /etc/php.ini service httpd restart
I tried your suggestion and everything seems right, ...but the time.
Well, I realized that we're at summertime here so I changed to the following:
Code: Select all
cp /usr/share/zoneinfo/Etc/GMT+2 /etc/localtime
sed -i 's%.*ZONE.*%ZONE="Etc/GMT+2"%' /etc/sysconfig/clock
sed -i 's%.*date\.timezone.*%date\.timezone = Etc/GMT+2%' /etc/php.ini
service httpd restart
Code: Select all
[root@localhost ~]# clock
Mon 06 Jun 2011 07:59:31 AM GMT+1 -0.736826 seconds
[root@localhost ~]# ntpdate pool.ntp.org
6 Jun 07:59:56 ntpdate[10322]: adjust time server 178.237.34.94 offset 0.001051 sec
Just for the record, I run Nagios XI, I do have Internet connection and can ping (ex. pool.ntp.org).
Any ideas?
Sincerely yours
/Ditlev
EDIT: it seems there are difference between the time in the webinterface and the Nagios server.
Ex:
Nagios webinterface: 12.00
Nagios server: 13.00
Local time: 16.00
Ditlev - Nagios newbie
Nagios XI, 2011R1.6, 32bit
Operating system
LSB Version: :core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch
CentOS release 5.6 (Final)
Nagios XI, 2011R1.6, 32bit
Operating system
LSB Version: :core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch
CentOS release 5.6 (Final)
-
tonyyarusso
- Posts: 1128
- Joined: Wed Mar 03, 2010 12:38 pm
- Location: St. Paul, MN, USA
- Contact:
Re: Have to update time on server every day to login
For starters, if your locale uses summer time then you do not want to use the direct GMT offset definitions. Instead, use the proper locale, which will know when you switch and by how much:ditlevw wrote: Well, I realized that we're at summertime here so I changed to the following:
Code: Select all
cp /usr/share/zoneinfo/Europe/Copenhagen /etc/localtime
sed -i 's%.*ZONE.*%ZONE="Europe/Copenhagen"%' /etc/sysconfig/clock
sed -i 's%.*date\.timezone.*%date\.timezone = Europe/Copenhagen%' /etc/php.ini
service httpd restart
-
tonyyarusso
- Posts: 1128
- Joined: Wed Mar 03, 2010 12:38 pm
- Location: St. Paul, MN, USA
- Contact:
Re: Have to update time on server every day to login
Once you've done that, please follow the instructions in the attached PDF, using the attached PHP script, and show me your screenshot.
You do not have the required permissions to view the files attached to this post.
Re: Have to update time on server every day to login
Thanks. It helped a bit.tonyyarusso wrote:Once you've done that, please follow the instructions in the attached PDF, using the attached PHP script, and show me your screenshot.
As you can see, the server time, is still wrong. I forgot to tell, that I'm running Nagios on a VM server ESX 4.1. I have installed VM tools. I don't know if that has something to do with it.
I have read the Nagios Wiki, without finding anything usefull to my time-problem.
Any ideas?
/Ditlev
You do not have the required permissions to view the files attached to this post.
Ditlev - Nagios newbie
Nagios XI, 2011R1.6, 32bit
Operating system
LSB Version: :core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch
CentOS release 5.6 (Final)
Nagios XI, 2011R1.6, 32bit
Operating system
LSB Version: :core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch
CentOS release 5.6 (Final)