Merge lp:~jontai/openvista-gtm-integration/bug337644 into lp:openvista-gtm-integration

Proposed by Jon Tai
Status: Merged
Merged at revision: not available
Proposed branch: lp:~jontai/openvista-gtm-integration/bug337644
Merge into: lp:openvista-gtm-integration
Diff against target: 483 lines
10 files modified
mumps/MSCZJOBS.m (+10/-3)
packages/deb/openvista-gtm-integration/debian/changelog (+6/-0)
packages/deb/openvista-gtm-integration/debian/control (+15/-0)
packages/deb/openvista-gtm-integration/debian/openvista-munin-plugins.dirs (+3/-0)
packages/deb/openvista-gtm-integration/debian/rules (+4/-3)
packages/rpm/openvista-gtm-integration.spec (+43/-0)
scripts/etc/munin/plugin-conf.d/openvista (+2/-0)
scripts/usr/share/munin/plugins/openvista_databases_ (+93/-0)
scripts/usr/share/munin/plugins/openvista_locks_ (+99/-0)
scripts/usr/share/munin/plugins/openvista_processes_ (+111/-0)
To merge this branch: bzr merge lp:~jontai/openvista-gtm-integration/bug337644
Reviewer Review Type Date Requested Status
jeff.apple Approve
Review via email: mp+13741@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jon Tai (jontai) wrote :

Jeff, please review -- especially the MUMPS changes. Thanks!

Revision history for this message
jeff.apple (jeff-apple) wrote :

It looks like MSCZJOBS will only report the first socket. Is that intentional and/or acceptable?

review: Approve
Revision history for this message
Jon Tai (jontai) wrote :

> It looks like MSCZJOBS will only report the first socket. Is that intentional
> and/or acceptable?

I think it's acceptable... most vista processes only use a single socket anyway, right? The alternative would be to do multi-line output.

Revision history for this message
jeff.apple (jeff-apple) wrote :

> > It looks like MSCZJOBS will only report the first socket. Is that
> intentional
> > and/or acceptable?
>
> I think it's acceptable... most vista processes only use a single socket
> anyway, right? The alternative would be to do multi-line output.

I believe that to be true. I would say it's OK.

106. By Jon Tai

oops, forgot to package the plugin conf file -- without it, the plugin will run as root

Revision history for this message
Jon Tai (jontai) wrote :

Doh -- when I was doing the merge, I realized that I forgot the munun plugin conf file. I've committed r106 to add it. Can you have a quick look?

Revision history for this message
jeff.apple (jeff-apple) wrote :

