Sunday, December 28, 2014

Fix for VMware Workstation “Not enough physical memory is available” Error

VMware Workstation is, in my eyes, the best personal virtualization product around. Although other products exist, such as the free client Hyper-V on Windows 8/8.1 and Oracle Virtual Box, VMware Workstation has so many features that makes it much more usable compared to other offerings. I’ve used it for many years, and now VMware Workstation is on version 10. On my laptop I have several virtual machines (VMs) that I constantly use for various purposes, mostly running Windows Server 2012 R2 and Windows 7/8.1, but I also have some CentOS and RedHat VMs.
Sponsored
A couple of days ago I rebooted my laptop due to a Microsoft Windows Update, and when it started I launched VMware Workstation. I powered on one of my VMs, as I usually do. But this time I was presented with the following error:
Not enough physical memory is available to power on this virtual machine with its configured settings.
To fix this problem, power off other virtual machines, decrease the memory size of this virtual machine to 220 MB, increase the amount of physical memory for all virtual machines to 2256 MB, or adjust the additional memory settings to allow more virtual machine memory to be swapped.
It is possible that native applications and/or services have locked down memory which could be preventing the virtual machine from launching. Shutting down unnecessary applications or services may free enough memory to launch this virtual machine.
If you were able to power on this virtual machine on this host computer in the past, try rebooting the host computer. Rebooting may allow you to use slightly more host memory to run virtual machines.
And here’s a screenshot of the error I received:
Physical memory error message generated by VMware Workstation. (Image Credit: Daniel Petri)
Physical memory error message generated by VMware Workstation. (Image Credit: Daniel Petri)
The actual number of megabytes that the prompt tells you to configure may change, and sometimes it even changes between reboots of the host machine.
What? That cannot be right. My laptop has 16 GB of RAM and there were no apps that took more than 4 GB overall, which left more than 12 GB free. The VM I tried to boot was a Windows Server 2012 R2 machine with 4 GB of RAM.
I tried again, same error. I tried a different VM, same error. All my VMs couldn’t boot.
Since the same VMs worked just fine since my last reboot of the host laptop, I rebooted it, hoping it will make the error go away. It didn’t.
I looked around on the Internet. Reading some forum posts that I found, this error appears for a random reason and has been around in older versions of VMware Workstation, where it’s been found to go back to VMware Workstation 6.
Sponsored

4 Fixes for “Not enough physical memory” Errors

There were four approaches that I found to solve this error. For me, the third one worked, but I’ll list all of them just in case.

Fix #1 – Run as Administrator

1. Make sure VMware Workstation is not running.
2. If you have an icon for VMware Workstation on your desktop, right-click it and read on. If you don’t have an icon on the desktop, find it in Start and right-click it.
Navigating to VMware Workstation properties. (Image Credit: Daniel Petri)
Navigating to VMware Workstation properties. (Image Credit: Daniel Petri)
3. Select “Open file location.”
4. Right-click the VMware Workstation icon and select Properties. Go to the Compatibility tab and select “Run this program as administrator.”
Running VMware Workstation as an administrator. (Image Credit: Daniel Petri)
Running VMware Workstation as an administrator. (Image Credit: Daniel Petri)
5. Click OK.
6. Try to run VMware Workstation and boot your VM. If it works, fine. If not, read on.

Fix #2 – Uninstall Windows Update Fix KB2995388

1. If you have the Windows Update fix KB2995388 installed on your machine, then you may want to remove it. It should solve the VMware error, but it will prevent you from getting the other fixes in this rollup update, so I wouldn’t rush to go down this path.
2. October 2014 update rollup for Windows RT 8.1, Windows 8.1, and Windows Server 2012 R2.

Fix #3 – Modify the config.ini file (Host Parameters)

1. Open the config.ini file located by default at C:\ProgramData\VMware\VMware Workstation.
2. Add the following line to the end of the file:
3. Save the file. You may need to edit it as an administrator in case you get an error during the save.
4. Reboot your host computer.
5. Try to run VMware Workstation and boot your VM.
Sponsored

Fix # 4 – Modify the config.ini file (VmMemPct)

