Monday 28 May 2012

Line6 Pocket Pod Quick Reference Chart

I love my Line6 pocket pod - but its got a lot of functionality in such a tiny device...so I made this quick reference chart - essentially a 1 page printable A3 summary of the reference guide.


It shows the line6 pocket pod default user presets by title and bank, the button controls and a quick description of all the amp models and what historical amps they are based on.

Wednesday 16 May 2012

CA eHealth Oracle Queries for Systemedge Agents

In our site we wanted to export some CA eHealth data daily to use in another system. These queries use direct oracle query to export data using the regularised tables in the database for systemedge agents.

Here are some ehealth sql queries that that use the aggregate hourly sample tables. e.g 

These queries have &1 and &2 as variables for epoc timestamp of the data but you can use hardcode values.

system edge agent host key stats - NHV_ST_H_SYSEDGEUNIXSYSTEM 

COLUMN AVGCPUUTILIZATION FORMAT 999.9;
COLUMN CPUSYSTEMUTILIZATION FORMAT 999.9;
COLUMN CPUUSERUTILIZATION FORMAT 999.9;
COLUMN CPUWAITUTILIZATION FORMAT 999.9;
COLUMN LOADAVERAGE FORMAT 9999.99;
COLUMN PHYSICALMEMORYUTILIZATION FORMAT 999.9;
COLUMN TOTALCPUUTILIZATION FORMAT 9999.9;
COLUMN VIRTUALMEMORYUTILIZATION FORMAT 999.9;
COLUMN PAGESCANRATE FORMAT 999999999;
COLUMN PROCESSES FORMAT 99999;
COLUMN RUNQUEUELENGTH FORMAT 99999;
COLUMN ACTIVEVIRTMEMORY_MB FORMAT 999999999;
COLUMN PHYSICALMEMORYFREE_MB FORMAT 999999999;
COLUMN PHYSICALMEMORYUSED_MB FORMAT 9999999999;
COLUMN TOTALBYTES_MB FORMAT 999999999;
COLUMN TOTALPHYSICALMEMORY_MB FORMAT 999999999;
COLUMN TOTALVIRTUALMEMORY_MB FORMAT 999999999;
COLUMN VIRTUALMEMORYFREE_MB FORMAT 999999999;
COLUMN VIRTUALMEMORYUSED_MB FORMAT 999999999;
COLUMN CPUIMBALANCE FORMAT 999999999.9;
COLUMN NUMSWITCHES FORMAT 999999999;

Select el.NAME, data.* from
(select distinct ELEMENT_ID, replace(NAME,'-1691-SH','') AS NAME
from NH_ELEMENT
where ELEMENT_TYPE = 104108) el, 
(select ELEMENT_ID,SAMPLE_TIMESTAMP,ACTIVEVIRTMEMORY/1048576 AS ACTIVEVIRTMEMORY_MB,AVGCPUUTILIZATION,CPUIMBALANCE,CPUSYSTEMUTILIZATION,
CPUUSERUTILIZATION,CPUWAITUTILIZATION,LOADAVERAGE,NUMSWITCHES,PAGESCANRATE,
PHYSICALMEMORYFREE/1048576 AS PHYSICALMEMORYFREE_MB,PHYSICALMEMORYUSED/1048576 AS PHYSICALMEMORYUSED_MB,PHYSICALMEMORYUTILIZATION,PROCESSES,
RUNQUEUELENGTH,TOTALBYTES/1048576 AS TOTALBYTES_MB,TOTALCPUUTILIZATION,TOTALPHYSICALMEMORY/1048576 AS TOTALPHYSICALMEMORY_MB,
TOTALVIRTUALMEMORY/1048576 AS TOTALVIRTUALMEMORY_MB,
VIRTUALMEMORYFREE/1048576 AS VIRTUALMEMORYFREE_MB,VIRTUALMEMORYUSED/1048576 AS VIRTUALMEMORYUSED_MB,VIRTUALMEMORYUTILIZATION
from NHV_ST_H_SYSEDGEUNIXSYSTEM 
--where SAMPLE_TIME > 1333050481 and SAMPLE_TIME < 1333057681) data
where SAMPLE_TIME > '&1' and SAMPLE_TIME < '&2') data
where 
el.ELEMENT_ID = data.ELEMENT_ID;

