ibm connections monitoring with nagios

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

Upload: social-connections

Post on 20-Mar-2017

553 views

Category:

Technology


0 download

TRANSCRIPT

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

and Nagios

KlausBild,ChristianGüdemannWebGate

Aboutme

• KlausBild• SeniorSystemArchitect• @

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

Agenda

• WhatisNagios• HowtouseNagioswithIBMConnections• WhatisJMeterandhowtouseitwithIBMConnections

• HowtocombineNagiosandJMeter• PythonscriptsforMonitoring

Agenda

• WhatisNagios• HowtouseNagioswithIBMConnections• WhatisJMeterandhowtouseitwithIBMConnections

• HowtocombineNagiosandJMeter• PythonscriptsforMonitoring

WhatisNagios

• Opensourcecomputersystemmonitoring,networkmonitoringandinfrastructuremonitoringsoftwareapplication

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

WhatisNagios

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

Agenda

• WhatisNagios• HowtouseNagioswithIBMConnections• WhatisJMeterandhowtouseitwithIBMConnections

• HowtocombineNagiosandJMeter• PythonscriptsforMonitoring

HowtouseNagioswithConnections

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

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

Mostofthesemonitorsjustprovideyes/noinfo

NagioswithConnections-WASAgentPlugin

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

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

• Weusepnp4nagiosforperformancecharts

NagioswithConnections-WASAgentPlugin

• AllstatisticswillbecreatedbythePerformanceMonitoringInfrastructure(PMI)

• StandardPMIconfigurationwilldeliverallneededstatistics

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

Agenda

• WhatisNagios• HowtouseNagioswithIBMConnections• WhatisJMeterandhowtouseitwithIBMConnections

• HowtocombineNagiosandJMeter• PythonscriptsforMonitoring

WhatisJMeter

• TheApacheJMeter™applicationisopensourcesoftware,a100%pureJavaapplicationdesignedtoloadtestfunctionalbehaviorandmeasureperformance.ItwasoriginallydesignedfortestingWebApplicationsbuthassinceexpandedtoothertestfunctions.

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

HowtouseJMeterwithConnections

• JMeterletyourecordandplaybackallOperationsequalstothebrowser

• JMetershouldbeusedtodobasicoperations• JMeterallowsyoutodoEndtoEndTesting• JMeterprovidesperformancedataaswell

HowtouseJMeterwithConnections

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

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

HowtouseJMeterwithConnections

• WikiExample

HowtouseJMeterwithConnections

Agenda

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

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

Thingstoconsider

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

• Theusershouldhaveno“relationships”toanyotherusers

• Youarecreatingandmanipulatingdataonthelivesystem!

• Updatescanletyourplanfail!

Agenda

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

PythonscriptsforMonitoring

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

PythonscriptsforMonitoring

• Examples:• DateofConnectionsSearchIndex• OwnerlessIBMConnectionsCommunities• InactiveCommunities

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")

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)

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

PLATINUM&CHAMPAGNESPONSORS

GOLDSPONSORS

SILVERSPONSORS

BRONZESPONSORS