def msg_curse(self, args=None, max_width=None):
        """Return the string to display in the curse interface."""
        # Init the return message
        ret = []

        # Build the string message
        if args.client:
            # Client mode
            if args.cs_status.lower() == "connected":
                msg = 'Connected to '
                ret.append(self.curse_add_line(msg, 'OK'))
            elif args.cs_status.lower() == "snmp":
                msg = 'SNMP from '
                ret.append(self.curse_add_line(msg, 'OK'))
            elif args.cs_status.lower() == "disconnected":
                msg = 'Disconnected from '
                ret.append(self.curse_add_line(msg, 'CRITICAL'))

        # Hostname is mandatory
        msg = self.stats['hostname']
        ret.append(self.curse_add_line(msg, "TITLE"))
        # System info
        if self.stats['os_name'] == "Linux" and self.stats['linux_distro']:
            msg = ' ({} {} / {} {})'.format(self.stats['linux_distro'],
                                            self.stats['platform'],
                                            self.stats['os_name'],
                                            self.stats['os_version'])
        else:
            try:
                msg = ' ({} {} {})'.format(self.stats['os_name'],
                                           self.stats['os_version'],
                                           self.stats['platform'])
            except Exception:
                msg = ' ({})'.format(self.stats['os_name'])
        ret.append(self.curse_add_line(msg, optional=True))

        # Return the message with decoration
        return ret
def msg_curse ( self , args = None , max_width = None ) : ret = [ ] if args . client : if args . cs_status . lower ( ) == "connected" : msg = 'Connected to ' ret . append ( self . curse_add_line ( msg , 'OK' ) ) elif args . cs_status . lower ( ) == "snmp" : msg = 'SNMP from ' ret . append ( self . curse_add_line ( msg , 'OK' ) ) elif args . cs_status . lower ( ) == "disconnected" : msg = 'Disconnected from ' ret . append ( self . curse_add_line ( msg , 'CRITICAL' ) ) msg = self . stats [ 'hostname' ] ret . append ( self . curse_add_line ( msg , "TITLE" ) ) if self . stats [ 'os_name' ] == "Linux" and self . stats [ 'linux_distro' ] : msg = ' ({} {} / {} {})' . format ( self . stats [ 'linux_distro' ] , self . stats [ 'platform' ] , self . stats [ 'os_name' ] , self . stats [ 'os_version' ] ) else : try : msg = ' ({} {} {})' . format ( self . stats [ 'os_name' ] , self . stats [ 'os_version' ] , self . stats [ 'platform' ] ) except Exception : msg = ' ({})' . format ( self . stats [ 'os_name' ] ) ret . append ( self . curse_add_line ( msg , optional = True ) ) return ret
Return the string to display in the curse interface.