Exemple #1
0
	def get(self, alert_id):
		alert = alerts_model.get_by_id(alert_id)

		server = server_model.get_one()

	
		errors =  self.session.get('errors',None)
		form_data =  self.session.get('form_data',None)
		email_recepients = email_recepient_model.get_all()
		sms_recepients = sms_recepient_model.get_all()

		self.delete_session_key('errors')
		self.delete_session_key('form_data')

		self.render('alerts/edit_server_alert.html',
				alert=alert,
				email_recepients=email_recepients,
				sms_recepients=sms_recepients,
				process_metrics=process_metrics,
				server_metrics=server_metrics,
				common_metrics=common_metrics,
				errors=errors,
				form_data=form_data,
				server=server
		)
Exemple #2
0
	def get(self):
		date_from = self.get_argument('date_from', None)
		date_to = self.get_argument('date_to', None)
		daterange = self.get_argument('daterange', None)
		processes = self.get_arguments('process', None)


		 # Default 24 hours period
		day = timedelta(hours=24)
		default_to = self.now
		default_from = default_to - day

		if date_from:
			date_from = datestring_to_utc_datetime(date_from)
		else:
			date_from = default_from

		if date_to:
			date_to = datestring_to_utc_datetime(date_to)
		else:
			date_to = default_to

		date_from = datetime_to_unixtime(date_from)
		date_to = datetime_to_unixtime(date_to) 
		default_from = datetime_to_unixtime(default_from)
		default_to = datetime_to_unixtime(default_to) 

		process_data = process_model.get_process_data(processes, date_from, date_to)

		# Convert the dates to local time for display
		date_from = utc_unixtime_to_localtime(date_from)
		date_to = utc_unixtime_to_localtime(date_to)
		default_from = utc_unixtime_to_localtime(default_from)
		default_to = utc_unixtime_to_localtime(default_to)

		# Get the difference between UTC and localtime - used to display 
		# the ticks in the charts
		zone_difference = localtime_utc_timedelta()

		# Get the max date - utc, converted to localtime
		max_date = utc_now_to_localtime() 

		server = server_model.get_one()

		self.render('processes.html',	
				current_page=self.current_page,
				processes=processes,
				process_data=process_data,
				date_from=date_from,
				date_to=date_to,
				default_from=default_from,
				default_to=default_to,
				zone_difference=zone_difference,
				max_date=max_date,
				daterange=daterange,
				server=server
				)
Exemple #3
0
    def get(self):
        date_from = self.get_argument('date_from', None)
        date_to = self.get_argument('date_to', None)
        daterange = self.get_argument('daterange', None)
        processes = self.get_arguments('process', None)

        # Default 24 hours period
        day = timedelta(hours=24)
        default_to = self.now
        default_from = default_to - day

        if date_from:
            date_from = datestring_to_utc_datetime(date_from)
        else:
            date_from = default_from

        if date_to:
            date_to = datestring_to_utc_datetime(date_to)
        else:
            date_to = default_to

        date_from = datetime_to_unixtime(date_from)
        date_to = datetime_to_unixtime(date_to)
        default_from = datetime_to_unixtime(default_from)
        default_to = datetime_to_unixtime(default_to)

        process_data = process_model.get_process_data(processes, date_from,
                                                      date_to)

        # Convert the dates to local time for display
        date_from = utc_unixtime_to_localtime(date_from)
        date_to = utc_unixtime_to_localtime(date_to)
        default_from = utc_unixtime_to_localtime(default_from)
        default_to = utc_unixtime_to_localtime(default_to)

        # Get the difference between UTC and localtime - used to display
        # the ticks in the charts
        zone_difference = localtime_utc_timedelta()

        # Get the max date - utc, converted to localtime
        max_date = utc_now_to_localtime()

        server = server_model.get_one()

        self.render('processes.html',
                    current_page=self.current_page,
                    processes=processes,
                    process_data=process_data,
                    date_from=date_from,
                    date_to=date_to,
                    default_from=default_from,
                    default_to=default_to,
                    zone_difference=zone_difference,
                    max_date=max_date,
                    daterange=daterange,
                    server=server)
Exemple #4
0
    def get(self):

        server = server_model.get_one()

        errors = self.session.get('errors', None)
        form_data = self.session.get('form_data', None)
        email_recepients = email_recepient_model.get_all()
        sms_recepients = sms_recepient_model.get_all()

        self.delete_session_key('errors')
        self.delete_session_key('form_data')

        self.render('alerts/add_process_alert.html',
                    email_recepients=email_recepients,
                    sms_recepients=sms_recepients,
                    process_metrics=process_metrics,
                    errors=errors,
                    form_data=form_data,
                    server=server)
