690 shaares
3 liens privés
3 liens privés
3 résultats
taggé
timestamp
timestamp to date in command line
date -d @1267619929
Dump d'un processus java par la ligne de commande :
@echo off
set JAVA_HOME=C:\Temp\jdk1.7.0_51\
set DUMP_DIR=c:\Temp
REM Preparing Timestamp Information
set year=%date:~6,4%
set month=%date:~3,2%
set day=%date:~0,2%
set hour=%time:~0,2%
REM Replace leading space with zero
if “%hour:~0,1%” ==” ” set hour=0%hour:~1,1%
set minute=%time:~3,2%
set seconds=%time:~6,2%
set timestamp=%year%%month%%day%%hour%%minute%%seconds%
for /f "tokens=2" %%a in ('
tasklist ^| findstr java
') do if not "%%a"=="0" %JAVA_HOME%\bin\jstack.exe %%a > "%DUMP_DIR%\threaddump-%%a-%timestamp%.txt"
A short script to record top & vmstat, create monitor.sh
#!/bin/bash
echo "To kill : cat *.pid | xargs kill"
cp top.output top.output.old 2>&1 > /dev/null ; rm -f top.output
cp vmstat.output vmstat.output.old 2>&1 > /dev/null ; rm -f vmstat.output
(vmstat 30 & echo $! > vmstat.pid) | awk '{ print strftime("%Y-%m-%d %H:%M:%S"), $0; fflush() }' 2>&1 > vmstat.output &
echo $$ > monitor.pid
while :
do
top -b -n 1 | grep -v "0.0 0.0" 2>&1 | awk '{ print strftime("%Y-%m-%d %H:%M:%S"), $0; fflush() }' 2>&1 >> top.output
sleep 30
done
Then monitor.sh &
Will add soon a link to an excel file to analyze the results.
Of course zimbra like tools are much more friendly but sometimes, you have a console and few access...