330 likes | 459 Views
Introduction Monitor agent / Monitor viewer. By Kåre Jonsson Date: 2007-dec-17. Main concepts. One agent program in an environment where something can be measured, probably close. One central viewer program for reporting. Agent is extreamley sparse on resources.
E N D
Introduction Monitor agent / Monitor viewer By Kåre Jonsson Date: 2007-dec-17
Main concepts • One agent program in an environment where something can be measured, probably close. • One central viewer program for reporting. • Agent is extreamley sparse on resources. • Viewer not adding load to production.
Architecture and interaction SMTP HTTP url download Tomcat HTTP Monitor agent Monitor viewer File system Database file *.rrd Java Runtime API
Cluster Monitor agent HTTP HTTP Tomcat Monitor viewer HTTP HTTP Monitor agent Monitor agent
Process view SAF Viewer OS OS OS OS
Monitor agent Monitor agent Tomcat Monitor agent Monitor viewer Monitor agent Monitor agent Monitor agent Monitor agent Monitor agent
Two separated cluster deployments Monitor agent Tomcat Monitor viewer Monitor agent HTTP HTTP Tomcat Monitor agent Monitor viewer HTTP HTTP Monitor agent Monitor agent Monitor agent Monitor agent Monitor agent
Use extra node for viewers Optionally deployed outside the production nodes Monitor agent Tomcat Monitor viewer Monitor agent HTTP HTTP Tomcat Monitor agent Monitor viewer HTTP HTTP Monitor agent Monitor agent Monitor agent Monitor agent Monitor agent
Two cluster deployments with agent reuse Monitor agent Tomcat Monitor viewer Monitor agent HTTP HTTP Tomcat Monitor agent Monitor viewer HTTP HTTP Monitor agent Monitor agent Monitor agent Monitor agent Monitor agent
Questions Viewer asks Agent. Protocol. • What types/instances? KERNEL, DISK, NETWORK... • What measurements? (kernel: contextswitch, idletime, systemtime ...) (network: tcpError..., ..., ...) • Give me the .rrd file of ... • What is your internal RAM log? (Diagnosis)
Process view customized case Viewer SAF OS OS Custom Viewer OS OS Custom Custom
Viewer Agent Tomcat servlet Monitor viewer Monitor agent kernel Executables Closed Opened Predefined Cluster view Configuration Scripts for platform Standard Customized Customized scripts Customized Cluster view Optional customization On demand post processors On demand scripts Deployment considerations TCP ports Instances monitoragents.xml
Development Make measurement script Add to Monitor agent ring Presentation
Write measurement script • Find command or file or download that contains parseable data in which the value appears. • Find a systematic way to extract it. • Decide how often to measure. • Write the Monitor agent script to register the values. Here an example with the context switch (Solaris). D – Duty S – Solution
Find command D: Find command or file or download that contains parseable data in which the value appears. S: The command ”vmstat 5 2” $> vmstat 5 2 kthr memory page disk faults cpu r b w swap free re mf pi po fr de sr s0 s1 s3 s4 in sy cs us sy id 0 0 0 18847200 7733416 8 36 29 0 0 0 11 0 3 0 0 328 316 642 0 1 99 0 0 0 18995744 7672152 0 7 0 0 0 0 0 0 0 0 0 325 220 657 0 0 99 $>
Find systmetic way D: Find a systematic way to extract it. S: It is the third lines 18th fragment (some from previous page is copied to here) $> vmstat 5 2 kthr memory page disk faults cpu r b w swap free re mf pi po fr de sr s0 s1 s3 s4 in sy cs us sy id 0 0 0 18847200 7733416 8 36 29 0 0 0 11 0 3 0 0 328 316 642 0 1 99 0 0 0 18995744 7672152 0 7 0 0 0 0 0 0 0 0 0 325 220 657 0 0 99 $>
Decide periodicity D: Decide periodicity. How often to measure. S: An example is once every 2 minutes. That is 120 seconds. In general this is depending on what is measured.
Write Monitor agent script D: Write the Monitor agent script to register values. S: The following is the contents of the file contextswitch.mtr <PERMANENT> <SCRIPT> { } </SCRIPT> </PERMANENT> <ROUTINE> <PERIODICITY>120</PERIODICITY> <SCRIPT> { command("vmstat 5 2"); register(“ContextSwitch”, value(fragment(3, 18))); } </SCRIPT> </ ROUTINE >
Deploying Execute the script $> monitoragent –i=X contextswitch.mtr Put many scripts on the commandline. The –i=X is omitted in this session. One script can produce any number of measurements. Not just one as in this example.
Monitor agent ”Processes” . . . .mtr .mtr .mtr .mtr .mtr .mtr Monitor agent Java Processor/OS
Extend Monitor agent ring Add the ”-i=X contextswitch.mtr” on your Monitor agent invokation line. Any number of ”-i=X Y.mtr” is allowed. Have the following cluster questions in mind • Will the Monitor agent process fail over? • Should the routine fail over like the Monitor agent? • Should the routine execute in parallell on the nodes?
Customization Monitoring Agent / Viewer To do To read
To do • Add measurement routines • Scripts for measurements (.sh, .ksh, .pl, .py) • Scripts for on demand contents (.sh, .ksh, .pl, .py) • Measurement routines (.mtr) • Integrate • Presentation • Map symbols in map.xml • Graph compositions • On demand view • Integrate
Absolute winning concepts • Optimal deployment. • Optimal behaviour. • Extremely low memory consumption • Extremely low disk usage • No spontaneous network activity • Almost always ”sleeping” • Configured in scripting language programming. • Mainly builds on command line invocations. • Type references. Monitor viewer asks for instance names. Cluster configuration remains independent of deployment.
More winning concepts • Open format. .rrd-files of JRobin at www.jrobin.org. • Viewer extendible with curve compositions. • Agent extendible. Add –i=X X.mtr as suitable. • Command line style of the invocation of the processes, i.e. –p=... –debug=... –confdir=... –datadir=... -ondemand • No spontaneous activity • CGI like functionality
All about Monitor agent configuration What one can do in Monitor agent scripting is in monitoragent_devguide.pdf To program in Monitor agent scripting is to configure the same!
All about Monitor viewer configuration What one can do in Monitor viewer is in monitorviewer_devguide.pdf
Full screen 1 3 2