1. Open the config.ini file located by default at C:\ProgramData\VMware\VMware Workstation.
2. Add the following lines to the end of the file:
3. Use “100” to run a few VMs with best performance, or use lower values such as “25” if you want to run many VMs at the same time.
Note: These settings can also be done through the VMware Workstation UI under > Edit > Preferences.
Managing preferences for VMware Workstation. (Image Credit: Daniel Petri)
Managing preferences for VMware Workstation. (Image Credit: Daniel Petri)


Some more tuning options:
  • The VMware Continuum tuning guide provides instructions to set up the host for expected usage.
  • Save the file. Note that you may need to edit it as administrator in case you get an error while saving.
  • Reboot your host computer.
  • Try to run VMware Workstation and boot your VM.

Thursday, June 12, 2014

How to Reset Your Forgotten Windows Password the Easy Way

image[2]
Forgetting your password is never any fun, but luckily there’s a really easy way to reset the password. All you need is a copy of the Windows installation disk and one simple command line trick.

Resetting Your Forgotten Windows Password

Boot off the Windows disk and select the “Repair your computer” option from the lower left-hand corner.
image
Follow through until you get to the option to open the Command Prompt, which you’ll want to select.
image
First you’ll want to type in the following command to backup the original sticky keys file:
copy c:\windows\system32\sethc.exe c:\
Then you’ll copy the command prompt executable (cmd.exe) over top of the sticky keys executable:
copy c:\windows\system32\cmd.exe c:\windows\system32\sethc.exe
image
Now you can reboot the PC.

Resetting the Password

Once you get to the login screen, hit the Shift key 5 times, and you’ll see an administrator mode command prompt.
image
Now to reset the password—just type the following command, replacing the username and password with the combination you want:
net user geek MyNewPassword
image
That’s all there is to it. Now you can login.
Of course, you’ll probably want to put the original sethc.exe file back, which you can do by rebooting into the installation CD, opening the command prompt, and copying the c:\sethc.exe file back to c:\windows\system32\sethc.exe.

Thursday, May 29, 2014

How to Enable ICMP (PING) through the Windows Firewall with Advanced Security using Group Policy

Prerequisites

You will require the Group Policy Management Tools on Windows 7, Windows 8, Windows Server 2008, Windows or Server 2012. These are part of the Remote Server Administration Tools (RSAT) availabale form the Microsoft web site.

Instructions

To enable ICMP on computers using the Windows Firewall with Advanced Security (Windows Vista, Windows 7, Windows 8, Windows Server 2008, Windows Server 2012) please follow these instuctions.
  1. Edit an existing Group Policy object or create a new one using the Group Policy Management Tool.
  2. Expand the Computer Configuration/Policies/Windows Settings/Security Settings/Windows Firewall with Advanced Security/Windows Firewall with Advanced Security/Inbound Rules node.
    Group Policy Management Editor
  3. Check the Custom radio button and click Next
    New Inbound Rule Wizard
  4. Check the All Programs radio button and click Next
    New Inbound Rule Wizard
  5. From the Protocol Type: drop down list select ICMPv4 and click Customize...
    New Inbound Rule Wizard
  6. Check the All ICMP types radio botton and click OK.
    Note: If you want to limit ICMP to specific types Echo Request should be allowed as a minimum.
    Customize ICMP Settings
  7. You may choose to restrict what IP addresses ICMP is allowed to and from or check the Any IP address radio buttons to allow all then click Next.
    New Inbound Rule Wizard
  8. Check the Allow the Connection radio botton and click Next.
    New Inbound Rule Wizard
  9. Choose what profiles the rule will apply to. Check the Domain profile checkbox as a minimum and click Next.
    New Inbound Rule Wizard
  10. Add a meaninful name for the rule in the Name: field. Add a description if desired and click Finish to exit and save the new rule.
    New Inbound Rule Wizard
  11. Make sure the Group Policy Object is applied to the relevant computers using the Group Policy Management Tool.

Monday, April 7, 2014

Definition of Web Browsers

