Beispiel #1
0
        private void CheckStatusAndUpdateLeds()
        {
            try {
                NagiosChecker vChecker = new NagiosChecker(
                    this.DoLogLine,
                    Settings.Default.IGNORE_DATE,
                    ConfigurationManager.AppSettings["NagiosURL"],
                    ConfigurationManager.AppSettings["NagiosLogin"],
                    ConfigurationManager.AppSettings["NagiosPassword"]);

                NagiosChecker.NagiosEventState vStatus = vChecker.CheckStatus();

                switch (vStatus)
                {
                case NagiosChecker.NagiosEventState.OK:
                    ckbRedBlink.Checked = false;
                    SetOrBlinkStatus(vStatus == mCurrentStatus, Constants.LED_GREEN, 100, 5);
                    break;

                case NagiosChecker.NagiosEventState.WARNING:
                    ckbRedBlink.Checked = false;
                    SetOrBlinkStatus(vStatus == mCurrentStatus, Constants.LED_ORANGE, 100, 10);
                    break;

                case NagiosChecker.NagiosEventState.CRITICAL:
                    ckbRedBlink.Checked = true;
                    SetOrBlinkStatus(vStatus == mCurrentStatus, Constants.LED_RED, 100, 20);
                    break;
                }


                mCurrentStatus = vStatus;
            }
            catch (Exception ex) {
                //mute for now
            }
        }
Beispiel #2
0
        private void CheckStatusAndUpdateLeds()
        {
            try {
                NagiosChecker vChecker = new NagiosChecker(
                    this.DoLogLine,
                    Settings.Default.IGNORE_DATE,
                    ConfigurationManager.AppSettings["NagiosURL"],
                    ConfigurationManager.AppSettings["NagiosLogin"],
                    ConfigurationManager.AppSettings["NagiosPassword"]);

                NagiosChecker.NagiosEventState vStatus = vChecker.CheckStatus();

                switch (vStatus) {
                    case NagiosChecker.NagiosEventState.OK:
                        ckbRedBlink.Checked = false;
                        SetOrBlinkStatus(vStatus == mCurrentStatus, Constants.LED_GREEN, 100, 5);
                        break;
                    case NagiosChecker.NagiosEventState.WARNING:
                        ckbRedBlink.Checked = false;
                        SetOrBlinkStatus(vStatus == mCurrentStatus, Constants.LED_ORANGE, 100, 10);
                        break;
                    case NagiosChecker.NagiosEventState.CRITICAL:
                        ckbRedBlink.Checked = true;
                        SetOrBlinkStatus(vStatus == mCurrentStatus, Constants.LED_RED, 100, 20);
                        break;
                }

                mCurrentStatus = vStatus;

            }
            catch (Exception ex) {
                //mute for now
            }
        }