redhat

Get Process Count on Linux

The first part is to identify the PPID. I used this command to get my PPID for the mysql user:

# ps -A -mPl | grep mysql

 

I then used this command to get the total count for all child processes for the given PPID for the mysql user:

# ps -elm|grep 902|grep -v grep |wc -l

Output

377

 

If you want to get a count of ALL processes, use the following command:

#  ps -elm|wc -l

Output

1142

 

Kevin is putting a script together that will collect these counts periodically. One of us will post it to the article when tested and complete.

redhat

How To Get Computer Serial Number Using CMD Line in Linux

DMIDECODE
Use dmidecode command. If it’s not on the system, install it first.

yum install dmidecode

Now that it’s installed, run it.

dmidecode -t system

Output Example

SMBIOS 2.3 present.

Handle 0x0100, DMI type 1, 25 bytes.
System Information
Manufacturer: HP
Product Name: ProLiant DL380 G4
Version: Not Specified
Serial Number: XXXXXXXXXXX
UUID: XXXXXXX-XXXXX-XXXXXXX-XXXXXXXX-XXXXXXXX
Wake-up Type: Power Switch

Handle 0x2000, DMI type 32, 11 bytes.
System Boot Information
Status: No errors detected

Variations to use instead of "system":

bios
system
baseboard
chassis
processor
memory
cache
connector
slot