A browser is software that is used to access the internet. A browser lets you visit websites and do activities within them like login, view multimedia, link from one site to another, visit one page from another, print, send and receive email, among many other activities. The most common browser software titles on the market are: Microsoft Internet Explorer, Google's Chrome, Mozilla Firefox, Apple's Safari, and Opera. Browser availability depends on the operating system your computer is using (for example: Microsoft Windows, Linux, Ubuntu, Mac OS, among others).

Software Suites and Integrated Packages

Software Suites and Integrated Packages
Software suite is the popular general-purpose application software. That’s because the most widely used productivity packages come with bundle together as software suites such as Microsoft office, Lotus Smart Suite, Coral WordPerfect Office, and Sun’s StarOffice. Examining their components gives us an overview of the important software tools that can be used to increase productivity.



Notice that each suite integrates software packages for word processing, spreadsheets, presentation graphic, database management, and personal information management. Microsoft, Lotus, Corel, and Sun bundle several other programs for internet access, E-mail, Web publishing, desktop publishing, voice recognition, financial management, electronic encyclopedia, and so on.

Advantages of software suite
A software suite costs a lot less that the total cost of buying its individual packages separately. Another advantages is that all programs use is similar graphical user interface (GUI) of icons, tool, and status bars, menus, and so on, which give them the same look and feel, and makes them easier to learn and use. Software suite also share common tools, such as spell checkers and help wizards to increase their efficiency. Another big advantage of suites is that their programs are designed to work together seamlessly and import each other’s file easily; no matter which program is being using at the times. These capabilities make them more efficient and easier to use that using a variety of individual package version.

Disadvantages of software suite
Of course, putting so many programs and features together in one super-size package does have some disadvantages. Industry critics argue that many software suite features are never used by most end users. The suites take a lot of disk space, from over 100 megabytes to over 150 megabytes, depending on which version or functions installed. So such software is sometimes derisively called ‘bloatware’ by its critics. These drawbacks are one reason for the continued use of integrated packages like Microsoft Works, Lotus e-suite WorkPlace, AppleWorks, and so on. Integrated packages combine some of the function of several programs-word processing, spreadsheets, presentation graphics, database management, and so on into one software package.
Software Suites and Integrated P

Computer Software Definition

Software is a generic term for organized collections of computer data and instructions, often broken into two major categories: system software that provides the basic non-task-specific functions of the computer, and application software which is used by users to accomplish specific tasks.
System software is responsible for controlling, integrating, and managing the individual hardware components of a computer system so that other software and the users of the system see it as a functional unit without having to be concerned with the low-level details such as transferring data from memory to disk, or rendering text onto a display. Generally, system software consists of an operating system and some fundamental utilities such as disk formatters, file managers, display managers, text editors, user authentication (login) and management tools, and networking and device control software.
Application software, on the other hand, is used to accomplish specific tasks other than just running the computer system. Application software may consist of a single program, such as an image viewer; a small collection of programs (often called a software package) that work closely together to accomplish a task, such as a spreadsheet or text processing system; a larger collection (often called a software suite) of related but independent programs and packages that have a common user interface or shared data format, such as Microsoft Office, which consists of closely integrated word processor, spreadsheet, database, etc.; or a software system, such as a database management system, which is a collection of fundamental programs that may provide some service to a variety of other independent applications.
Software is created with programming languages and related utilities, which may come in several of the above forms: single programs like script interpreters, packages containing a compiler, linker, and other tools; and large suites (often called Integrated Development Environments) that include editors, debuggers, and other tools for multiple languages. 

Wednesday, March 12, 2014

Linux How to set kernel parameters in sysctl.conf file permanently

How to set kernel parameters in sysctl.conf file permanently in Linux? Specifically RHEL in this case, but this applies to centos as well. Even Suse I believe :)  The kernel parameters can be tuned dynamically with the sysctl command.  Meaning you can change a kernel parameter on the fly.  But this won’t survive a reboot.  To make this type of change permanently the best and possibly easiest way is to either edit the /etc/sysctl.conf file and then save it with the sysctl -p command below.

Edit /etc/sysctl.conf file

