Quick Tip: How To Find OS Version On IBM i

To find the OS version of the IBM i (iSeries, AS/400), use the commands below:

DSPSFWRSC

F11

The above commands will result in a screen similar to the one below:

IBM i Version

How To Kill Zombies The Easy Way

How To Kill A Zombie

Zombie processes have been the scourge of the JDE EnterpriseOne landscape for CNC Admins for many years. Usually, they are difficult to troubleshoot because many times there are no logs to assist you and if you do happen to get a log file, more often than not, it just ends abruptly with no hints as to what caused it.

ServerManager-ZombiesSo, what are these “zombies”?

They are server processes that have ended but the system thinks they are still out there and available to do work. It doesn’t take long to figure out that it’s a problem if a Call Object Kernel has died but the system is still sending it work to do.

I’m sure there is an explanation that is a lot more technical and detailed, but for how far I need to dive into these things the above is good enough for me.

How do you get rid of Zombies?

Remove Zombies Using Server Manager

Zombie-ProcessesThe traditional way to rid your system of the dreaded un-dead is to use Server Manager. Use the [Process Detail] view on the EnterpriseServer that has the issue and sort by [Process Status]. You will need to click the column title twice because the processes you are looking for have a status of “STOPPED”.

Then, we check the box beside the little bugger and click [Remove Zombie].

Remove Zombies The Easy Way

Nimish Prabhu has used his .Net skills to devise a way to kill zombie processes using the command line.

Why is that so cool?

Because it can be put into a script and scheduled!

clearzombies JDEDEPSVR.company.com 8999 <USERID> <ENCRYPTED PASSWORD> JDEUBESVR.company.com Ent_Prod /u01/apps/jdedwards/e900/jde_home/agent

Yep, that’s right! Instead of trudging around in Server Manager when you are alerted of a zombie process (Yes, you can be alerted of zombies if you set it up the Monitor in Server Manager), you can just run a script every few hours or so and not have to worry that your system is being overrun by the un-dead.

Nimish’s little application supports Tools Release 8.984.7 and higher. He was very responsive when I had a question and worked with me to extend it’s compatibility.

Thanks Nimish for helping CNC Admins rid the world (or is it OneWorld) of Zombies!

 

5 Ways to Empty a File on Linux

Like most operations on any Operating System, there are several ways to do basic file manipulation on Linux. Below are 5 different ways to empty a file.

Simple Redirection

Redirection is usually used to output command results to a file.  However, if we redirect “nothing” to a file, we can overwrite it with a blank file. Redirection can be done using a “&gt;” greater-than symbol or a “|” pipe symbol.

# > file.txt
or
# :> file.txt

REDIRECT THE echo command

Use the echo command to redirect null values to a file.

# echo -n > file.txt
  • n do not output the trailing newline.

UsE THE truncate command

Use the truncate command to shrink or expand the size of a file to the size specified by the s option value. Use zero to make the file empty.

# truncate -s 0 file.txt
or
# truncate file.txt --size 0

REDIRECT THE /dev/null device

The null device is usually used for disposing of unwanted output streams of a process or as a empty file for input streams or a redirection operation.

# cat /dev/null > file.txt
or
# cp /dev/null file.txt
cp: overwrite 'file.txt'? y

SCRIPT THE Vim Editor

Vim is a text editor built to make creating and changing any kind of text very efficient. It is included as “vi” in most Linux/Unix systems.

# ex -sc ':%d|x' file.txt
or
# ex -sc ':1,$d|x' file.txt
  • ex : Enter into Ex mode
  • s : Silent; do not display prompts
  • c : Run the given ex command upon startup
  • : : Invoke an ex command
  • % : Choose all the lines
  • d : Delete selected lines
  • x : save and close
  • 2g.txt : input filename

Windows 2003 Firewall Rules Allow UNC Access To Shared Folders

E1Tips FireA couple weeks ago I wrote a post about setting up Windows Firewall on a Windows 2003 Server running Oracle JD Edwards EnterpriseOne.

Well, looks like I wrote that article a little too quickly. Because although Oracle JD Edwards EnterpriseOne ran perfectly, the users were not able to access the exported files on the shared folders. Actually, neither was I. In fact, I couldn’t get to any of the shared folders using a basic UNC path (i.e. \\servername\foldername\file.name).

Windows Firewall File and Print SharingI thought this would be easily resolved by checking a box on the Windows Firewall Exceptions tab like on the image to the right. I was wrong. Although, it seemed like it should work, it didn’t.

Then, I did some checking and found that I could access the shared folders from the servers on the same segment as the Windows 2003 Server but not from my laptop. Since I’ve been out of the Windows networking arena for a while and I had no idea what the Infrastructure Team might have setup, I decided to submit a Service Request to our Support Desk and hope for the best. Unfortunately, because Windows Server 2003 reached it’s End-of-Life in 2009, the extremely limited options of the Windows Firewall at that time and the number of different things that have been tried to segregate these servers from the rest of the network, my support options were pretty limited. Our Infrastructure Team worked with me for a while on the issue until we both gave up.

Defeated, I let it sit for a day or so.

Since I was getting tired of seeing that Service Request sitting in my queue, I took a look at it again. I did some research into the exact ports that needed to be opened up on any firewall to allow Windows Shared Folders to be used. Those ports are listed here:

  • udp 137: NetBIOS Name Service (nbname)
  • udp 138: NetBIOS Datagram Service (nbdatagram)
  • tcp 139: NetBIOS Session Service (nbsession)
  • tcp 445: SMB Over TCP

I tried to insert exceptions for those ports but kept getting errors notifying me that “An entry for the same port ‘TCP 445 (SMB over TCP)’ already exists” and I couldn’t make port_can_not_be_addedanother one. So, that made me want to see the raw settings in the registry rather than through the GUI. I did some searching and finally figured out that what I wanted could be found at the following registry key:

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\DomainProfile\GloballyOpenPorts\List]

 

I found the entries to allow Windows Shared Folders and noticed that they were different than the entries that I had added manually. They indicated that the scope was for the “LocalSubNet” rather than “*”. No wonder I could only get to the shared folders from servers that were on the same network segment.

I replace the “LocalSubnet” with “*” and everything worked!

You can use a .reg file like the following to make the changes:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\DomainProfile\GloballyOpenPorts\List]
"137:UDP"="137:UDP:*:Enabled:@xpsp2res.dll,-22001"
"139:TCP"="139:TCP:*:Enabled:@xpsp2res.dll,-22004"
"445:TCP"="445:TCP:*:Enabled:@xpsp2res.dll,-22005"
"138:UDP"="138:UDP:*:Enabled:@xpsp2res.dll,-22002"

That was fun! I think…

Submit a Tip or Trick

Results: Where Does The CNC Function Reside In Your IT Department?

Where do you put CNC?

That was the question I asked in my first survey attempt. Needless to say, the CNC community is a quiet group. I only got 7 responses. I know there are many people that read this blog but rarely do I get comments, suggestions or flat out criticisms. Maybe that’s due to me staying pretty factual (translate “geeky”). For those that actually know me, I don’t seem to hold back when it comes to my opinions.

Anyway, here are the results:

CNC_function_IT Department Survey Chart

So, are you surprised?