how to monitor your ibm connections environment with python scripts, jmeter and nagios

30
How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios Klaus Bild WebGate

Upload: klaus-bild

Post on 20-Mar-2017

1.750 views

Category:

Presentations & Public Speaking


2 download

TRANSCRIPT

Page 1: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios

How to monitor your IBM Connections environment with Python Scripts, JMeter

and Nagios

KlausBildWebGate

Page 2: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios

Aboutme

• KlausBild• SeniorSystemArchitect• @

• Blog:http://kbild.ch• http://linkedin.com/in/kbild

Page 3: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios

Agenda

• WhatisNagios• HowtouseNagioswithIBMConnections• WhatisJMeterandhowtouseitwithIBMConnections

• HowtocombineNagiosandJMeter• PythonscriptsforMonitoring

Page 4: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios

Agenda

• WhatisNagios• HowtouseNagioswithIBMConnections• WhatisJMeterandhowtouseitwithIBMConnections

• HowtocombineNagiosandJMeter• PythonscriptsforMonitoring

Page 5: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios

WhatisNagios

• Opensourcecomputersystemmonitoring,networkmonitoringandinfrastructuremonitoringsoftwareapplication

• InitialRelease1999• ActualVersion4.0.8-http://www.nagios.org/• GNUGeneralPublicLicenseversion2• CommercialVersionNagiosXI• Icinga1(Nagiosfork)andIcinga2(Coreframeworkreplacement/Nagiosrewrite)

Page 6: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios

WhatisNagios

Page 7: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios

WhatisNagios-Definitions

Commandscanbefoundin…/nagios/etc/objects/commands.cfgdefine command { command_name ncpa_check command_line $USER1$/check_ncpa.py -H $HOSTADDRESS$ -P 5693 -t $USER2$ -M $ARG1$ }

Host

uselinux-serverhost_namewghub01.webgate.bizaliasDominoServeraddress192.168.45.123

Services

usehigh-prio-servicesservice_descrip0onCheckDominoserviceWinhostgroup_namedomino-serverscheck_commandncpa_check!service/rc_domino/running

Plugin

Page 8: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios

Agenda

• WhatisNagios• HowtouseNagioswithIBMConnections• WhatisJMeterandhowtouseitwithIBMConnections

• HowtocombineNagiosandJMeter• PythonscriptsforMonitoring

Page 9: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios

HowtouseNagioswithConnections

• MonitorPortsandServices(WAS,DB2,HTTP)• URLs(HTTP,Connections->returnsalwaysstatuscode200,checkforcontentonpage)

• Checkforerrorsinlogs(WAS,HTTP,TDI,DB2)• TestJDBCconnectionstoDBs

Mostofthesemonitorsjustprovideyes/noinfo

Page 10: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios

NagioswithConnections-WASAgentPlugin

• WASAgentPlugin:https://github.com/yannlambret/websphere-nagios• WillbeinstalledontheDmgr• Currentfeaturesare:

• JVMheapmonitoring• Serverthreadpoolsmonitoring• Transactionsmonitoring• JDBCdatasourcesmonitoring• JMSconnectionfactoriesmonitoring• SIBqueuesdepthmonitoring• HTTPsessionsmonitoring• Servletsservicetimemonitoring

• Weusepnp4nagiosforperformancecharts

Page 11: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios

NagioswithConnections-WASAgentPlugin

• AllstatisticswillbecreatedbythePerformanceMonitoringInfrastructure(PMI)

• StandardPMIconfigurationwilldeliverallneededstatistics

Page 12: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios

NagioswithConnections-WASAgentPlugin

• WASAgentPlugin• ThesemonitorscaninformyouofproblemsbeforeConnectionsstopsworking

• Exampletogetusedheapsize:./wasagent.sh'hostname=192.168.45.123& port=8880&jvm=heapUsed,90,95

• Response:InfraCluster_server1:statusOK|jvm-heapSize=3267MB;;;0;3268 jvm-heapUsed=944MB;;;0;3268jvm-cpu=0%;;;0;100

ProactiveMonitoring

Page 13: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios

Agenda

• WhatisNagios• HowtouseNagioswithIBMConnections• WhatisJMeterandhowtouseitwithIBMConnections

• HowtocombineNagiosandJMeter• PythonscriptsforMonitoring

Page 14: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios

WhatisJMeter

• TheApacheJMeter™applicationisopensourcesoftware,a100%pureJavaapplicationdesignedtoloadtestfunctionalbehaviorandmeasureperformance.ItwasoriginallydesignedfortestingWebApplicationsbuthassinceexpandedtoothertestfunctions.

h"p://jmeter.apache.org/

Page 15: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios

HowtouseJMeterwithConnections

• JMeterletyourecordandplaybackallOperationsequalstothebrowser

• JMetershouldbeusedtodobasicoperations• JMeterallowsyoutodoEndtoEndTesting• JMeterprovidesperformancedataaswell

Page 16: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios

HowtouseJMeterwithConnections

