with mytree as (select distinct tnode.tree_name, tnode.parent_node_num, tnode.tree_node_num, tnode.tree_node, tlvl.tree_level, glacct.account, glacct.account_type, tnode.parent_node_name, glacct.descr from sysadm.pstreenode tnode, sysadm.pstreeleaf tleaf, sysadm.ps_gl_account_tbl glacct, sysadm.pstreelevel tlvl where tnode.setid=tleaf.setid and tnode.tree_name=tleaf.tree_name and tnode.effdt=tleaf.effdt and tleaf.tree_node_num between tnode.tree_node_num and tnode.tree_node_num_end and glacct.account between tleaf.range_from and…
Author: Steve
Programatically gathering a thread dump
This is just a method you could add to your software if you wish to trigger a thread dump in a controlled fashion. import java.sql.*; import java.lang.management.*; public class DebugLocks { public static String dumpThreads() { final StringBuilder dump =…
Splunk – Transaction to calculate start and end time of component
host=cmhlpecomecm* EOMReservationService AND (started OR ended) | eval tmp=split(_raw,” “) | eval thread=mvindex(tmp,5) | transaction thread startswith=”started” endswith=”ended” | timechart span=1h avg(duration) median(duration) The query above results in the following output on the Events tab of the UI… …and the…
C# – Write file on client and read same file from inside the database
We had a job that an enterprise software vendor was running that failed on permissions denied. They asked us to open the file share to anyone without a password. Our awesome SQL Server DBA pushed back, thankfully. We came up…
Formatting netstat output
We had a need to ingest open sockets into Splunk so we could map our integration points across the enterprise. We came up with what is below. This will show if the host on which it is run is a…
JMeter AJAX example
I couldn’t find any complete AJAX examples. Most of them, including the one on blazemeter.com that provided the impetus for this post, don’t go far enough to include the cookies needed for the requests to work in most web application…
Powershell – Getting tables from a SQL Server database
c:\Users\adm-showard>powershell Windows PowerShell Copyright (C) 2009 Microsoft Corporation. All rights reserved. PS C:\Users\adm-showard> $sqlConn = New-Object System.Data.SqlClient.SqlConnection PS C:\Users\adm-showard> $sqlConn.ConnectionString = “Server=CMHWPSWSQL1201;Integrated Security=true;Initial Catalog=SWNetPerfMon” PS C:\Users\adm-showard> $sqlConn.Open() PS C:\Users\adm-showard> $sqlcmd = $sqlConn.CreateCommand() PS C:\Users\adm-showard> $sqlcmd = New-Object System.Data.SqlClient.SqlCommand PS C:\Users\adm-showard>…
nginx – passing request headers to upstream server as body
This example does two things: 1) Changes a GET request from the client to a POST 2) Captures the request headers from the client and converts them to a body for POST to the upstream server Note we have underscores…
What does web service do when client has socket timeout exceeded?
It should throw a broken pipe exception. Below shows an strace of a server socket when the client has timed out after not receiving a response in the time period it specified (setTimeout() method)… 13125 12:19:13.666786 ) = 1 ([{fd=7,…
Splunk query to extract JSP from stack trace in error log
We used what is below to parse through stack traces that had been logged in JBOSS. We were looking for the page most frequently impacted by a persistent transaction blocking issue. host=cmhlpecomecm* (ORA-00060 OR ORA-02049) AND org.apache.jsp | rex field=_raw…