Few commands to troubleshoot:
Networking slowness
ping -c 3 -M do -s 30000 -T IP
Grep based on time range
grep -v -e "^[2014-03-06T08:[30-59]" soa_server2-diagnostic-1297.log |more
Grep based on time range
grep -v -e "^[2014-03-06T08:[30-59]" soa_server2-diagnostic-1297.log |more
Find number of threads running in the system
cat /proc/PID/status
ps -eLo pid,cmd,nlwpHeap dump
/u01/app/jdk1.6.0_31/bin/jmap -dump:format=b,file=heapdump.hprof 8440
Top running process consuming high CPU
top –H –b –p PID
Strace monitors the system calls and signals of a specific program
/usr/bin/strace –s 200 –o /u01/tmp/some.txt –fp <PID>
Search receive from and socket descriptor from the output file
/usr/bin/lsof |grep port
Sar reports extraction:
LC_ALL=C sar -A -f /var/log/sa/sa09 >>
sar_node1_nov9.txt
You can use ksar tool and generate a nice PDF from the output file.
Zombie process:
ps -lA |grep '^. Z'
4 Z 0 4332 3938
0 85 0 - 0 exit ?
00:00:00 pwck <defunct>
4 Z 0 4339 3938
0 80 0 - 0 exit
? 00:00:00 test <defunct>
4 Z 0 4739 3938
0 82 0 - 0 exit
? 00:00:00 pwck <defunct>
0 Z 0 27064 3938 0
75 0 - 0 exit ?
00:00:00 ldapsearch <defunct>
$ ps axo stat,ppid,comm |grep
-w defunct
Zs 3938 pwck <defunct>
Zs 3938 test <defunct>
Zs 3938 pwck <defunct>
Zs 3938 ldapsearch <defunct>
$ ps -ef |grep 3938
Pmap command reports the memory map of a process:
cat /proc/pid/status or whatever
Pmap command reports the memory map of a process:
cat /proc/pid/status or whatever
pmap -x <process pid>
Java heap dump
I recently worked on a project where I was faced with "out
of memory" problem. Exception appeared usually after the application
has worked for several weeks. I solved the problem with VisualVM tool that
ships with Java 1.6 JDK.
VisualVM tool provides a direct connection to any Virtual Machine locally or remote, or can load heap dump or thread dump from a file.
VisualVM tool provides a direct connection to any Virtual Machine locally or remote, or can load heap dump or thread dump from a file.
To dump heap memory to a file type in console(linux):
1.
Get java process id
ps -eaf | grep java
ps -eaf | grep java
2.
Dump heap memory to a file using jmap ("jmap
prints shared object memory maps or heap memory details of a given process or
core file or a remote debug server")
jmap -heap:format=b PID (where PID i id of your java process)
jmap -heap:format=b PID (where PID i id of your java process)
3.
Run jvisualvm
jvisualvm -J-Xmx512M
jvisualvm -J-Xmx512M
4.
Load heap.bin file
5.
Find biggest objects by retained size. After
file loads you can see every object that was in memory at the time the dump was
taken.Click on find biggest objects by retained size and you will get hierarchy
of biggest objects in memory.
ps – Displays The Processes
ps command will report a snapshot of the current processes. To select all processes use the -A or -e option:
# ps -A
Sample Outputs:
# ps -A
Sample Outputs:
ps -A
PID TTY TIME CMD
1 ttyp0 00:00:22 init
89 ? 00:00:00 init-logger
142 ? 00:00:00 udevd
634 ? 00:00:00 syslog-ng
635 ? 00:20:39 syslog-ng
718 ? 00:00:00 zabbix_agentd
720 ? 00:04:02 zabbix_agentd
736 ? 00:00:00 xinetd
754 ? 00:00:00 mysqld_safe
784 ? 21:08:05 mysqld
788 pts/2 00:00:00 zsh
820 ? 00:00:01 logger
826 ? 00:00:00 httpd
827 ? 00:00:34 httpd
1154 ? 00:00:00 gam_server
1633 ? 00:05:30 httpd
1642 ? 00:00:05 pure-ftpd
....
32656 ? 00:00:00 exim
32659 ? 00:00:02 php5
32660 ? 00:00:00 php5
32691 ? 00:00:00 gam_server
32698 ? 00:00:01 php5
32700 ? 00:00:00 php5
32704 ? 00:00:00 exim
32705 ? 00:00:00 cpsrvd-ssl
32707 pts/0 00:00:00 ps
Now for some switches that will allow you to do a lot more with this command:
Show Long Format Output
# ps -Al
To turn on extra full mode (it will show command line arguments passed to process):
# ps -AlF
To See Threads ( LWP and NLWP)
# ps -AlFH
To See Threads After Processes
# ps -AlLm
Print All Process On The Server
# ps ax
# ps axu
Print A Process Tree
# ps -ejH
# ps axjf
# pstree
Print Security Information
# ps -eo euser,ruser,suser,fuser,f,comm,label
# ps axZ
# ps -eM
See Every Process Running As User Vivek
# ps -U vivek -u vivek u
Set Output In a User-Defined Format
# ps -eo pid,tid,class,rtprio,ni,pri,psr,pcpu,stat,wchan:14,comm
# ps axo stat,euid,ruid,tty,tpgid,sess,pgrp,ppid,pid,pcpu,comm
# ps -eopid,tt,user,fname,tmout,f,wchan
Display Only The Process IDs of httpd (apache)
# ps -C httpd -o pid=
OR
# pgrep httpd
OR
# pgrep -u vivek php-cgi
Display The Name of PID 58721
# ps -p 58721 -o comm=
Find Out The Top 10 Memory Consuming Process
# ps -auxf | sort -nr -k 4 | head -10
Find Out top 10 CPU Consuming Process
# ps -auxf | sort -nr -k 3 | head -10
SOFT TECH GEEKS
ReplyDeleteSoft Tech Geeks is a chinese underground organisation of computer experts and hackers. We stay discrete in order to prevent the identity of our clients from FEDs and individuals.
• Hacking really takes the right tools and equipment (Spywares and other necessary softwares).
Most people really think that a hacker can just breaking into a security system just by browsing through the site.
But if you really need a hacker we are here for you. We give you full details of our strategy on how we are going to get the job done, then you can decide if we are really or not.
HOW WE WORK:
• We don't ask personal questions about you and we dont give out our personal information.
We strictly do business and don't expose you or your service to you to anyone.
That's how discrete we are.
OUR HACKING SERVICES:
As long as technology is involved anything can be hacked.
*Most people want to Hack a target's email I.D, social media websites or apps, smartphones, for many reasons such as husband cheating on wife, girlfriend cheating on boyfriend.
*if you need to hack a particular organisation so as to sniff, delete, change a particular information or records.
*as a parent you might need to monitor what your children are doing on social media and on their personal computers or even clone their phones to also hear their calls or see text messages on any app they chatting with, so that they don’t get into trouble.
*if you want to hack a private domain email account(business email).
*you want to eraze your name from court’s criminal records, perhaps you might want to Hack into the database of any government agency,
*you want to spend someone's money by cloning another credit card to their account without bank or the user's notification,
*some people want to mine bit coin, we can create a platform for you to mine bit coin without having to cheat anyone.
All these are what we can get done within few hours.
OUR ASSURANCE TO YOU:
Fankly speaking, we always give a 100% guarantee on an job we take. Time to complete a job depends on the complication of the job and if we take your job then be rest assured that it will be done, and we give you a 100% assurance that we cover our tracks well enough, so when we do a job its like we were never there. We have also come across FAKE HACKERS claiming they will get the job done in a short time , and sharing testimony of themselves but they are all scams (AVOID THEM).
REMEMBER THIS "AS LONG AS IT'S TECHNOLOGY IT CAN BE HACKED"
We look forward to working for you.
SOFT TECH GEEKS
softtechgeeks@gmail.com