Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correcting the alert rule expression for required labels #3143

Merged
merged 13 commits into from
Sep 23, 2024

Conversation

Hardikl
Copy link
Contributor

@Hardikl Hardikl commented Sep 10, 2024

No description provided.

@cla-bot cla-bot bot added the cla-signed label Sep 10, 2024
@Hardikl Hardikl linked an issue Sep 10, 2024 that may be closed by this pull request
@Hardikl Hardikl marked this pull request as draft September 13, 2024 13:45
cmd/collectors/alert_rule_test.go Outdated Show resolved Hide resolved
cmd/collectors/alert_rule_test.go Outdated Show resolved Hide resolved
@Hardikl
Copy link
Contributor Author

Hardikl commented Sep 17, 2024

These are the missing labels identified

--- FAIL: TestParseEmsAlertRules (0.33s)
    alert_rule_test.go:67: vscanEngineStatus is not available in Nblade.vscanVirusDetected ems
    alert_rule_test.go:67: vscanEngineResultString is not available in Nblade.vscanVirusDetected ems
    alert_rule_test.go:67: reason is not available in arl.netra.ca.check.failed ems
    alert_rule_test.go:67: errMsg is not available in cifs.shadowcopy.failure ems
    alert_rule_test.go:67: reason is not available in gb.netra.ca.check.failed ems
    alert_rule_test.go:67: detailed_info is not available in hm.alert.raised ems
FAIL

@Hardikl
Copy link
Contributor Author

Hardikl commented Sep 17, 2024

  1. Nblade.vscanVirusDetected ems
         "message": {
                "severity": "error",
                "name": "Nblade.vscanVirusDetected"
            },
            "source": "notifyd",
            "parameters": [
                {
                    "name": "vserverName",
                    "value": "1"
                },
                {
                    "name": "vscanServerIp",
                    "value": "2"
                },
                {
                    "name": "filePath",
                    "value": "3"
                },
                {
                    "name": "clientIp",
                    "value": "4"
                },
                {
                    "name": "SID",
                    "value": "5"
                },
                {
                    "name": "vscanEngineStatus",
                    "value": "6"
                },
                {
                    "name": "vscanEngineResultString",
                    "value": "7"
                },
                {
                    "name": "object_type",
                    "value": "8"
                },
                {
                    "name": "object_uuid",
                    "value": "9"
                }
            ],
  1. arl.netra.ca.check.failed
         "message": {
                "severity": "error",
                "name": "arl.netra.ca.check.failed"
            },
            "source": "notifyd",
            "parameters": [
                {
                    "name": "vol",
                    "value": "1"
                },
                {
                    "name": "aggr_uuid",
                    "value": "2"
                },
                {
                    "name": "reason",
                    "value": "3"
                }
            ],
  1. cifs.shadowcopy.failure
         "message": {
                "severity": "error",
                "name": "cifs.shadowcopy.failure"
            },
            "source": "notifyd",
            "parameters": [
                {
                    "name": "errMsg",
                    "value": "1"
                },
                {
                    "name": "operation",
                    "value": "2"
                },
                {
                    "name": "clientShadowCopySetId",
                    "value": "3"
                },
                {
                    "name": "filerShadowCopySetId",
                    "value": "4"
                },
                {
                    "name": "clientShadowCopyId",
                    "value": "5"
                },
                {
                    "name": "filerShadowCopyId",
                    "value": "6"
                },
                {
                    "name": "shareName",
                    "value": "7"
                },
                {
                    "name": "object_type",
                    "value": "8"
                },
                {
                    "name": "object_uuid",
                    "value": "9"
                }
            ],
  1. gb.netra.ca.check.failed
          "message": {
                "severity": "error",
                "name": "gb.netra.ca.check.failed"
            },
            "source": "notifyd",
            "parameters": [
                {
                    "name": "vol",
                    "value": "1"
                },
                {
                    "name": "aggr_uuid",
                    "value": "2"
                },
                {
                    "name": "reason",
                    "value": "3"
                }
            ],
  1. hm.alert.raised
       "message": {
                "severity": "alert",
                "name": "hm.alert.raised"
            },
            "source": "notifyd",
            "parameters": [
                {
                    "name": "detailed_info",
                    "value": "1"
                },
                {
                    "name": "monitor",
                    "value": "2"
                },
                {
                    "name": "alert_id",
                    "value": "3"
                },
                {
                    "name": "alerting_resource",
                    "value": "4"
                },
                {
                    "name": "probable_cause_description",
                    "value": "5"
                },
                {
                    "name": "alert_corrective_action",
                    "value": "6"
                },
                {
                    "name": "possible_effect",
                    "value": "7"
                },
                {
                    "name": "additional_info",
                    "value": "8"
                },
                {
                    "name": "tags",
                    "value": "9"
                },
                {
                    "name": "acknowledge",
                    "value": "10"
                },
                {
                    "name": "acknowledger",
                    "value": "11"
                },
                {
                    "name": "suppress",
                    "value": "12"
                },
                {
                    "name": "suppressor",
                    "value": "13"
                },
                {
                    "name": "asup_enable",
                    "value": "14"
                }
            ],

@Hardikl Hardikl marked this pull request as ready for review September 17, 2024 16:39
@Hardikl Hardikl marked this pull request as draft September 17, 2024 17:01
@Hardikl Hardikl marked this pull request as ready for review September 19, 2024 13:21
@Hardikl Hardikl linked an issue Sep 20, 2024 that may be closed by this pull request
cgrinds
cgrinds previously approved these changes Sep 20, 2024
cmd/tools/generate/generate.go Outdated Show resolved Hide resolved
integration/test/alert_rule_test.go Outdated Show resolved Hide resolved
integration/test/alert_rule_test.go Show resolved Hide resolved
integration/test/alert_rule_test.go Show resolved Hide resolved
conf/ems/9.6.0/ems.yaml Show resolved Hide resolved
@rahulguptajss rahulguptajss merged commit d24598f into main Sep 23, 2024
6 checks passed
@rahulguptajss rahulguptajss deleted the hl_alert_test branch September 23, 2024 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Labels are missing for few alerts Usage of wrong labels in alert rules definition
3 participants