Tuesday, January 24, 2012
Sunday, January 22, 2012
Time
CentOS-Setting the time.
http://www.yolinux.com/TUTORIALS/LinuxTutorialSysAdmin.html
Set time: (two methods)
Note than when setting server time to GMT, set your local environment first to GMT: export TZ=GMT0 (link to current GMT)
1)Set hardware clock and sync system (OS) time to match: (hctosys)
Set hardware clock: /sbin/hwclock --utc --set --date="07/30/2008 23:16:30"
(Set either --utc or --localtime)
Then match system clock: hwclock --hctosys
(Set the System Time from the Hardware Clock.)
2)Set system (OS) clock and sync hardware time to match: (systohc)
Set system time (Linux OS time):
date -s 10:20
date 073023162008.30
July 30, 2008 11:16 pm and 30 seconds
date MMDDhhmm.ss
(month, day, hour, minute, year and dot seconds - seconds optional)
(where hours are from 00 to 24)
Set hardware clock to system clock in UTC: /sbin/hwclock --systohc --utc
(UTC preferred for Linux because it allows automatic accounting of daylight savings time. Microsoft\\
OS's use local time. UTC will mess up the time setting on a dual boot system which hosts a Microsoft OS)
Set hardware clock in localtime to current system clock: /sbin/hwclock --systohc
(Same as: /sbin/hwclock --systohc --localtime)
Ubuntu-Setting the time.
If not, you can do this via the commandline in Linux :-
In Linux, set the date and time to what it currently is. For example if it’s 10:20am local time:
user@server:~$ sudo date -s 10:20
Then update the hardware clock accordingly, and force this to be considered “localtime”:
user@server:~$ sudo /sbin/hwclock --systohc --localtime
Check to make sure it looks right:
user@server:~$ sudo /sbin/hwclock --localtime
Sync between hardware clock and system clock:
user@server:~$ sudo /sbin/hwclock --hctosys --localtime
http://www.yolinux.com/TUTORIALS/LinuxTutorialSysAdmin.html
Set time: (two methods)
Note than when setting server time to GMT, set your local environment first to GMT: export TZ=GMT0 (link to current GMT)
1)Set hardware clock and sync system (OS) time to match: (hctosys)
Set hardware clock: /sbin/hwclock --utc --set --date="07/30/2008 23:16:30"
(Set either --utc or --localtime)
Then match system clock: hwclock --hctosys
(Set the System Time from the Hardware Clock.)
2)Set system (OS) clock and sync hardware time to match: (systohc)
Set system time (Linux OS time):
date -s 10:20
date 073023162008.30
July 30, 2008 11:16 pm and 30 seconds
date MMDDhhmm.ss
(month, day, hour, minute, year and dot seconds - seconds optional)
(where hours are from 00 to 24)
Set hardware clock to system clock in UTC: /sbin/hwclock --systohc --utc
(UTC preferred for Linux because it allows automatic accounting of daylight savings time. Microsoft\\
OS's use local time. UTC will mess up the time setting on a dual boot system which hosts a Microsoft OS)
Set hardware clock in localtime to current system clock: /sbin/hwclock --systohc
(Same as: /sbin/hwclock --systohc --localtime)
Ubuntu-Setting the time.
If not, you can do this via the commandline in Linux :-
In Linux, set the date and time to what it currently is. For example if it’s 10:20am local time:
user@server:~$ sudo date -s 10:20
Then update the hardware clock accordingly, and force this to be considered “localtime”:
user@server:~$ sudo /sbin/hwclock --systohc --localtime
Check to make sure it looks right:
user@server:~$ sudo /sbin/hwclock --localtime
Sync between hardware clock and system clock:
user@server:~$ sudo /sbin/hwclock --hctosys --localtime
Friday, January 20, 2012
Nagios
After Nagios install two local host service checks fail, check_http & check_ssh. Check_http is looking for index.html, but can't find it. Check_ssh isn't working because I'm using non-standard ssh port 3509, instead of port 22. Here's how to solve both problems.
My setup-
VMWare 5.0
CentOS 5.7
Nagios Core 3.2.3
1)Solving check_http-
Create index.html file under http root directory.
[root@nagios]# cd /var/www/html
[root@nagios]# touch index.html
Confirm at command line-
[root@nagios]# /usr/lib64/nagios/plugins/check_http nagios
2)Solving check_ssh-
[root@nagios]#vi /etc/nagios/objects/localhost.cfg
Change the argument on the check_command line, like this-
FROM:
define service{
use local-service ; Name of service template to use
host_name nagios.local
service_description SSH
=> check_command check_ssh
notifications_enabled 0
}
TO:
define service{
use local-service ; Name of service template to use
host_name nagios.local
service_description SSH
=> check_command check_ssh!-p 3509
notifications_enabled 0
}
Save the edits and exit vi.
:wq
Confirm at command line-
[root@nagios]# /usr/lib64/nagios/plugins/check_ssh -p 3509 nagios
Restart web services and Nagios.
[root@nagios]# service httpd reload
[root@nagios]# service nagios reload
My setup-
VMWare 5.0
CentOS 5.7
Nagios Core 3.2.3
1)Solving check_http-
Create index.html file under http root directory.
[root@nagios]# cd /var/www/html
[root@nagios]# touch index.html
Confirm at command line-
[root@nagios]# /usr/lib64/nagios/plugins/check_http nagios
2)Solving check_ssh-
[root@nagios]#vi /etc/nagios/objects/localhost.cfg
Change the argument on the check_command line, like this-
FROM:
define service{
use local-service ; Name of service template to use
host_name nagios.local
service_description SSH
=> check_command check_ssh
notifications_enabled 0
}
TO:
define service{
use local-service ; Name of service template to use
host_name nagios.local
service_description SSH
=> check_command check_ssh!-p 3509
notifications_enabled 0
}
Save the edits and exit vi.
:wq
Confirm at command line-
[root@nagios]# /usr/lib64/nagios/plugins/check_ssh -p 3509 nagios
Restart web services and Nagios.
[root@nagios]# service httpd reload
[root@nagios]# service nagios reload
Sunday, January 15, 2012
if !1 0
When searching for command line tips I discovered http://www.if-not-true-then-false.com/. It contains a wide variety of Linux centric howtos. Lots of CentOS, SQL, web server, and related topics are presented in very readable formats. From the site, it contains "Guides and forums about Linux and programming".
Monday, January 9, 2012
SQLite-Souptonuts
Souptonuts is a great collection of Open Source tips and tutorials. I'm currently reading the SQLite tutorial.
Wednesday, January 4, 2012
x.org
The X.Org project provides an open source implementation of the X Window System. The development work is being done in conjunction with the freedesktop.org community. The X.Org Foundation is the educational non-profit corporation whose Board serves this effort, and whose Members lead this work.
Subscribe to:
Posts (Atom)