• Commontestingscenarios:• LogontoConnections• Create/deleteaActivity,Wiki…• CreateaCommunityandaddApps,deleteCommunity

Page 17: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios

HowtouseJMeterwithConnections

• RecordyourtestcasewithJMeterwiththeHTTP(S)TestScriptRecorder

• MostoftheactionswillbedonethroughtheConnectionsAPI:http://www-10.lotus.com/ldd/lcwiki.nsf/xpAPIViewer.xsp?lookupName=IBM+Connections+5.0+API+Documentation

• Usevariablesforservers/users/ports

Page 18: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios

HowtouseJMeterwithConnections

• WikiExample

Page 19: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios

HowtouseJMeterwithConnections

Page 20: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios

Agenda

• WhatisNagios• HowtouseNagioswithIBMConnections• WhatisJMeter• HowtouseJMeterwithIBMConnections• HowtocombineNagiosandJMeter• PythonscriptsforMonitoring

Page 21: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios

HowtocombineNagiosandJMeter

• TherearedifferentPluginsforNagiosavailablehttps://github.com/gmykhailiuta/nagios_jmeter_check

• InstallJMeteronyourNagiosServer• TesttheJMeterplanfromthecommandlineandinspecttheresultfileD:\apache-jmeter-2.13\bin\jmeter-tC:\JMeter\CreateWiki.jmx-Jserver=connections.demo.ch-Jport=443-Juser=kbi-Jpassword=IBMConnect14-Jwiki_title=Soccnx

• UsetheJMeterpluginwithvariables

Page 22: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios

Thingstoconsider

• Connectionsalwaysreturnsstatuscode200duringlogin,evenifawrongpasswordisused ->checkResponseHeaderfor“X-LConn-Auth:true”

• Theusershouldhaveno“relationships”toanyotherusers

• Youarecreatingandmanipulatingdataonthelivesystem!

• Updatescanletyourplanfail!

Page 23: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios

Agenda

• WhatisNagios• HowtouseNagioswithIBMConnections• WhatisJMeter• HowtouseJMeterwithIBMConnections• HowtocombineNagiosandJMeter• PythonscriptsforMonitoring

Page 24: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios

PythonscriptsforMonitoring

• NagiosalwaysneedsfollowingPluginreturncodes:• 0(OK)• 1(Warning)• 2(Critical)• 3Unknown• Description(optional)• Performancedata(optional)

Page 25: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios

PythonscriptsforMonitoring

• Examples:• DateofConnectionsSearchIndex• OwnerlessIBMConnectionsCommunities• InactiveCommunities

Page 26: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios

DateofConnectionsSearchIndex#!/usr/bin/envpythonimportsys,argparse,urllib2,cookielib,urllib,datetimefrombs4importBeautifulSoup

parser=argparse.ArgumentParser(description='Thisscriptgetsthearguments')parser.add_argument('-H','--conn_host',help='ConnectionsDomain',required=True)parser.add_argument('-w','--warning',help='Warningvalueinhours',required=True)parser.add_argument('-c','--critical',help='Criticalvalueinhours',required=True)parser.add_argument('-u','--user',help='User',required=True)parser.add_argument('-p','--pw',help='Password',required=True)args=parser.parse_args()

password_mgr=urllib2.HTTPPasswordMgrWithDefaultRealm()top_level_url="http://"+args.conn_hostpassword_mgr.add_password(None,top_level_url,args.user,args.pw)handler=urllib2.HTTPBasicAuthHandler(password_mgr)opener=urllib2.build_opener(urllib2.HTTPHandler,handler)

soup=BeautifulSoup(opener.open(‘https://'+args.conn_host+'/search/atom/mysearch?scope=&query=test_something_weird&page=1&pageSize=10&format=light').read().strip(),"lxml")

search_date=datetime.datetime.strptime(soup.updated.string[:-10],"%Y-%m-%dT%H:%M:%S")

Page 27: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios

DateofConnectionsSearchIndex

if(datetime.datetime.now()-datetime.timedelta(hours=int(args.critical))>search_date):

print("StatusCritical-SearchIndexolderthan"+args.critical+"hours-SearchIndexdate"+str(search_date))

sys.exit(1)

elif(datetime.datetime.now()-datetime.timedelta(hours=int(args.warning))>search_date):

print("StatusWarning-SearchIndexolderthan"+args.warning+"hours-SearchIndexdate"+str(search_date))

sys.exit(2)

else:

print("StatusOK-SearchIndexdate"+str(search_date))

sys.exit(0)

Page 28: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios

FurtherMaterial

• http://kbild.ch

• http://www.slideshare.net/kbild/the-best-things-in-life-are-free-wie-sie-ihre-ibm-conneceons-umgebung-kostenlos-mit-jmeter-und-nagios-uberwachen-konnen

Page 29: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios
Page 30: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios

PLATINUM&CHAMPAGNESPONSORS

GOLDSPONSORS

SILVERSPONSORS

BRONZESPONSORS