# vi /etc/sysctl.conf
Add or change whatever entries you need to in sysctl.conf, as given below.
kernel.sem=1000 32000 32 512 kernel.msgmni = 1024 fs.file-max = 65535 net.ipv4.tcp_max_syn_backlog = 8192 # set cause we are now a router net.ipv4.ip_forward = 1 # Controls the maximum size of a message, in bytes kernel.msgmnb = 32768 # Controls the default maxmimum size of a mesage queue kernel.msgmax = 65536 # Controls the maximum shared segment size, in bytes kernel.shmmax = 68719476736 # Controls the maximum number of shared memory segments, in pages kernel.shmall = 4294967296
Confirm that there are no duplicate entries in the /etc/sysctl.conf file. To install the newly configured kernel paramaters, run the sysctl command with the -p parameter. This loads the sysctl settings from the default file /etc/sysctl.conf.
# sysctl -p

Linux Understanding SHMMAX and SHMALL Settings

Linux Understanding SHMMAX and SHMALL Settings

Linux and understanding SHMMAX and SHMALL kernel paramaters are the key to your oracle databases performance. These two parameters are pretty important paramaters and they affect how Oracle creates and manages SGA’s.  Your operating system has to provide an application access to a certain type of memory with certain types of controls.  It’s the Unix kernel that allows applications to access shared memory (IPC), and how much memory, in multiple big chunks or small chunks etc…
Sometimes, portions of memory get used leaving memory segments out of order.  So these chunks of memory, from Linux Understanding SHMMAX and SHMALLnow on called segments, can get used inefficiently leaving unused memory segments.  This can be caused by many reasons which I won’t get into now.  So when Orale wants to access some shared memory on startup, it knows how much memory it needs for it’s SGA and has to figure out the best and most efficient way to access the resource.  If Oracle needs 8GB or shared memory but can only find 4 seperate 2GB segments that are out of order, it will then have no choice but to use this memory model.  This non-contiguous memory model isn’t the best.  Oracle will use shared memory in 3 different ways or memory models.  The first memory model as just described, the non-contiguous model where the memory segments are scattered over the place.  Another memory model being multiple memory segments that are in fact contiguous, so this is better, less overhead than the non-contiguous model.  But the ultimate is one big segment that is the size of the SGA. So in this case an 8 GB segment.  And that is where the tuning comes into play.  How to tune the kernel and it’s paramaters to meet your Oracle applications shared memory needs.  As I mentioned in the opening paragraph, its the SHMMAX that is the key kernel paramater in Linux to tune the SGA shared memory requirement.

Shared memory and SHMMAX and SHMALL

Just to clarify a couple of definitions, I will go over some terminology.  The term shared memory is a term used to describe a type of memory management in the Unix kernel.  It is a memory region that can shared between different processes.  Oracle uses this shared memory when using and implementing the SGA, which has to be visible to all database sessions.  Using a shared memory model, this avoids creating duplicate copies of memory.  So programs can eaily share data.  These regions of memory, because they are shared need to have controls on who can access them and who can’t. A locking mechanism is required. This is where semaphores come into play. Basically, flags that are either on or off. If the memory is being used, the process turns on the flag and other processes have to wait until the semaphore is freed or the flag is turned off.  So shared memory needs semaphores, they go hand in hand.  I should probably mention that an application can access shared memory programatically through a set of POSIX C routines, common on most Unix like operating systems including Linux.  The IPC or shared memory API’s have common IPC calls like shmget() and shmat() which allow the programmer to get a shared memory segment, or attach to a segment.  There are many more.  Now the kernel paramaters SHMMAX and SHMALL need to be defined now. SHMMAX is really just the maximum size of a single shared memory segment.  It’s size is represented in bytes”.  And SHMALL is the sum of all shared memory segments on the whole system.  But it is measured in number of pages.  Will leave it at that for now.
At times on very busy transactional databases, you can run out of semaphores. This seriously limits the performance of a database. You can look at your semaphores as follows:
# ipcs -s ------ Semaphore Arrays -------- key        semid      owner      perms      nsems      0x00000000 0          root       600        1          0x00000000 65537      root       600        1          0x00000000 229378     oracle     660        300        0x00000000 265667     oracle     660        300       0x00000000 247100     oracle     660        360
Enough of a semaphore tangent. Linux being a type of Unix, there are 300 different ways of finding the value of a system paramaters. The traditional way is calling ipcs to list the shared memory limits:
# ipcs -lm
------ Shared Memory Limits --------
max number of segments = 4096       <--- this is SHMMNI
max seg size (kbytes) = 67108864    <--- this is SHMMAX
max total shared memory (kbytes) = 17179869184<- this is SHMALL
min seg size (bytes) = 1