> Doh -- when I was doing the merge, I realized that I forgot the munun plugin
> conf file. I've committed r106 to add it. Can you have a quick look?
Looks fine

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'mumps/MSCZJOBS.m'
2--- mumps/MSCZJOBS.m 2009-06-26 17:39:51 +0000
3+++ mumps/MSCZJOBS.m 2009-10-21 23:30:24 +0000
4@@ -1,4 +1,4 @@
5-MSCZJOBS ;JKT/MSC - OpenVista System status ;26JUN2009
6+MSCZJOBS ;JKT/MSC - OpenVista System status ;24AUG2009
7 ;;8.0;KERNEL;**MSC**
8 ;
9 ALL D SS() Q
10@@ -37,7 +37,14 @@
11 Q $J(PID,8)_$S($J=PID:"*",1:"")
12 ;
13 DEVICE(PID) ;Return device
14- Q $$FIND(PID,"I","$PRINCIPAL")
15+ N PRI S PRI=$$FIND(PID,"I","$PRINCIPAL")
16+ Q:PRI'="0" PRI ; FIXME: this could probably be more general
17+ ;
18+ ; look at devices for sockets
19+ N SOCK S SOCK=$$FIND(PID,"D"," SOCKET[0]")
20+ I $P(SOCK," ",3)="LISTENING" Q $P($P(SOCK," PORT=",2)," ")_",LISTENING"
21+ I $P(SOCK," ",3)="CONNECTED" Q $P($P($P(SOCK," LOCAL=",2)," "),"@",2)_",CONNECTED"
22+ Q ""
23 ;
24 INSTANCE(PID) ;Return name of OpenVista instance
25 N ZG S ZG=$$FIND(PID,"I","$ZGBLDIR")
26@@ -56,5 +63,5 @@
27 ;
28 FIND(PID,ARR,KEY) ;Return the value of a key in one of the ZSHOW arrays
29 N I,X S I="",X=""
30- F S I=$O(@MSC@(PID,ARR,I)) Q:'I I $P(@MSC@(PID,ARR,I),KEY_"=")="" S X=$TR($P(@MSC@(PID,ARR,I),"=",2),"""") Q
31+ F S I=$O(@MSC@(PID,ARR,I)) Q:'I I $P(@MSC@(PID,ARR,I),KEY_"=")="" S X=$TR($P(@MSC@(PID,ARR,I),"=",2,999),"""") Q
32 Q X
33
34=== modified file 'packages/deb/openvista-gtm-integration/debian/changelog'
35--- packages/deb/openvista-gtm-integration/debian/changelog 2009-10-20 02:23:22 +0000
36+++ packages/deb/openvista-gtm-integration/debian/changelog 2009-10-21 23:30:24 +0000
37@@ -1,3 +1,9 @@
38+openvista-gtm-integration (0.8.5-0ubuntu2) jaunty; urgency=low
39+
40+ * Package munin plugins. (Closes: #337644)
41+
42+ -- Jonathan Tai <jon.tai@medsphere.com> Wed, 21 Oct 2009 08:00:34 -0700
43+
44 openvista-gtm-integration (0.8.5-0ubuntu1) jaunty; urgency=low
45
46 * Consolidate openvista-utils and openvista-libs-* packages into a single
47
48=== modified file 'packages/deb/openvista-gtm-integration/debian/control'
49--- packages/deb/openvista-gtm-integration/debian/control 2009-10-20 02:23:22 +0000
50+++ packages/deb/openvista-gtm-integration/debian/control 2009-10-21 23:30:24 +0000
51@@ -50,3 +50,18 @@
52 utilities used to send signals to other GT.M processes.
53 .
54 The shared library in this package was built against GT.M V5.3-004A.
55+
56+Package: openvista-munin-plugins
57+Architecture: all
58+Depends: ${shlibs:Depends}, ${misc:Depends}, munin-node, openvista-utils
59+Description: Munin plugins to monitor OpenVista instances
60+ OpenVista is a cost-effective, open, trusted and complete EHR which enhances
61+ patient safety, increases clinical and operational efficiency and provides an
62+ opportunity to improve quality of care delivery.
63+ .
64+ Munin is a highly flexible and powerful solution used to create graphs of
65+ virtually everything imaginable throughout your network, while still
66+ maintaining a rattling ease of installation and configuration.
67+ .
68+ This package contains plugins for the Munin node to monitor OpenVista
69+ instances.
70
71=== added file 'packages/deb/openvista-gtm-integration/debian/openvista-munin-plugins.dirs'
72--- packages/deb/openvista-gtm-integration/debian/openvista-munin-plugins.dirs 1970-01-01 00:00:00 +0000
73+++ packages/deb/openvista-gtm-integration/debian/openvista-munin-plugins.dirs 2009-10-21 23:30:24 +0000
74@@ -0,0 +1,3 @@
75+etc/munin/plugin-conf.d
76+usr/share/doc/openvista-munin-plugins
77+usr/share/munin/plugins
78
79=== modified file 'packages/deb/openvista-gtm-integration/debian/rules'
80--- packages/deb/openvista-gtm-integration/debian/rules 2009-10-20 22:04:58 +0000
81+++ packages/deb/openvista-gtm-integration/debian/rules 2009-10-21 23:30:24 +0000
82@@ -86,9 +86,10 @@
83 dh_prep -i
84 dh_installdirs -i
85
86- # Add here commands to install the indep part of the package into
87- # debian/<package>-doc.
88- #INSTALLDOC#
89+ install scripts/etc/munin/plugin-conf.d/openvista debian/openvista-munin-plugins/etc/munin/plugin-conf.d/
90+ install scripts/usr/share/munin/plugins/openvista_databases_ debian/openvista-munin-plugins/usr/share/munin/plugins/
91+ install scripts/usr/share/munin/plugins/openvista_locks_ debian/openvista-munin-plugins/usr/share/munin/plugins/
92+ install scripts/usr/share/munin/plugins/openvista_processes_ debian/openvista-munin-plugins/usr/share/munin/plugins/
93
94 dh_install -i
95
96
97=== modified file 'packages/rpm/openvista-gtm-integration.spec'
98--- packages/rpm/openvista-gtm-integration.spec 2009-10-20 22:17:48 +0000
99+++ packages/rpm/openvista-gtm-integration.spec 2009-10-21 23:30:24 +0000
100@@ -114,6 +114,14 @@
101 install -d %{buildroot}/sbin
102 install -m 4550 src/ovauth/ovauth %{buildroot}/sbin
103
104+install -d %{buildroot}%{_sysconfdir}/munin/plugin-conf.d/
105+install scripts/etc/munin/plugin-conf.d/openvista %{buildroot}%{_sysconfdir}/munin/plugin-conf.d/
106+
107+install -d %{buildroot}%{_datadir}/munin/plugins/
108+for plugin in scripts/usr/share/munin/plugins/*; do
109+ install $plugin %{buildroot}%{_datadir}/munin/plugins/
110+done
111+
112 %clean
113 rm -rf %{buildroot}
114
115@@ -405,3 +413,38 @@
116 fi
117
118 /sbin/service httpd reload > /dev/null 2>&1 || :
119+
120+
121+
122+
123+
124+%package -n openvista-munin-plugins
125+Release: 3
126+Summary: Munin plugins to monitor OpenVista instances
127+Group: Applications/System
128+
129+Requires: /bin/bash, coreutils
130+Requires: munin-node
131+Requires: openvista-utils
132+
133+%description -n openvista-munin-plugins
134+OpenVista is a cost-effective, open, trusted and complete EHR which enhances
135+patient safety, increases clinical and operational efficiency and provides an
136+opportunity to improve quality of care delivery.
137+
138+Munin is a highly flexible and powerful solution used to create graphs of
139+virtually everything imaginable throughout your network, while still
140+maintaining a rattling ease of installation and configuration.
141+
142+This package contains plugins for the Munin node to monitor OpenVista
143+instances.
144+
145+%files -n openvista-munin-plugins
146+%defattr(-,root,root)
147+%doc README
148+%doc COPYING
149+%doc COPYING.AGPL
150+%doc NEWS
151+%{_sysconfdir}/munin/plugin-conf.d/openvista
152+%{_datadir}/munin/plugins/*
153+
154
155=== added directory 'scripts/etc/munin'
156=== added directory 'scripts/etc/munin/plugin-conf.d'
157=== added file 'scripts/etc/munin/plugin-conf.d/openvista'
158--- scripts/etc/munin/plugin-conf.d/openvista 1970-01-01 00:00:00 +0000
159+++ scripts/etc/munin/plugin-conf.d/openvista 2009-10-21 23:30:24 +0000
160@@ -0,0 +1,2 @@
161+[openvista*]
162+group openvista, gtm
163
164=== added directory 'scripts/usr/share'
165=== added directory 'scripts/usr/share/munin'
166=== added directory 'scripts/usr/share/munin/plugins'
167=== added file 'scripts/usr/share/munin/plugins/openvista_databases_'
168--- scripts/usr/share/munin/plugins/openvista_databases_ 1970-01-01 00:00:00 +0000
169+++ scripts/usr/share/munin/plugins/openvista_databases_ 2009-10-21 23:30:24 +0000
170@@ -0,0 +1,93 @@
171+#!/bin/bash
172+
173+# This is a munin plugin that monitors the size of each OpenVista database on
174+# the system.
175+
176+
177+# Copyright (C) 2009 Medsphere Systems Corporation
178+#
179+# This program is free software; you can redistribute it and/or modify it solely
180+# under the terms of the GNU Affero General Public License version 3 as published
181+# by the Free Software Foundation.
182+#
183+# This program is distributed in the hope that it will be useful, but WITHOUT
184+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
185+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
186+# for more details.
187+#
188+# You should have received a copy of the GNU Affero General Public License
189+# along with this program. If not, see <http://www.gnu.org/licenses>.
190+#
191+# You can contact Medsphere Systems Corporation headquarters at 1917 Palomar
192+# Oaks Way, Suite 200, Carlsbad, CA 92008 or at legal@medsphere.com.
193+
194+INSTANCE=`basename $0 | sed 's/^openvista_databases_//g'`
195+
196+. /usr/lib/openvista/functions
197+
198+root="/opt/openvista"
199+user="openvista"
200+
201+case $1 in
202+ autoconf)
203+ for instance in `ls $root`; do
204+ [ -L "$root/$instance/gtm" ] || continue
205+
206+ echo "yes"
207+ exit 0
208+ done
209+
210+ echo "no"
211+ exit 1
212+ ;;
213+
214+ suggest)
215+ for instance in `ls $root`; do
216+ [ -L "$root/$instance/gtm" ] || continue
217+
218+ echo $instance
219+ done
220+ ;;
221+
222+ config)
223+ echo "graph_args --base 1024 -l 0"
224+ echo "graph_vlabel Bytes"
225+ echo "graph_title Database files in $INSTANCE"
226+ echo "graph_category OpenVista"
227+ echo "graph_info The size of the OpenVista database files in $INSTANCE"
228+ echo "graph_order default scratch"
229+
230+ echo "default.label DEFAULT"
231+ echo "default.draw LINE2"
232+ echo "default.info The size of the default.dat file"
233+
234+ echo "scratch.label SCRATCH"
235+ echo "scratch.draw LINE2"
236+ echo "default.info The size of the scratch.dat file"
237+
238+ echo "all.label Total"
239+ echo "all.draw LINE2"
240+ echo "all.info The total size of all .dat files"
241+ ;;
242+
243+ *)
244+ # check permissions
245+ in_groups || {
246+ echo "permission denied"
247+ exit 1
248+ }
249+
250+ # check for for valid arguments (requires correct permissions to do; must happen after permission checks)
251+ set_gtm_env "$INSTANCE" || {
252+ echo "not an OpenVista instance"
253+ exit 1
254+ }
255+
256+ default=`stat -c%s "$root/$instance/globals/default.dat"`
257+ scratch=`stat -c%s "$root/$instance/globals/scratch.dat"`
258+ all=`expr $default + $scratch`
259+ echo "default.value $default"
260+ echo "scratch.value $scratch"
261+ echo "all.value $all"
262+ ;;
263+esac
264
265=== added file 'scripts/usr/share/munin/plugins/openvista_locks_'
266--- scripts/usr/share/munin/plugins/openvista_locks_ 1970-01-01 00:00:00 +0000
267+++ scripts/usr/share/munin/plugins/openvista_locks_ 2009-10-21 23:30:24 +0000
268@@ -0,0 +1,99 @@
269+#!/bin/bash
270+
271+# This is a munin plugin that monitors the number of locks in an OpenVista
272+# instance.
273+
274+
275+# Copyright (C) 2009 Medsphere Systems Corporation
276+#
277+# This program is free software; you can redistribute it and/or modify it solely
278+# under the terms of the GNU Affero General Public License version 3 as published
279+# by the Free Software Foundation.
280+#
281+# This program is distributed in the hope that it will be useful, but WITHOUT
282+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
283+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
284+# for more details.
285+#
286+# You should have received a copy of the GNU Affero General Public License
287+# along with this program. If not, see <http://www.gnu.org/licenses>.
288+#
289+# You can contact Medsphere Systems Corporation headquarters at 1917 Palomar
290+# Oaks Way, Suite 200, Carlsbad, CA 92008 or at legal@medsphere.com.
291+
292+
293+INSTANCE=`basename $0 | sed 's/^openvista_locks_//g'`
294+
295+. /usr/lib/openvista/functions
296+
297+root="/opt/openvista"
298+user="openvista"
299+
300+case $1 in
301+ autoconf)
302+ for instance in `ls $root`; do
303+ [ -L "$root/$instance/gtm" ] || continue
304+
305+ echo "yes"
306+ exit 0
307+ done
308+
309+ echo "no"
310+ exit 1
311+ ;;
312+
313+ suggest)
314+ for instance in `ls $root`; do
315+ [ -L "$root/$instance/gtm" ] || continue
316+
317+ echo $instance
318+ done
319+ ;;
320+
321+ config)
322+ echo "graph_args -l 0"
323+ echo "graph_vlabel Locks"
324+ echo "graph_title Locks in $INSTANCE"
325+ echo "graph_category OpenVista"
326+ echo "graph_info The number of locks in $INSTANCE"
327+ echo "graph_order default scratch"
328+
329+ echo "default.label DEFAULT"
330+ echo "default.draw LINE2"
331+ echo "default.info The number of locks in the DEFAULT region"
332+
333+ echo "scratch.label SCRATCH"
334+ echo "scratch.draw LINE2"
335+ echo "scratch.info The number of locks in the SCRATCH region"
336+ ;;
337+
338+ *)
339+ # check permissions
340+ in_groups || {
341+ echo "permission denied"
342+ exit 1
343+ }
344+
345+ # check for for valid arguments (requires correct permissions to do; must happen after permission checks)
346+ set_gtm_env "$INSTANCE" || {
347+ echo "not an OpenVista instance"
348+ exit 1
349+ }
350+
351+ # object files should be created with permissions 660
352+ umask 007
353+
354+ # switch to temp directory so *.mj[eo] files are created there
355+ # because of the umask, even if two users job off the same routine,
356+ # the second user will be able to overwrite the *.mj[eo] files and
357+ # the JOB command will succeed, but the *.mj[eo] files will become
358+ # garbled (both JOBs will write to them in no particular order)
359+ cd "$root/$INSTANCE/tmp"
360+
361+ echo -n "default.value "
362+ lke show -region=DEFAULT 2>&1 | grep -v '^$' | grep -v '^DEFAULT$' | grep -v 'No locks were found' | grep -v '^ ' | wc -l
363+
364+ echo -n "scratch.value "
365+ lke show -region=SCRATCH 2>&1 | grep -v '^$' | grep -v '^SCRATCH$' | grep -v 'No locks were found' | grep -v '^ ' | wc -l
366+ ;;
367+esac
368
369=== added file 'scripts/usr/share/munin/plugins/openvista_processes_'
370--- scripts/usr/share/munin/plugins/openvista_processes_ 1970-01-01 00:00:00 +0000
371+++ scripts/usr/share/munin/plugins/openvista_processes_ 2009-10-21 23:30:24 +0000
372@@ -0,0 +1,111 @@
373+#!/bin/bash
374+
375+# This is a munin plugin that monitors the number of processes running in an
376+# OpenVista instance.
377+
378+
379+# Copyright (C) 2009 Medsphere Systems Corporation
380+#
381+# This program is free software; you can redistribute it and/or modify it solely
382+# under the terms of the GNU Affero General Public License version 3 as published
383+# by the Free Software Foundation.
384+#
385+# This program is distributed in the hope that it will be useful, but WITHOUT
386+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
387+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
388+# for more details.
389+#
390+# You should have received a copy of the GNU Affero General Public License
391+# along with this program. If not, see <http://www.gnu.org/licenses>.
392+#
393+# You can contact Medsphere Systems Corporation headquarters at 1917 Palomar
394+# Oaks Way, Suite 200, Carlsbad, CA 92008 or at legal@medsphere.com.
395+
396+
397+INSTANCE=`basename $0 | sed 's/^openvista_processes_//g'`
398+
399+. /usr/lib/openvista/functions
400+
401+root="/opt/openvista"
402+user="openvista"
403+
404+case $1 in
405+ autoconf)
406+ for instance in `ls $root`; do
407+ [ -L "$root/$instance/gtm" ] || continue
408+
409+ echo "yes"
410+ exit 0
411+ done
412+
413+ echo "no"
414+ exit 1
415+ ;;
416+
417+ suggest)
418+ for instance in `ls $root`; do
419+ [ -L "$root/$instance/gtm" ] || continue
420+
421+ echo $instance
422+ done
423+ ;;
424+
425+ config)
426+ echo "graph_args -l 0"
427+ echo "graph_vlabel Processes"
428+ echo "graph_title Processes running in $INSTANCE"
429+ echo "graph_category OpenVista"
430+ echo "graph_info The number of processes running in $INSTANCE"
431+ echo "graph_order terminal rpc other all"
432+
433+ echo "terminal.label Terminal User Processes"
434+ echo "terminal.draw LINE2"
435+ echo "terminal.info The number of processes servicing terminal user connections"
436+
437+ echo "rpc.label RPC Broker Processes"
438+ echo "rpc.draw LINE2"
439+ echo "rpc.info The number of processes servicing RPC broker connections"
440+
441+ echo "other.label Other Processes"
442+ echo "other.draw LINE2"
443+ echo "other.info The number of processes running in the background"
444+
445+ echo "all.label Total"
446+ echo "all.draw LINE2"
447+ echo "all.info The total number of OpenVista processes running in $INSTANCE"
448+ ;;
449+
450+ *)
451+ # check permissions
452+ in_groups || {
453+ echo "permission denied"
454+ exit 1
455+ }
456+
457+ # check for for valid arguments (requires correct permissions to do; must happen after permission checks)
458+ set_gtm_env "$INSTANCE" || {
459+ echo "not an OpenVista instance"
460+ exit 1
461+ }
462+
463+ # object files should be created with permissions 660
464+ umask 007
465+
466+ # switch to temp directory so *.mj[eo] files are created there
467+ # because of the umask, even if two users job off the same routine,
468+ # the second user will be able to overwrite the *.mj[eo] files and
469+ # the JOB command will succeed, but the *.mj[eo] files will become
470+ # garbled (both JOBs will write to them in no particular order)
471+ cd "$root/$INSTANCE/tmp"
472+
473+ ss=`mumps -run THIS^%SS | tail -n +7 | head -n -2`
474+ terminal=`echo "$ss" | grep -v '^$' | awk '{ print $2 }' | grep '/dev/pts' | wc -l`
475+ rpc=`echo "$ss" | grep -v '^$' | awk '{ print $2 }' | grep 'CONNECTED' | wc -l`
476+ all=`echo "$ss" | grep -v '^$' | wc -l`
477+ other=`expr $all - $terminal - $rpc`
478+ echo "terminal.value $terminal"
479+ echo "rpc.value $rpc"
480+ echo "other.value $other"
481+ echo "all.value $all"
482+ ;;
483+esac

Subscribers

People subscribed via source and target branches