Ejemplo n.º 1
0
    def get_conn_forwarding_stats(self, start_time, end_time, neighbor_ip):
        """
        get_conn_forwarding_stats(auth, start_time, end_time, neighbor_ip) ->
        [
            [packets sent],
            [bytes sent]
        ]

        Fetch the system's connection forwarding statistics.

        Parameters:
        start_time (datetime) - start of the stats query period
        end_time (datetime) - end of the stats query period
        neighbor_ip (string) - IP address of the neighbor whose stats are
                               desired or 'all' or '0.0.0.0' for the sum of
                               all neighbors

        Exceptions:
        get_conn_forwarding_statsFault - Datetime not in known format
        get_conn_forwarding_statsFault - Invalid neighbor address
        """
        if neighbor_ip == 'all':
            neighbor_ip_int = 0
        else:
            try:
                neighbor_ip_int = common.lc_str_to_ipv4addr(neighbor_ip)
            except:
                raise ServiceError, "Invalid IP address: '%s'" % neighbor_ip

        return self.get_stats_internal('neighbor', 2,
                                       start_time, end_time, neighbor_ip_int)
Ejemplo n.º 2
0
    def get_nfs_stats(self, start_time, end_time, server_ip):
        """
        get_nfs_stats(auth, start_time, end_time, server_ip) ->
        [
            [local responses],
            [delayed responses],
            [remote responses],
            [total calls]
        ]

        Fetch the system's NFS statistics.

        Parameters:
        start_time (datetime) - start of the stats query period
        end_time (datetime) - end of the stats query period
        server_ip (string) - IP address of the server whose stats are desired
                             or 'all' or '0.0.0.0' for the sum of all servers

        Exceptions:
        get_nfs_statsFault - Datetime not in known format
        get_nfs_statsFault - Invalid server IP
        """
        if server_ip == 'all':
            server_ip_int = 0
        else:
            try:
                server_ip_int = common.lc_str_to_ipv4addr(server_ip)
            except:
                raise ServiceError, "Invalid IP address: '%s'" % server_ip

        return self.get_stats_internal('nfs', 4,
                                       start_time, end_time, server_ip_int)