5 %define url $URL: svn+ssh://svn.planet-lab.org/svn/monitor/trunk/monitor.spec $
8 # keep this version in sync with monitor/monitor_version.py
12 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
13 %global python_sitearch %( python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)" )
18 Source0: %{name}-%{version}.tar.bz2
20 Group: Applications/System
21 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
24 Packager: PlanetLab Central <support@planet-lab.org>
25 Distribution: PlanetLab %{plrelease}
26 URL: %(echo %{url} | cut -d ' ' -f 2)
28 # this is only required for fedora and we have this in devel.pkgs for
30 # BuildRequires: python-setuptools-devel
33 Summary: Monitor account initialization for the root image.
34 Group: Applications/System
37 Monitor is a collection of secondary scripts for configuring the node polling
38 system, syncing the PLC db with the monitoring database, notifying users,
39 interacting with PCU hardware, applying penalties to sites that violate
42 ######################################## CLIENT
45 Summary: Monitor hooks for a PLC node
46 Group: Applications/System
51 The client scripts handle account creation inside of a node. This will
52 include configuration setup for the monitoring agent running on the node. It
53 will also include any cron or init scripts needed to perform this kind of
55 ######################################## Server Deps
57 Summary: Monitor hooks for the PLC server.
58 Group: Applications/System
61 Requires: python-peak-util-extremes
63 Requires: compat-libstdc++-296
64 Requires: openssh-clients
65 Requires: perl-libwww-perl
66 Requires: perl-IO-Socket-SSL
67 Requires: MySQL-python
72 Requires: plewww-plekit
74 #Requires: zabbix-client
76 #Requires: zabbix-server
78 %description server-deps
79 The server side include all python modules and scripts needed to fully
81 ######################################## Server
83 Summary: Monitor hooks for the PLC server.
84 Group: Applications/System
88 Requires: monitor-server-deps
89 Requires: PLCWWW >= 4.2
90 Requires: bootcd-%{pldistro}-%{_arch} >= 4.2
93 The server side include all python modules and scripts needed to fully
94 operation, track, and interact with any third-party monitoring software, such
97 ####################################### RunlevelAgent
98 %package runlevelagent
99 summary: the RunlevelAgent that reports node runlevels
100 group: applications/system
103 %description runlevelagent
104 The RunlevelAgent starts as early as possible during boot-up and production
105 mode to actively report the observed runlevel to PLC and update the
106 'last_contact' field.
112 # NOTE: the build uses g++ cmdamt/
113 # NOTE: TMPDIR is needed here b/c the tmpfs of the build vserver is too small.
114 cd pcucontrol/models/intelamt
115 export TMPDIR=$PWD/tmp
120 rm -rf $RPM_BUILD_ROOT
121 #################### CLIENT
122 #install -D -m 755 monitor-client.init $RPM_BUILD_ROOT/%{_initrddir}/monitor
123 #install -D -m 644 monitor.cron $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/monitor
124 install -D -m 755 tools/timeout.pl $RPM_BUILD_ROOT/usr/bin/timeout.pl
127 #################### SERVER
128 install -d $RPM_BUILD_ROOT/usr/share/%{name}
129 install -d $RPM_BUILD_ROOT/data/var/lib/%{name}
130 install -d $RPM_BUILD_ROOT/data/var/lib/%{name}/archive-pdb
131 install -d $RPM_BUILD_ROOT/var/lib/%{name}
132 install -d $RPM_BUILD_ROOT/var/lib/%{name}/archive-pdb
133 install -d $RPM_BUILD_ROOT/var/www/html/monitorlog/
134 install -d $RPM_BUILD_ROOT/etc/httpd/conf.d/
135 install -d $RPM_BUILD_ROOT/%{python_sitearch}/monitor
137 # pack monitor's dependencies in RPM to make it easier to deploy.
138 export TMPDIR=/var/tmp/
139 export PYTHONPATH=$PYTHONPATH:$RPM_BUILD_ROOT/%{python_sitearch}/
140 easy_install -d $RPM_BUILD_ROOT/%{python_sitearch}/ -UZ http://files.turbogears.org/eggs/TurboGears-1.0.7-py2.5.egg
141 easy_install -d $RPM_BUILD_ROOT/%{python_sitearch}/ -UZ http://pypi.python.org/packages/source/S/SQLAlchemy/SQLAlchemy-0.5.3.tar.gz
142 easy_install -d $RPM_BUILD_ROOT/%{python_sitearch}/ -UZ Elixir
143 rm -rf $RPM_BUILD_ROOT/%{python_sitearch}/site.py*
146 install -D -m 644 monitor.functions $RPM_BUILD_ROOT/%{_sysconfdir}/plc.d/monitor.functions
147 install -D -m 755 monitor-server.init $RPM_BUILD_ROOT/%{_sysconfdir}/plc.d/monitor
148 install -D -m 755 zabbix/monitor-zabbix.init $RPM_BUILD_ROOT/%{_sysconfdir}/plc.d/zabbix
150 # cron job for automated polling
151 install -D -m 644 monitor-server.cron $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/monitor-server.cron
153 # apache configuration
154 install -D -m 644 web/monitorweb-httpd.conf $RPM_BUILD_ROOT/etc/httpd/conf.d/
156 # we'll install monitor and pcucontrol in site-packages
157 # install rest to /usr/share/monitor
158 rsync -a --exclude archive-pdb --exclude .svn --exclude CVS \
160 --exclude pcucontol/ \
161 ./ $RPM_BUILD_ROOT/usr/share/%{name}/
163 # install monitor python package
164 rsync -a --exclude .svn ./monitor/ $RPM_BUILD_ROOT/%{python_sitearch}/monitor/
167 rsync -a --exclude .svn ./pcucontrol/ $RPM_BUILD_ROOT/%{python_sitearch}/pcucontrol/
169 # install third-party module to site-packages
170 install -D -m 755 threadpool.py $RPM_BUILD_ROOT/%{python_sitearch}/threadpool.py
173 echo " * TODO: Setting up Monitor account in local MyPLC"
175 #touch $RPM_BUILD_ROOT/var/www/cgi-bin/monitor/monitorconfig.php
176 #chmod 777 $RPM_BUILD_ROOT/var/www/cgi-bin/monitor/monitorconfig.php
178 #install -D -m 755 monitor-default.conf $RPM_BUILD_ROOT/etc/monitor.conf
179 #cp $RPM_BUILD_ROOT/usr/share/%{name}/monitorconfig-default.py $RPM_BUILD_ROOT/usr/share/%{name}/monitorconfig.py
181 #################### RunlevelAgent
182 install -D -m 755 RunlevelAgent.py $RPM_BUILD_ROOT/usr/bin/RunlevelAgent.py
183 install -D -m 755 monitor-runlevelagent.init $RPM_BUILD_ROOT/%{_initrddir}/monitor-runlevelagent
185 mkdir -p $RPM_BUILD_ROOT/var/log
186 touch $RPM_BUILD_ROOT/var/log/server-deps.log
190 rm -rf $RPM_BUILD_ROOT
193 /var/log/server-deps.log
196 %defattr(-,root,root)
197 #%config /usr/share/%{name}/monitorconfig.py
198 #%config /etc/monitor.conf
201 #/var/www/cgi-bin/monitor
202 %{_sysconfdir}/cron.d/monitor-server.cron
203 %{_sysconfdir}/plc.d/monitor
204 %{_sysconfdir}/plc.d/monitor.functions
205 %{_sysconfdir}/plc.d/zabbix
206 %{_sysconfdir}/httpd/conf.d
210 %defattr(-,root,root)
211 #%{_initrddir}/monitor
212 #%{_sysconfdir}/cron.d/monitor
216 /usr/bin/RunlevelAgent.py*
217 /%{_initrddir}/monitor-runlevelagent
221 # crazy openssl libs for racadm binary
222 ln -s /lib/libssl.so.0.9.8b /usr/lib/libssl.so.2
223 mkdir %{_datadir}/%{name}/.ssh
224 chmod 700 %{_datadir}/%{name}/.ssh
226 if grep 'pam_loginuid.so' /etc/pam.d/crond ; then
227 sed -i -e 's/^session required pam_loginuid.so/#session required pam_loginuid.so/g' /etc/pam.d/crond
230 # NOTE: enable monitor by default, since we're installing it.
231 if ! plc-config --category plc_monitor --variable enabled ; then
232 plc-config --category plc_monitor --variable enabled --value true \
233 --save /etc/planetlab/configs/site.xml /etc/planetlab/configs/site.xml
235 if ! plc-config --category plc_monitor --variable from_email ; then
236 plc-config --category plc_monitor --variable from_email --value monitor@localhost.localdomain \
237 --save /etc/planetlab/configs/site.xml /etc/planetlab/configs/site.xml
239 if ! plc-config --category plc_monitor --variable cc_email ; then
240 plc-config --category plc_monitor --variable cc_email --value monitor@localhost.localdomain \
241 --save /etc/planetlab/configs/site.xml /etc/planetlab/configs/site.xml
243 if ! plc-config --category plc_monitor --variable rt_queue ; then
244 plc-config --category plc_monitor --variable rt_queue --value support \
245 --save /etc/planetlab/configs/site.xml /etc/planetlab/configs/site.xml
249 if ! plc-config --category plc_zabbix --variable enabled ; then
250 plc-config --category plc_zabbix --variable enabled --value false \
251 --save /etc/planetlab/configs/site.xml /etc/planetlab/configs/site.xml
253 if ! plc-config --category plc_zabbix --variable host ; then
254 plc-config --category plc_zabbix --variable host --value localhost.localdomain \
255 --save /etc/planetlab/configs/site.xml /etc/planetlab/configs/site.xml
257 if ! plc-config --category plc_zabbix --variable ip ; then
258 plc-config --category plc_zabbix --variable ip --value "" \
259 --save /etc/planetlab/configs/site.xml /etc/planetlab/configs/site.xml
263 # TODO: this will be nice when we have a web-based service running., such as
264 # an API server or so on.
265 # TODO: create real monitorconfig.py from monitorconfig-default.py
266 # TODO: create symlink in /var/lib/monitor for chroot environments
267 # TODO: update the content of automate_pl03.sh
268 # TODO: Use the installed version of bootcd to create custom boot images. ( or, use the api now).
270 # NOTE: generate the python defines from zabbix include files.
271 #php /usr/share/%{name}/zabbix/getdefines.php > %{python_sitearch}/monitor/database/zabbixapi/defines.py
273 # apply patches to zabbix
274 #patch -d /var/www/html/zabbix/ -p0 < /usr/share/%{name}/zabbix/zabbix-auto-login.diff
276 #chkconfig --add monitor-server
277 #chkconfig monitor-server on
280 chkconfig --add monitor
284 chkconfig --add monitor-runlevelagent
285 chkconfig monitor-runlevelagent on
286 if [ "$PL_BOOTCD" != "1" ] ; then
287 service monitor-runlevelagent restart
292 * Thu Dec 17 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - Monitor-3.0-28
293 - do not need buildrequires. a new tag to fix centos builds
295 * Thu Dec 17 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - Monitor-3.0-27
296 - fix rpm build issues
298 * Wed Dec 16 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - Monitor-3.0-26
299 - to many changes, but mostly moved stuff around. there are some small fixes here and there.
301 * Fri Nov 20 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-25
302 - add option for site status to include both node & pcu status
303 - improve ticket handling
304 - template gadget.xml for a site-specific google-gadget summary
306 * Thu Oct 22 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - Monitor-3.0-24
309 * Mon Oct 19 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - Monitor-3.0-23
310 - - remove monitor-client.cron
311 - - remove unused monitor-client init script
312 - - fix UP/DOWN summary on nodes page.
313 - - make node page display all nodes by default
314 - - add boot_server field
315 - - add myops_ssh_key to the keychain
316 - - use ext_consortium_id to distinguish pending sites.
318 * Fri Oct 09 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - Monitor-3.0-22
319 - show/hide advance query form.
321 * Thu Sep 24 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-21
322 - fixed pause_penalty bug.
323 - fixed IPAL pcucontrol bug
324 - fixed bootman tunnel setup bug (occurred in rare cases)
326 - added BootmanSequenceRecords to separate config data from source code
327 - added get/setBootmanSequence(s) to xmlrpc API
329 * Fri Sep 04 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-20
331 - added bm log collection and optional integration with BootManager's log Upload()
332 - added iptables_status
333 - expanded advanced query
334 - added differentiated bootmanager_restore actions so that actionsummary displays
335 - counts for each kind of bootmanager action
336 - added pcuerror notices (for mis-configurations) in addition to pcufailed notices
337 - added plain-text options for query page by adding tg_format=plain to URL
338 - fixed cross-module reference that prevented pcucontrol for working with RebootNodeWithPCU() api call.
339 - fixed a bug in determining whether comon's dir was running on a node
341 * Mon Aug 17 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-19
343 - adds multiple features and web changes
344 - adds new fields to db
346 - general improvements otherwise
348 * Sun Jun 28 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-18
350 - improved templates and views
351 - cleaned controller code for web
352 - added IPMI requirement to pcucontrol package.
354 * Thu Jun 18 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-17
355 - added bootmanager log links
356 - addressed root cause of IntegrityErrors ; big deal
357 - adjusted templates to accomodate fix for IntegrityErrors
358 - added session.flush() to bootman.py to write out ActionsRecords
359 - fixed policy to either pause penalties or apply them ; not both.
361 -* Wed Jun 17 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-16
362 -- Added Rpyc from 1.0 branch.
364 -- add setup-agent for password protected keys.
365 -- other minor improvements.
367 * Wed Jun 17 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-15
371 * Fri Jun 12 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-14
374 - added statistics dir
376 * Mon Jun 08 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-13
377 - remove plccache from controllers, all lookups from db.
378 - reformat emailTxt messags
379 - updated bootstates in bootman.py
381 * Tue Jun 02 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-12
382 - tag of latest changes.
383 - need to test end to end.
385 * Sat May 30 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - Monitor-3.0-11
386 - big merge from the 2.0 branch
388 * Tue May 26 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - Monitor-3.0-10
389 - minor improvements in rendering with sortable tables
391 * Tue May 19 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - Monitor-3.0-9
393 * Fri May 15 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - Monitor-3.0-8
394 - first draft with sortable tables + checkpoint
396 * Fri May 15 2009 Baris Metin <tmetin@sophia.inria.fr>
397 - use plekit tables from plewww.
398 - depend on plewww-plekit
400 * Tue May 12 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-7
402 - fix for package name dependency
405 * Mon May 04 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-6
406 - add improved docs to the latest build and tag.
408 * Mon May 04 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-5
409 - add documentation hooks for adding in-line docs like NM and PLCAPI
411 * Fri May 01 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-4
412 - Rough pass over monitor-3.0 to allow it to work with 4.3 API.
413 - replaced GetNodeNetworks, nodeinterface_ids and using new bootstates
414 - 'safeboot', 'failboot', 'reinstall', etc.
416 * Tue Apr 28 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-3
417 - same as 2.0-12 tag.
419 * Mon Apr 27 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-2
420 - merge from 2.0, remove more zabbix code, simplify install, etc.
422 * Thu Apr 16 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-1
423 - major merge from 2.0 branch.
424 - ready to be updated with 4.3 and web changes.
426 * Fri Feb 27 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-1
427 - preparing to make a 2.0 branch for monitor.
429 * Mon Jan 05 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-0
430 - new changes are significantly different, that I'm upping the number for clarity.
432 * Wed Sep 24 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-1.0-8
433 - These are all changes in the latest Monitor code. I will branch this version
434 - next, before making additional large changes.
436 * Mon Sep 01 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - Monitor-1.0-7
437 - Checkpointing current version for 4.2-rc21 - many many changes
439 * Mon Aug 11 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-1.0-6
440 - This is a major tag of every thing. probably needs a very different release
443 * Fri Jul 18 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-1.0-5
444 - Incremental improvements
446 * Mon May 19 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-1.0-4
447 - tagging everything for OneLab tech-transfer.
450 * Fri May 09 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-1.0-3
453 * Mon May 05 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-1.0-2
456 * Wed Apr 23 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-1.0-1
457 - This should be ready for 4.2rc2
460 * Mon Apr 07 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - monitor-1.0-0
463 %define module_current_branch 2.0