how to monitor your ibm connections environment with python scripts, jmeter and nagios
TRANSCRIPT
![Page 1: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios](https://reader034.vdocument.in/reader034/viewer/2022051318/58cfdcb91a28ab13238b5b03/html5/thumbnails/1.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051318/58cfdcb91a28ab13238b5b03/html5/thumbnails/2.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051318/58cfdcb91a28ab13238b5b03/html5/thumbnails/3.jpg)
Agenda
• WhatisNagios• HowtouseNagioswithIBMConnections• WhatisJMeterandhowtouseitwithIBMConnections
• HowtocombineNagiosandJMeter• PythonscriptsforMonitoring
![Page 4: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios](https://reader034.vdocument.in/reader034/viewer/2022051318/58cfdcb91a28ab13238b5b03/html5/thumbnails/4.jpg)
Agenda
• WhatisNagios• HowtouseNagioswithIBMConnections• WhatisJMeterandhowtouseitwithIBMConnections
• HowtocombineNagiosandJMeter• PythonscriptsforMonitoring
![Page 5: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios](https://reader034.vdocument.in/reader034/viewer/2022051318/58cfdcb91a28ab13238b5b03/html5/thumbnails/5.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051318/58cfdcb91a28ab13238b5b03/html5/thumbnails/6.jpg)
WhatisNagios
![Page 7: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios](https://reader034.vdocument.in/reader034/viewer/2022051318/58cfdcb91a28ab13238b5b03/html5/thumbnails/7.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051318/58cfdcb91a28ab13238b5b03/html5/thumbnails/8.jpg)
Agenda
• WhatisNagios• HowtouseNagioswithIBMConnections• WhatisJMeterandhowtouseitwithIBMConnections
• HowtocombineNagiosandJMeter• PythonscriptsforMonitoring
![Page 9: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios](https://reader034.vdocument.in/reader034/viewer/2022051318/58cfdcb91a28ab13238b5b03/html5/thumbnails/9.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051318/58cfdcb91a28ab13238b5b03/html5/thumbnails/10.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051318/58cfdcb91a28ab13238b5b03/html5/thumbnails/11.jpg)
NagioswithConnections-WASAgentPlugin
• AllstatisticswillbecreatedbythePerformanceMonitoringInfrastructure(PMI)
• StandardPMIconfigurationwilldeliverallneededstatistics
![Page 12: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios](https://reader034.vdocument.in/reader034/viewer/2022051318/58cfdcb91a28ab13238b5b03/html5/thumbnails/12.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051318/58cfdcb91a28ab13238b5b03/html5/thumbnails/13.jpg)
Agenda
• WhatisNagios• HowtouseNagioswithIBMConnections• WhatisJMeterandhowtouseitwithIBMConnections
• HowtocombineNagiosandJMeter• PythonscriptsforMonitoring
![Page 14: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios](https://reader034.vdocument.in/reader034/viewer/2022051318/58cfdcb91a28ab13238b5b03/html5/thumbnails/14.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051318/58cfdcb91a28ab13238b5b03/html5/thumbnails/15.jpg)
HowtouseJMeterwithConnections
• JMeterletyourecordandplaybackallOperationsequalstothebrowser
• JMetershouldbeusedtodobasicoperations• JMeterallowsyoutodoEndtoEndTesting• JMeterprovidesperformancedataaswell
![Page 16: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios](https://reader034.vdocument.in/reader034/viewer/2022051318/58cfdcb91a28ab13238b5b03/html5/thumbnails/16.jpg)
HowtouseJMeterwithConnections
• Commontestingscenarios:• LogontoConnections• Create/deleteaActivity,Wiki…• CreateaCommunityandaddApps,deleteCommunity
![Page 17: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios](https://reader034.vdocument.in/reader034/viewer/2022051318/58cfdcb91a28ab13238b5b03/html5/thumbnails/17.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051318/58cfdcb91a28ab13238b5b03/html5/thumbnails/18.jpg)
HowtouseJMeterwithConnections
• WikiExample
![Page 19: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios](https://reader034.vdocument.in/reader034/viewer/2022051318/58cfdcb91a28ab13238b5b03/html5/thumbnails/19.jpg)
HowtouseJMeterwithConnections
![Page 20: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios](https://reader034.vdocument.in/reader034/viewer/2022051318/58cfdcb91a28ab13238b5b03/html5/thumbnails/20.jpg)
Agenda
• WhatisNagios• HowtouseNagioswithIBMConnections• WhatisJMeter• HowtouseJMeterwithIBMConnections• HowtocombineNagiosandJMeter• PythonscriptsforMonitoring
![Page 21: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios](https://reader034.vdocument.in/reader034/viewer/2022051318/58cfdcb91a28ab13238b5b03/html5/thumbnails/21.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051318/58cfdcb91a28ab13238b5b03/html5/thumbnails/22.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051318/58cfdcb91a28ab13238b5b03/html5/thumbnails/23.jpg)
Agenda
• WhatisNagios• HowtouseNagioswithIBMConnections• WhatisJMeter• HowtouseJMeterwithIBMConnections• HowtocombineNagiosandJMeter• PythonscriptsforMonitoring
![Page 24: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios](https://reader034.vdocument.in/reader034/viewer/2022051318/58cfdcb91a28ab13238b5b03/html5/thumbnails/24.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051318/58cfdcb91a28ab13238b5b03/html5/thumbnails/25.jpg)
PythonscriptsforMonitoring
• Examples:• DateofConnectionsSearchIndex• OwnerlessIBMConnectionsCommunities• InactiveCommunities
![Page 26: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios](https://reader034.vdocument.in/reader034/viewer/2022051318/58cfdcb91a28ab13238b5b03/html5/thumbnails/26.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051318/58cfdcb91a28ab13238b5b03/html5/thumbnails/27.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051318/58cfdcb91a28ab13238b5b03/html5/thumbnails/28.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022051318/58cfdcb91a28ab13238b5b03/html5/thumbnails/29.jpg)
![Page 30: How to monitor your IBM Connections environment with Python Scripts, JMeter and Nagios](https://reader034.vdocument.in/reader034/viewer/2022051318/58cfdcb91a28ab13238b5b03/html5/thumbnails/30.jpg)
PLATINUM&CHAMPAGNESPONSORS
GOLDSPONSORS
SILVERSPONSORS
BRONZESPONSORS