Group: Applications/System
Requires: python
-Requires: python-sqlalchemy
-Requires: python-elixir
+#Requires: python-sqlalchemy
+#Requires: python-elixir
Requires: openssh-clients
Requires: perl-libwww-perl
Requires: PLCWWW >= 4.2
Requires: bootcd-planetlab-i386 >= 4.2
-Requires: zabbix-client
-Requires: zabbix-gui
-Requires: zabbix-server
+#Requires: zabbix-client
+#Requires: zabbix-gui
+#Requires: zabbix-server
%description server
The server side include all python modules and scripts needed to fully
# TODO: Use the installed version of bootcd to create custom boot images. ( or, use the api now).
# NOTE: generate the python defines from zabbix include files.
-php /usr/share/%{name}/zabbix/getdefines.php > %{python_sitearch}/monitor/database/zabbixapi/defines.py
+#php /usr/share/%{name}/zabbix/getdefines.php > %{python_sitearch}/monitor/database/zabbixapi/defines.py
# apply patches to zabbix
-patch -d /var/www/html/zabbix/ -p0 < /usr/share/%{name}/zabbix/zabbix-auto-login.diff
+#patch -d /var/www/html/zabbix/ -p0 < /usr/share/%{name}/zabbix/zabbix-auto-login.diff
#chkconfig --add monitor-server
#chkconfig monitor-server on
check_monitor_conf
check_monitor_schema_and_data
- check_pg_hba $ZABBIX_DB_NAME $ZABBIX_DB_USER
- check_user_and_db $ZABBIX_DB_NAME $ZABBIX_DB_USER
+ #check_pg_hba $ZABBIX_DB_NAME $ZABBIX_DB_USER
+ #check_user_and_db $ZABBIX_DB_NAME $ZABBIX_DB_USER
if [ -n "$WROTE_PG_CONFIG" ] ; then
# NOTE: restart db to enable access by users granted above.
dialog "$MESSAGE"
fi
- check_zabbix_schema_and_data
- check_zabbix_templates_and_import
+ #check_zabbix_schema_and_data
+ #check_zabbix_templates_and_import
# create /etc/httpd/conf.d/monitorweb.conf
start_tg_server
# START zabbix services. SETUP default config files.
- check_zab_server
- check_zab_agentd
- check_zab_webconfig
+ #check_zab_server
+ #check_zab_agentd
+ #check_zab_webconfig
result "$MESSAGE"
;;
MESSAGE=$"Deleting databases..."
dialog "$MESSAGE"
- dropdb -U postgres $ZABBIX_DB_NAME
- dropuser -U postgres $ZABBIX_DB_USER
+ #dropdb -U postgres $ZABBIX_DB_NAME
+ #dropuser -U postgres $ZABBIX_DB_USER
dropdb -U postgres $MONITOR_DB_NAME
dropuser -U postgres $MONITOR_DB_USER
dialog "$MESSAGE"
stop_tg_server
- service zabbix_server stop
- service zabbix_agentd stop
+ #service zabbix_server stop
+ #service zabbix_agentd stop
# TODO: is there anything to stop?
result "$MESSAGE"
;;
dbpcu.plc_pcu_stats = pcu
deleteExtra(l_pcus, PlcPCU, 'pcu_id', 'pcu_id')
deleteExtra(l_pcus, HistoryPCURecord, 'plc_pcuid', 'pcu_id')
+ deleteExtra(l_pcus, FindbadPCURecord, 'plc_pcuid', 'pcu_id')
session.flush()
print "sync nodes"
dbnode.plc_node_stats = node
deleteExtra(l_nodes, PlcNode, 'hostname', 'hostname')
deleteExtra(l_nodes, HistoryNodeRecord, 'hostname', 'hostname')
+ deleteExtra(l_nodes, FindbadNodeRecord, 'hostname', 'hostname')
session.flush()
init()
return
if __name__ == '__main__':
- profile.run('sync()')
+ sync()
else:
init()
from monitor import parser as parsermodule
from sets import Set
-from monitor.common import *
from monitor.database.info.model import FindbadNodeRecord
def network_config_to_str(net):
node_keys = ['boot_state', 'key', 'last_updated', 'last_contact']
for k in node_keys:
if 'last' in k:
- print "%15s == %s" % (k, diff_time(n[k]))
+ #print "%15s == %s" % (k, diff_time(n[k]))
+ print "%15s == %s" % (k, n[k])
else:
print "%15s == %s" % (k, n[k])
#for k in net.keys():
# print k, "==" , net[k]
except:
+ #from monitor.common import email_exception
print "Error with %s" % node
- email_exception()
+ #email_exception()
import traceback; print traceback.print_exc()
pass
ssh_options="-o StrictHostKeyChecking=no -o PasswordAuthentication=yes -o PubkeyAuthentication=no"
s = pxssh.pxssh()
- if not s.login(self.host, self.username, self.password, ssh_options):
- raise ExceptionPassword("Invalid Password")
+ try:
+ if not s.login(self.host, self.username, self.password, ssh_options):
+ raise ExceptionPassword("Invalid Password")
+ except pexpect.EOF:
+ raise ExceptionNoTransport("No Connection Possible")
+
+
# Otherwise, the login succeeded.
# Send a ctrl-c to the remote process.
ret = s.recv(count, socket.MSG_DONTWAIT)
except socket.error, e:
if e[0] == errno.EAGAIN:
- raise Exception(e[1])
+ #raise Exception(e[1])
+ raise ExceptionNotFound(e[1])
+ elif e[0] == errno.ETIMEDOUT:
+ raise ExceptionTimeout(e[1])
else:
# TODO: not other exceptions.
raise Exception(e)
# NOTE: reformat some fields.
prep_node_for_display(node)
- node.history.status
+ #node.history.status
+ print node.hostname
if node.history.status in ['down', 'offline']:
if node.plc_node_stats and node.plc_node_stats['last_contact'] != None: