Many small updates and fixes:
[monitor.git] / Monitor.spec
index 8d9ede0..32ecb44 100644 (file)
@@ -50,7 +50,11 @@ Requires: mysql-server
 Requires: mysql-devel
 Requires: mysql-libs
 Requires: mailx
+Requires: sendmail
+Requires: php
+Requires: httpd
 
+Requires: cronie
 Requires: nagios
 Requires: nagios-common
 Requires: nagios-devel
@@ -58,6 +62,8 @@ Requires: nagios-plugins-all
 Requires: ndoutils
 Requires: ndoutils-mysql
 
+Requires: rt3
+
 
 %description nagios
 Scripts and setup necessary to integrate and monitor PLC with Nagios.
@@ -156,7 +162,9 @@ install -d $RPM_BUILD_ROOT/%{python_sitearch}/monitor
 install -D -m 644 monitor.functions $RPM_BUILD_ROOT/%{_sysconfdir}/plc.d/monitor.functions
 install -D -m 755 monitor-server.init $RPM_BUILD_ROOT/%{_sysconfdir}/plc.d/monitor
 install -D -m 755 zabbix/monitor-zabbix.init $RPM_BUILD_ROOT/%{_sysconfdir}/plc.d/zabbix
+
 install -D -m 755 nagios/monitor-nagios.init $RPM_BUILD_ROOT/%{_sysconfdir}/plc.d/monitor-nagios
+install -D -m 644 nagios/monitor-nagios.cron $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/monitor-nagios.cron
 
 # cron job for automated polling
 install -D -m 644 monitor-server.cron $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/monitor-server.cron
@@ -173,6 +181,9 @@ rsync -a --exclude archive-pdb --exclude .cvsignore --exclude .svn --exclude CVS
 # install monitor python package
 rsync -a --exclude .svn  ./monitor/   $RPM_BUILD_ROOT/%{python_sitearch}/monitor/
 
+install -D -m 644 monitor/wrapper/plc.py $RPM_BUILD_ROOT/usr/share/%{name}/nagios/
+install -D -m 644 monitor/generic.py $RPM_BUILD_ROOT/usr/share/%{name}/nagios/
+
 # install third-party module to site-packages
 install -D -m 755 threadpool.py $RPM_BUILD_ROOT/%{python_sitearch}/threadpool.py
 
@@ -201,6 +212,7 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(-,root,root)
 %{_sysconfdir}/plc.d/monitor-nagios
 /usr/share/%{name}/nagios 
+%{_sysconfdir}/cron.d/monitor-nagios.cron
 
 %files server
 %defattr(-,root,root)
@@ -338,10 +350,12 @@ chkconfig --add monitor
 chkconfig monitor on
 
 %post runlevelagent
-chkconfig --add monitor-runlevelagent
-chkconfig monitor-runlevelagent on
-if [ "$PL_BOOTCD" != "1" ] ; then
-       service monitor-runlevelagent restart
+if [ -f /etc/planetlab/node_id ] ; then
+    chkconfig --add monitor-runlevelagent
+    chkconfig monitor-runlevelagent on
+    if [ "$PL_BOOTCD" != "1" ] ; then
+        service monitor-runlevelagent restart
+    fi
 fi