Overwrite the default get_alert method.

        Alert is on signal quality where lower is better...

        :returns: string -- Signal alert
498367
def get_alert(self, value):
        
        ret = 'OK'
        try:
            if value <= self.get_limit('critical', stat_name=self.plugin_name):
                ret = 'CRITICAL'
            elif value <= self.get_limit('warning', stat_name=self.plugin_name):
                ret = 'WARNING'
            elif value <= self.get_limit('careful', stat_name=self.plugin_name):
                ret = 'CAREFUL'
        except (TypeError, KeyError) as e:
            # Catch TypeError for issue1373
            ret = 'DEFAULT'

        return ret
843741
def do_signal(self, signame: str) -> None:
        """"""
        if hasattr(signal, signame):
            os.kill(os.getpid(), getattr(signal, signame))
        else:
            self._sout.write('Unknown signal %s\n' % signame)
855421
def create_alert(self, alert):

        

        req = self.url + "/api/alert"
        data = alert.jsonify()
        try:
            return requests.post(req, headers={'Content-Type': 'application/json'}, data=data, proxies=self.proxies, auth=self.auth, verify=self.cert)
        except requests.exceptions.RequestException as e:
            raise AlertException("Alert create error: {}".format(e))
903684
def get_single_alert(alert_id)
      ret = http_get('/alert/' + alert_id)
      val = Alert.new(ret)
      val
    end
1281848
def get_nice_alert(self, value):
        """"""
        value = str(value)
        try:
            if value in self.get_limit('nice_critical'):
                return 'CRITICAL'
        except KeyError:
            pass
        try:
            if value in self.get_limit('nice_warning'):
                return 'WARNING'
        except KeyError:
            pass
        try:
            if value in self.get_limit('nice_careful'):
                return 'CAREFUL'
        except KeyError:
            pass
        return 'DEFAULT'
901604
def get_server_alerts(call=None, for_output=True, **kwargs):
    '''
    
    '''
    for key, value in kwargs.items():
        servername = ""
        if key == "servername":
            servername = value
    creds = get_creds()
    clc.v2.SetCredentials(creds["user"], creds["password"])
    alerts = clc.v2.Server(servername).Alerts()
    return alerts
1075257
def alerts(self):
        
        if not self.__alerts:
            self.__alerts = Alerts(self.__connection)
        return self.__alerts
1103031
def __signalReceived(self, *args):
        """"""
        if self.__disconnecting:
            return
        with self.__lock:
            self.__args = args
            if self.__rateLimit == 0:
                self.__timer.stop()
                self.__timer.start((self.__delay * 1000) + 1)
            else:
                now = time.time()
                if self.__lastFlushTime is None:
                    leakTime = 0
                else:
                    lastFlush = self.__lastFlushTime
                    leakTime = max(0, (lastFlush + (1.0 / self.__rateLimit)) - now)

                self.__timer.stop()
                # Note: original was min() below.
                timeout = (max(leakTime, self.__delay) * 1000) + 1
                self.__timer.start(timeout)
1088358
def signal(signal=None):
    '''
    
    '''
    no_extra_args = ('configtest', 'status', 'fullstatus')
    valid_signals = ('start', 'stop', 'restart', 'graceful', 'graceful-stop')

    if signal not in valid_signals and signal not in no_extra_args:
        return
    # Make sure you use the right arguments
    if signal in valid_signals:
        arguments = ' -k {0}'.format(signal)
    else:
        arguments = ' {0}'.format(signal)
    cmd = _detect_os() + arguments
    out = __salt__['cmd.run_all'](cmd)

    # A non-zero return code means fail
    if out['retcode'] and out['stderr']:
        ret = out['stderr'].strip()
    # 'apachectl configtest' returns 'Syntax OK' to stderr
    elif out['stderr']:
        ret = out['stderr'].strip()
    elif out['stdout']:
        ret = out['stdout'].strip()
    # No output for something like: apachectl graceful
    else:
        ret = 'Command: "{0}" completed successfully!'.format(cmd)
    return ret
1177354
def get(self, signal=None, plugin=None):
        
        if plugin is not None:
            if signal is None:
                signals_list = {}
                for key in self.signals.keys():
                    if self.signals[key].plugin == plugin:
                        signals_list[key] = self.signals[key]
                return signals_list
            else:
                if signal in self.signals.keys():
                    if self.signals[signal].plugin == plugin:
                        return self.signals[signal]
                    else:
                        return None
                else:
                    return None
        else:
            if signal is None:
                return self.signals
            else:
                if signal in self.signals.keys():
                    return self.signals[signal]
                else:
                    return None
1235989
def enable_signals(self):
        '''
        
        '''
        signal_dict = self.settings[self.signal_key] or {}
        for i in signal_dict.keys():
            sig_module, signal_class = self.import_class_from_path(i)
            for j in signal_dict[i]:
                recv_module, recv_coro = self.import_class_from_path(j)
                signal_class.register(recv_coro)
1227050
def get_alert(self, alert_id):
        
        for alert in self.alerts:
            if alert.id == alert_id:
                return alert
        return None
446117
def signal_handler_as(sig, handler):
  
  old_handler = signal.signal(sig, handler)
  try:
    yield
  finally:
    signal.signal(sig, old_handler)
1208802
def signal(signal=None):
    '''
    
    '''
    valid_signals = ('start', 'reopen', 'stop', 'quit', 'reload')

    if signal not in valid_signals:
        return

    # Make sure you use the right arguments
    if signal == "start":
        arguments = ''
    else:
        arguments = ' -s {0}'.format(signal)
    cmd = __detect_os() + arguments
    out = __salt__['cmd.run_all'](cmd)

    # A non-zero return code means fail
    if out['retcode'] and out['stderr']:
        ret = out['stderr'].strip()
    # 'nginxctl configtest' returns 'Syntax OK' to stderr
    elif out['stderr']:
        ret = out['stderr'].strip()
    elif out['stdout']:
        ret = out['stdout'].strip()
    # No output for something like: nginxctl graceful
    else:
        ret = 'Command: "{0}" completed successfully!'.format(cmd)
    return ret
1281041
def process_alert(file_name):
    

    processed_line = open(file_name, 'r').read()
    char_pos = processed_line.find("}")
    new_line = "{" + processed_line[char_pos + 2:]
    return new_line
1039941
def dismiss(self):
        
        if self.driver.w3c:
            self.driver.execute(Command.W3C_DISMISS_ALERT)
        else:
            self.driver.execute(Command.DISMISS_ALERT)
961907
function makeCallSignal (signals, opts) {
  return (address, signalName, arg) => {
    if (opts.verbose) {
      console.log('Called signal ' + signalName + ' at [' + address.join(', ') +
                  '].')
    }
    signals.get(address).data.signals[signalName].call(arg)
  }
}