Or cat’ing the /proc/* data structures

#  cat /proc/sys/kernel/shmall
4294967296
#  cat /proc/sys/kernel/shmmax
68719476736

Now, how do you configure SHMALL for an Oracle database

Right off the top, since SHMALL is the sum of all the shared memory segments on your system, you had better make it smaller than your total system memory.  If I remember correctly, back in the 90′s, when memory was more expensive than the US space program,  on HP-UX systems we used to define shared memory SHMALL equivalent to much larger than physical memory. Swap disks were busy then. I don’t know if it’s possible to do this now, but it’s not recommended. I’ll have to test that some day for fun. SHMALL should also be less than the sum of all the SGA’s configured on the system.  If you allow more shared memory than the physical memory on the system, then your asking for a world of hurt.  Obviously your system has to be sized appropriately for the work to be done.  If you create a new database instance and start Oracle which will then want to create a new SGA, shmget() -> shmat() etc… it will fail with the much feared “out of memory” etc…  This just means that SHMALL is doing it’s job properly and preventing Oracle from taking what it isn’t allowed to take.
A typical error message caused by there being insufficient memory when an Oracle instance is starting would be somehing like:
ORA-27102: out of memory Linux-x86_64 Error: 28: No space left on device
This means SHMALL is doing it’s job. As shared memory is a device, ie. /dev/shm, the error message above makes sense.

The logic behind finding the SHMALL value for your system

Configuring the kernel parameter SHMALL is mostly just basic math.  It’s a decision that involves finding the amount of memory you want to give to Oracle, or how much you can give away.  This memory I am talking about can be talked about in terms of physical memory.  Physical memory shouldn’t be confused with virtual memory which has swap space included.  From the physical memory we take away the memory that the operating system needs.  Linux will use a lot of memory for disk caching and other assorted data structures.  So lets be moderately generous and say we will give the Unix kernel 1GB, this is a good rule.

Working example

System memory 12GB
Linux Kernel  1GB
Memory for Oracle  11GB (System memory – Linux Kernel)
So we can assign SHMALL the value of 11GB. But… SHMALL is measured in memory pages not bytes.  We need to divide the 11GB by the systems page size value.  It’s almost always 4K which is the recommended size, but to be safe, you run the following command:
# getconf PAGE_SIZE
4096
We have to convert the 11GB byte value into a page value because as I mentioned above, SHMALL is measured in page size.  I don’t make the rules, sorry.  I use bc, the unix calculator and I don’t need decimal places.
# bc
bc 1.06.95
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
11*1024*1024*1024   <--- 11 x 1K x 1K x 1K gives me 11GB value in bytes
11811160064
11811160064/4096    <--- 11GB value in bytes divided by 4k (page size)
2883584             <--- page size value to assign to SHMALL

This is a tad conveluted, but easy math.  Lets make this SHMALL kernel paramater permanent by adding it to the /etc/sysctl.conf file.

# vi /etc/sysctl.conf
kernel.shmall = 2883584

The logic behind finding the SHMMAX value for your system

If you read the release and install and configuration documentation for Oracle 11g, Oracle recommends you set Linux Understanding SHMMAX and SHMALLshmmax to half of your physical memory or 4 GB less 1 byte. Choose whichever is lower.  The interesting 4 GB less 1byte memory setting is based on the virtual memory addressing limitations of the 32 bit (x86) processors. All 64 bit processors can address much larger memory addresse space and is not limited like it’s 32 bit brethren. So much larger shared memory segments can be permitted and created and used.
When Oracle first starts up, after having read it’s configuration files it will know how much memory it needs for it’s assorted SGA’s.  The best fit for an Oracle SGA shared memory segment is when the SGA fits into one shared memory segment.  As I mentioned earlier, Oracle can use non-contiguous shared memory segments, but its not Oracle’s chosen memory model.  Therefore by defenition, if the SGA is larger than the value of SHMMAX, then Oracle has to use one of the two other remaining shared memory models.  Contiguous or non-contiguous memory segments.
I try to set the SHMMAX to the size of the largest SGA defined on your database server.  If your system has 6 Oracle instances configured, 2 require 2 GB SGA’s, 2 require 1.5GB SGA’s and 2 require 1 GB SGA’s, you would set the SHMMAX to 2GB.
Edit your sysctl.conf and add the SHMMAX value to 2 GB in bytes
# vi /etc/sysctl.conf
kernel.shmmax = 2147483648
Or, as this is Unix and there are many ways of doing things, use sysctl -w argument=xyz which writes to the sysctl.conf file.
# sysctl -w kernel.shmmax=2147483648
Now reload the parameters by asking sysctl politely to to reread it’s configuration
# sysctl –p
Now that you have configured shmmax and shmall, and all the other steps required to configure you system for Oracle, I will jump ahead very fast here and install Oracle and create a test db instance.
# su - oracle
$ cd /tmp/2wherever/install/files/are
$ ./runInstaller
….
# service oracle start
Create a test databse
$ dbca
etc…..
# ipcs -a ------ Shared Memory Segments -------- key        shmid      owner      perms      bytes      nattch     status 0x6c6c6536 0          root       600        4096       0 0x2270894c 2359297    oracle     660        1512046592 30 ------ Semaphore Arrays -------- key        semid      owner      perms      nsems 0x00000000 0          root       600        1 0x00000000 65537      root       600        1 0x00000000 294914     apache     600        1 0x00000000 327683     apache     600        1 0x396b9144 983044     oracle     660        154 ------ Message Queues -------- key        msqid      owner      perms      used-bytes   messages

The last few steps have been exceedingly oversimplied, but the point here is to show the shared memory use.  You will also see that user oracle has grabbed 154 semaphores.  This isn’t a huge number, and in this case it’s only a test db instance so no real traffic.

Wednesday, January 22, 2014

Install the rsyslog7 to CentOS6

Summary

Rsyslog v5 is installed by default on CentOS6 series.
Note how to install rsyslog v7 to this CentOS, to transfer the TCP syslog.
(New format while maintaining backward compatibility RainerScript because like has been adopted), and try to write in the new format is also set.

Install rsyslog v7

I want to install it according to the next page
Community of rsyslog because it provides the rpm of the latest version, I take advantage of this.
Add file who wrote the repository information.
# cat /etc/yum.repos.d/rsyslog.repo
[rsyslog-v7-stable]
name=Adiscon Rsyslog v7-stable for CentOS-$releasever-$basearch
baseurl=http://rpms.adiscon.com/v7-stable/epel-$releasever/$basearch
enabled=1
gpgcheck=0
protect=1
List of packages that are available, see the following files.
The following packages are provided in the current 2013/12/23.
  • v5-stable
  • v6-stable
  • v7-stable
  • v7-devel
  • v8-devel

The update package information

# yum update
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
base                                                     | 3.7 kB     00:00
extras                                                   | 3.4 kB     00:00
extras/primary_db                                        |  19 kB     00:00
rsyslog-v7-stable                                        | 2.5 kB     00:00
rsyslog-v7-stable/primary_db                             | 103 kB     00:02
updates                                                  | 3.4 kB     00:00
updates/primary_db                                       | 817 kB     00:01
Setting up Update Process
...

# yum info rsyslog
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * epel: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
Installed Packages
Name        : rsyslog
Arch        : x86_64
Version     : 7.4.7
Release     : 1.el6
Size        : 2.8 M
Repo        : installed
From repo   : rsyslog-v7-stable
Summary     : Enhanced system logging and kernel message trapping daemon
URL         : http://www.rsyslog.com/
License     : (GPLv3+ and ASL 2.0)
Description : Rsyslog is an enhanced, multi-threaded syslog daemon. It supports MySQL,
            : syslog/TCP, RFC 3195, permitted sender lists, filtering on any message part,
            : and fine grain output format control. It is compatible with stock sysklogd
            : and can be used as a drop-in replacement. Rsyslog is simple to set up, with
            : advanced features suitable for enterprise-class, encryption-protected syslog
            : relay chains.

Install the rsyslog

# yum instal rsyslog
...
# rsyslogd -v
rsyslogd 7.4.7, compiled with:
        FEATURE_REGEXP:                         Yes
        FEATURE_LARGEFILE:                      No
        GSSAPI Kerberos 5 support:              Yes
        FEATURE_DEBUG (debug build, slow code): No
        32bit Atomic operations supported:      Yes
        64bit Atomic operations supported:      Yes
        Runtime Instrumentation (slow code):    No
        uuid support:                           Yes

See http://www.rsyslog.com for more information.

Server Setting

Configuration file (to accept the transfer log in TCP server in the log receiver /etc/rsyslog.conf to change)
That's legacy format
module(load="imtcp") # needs to be done just once
input(type="imtcp" port="514")
To accept the transfer log on port 514 if you write and so on.
I write the following in the new format
# /etc/rsyslog.conf

# define log filename
template(name="TransferFilename" type="string" string="/var/log/rsyslog/%fromhost%/syslog.log")

# Import imtcp module
module(load="imtcp"
       keepalive="on"
       MaxSessions="200"
       MaxListeners="20"
       NotifyOnConnectionClose="on")

# Provides TCP syslog reception on port 514
input(type="imtcp"
      port="514")

# TCP でログ転送されたものは TransferFilename で指定したパスにログ出力
# 出力先を "-" で始めているので、バッファリングされる
# & stop とすると、TCP 転送されたログが
# ここより下で設定されている通常の syslog に混ざらなくなる
if $inputname == "imtcp" then -?TransferFilename
& stop

# ... ここから下に通常の syslog 設定
Logs that are TCP transport is two for each source %fromhost% is logging turn off the directory, and output the local syslog so that their machines are not mixed.
Detailed settings, see the next page

Reload Configuration

Syntax check of the configuration file

Before you enable the setting $ rsyslogd -N1 to check the syntax of the configuration file.
# rsyslogd -f /etc/rsyslog.conf -N 1
rsyslogd: version 7.4.7, config validation run (level 1), master config /etc/rsyslog.conf
rsyslogd: End of config validation run. Bye.
If not specified by the-f option configuration file /etc/rsyslog.conf is utilized.
Of the above settings
if $inputname == "imtcp" then -?TransferFilename
& stop
At the point of stop of the old format ~ If you change to a
if $inputname == "imtcp" then -?TransferFilename
& ~
Deprecated warning similar to the following is displayed.
# rsyslogd -f /etc/rsyslog.conf -N 1
rsyslogd: version 7.4.7, config validation run (level 1), master config /etc/rsyslog.conf
rsyslogd: warning: ~ action is deprecated, consider using the 'stop' statement instead [try http://www.rsyslog.com/e/2307 ]
rsyslogd: End of config validation run. Bye.

Reload the configuration

Rsyslog recent does not me a reload of the configuration file you can send a HUP , and to re-read the configuration and restart the rsyslogd daemon.
514 TCP port to confirm that a LISTEN
# service rsyslog restart
Shutting down system logger:                               [  OK  ]
Starting system logger:                                    [  OK  ]
# netstat -tl --numeric-ports
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 *:80                        *:*                         LISTEN
tcp        0      0 *:22                        *:*                         LISTEN
tcp        0      0 localhost:25                *:*                         LISTEN
tcp        0      0 *:514                       *:*                         LISTEN
tcp        0      0 *:22                        *:*                         LISTEN
tcp        0      0 localhost:25                *:*                         LISTEN
tcp        0      0 *:514                       *:*                         LISTEN
TCP port 514 is generally remote shell (rsh) is defined in the application
$ grep ' 514/' /etc/services
shell           514/tcp         cmd             # no passwords used
syslog          514/udp
netstat if you did not output the numeric port number at the output of the shell and is output.

Client Setting

Transfer via TCP syslog to (192.168.0.1) server log.
If the destination log server does not respond, is set to spool (disk queue) to the local disk.
That's legacy format
$WorkDirectory /var/lib/rsyslog # where to place spool files
$ActionQueueFileName fwdRule1 # unique name prefix for spool files
$ActionQueueMaxDiskSpace 1g   # 1gb space limit (use as much as possible)
$ActionQueueSaveOnShutdown on # save messages to disk on shutdown
$ActionQueueType LinkedList   # run asynchronously
$ActionResumeRetryCount -1    # infinite retries if host is down
*.* @@192.168.0.1:514
I write and so on. @ UDP transport is to be just one.
I write the following in the new format
$WorkDirectory /var/lib/rsyslog
*.* action(type="omfwd"
           protocol="tcp"
           target="cent64a"
           port="514"
           queue.FileName="fwdRule1"
           queue.MaxDiskSpace="1g"
           queue.SaveOnShutdown="on"
           queue.size="1000"
           queue.Type="LinkedList"
           action.resumeretrycount="-1"
           )
Instead to line up with the soggy global variables, and clarity on how it is defined for any action.
Stop the rsyslog process on the destination server log, and then trying a lot of log output,,,
# ls -l /var/lib/rsyslog/
total 7696
-rw-------. 1 root root 1048882 Dec 24 03:21 fwdRule1.00000001
-rw-------. 1 root root 1048924 Dec 24 03:21 fwdRule1.00000002
-rw-------. 1 root root 1048944 Dec 24 03:21 fwdRule1.00000003
-rw-------. 1 root root 1048950 Dec 24 03:21 fwdRule1.00000004
-rw-------. 1 root root 1048880 Dec 24 03:21 fwdRule1.00000005
-rw-------. 1 root root 1048938 Dec 24 03:22 fwdRule1.00000006
-rw-------. 1 root root 1048728 Dec 24 03:22 fwdRule1.00000007
-rw-------. 1 root root  510460 Dec 24 03:22 fwdRule1.00000008
# tail -n 20 /var/lib/rsyslog/fwdRule1.00000008
+pszRcvFromIP:1:9:127.0.0.1:
+offMSG:2:2:25:
>End
.
<Obj:1:msg:1:
+iProtocolVersion:2:1:0:
+iSeverity:2:1:5:
+iFacility:2:1:1:
+msgFlags:2:1:4:
+ttGenTime:2:10:1387822923:
+tRcvdAt:3:34:2:2013:12:24:3:22:3:550422:6:+:9:0:
+tTIMESTAMP:3:34:2:2013:12:24:3:22:3:550422:6:+:9:0:
+pszTAG:1:5:root::
+pszRawMsg:1:27:Dec 24 03:22:03 root: 1:
+pszInputName:1:8:imuxsock:
+pszRcvFrom:1:7:cent64b:
+pszRcvFromIP:1:9:127.0.0.1:
+offMSG:2:2:25:
>End
.
It is spooled and so on.
in-memory (default), and direct queue can be selected also in other disk queue. Details of the queue, see the following URL:

Sample Logging

I try to syslog output actually
client server
$ logger test logging
logging server
$ tail -f  /var/log/rsyslog/cent64b/syslog.log
2013-12-24T03:38:09+09:00 cent64b root: test logging
It has been successfully log transfer mean that.

References

Tuesday, January 21, 2014

Accessing Linux Desktop from Windows XP using TightVNC

You can go this link:

http://mostmahmoud.wordpress.com/2011/02/17/accessing-linux-desktop-from-windows-xp-using-tightvnc/

Have fun!

Tuesday, January 7, 2014

Install Oracle Java JDK/JRE 7u45 on Fedora 20/19, CentOS/RHEL 6.5/5.10

This is guide, howto Install Sun/Oracle Java JDK and JRE 7 update 45 (7u45) on Fedora 20/19/18/17/16/15/14/13/12, CentOS 6.5/6.4/6.3/6.2/6.1/6/5.10, Red Hat (RHEL) 6.5/6.4/6.3/6.2/6.1/6/5.10.

Please you go this link: http://www.if-not-true-then-false.com/2010/install-sun-oracle-java-jdk-jre-7-on-fedora-centos-red-hat-rhel/