Disk partition for Systemedge - NHV_ST_H_DISKPARTITION
COLUMN INODEUTILIZATION FORMAT 999.9;
COLUMN PARTITIONUTILIZATION FORMAT 999.9;
COLUMN PCTPARTITIONFREE FORMAT 999.9;
COLUMN PARTITIONSTORAGECAPACITY_MB FORMAT 999999999;
COLUMN PARTITIONSTORAGEFREE_MB FORMAT 999999999;
COLUMN PARTITIONSTORAGEUSED_MB FORMAT 999999999;

Select el.NAME, data.* from
(select distinct ELEMENT_ID, replace(NAME,'-1691-SH','') AS NAME
from NH_ELEMENT
where ELEMENT_TYPE = 104045 or ELEMENT_TYPE =104039) el, 
(SELECT SAMPLE_TIME,ELEMENT_ID,SAMPLE_TIMESTAMP,INODEUTILIZATION,
PARTITIONSTORAGECAPACITY/1048576 AS PARTITIONSTORAGECAPACITY_MB,
PARTITIONSTORAGEFREE/1048576 AS PARTITIONSTORAGEFREE_MB,
PARTITIONSTORAGEUSED/1048576 AS PARTITIONSTORAGEUSED_MB,
PARTITIONUTILIZATION,PCTPARTITIONFREE
From NHV_ST_H_DISKPARTITION
where -- ELEMENT_ID>=1000013 and ELEMENT_ID <=1000020
-- SAMPLE_TIME > 1333050481 and SAMPLE_TIME < 1333057681
SAMPLE_TIME > '&1' and SAMPLE_TIME < '&2') data
where 
el.ELEMENT_ID = data.ELEMENT_ID;


SCOM Operations Manager Alarm Export Report

This simple powershell script will export SCOM / Operations Manager 2007 alarms to csv file using the command shell.

The second script is particularly useful for answering one of the long unanswerable questions of Operations Manager... how to tell if alarms are generated by a monitor or a rule because from this report we can tell if it is or not by the column 'IsMonitorAert'. Generally speaking

  • IsMonitorAlert=true means the alarms come from monitors and will resolve themselves when the situation is fixed
  • IsMonitorAlert=fase means the alarms come from rules and won't resolve themselves when the situation is fixed.
Rule monitors can create problems when not resolved by operations as repeat alarms are suppressed as duplicates.

One common example is the service terminated unexpectedly rule in the windows server management pack.

We can also categorize the alarms and tell which management pack they came from from the column MonitoringObjectFullName 

# this script will make some csv reports of System Center Operations Manager Alarms
#**********setup root ms connection assume local ***************

$cs = get-wmiobject win32_computersystem
$rootMS = $cs.Name + "." + $cs.Domain
$rootMS = $rootMS.ToUpper() 

#*****************************************************************
#Connect to the Mgmt Group (SDK)

if (Get-PSSnapin | select-string -pattern "OperationsManager")
{echo "OPs mgr snap in is installed already";}
else
{Add-PSSnapin "Microsoft.EnterpriseManagement.OperationsManager.Client" -ErrorVariable errSnapin;}

Set-Location "OperationsManagerMonitoring::" -ErrorVariable errSnapin;
new-managementGroupConnection -ConnectionString:$rootMS -ErrorVariable errSnapin;
set-location $rootMS -ErrorVariable errSnapin;

############ ALL including resolved Alerts ########################
$title="ALLAlertsByMonitoringObjectFullName"
$Body =get-alert | select Id,Name,Priority,Severity,TimeRaised,ResolutionState,TimeResolved,ResolvedBy,RepeatCount,LastModified,MonitoringObjectDisplayName,MonitoringObjectPath,Category,Description,MonitoringObjectId,MonitoringClassId,MonitoringObjectFullName,IsMonitorAlert | sort-object MonitoringObjectFullName 
$body | Export-Csv c:temp\$Title.csv

############ OPEN Alerts ########################
$title="OpenAlertsByUTCDateModDesc"
$Body =get-alert -criteria 'ResolutionState = "0"' | select Id,Name,Priority,Severity,TimeRaised,RepeatCount,LastModified,MonitoringObjectDisplayName,MonitoringObjectPath,Category,Description,MonitoringObjectId,MonitoringClassId,IsMonitorAlert | sort-object LastModified -descending
$body | Export-Csv c:temp\$Title.csv