Exemple #5
0
	def get(self):

		server = server_model.get_one()
		
		errors =  self.session.get('errors',None)
		form_data =  self.session.get('form_data',None)
		email_recepients = email_recepient_model.get_all()
		sms_recepients = sms_recepient_model.get_all()


		self.delete_session_key('errors')
		self.delete_session_key('form_data')

		self.render('alerts/add_process_alert.html',
				email_recepients=email_recepients,
				sms_recepients=sms_recepients,
				process_metrics=process_metrics,
				errors=errors,
				form_data=form_data,
				server=server
		)
Exemple #6
0
    def get(self, alert_id):
        alert = alerts_model.get_by_id(alert_id)

        server = server_model.get_one()

        errors = self.session.get('errors', None)
        form_data = self.session.get('form_data', None)
        email_recepients = email_recepient_model.get_all()
        sms_recepients = sms_recepient_model.get_all()

        self.delete_session_key('errors')
        self.delete_session_key('form_data')

        self.render('alerts/edit_server_alert.html',
                    alert=alert,
                    email_recepients=email_recepients,
                    sms_recepients=sms_recepients,
                    process_metrics=process_metrics,
                    server_metrics=server_metrics,
                    common_metrics=common_metrics,
                    errors=errors,
                    form_data=form_data,
                    server=server)
Exemple #7
0
    def get(self):

        date_from = self.get_argument("date_from", None)
        date_to = self.get_argument("date_to", None)
        charts = self.get_arguments("charts", None)

        daterange = self.get_argument("daterange", None)

        # Default 24 hours period
        day = timedelta(hours=24)
        default_to = self.now
        default_from = default_to - day

        if date_from:
            date_from = datestring_to_utc_datetime(date_from)
        else:
            date_from = default_from

        if date_to:
            date_to = datestring_to_utc_datetime(date_to)
        else:
            date_to = default_to

        date_from = datetime_to_unixtime(date_from)
        date_to = datetime_to_unixtime(date_to)

        checks = system_model.get_system_data(charts, date_from, date_to)

        active_charts = charts if len(charts) > 0 else checks.keys()

        first_check_date = system_model.get_first_check_date()

        default_from = datetime_to_unixtime(default_from)
        default_to = datetime_to_unixtime(default_to)

        # Convert the dates to local time for display
        first_check_date = utc_unixtime_to_localtime(first_check_date)
        date_from = utc_unixtime_to_localtime(date_from)
        date_to = utc_unixtime_to_localtime(date_to)
        default_from = utc_unixtime_to_localtime(default_from)
        default_to = utc_unixtime_to_localtime(default_to)

        # Get the max date - utc, converted to localtime
        max_date = utc_now_to_localtime()

        # Get the difference between UTC and localtime - used to display
        # the ticks in the charts
        zone_difference = localtime_utc_timedelta()

        server = server_model.get_one()

        self.render(
            "system.html",
            charts=charts,
            active_charts=active_charts,
            checks=checks,
            daterange=daterange,
            date_from=date_from,
            date_to=date_to,
            default_from=default_from,
            default_to=default_to,
            first_check_date=first_check_date,
            zone_difference=zone_difference,
            max_date=max_date,
            server=server,
        )
Exemple #8
0
    def get(self):

        date_from = self.get_argument('date_from', None)
        date_to = self.get_argument('date_to', None)
        charts = self.get_arguments('charts', None)

        daterange = self.get_argument('daterange', None)

        # Default 24 hours period
        day = timedelta(hours=24)
        default_to = self.now
        default_from = default_to - day

        if date_from:
            date_from = datestring_to_utc_datetime(date_from)
        else:
            date_from = default_from

        if date_to:
            date_to = datestring_to_utc_datetime(date_to)
        else:
            date_to = default_to

        date_from = datetime_to_unixtime(date_from)
        date_to = datetime_to_unixtime(date_to)

        checks = system_model.get_system_data(charts, date_from, date_to)

        active_charts = charts if len(charts) > 0 else checks.keys()

        first_check_date = system_model.get_first_check_date()

        default_from = datetime_to_unixtime(default_from)
        default_to = datetime_to_unixtime(default_to)

        # Convert the dates to local time for display
        first_check_date = utc_unixtime_to_localtime(first_check_date)
        date_from = utc_unixtime_to_localtime(date_from)
        date_to = utc_unixtime_to_localtime(date_to)
        default_from = utc_unixtime_to_localtime(default_from)
        default_to = utc_unixtime_to_localtime(default_to)

        # Get the max date - utc, converted to localtime
        max_date = utc_now_to_localtime()

        # Get the difference between UTC and localtime - used to display
        # the ticks in the charts
        zone_difference = localtime_utc_timedelta()

        server = server_model.get_one()

        self.render('system.html',
                    charts=charts,
                    active_charts=active_charts,
                    checks=checks,
                    daterange=daterange,
                    date_from=date_from,
                    date_to=date_to,
                    default_from=default_from,
                    default_to=default_to,
                    first_check_date=first_check_date,
                    zone_difference=zone_difference,
                    max_date=max_date,
                    server=server)