Skip to main content

Grafana

This Integration is part of the Grafana Pack.#

Supported versions

Supported Cortex XSOAR versions: 6.0.0 and later.

Grafana alerting service. This integration was integrated and tested with version 8.0.0 of Grafana

Configure Grafana on Cortex XSOAR#

  1. Navigate to Settings > Integrations > Servers & Services.

  2. Search for Grafana.

  3. Click Add instance to create and configure a new integration instance.

    ParameterDescriptionRequired
    Server URLTrue
    UsernameTrue
    PasswordTrue
    Use system proxy settingsFalse
    Trust any certificate (not secure)False
    Maximum number of incidents to fetchMaximum is limited to 200.False
    Fetch incidentsFalse
    First fetch time intervalFalse
    Dashboard IDs to fetchA comma-separated list of dashboard IDs. Can be found by running the "grafana-dashboards-search" command.False
    Panel ID to fetchSee "help".False
    Alert name to fetchFalse
    States to fetchFalse
    Incident typeFalse
  4. Click Test to validate the URLs, token, and connection.

Commands#

You can execute these commands from the Cortex XSOAR CLI, as part of an automation, or in a playbook. After you successfully execute a command, a DBot message appears in the War Room with the command details.

grafana-alerts-list#


Gets alerts.

Base Command#

grafana-alerts-list

Input#

Argument NameDescriptionRequired
dashboard_idA comma-separated list of dashboard IDs by which to filter the results.Optional
panel_idThe ID of the panel by which to filter the results.Optional
nameValue that is contained in the alert's name by which to filter the results.Optional
stateA comma-separated list of states by which to filter the results. The options are: all, no_data, paused, alerting, ok, pending, unknown.Optional
limitThe maximum number of alerts to return.Optional
folder_idA comma-separated list of folder IDs by which to filter the results.Optional
dashboard_nameValue that is contained in the dashboard's name by which to filter the results.Optional
dashboard_tagA comma-separated list of dashboard tags by which to filter the results.Optional

Context Output#

PathTypeDescription
Grafana.Alert.idNumberAlert ID.
Grafana.Alert.dashboardIdNumberAlert dashboard ID.
Grafana.Alert.dashboardUidStringAlert dashboard UID.
Grafana.Alert.dashboardNameStringAlert dashboard name.
Grafana.Alert.panelIdNumberAlert panel ID.
Grafana.Alert.nameStringAlert name.
Grafana.Alert.stateStringAlert state.
Grafana.Alert.newStateDateDateThe date on which the new alert state appeared.
Grafana.Alert.evalDateDateThe date the alert was evaluated.
Grafana.Alert.evalDataUnknownThe metric that triggered the alert and made it change to the alerting state.
Grafana.Alert.executionErrorStringAlert execution error.
Grafana.Alert.urlStringAlert URL.

Command Example#

!grafana-alerts-list

Context Example#

{
"Grafana": {
"Alert": [
{
"dashboardId": 2,
"dashboardName": "streaming2",
"dashboardUid": "yzDQUOR7z",
"evalData": {
"noData": true
},
"evalDate": "0001-01-01T00:00:00Z",
"executionError": "",
"id": 2,
"name": "Adi's Alert",
"newStateDate": "2021-09-30T15:43:20Z",
"panelId": 5,
"state": "unknown",
"url": "https://base_url/d/yzDQUOR7z/streaming2"
},
{
"dashboardId": 1,
"dashboardName": "streaming",
"dashboardUid": "TXSTREZ",
"evalData": {
"noData": true
},
"evalDate": "0001-01-01T00:00:00Z",
"executionError": "",
"id": 1,
"name": "Arseny's Alert",
"newStateDate": "2021-06-09T15:20:01Z",
"panelId": 4,
"state": "no_data",
"url": "https://base_url/d/TXSTREZ/streaming"
},
{
"dashboardId": 2,
"dashboardName": "streaming2",
"dashboardUid": "yzDQUOR7z",
"evalData": {
"noData": true
},
"evalDate": "0001-01-01T00:00:00Z",
"executionError": "",
"id": 3,
"name": "TryAlert",
"newStateDate": "2021-08-11T13:30:40Z",
"panelId": 6,
"state": "alerting",
"url": "https://base_url/d/yzDQUOR7z/streaming2"
}
]
}
}

Human Readable Output#

Existing Alerts:#

IdNameStateNew State DatePanel IdDashboard IdDashboard UidDashboard NameUrl
2Adi's Alertno_data2021-09-30T15:43:20Z52yzDQUOR7zstreaming2https://base_url/d/yzDQUOR7z/streaming2
1Arseny's Alertno_data2021-06-09T15:20:01Z41TXSTREZstreaminghttps://base_url/d/TXSTREZ/streaming
3TryAlertalerting2021-08-11T13:30:40Z62yzDQUOR7zstreaming2https://base_url/d/yzDQUOR7z/streaming2

grafana-alert-pause#


Pauses an alert by ID.

Base Command#

grafana-alert-pause

Input#

Argument NameDescriptionRequired
alert_idID of the alert to pause.Required

Context Output#

PathTypeDescription
Grafana.Alert.idNumberThe ID of the alert that was paused.
Grafana.Alert.stateStringThe new state of the alert.

Command Example#

!grafana-alert-pause alert_id=2

Context Example#

{
"Grafana": {
"Alert": {
"id": 2,
"message": "Alert paused",
"state": "paused"
}
}
}

Human Readable Output#

Paused Alert 2:#

IdMessageState
2Alert pausedpaused

grafana-alert-unpause#


Unpauses an alert by ID.

Base Command#

grafana-alert-unpause

Input#

Argument NameDescriptionRequired
alert_idID of the alert to unpause.Required

Context Output#

PathTypeDescription
Grafana.Alert.idNumberThe ID of the alert that was unpaused.
Grafana.Alert.stateStringThe new state of the alert.

Command Example#

!grafana-alert-unpause alert_id=2

Context Example#

{
"Grafana": {
"Alert": {
"id": 2,
"message": "Alert un-paused",
"state": "unknown"
}
}
}

Human Readable Output#

Un-paused Alert 2:#

IdMessageState
2Alert un-pausedunknown

grafana-users-search#


Gets users.

Base Command#

grafana-users-search

Input#

Argument NameDescriptionRequired
perpageNumber of results to return per page.Optional
pageIndex of the page of results to retrieve.Optional
queryThe value contained in either the name, login, or email fields by which to filter the results.Optional

Context Output#

PathTypeDescription
Grafana.User.idNumberUser ID.
Grafana.User.nameStringUser name.
Grafana.User.loginStringUser login.
Grafana.User.emailStringUser email.
Grafana.User.avatarUrlStringUser avatar URL.
Grafana.User.isAdminBooleanIs user an admin?
Grafana.User.isDisabledBooleanIs user disabled?
Grafana.User.lastSeenAtDateThe date the user was last seen.
Grafana.User.lastSeenAtAgeStringWhen the user was last seen in minutes (m), years (Y), month (M), days (d), etc.
Grafana.User.authLabelsUnknownUser authentication labels

Command Example#

!grafana-users-search

Context Example#

{
"Grafana": {
"User": [
{
"authLabels": [],
"avatarUrl": "https://base_url/avatar/5d9c68c6c50ed3d02a2fcf54f63993b",
"email": "User@mail",
"id": 1,
"isAdmin": true,
"isDisabled": false,
"lastSeenAt": "2021-10-04T15:25:40Z",
"lastSeenAtAge": "4m",
"login": "admin",
"name": "admin"
},
{
"authLabels": [],
"avatarUrl": "https://base_url/avatar/04501192ea3453723d1336c6520ce2c",
"email": "xadmin",
"id": 2,
"isAdmin": false,
"isDisabled": false,
"lastSeenAt": "2021-09-29T12:47:23Z",
"lastSeenAtAge": "5d",
"login": "xadmin",
"name": "xadmin"
}
]
}
}

Human Readable Output#

Existing Users:#

IdEmailNameLoginIs AdminIs DisabledAvatar UrlLast Seen AtLast Seen At Age
1User@mailadminadmintruefalsehttps://base_url/avatar/5d9c68c6c50ed3d02a2fcf54f63993b2021-10-04T15:25:40Z4m
2xadminxadminxadminfalsefalsehttps://base_url/avatar/04501192ea3453723d1336c6520ce2c2021-09-29T12:47:23Z5d
3test@testUser3Userfalsefalsehttps://base_url/avatar/46d229b033af06a191ff2267bca9ae52011-07-27T15:10:37Z10y

grafana-user-teams-get#


Gets the user's teams by user ID.

Base Command#

grafana-user-teams-get

Input#

Argument NameDescriptionRequired
user_idID of user for whom to get teams.Required

Context Output#

PathTypeDescription
Grafana.User.idNumberUser ID.
Grafana.User.teams.idNumberTeam ID.
Grafana.User.teams.orgIdNumberTeam organization ID.
Grafana.User.teams.nameStringTeam name.
Grafana.User.teams.emailStringTeam email.
Grafana.User.teams.avatarUrlStringTeam avatar URL.
Grafana.User.teams.memberCountNumberTeam member count.
Grafana.User.teams.permissionNumberNumber of team permissions.

Command Example#

!grafana-user-teams-get user_id=1

Context Example#

{
"Grafana": {
"User": {
"id": "1",
"teams": [
{
"avatarUrl": "https://base_url/avatar/f1f97cfa3c828a7352da671a",
"email": "team@test.com",
"id": 15,
"memberCount": 1,
"name": "Test Team",
"orgId": 1,
"permission": 0
},
{
"avatarUrl": "https://base_url/avatar/1d3226029e424011bffde2f",
"email": "test2@test.com",
"id": 16,
"memberCount": 2,
"name": "TestTeam2",
"orgId": 1,
"permission": 0
}
]
}
}
}

Human Readable Output#

Teams For User 1:#

IdOrg IdNameEmailAvatar UrlMember CountPermission
151Test Teamteam@test.comhttps://base_url/avatar/f1f97cfa3c828a7352da671a10
161TestTeam2test2@test.comhttps://base_url/avatar/1d3226029e424011bffde2f20

grafana-user-orgs-get#


Gets user's organizations by user ID.

Base Command#

grafana-user-orgs-get

Input#

Argument NameDescriptionRequired
user_idID of user for whom to get the organizations.Required

Context Output#

PathTypeDescription
Grafana.User.idNumberUser ID.
Grafana.User.orgs.orgIdNumberOrganization ID.
Grafana.User.orgs.nameStringOrganization name.
Grafana.User.orgs.roleStringOrganization role.

Command Example#

!grafana-user-orgs-get user_id=1

Context Example#

{
"Grafana": {
"User": {
"id": "1",
"orgs": [
{
"name": "Main Org.",
"orgId": 1,
"role": "Admin"
},
{
"name": "New Org.",
"orgId": 2,
"role": "Admin"
}
]
}
}
}

Human Readable Output#

Organizations For User 1:#

NameOrg IdRole
Main Org.1Admin
New Org.2Admin

grafana-user-update#


Updates a user by user ID. Login or email is mandatory. If you change your own login information, you won't be able to continue querying as your username (login) will change. Login and email should be unique.

Base Command#

grafana-user-update

Input#

Argument NameDescriptionRequired
emailUser email. If email is not specified, login must be specified.Optional
nameUser's name.Optional
loginUser login (username). If login is not specified, email must be specified.Optional
themeUser theme when using Grafana's interface. Possilble values: "light" or "dark". Possible values are: light, dark.Optional
user_idUser ID.Required

Context Output#

There is no context output for this command.

Command Example#

!grafana-user-update user_id=3 email=TestUser login=TestUser name=TestUser

Human Readable Output#

Successfully Updated User 3:#

Message
User updated

grafana-annotation-create#


Creates an annotation in the Grafana database. The dashboard_id and panel_id fields are optional. If they are not specified, a global annotation is created and can be queried in any dashboard that adds the Grafana annotations data source. When creating a region annotation include the time_end property.

Base Command#

grafana-annotation-create

Input#

Argument NameDescriptionRequired
dashboard_idDashboard ID.Optional
panel_idPanel ID.Optional
timeStart time.Optional
time_endEnd time.Optional
tagsA comma-separated list of tags by which to filter the dashboards to add the annotation to.Optional
textText of the annotation.Required

Context Output#

PathTypeDescription
Grafana.Annotation.idNumberAnnotation ID.

Command Example#

!grafana-annotation-create text="annotate"

Context Example#

{
"Grafana": {
"Annotation": {
"id": 266,
"message": "Annotation added"
}
}
}

Human Readable Output#

Successfully Created Annotation 266:#

IdMessage
266Annotation added

grafana-teams-search#


Gets teams.

Base Command#

grafana-teams-search

Input#

Argument NameDescriptionRequired
perpageNumber of results to return on a page.Optional
pageIndex of the page of results to retrieve.Optional
queryThe value contained in the name of a team.Optional
nameThe exact name of the team.Optional

Context Output#

PathTypeDescription
Grafana.Team.idNumberTeam ID.
Grafana.Team.orgIdNumberTeam organization ID.
Grafana.Team.nameStringTeam name.
Grafana.Team.emailStringTeam email.
Grafana.Team.avatarUrlStringTeam avatar URL.
Grafana.Team.memberCountNumberThe number of team members.
Grafana.Team.permissionNumberNumber of team permissions.

Command Example#

!grafana-teams-search

Context Example#

{
"Grafana": {
"Team": [
{
"avatarUrl": "https://base_url/avatar/f1f97cfa3c828a7352da671a",
"email": "team@test.com",
"id": 15,
"memberCount": 1,
"name": "Test Team",
"orgId": 1,
"permission": 0
},
{
"avatarUrl": "https://base_url/avatar/1d3226029e424011bffde2f",
"email": "test2@test.com",
"id": 16,
"memberCount": 2,
"name": "TestTeam2",
"orgId": 1,
"permission": 0
},
{
"avatarUrl": "https://base_url/avatar/71cc610bc4841e3444235f09d9c",
"email": "email@test.com",
"id": 144,
"memberCount": 0,
"name": "Elia",
"orgId": 1,
"permission": 0
}
]
}
}

Human Readable Output#

Teams Search Results:#

IdOrg IdNameEmailAvatar UrlMember CountPermission
151Test Teamteam@test.comhttps://base_url/avatar/f1f97cfa3c828a7352da671a10
161TestTeam2test2@test.comhttps://base_url/avatar/1d3226029e424011bffde2f20
1441Eliaemail@test.comhttps://base_url/avatar/71cc610bc4841e3444235f09d9c00

grafana-team-members-list#


Gets a list of all team members by team ID.

Base Command#

grafana-team-members-list

Input#

Argument NameDescriptionRequired
team_idTeam ID.Required

Context Output#

PathTypeDescription
Grafana.Team.idNumberTeam ID.
Grafana.Team.members.orgIdNumberMember organization ID.
Grafana.Team.members.teamIdNumberMember team ID.
Grafana.Team.members.userIdNumberMember user ID.
Grafana.Team.members.auth_moduleStringMember authentication module.
Grafana.Team.members.emailStringMember email.
Grafana.Team.members.nameStringMember name.
Grafana.Team.members.loginStringMember login.
Grafana.Team.members.avatarUrlStringMember avatar URL.
Grafana.Team.members.labelsUnknownMember labels.
Grafana.Team.members.permissionNumberMember permission.

Command Example#

!grafana-team-members-list team_id=15

Context Example#

{
"Grafana": {
"Team": {
"id": "15",
"members": [
{
"auth_module": "",
"avatarUrl": "https://base_url/avatar/5d9c68c6c50ed3d02a2fcf54f63993b",
"email": "User@mail",
"labels": [],
"login": "admin",
"name": "admin",
"orgId": 1,
"permission": 0,
"teamId": 15,
"userId": 1
}
]
}
}
}

Human Readable Output#

Team 15 Members:#

Org IdTeam IdUser IdEmailNameLoginAvatar UrlPermission
1151User@mailadminadminhttps://base_url/avatar/5d9c68c6c50ed3d02a2fcf54f63993b0

grafana-user-add-to-team#


Adds a user to a team.

Base Command#

grafana-user-add-to-team

Input#

Argument NameDescriptionRequired
user_idUser ID.Required
team_idTeam ID.Required

Context Output#

There is no context output for this command.

Command Example#

!grafana-user-add-to-team team_id=15 user_id=3

Human Readable Output#

Successfully Added User 3 to Team 15:#

Message
Member added to Team

grafana-user-remove-from-team#


Removes a user from a team.

Base Command#

grafana-user-remove-from-team

Input#

Argument NameDescriptionRequired
team_idTeam ID.Required
user_idUser ID.Required

Context Output#

There is no context output for this command.

Command Example#

!grafana-user-remove-from-team team_id=15 user_id=3

Human Readable Output#

Successfully Removed User 3 from Team 15:#

Message
Team Member removed

grafana-team-add#


Creates a new team.

Base Command#

grafana-team-add

Input#

Argument NameDescriptionRequired
nameThe team name. Must be unique.Required
emailEmail address of the team.Optional
org_idOrganization ID.Optional

Context Output#

PathTypeDescription
Grafana.Team.idNumberTeam ID.

Command Example#

!grafana-team-add name="TestTeam4"

Context Example#

{
"Grafana": {
"Team": {
"id": 153,
"message": "Team created"
}
}
}

Human Readable Output#

Successfully Created Team 153:#

MessageTeam Id
Team created153

grafana-team-delete#


Deletes a team.

Base Command#

grafana-team-delete

Input#

Argument NameDescriptionRequired
team_idTeam ID.Required

Context Output#

There is no context output for this command.

Command Example#

!grafana-team-delete team_id=152

Human Readable Output#

Successfully Deleted Team 152:#

Message
Team deleted

grafana-org-create#


Creates an organization.

Base Command#

grafana-org-create

Input#

Argument NameDescriptionRequired
nameName of the organization.Required

Context Output#

PathTypeDescription
Grafana.Organization.idNumberOrganization ID.

Command Example#

!grafana-org-create name="Organization"

Context Example#

{
"Grafana": {
"Organization": {
"id": 12,
"message": "Organization created"
}
}
}

Human Readable Output#

Successfully Created Organization 12:#

MessageOrg Id
Organization created12

grafana-dashboards-search#


Searches dashboards.

Base Command#

grafana-dashboards-search

Input#

Argument NameDescriptionRequired
queryValue is contained in the name of the dashboard.Optional
tagA comma-separated list of tags by which to filter the results.Optional
typeType of the dashboard. Possible values: "dash-folder" and "dash-db". Possible values are: dash-folder, dash-db.Optional
dashboard_idsA comma-separated list of dashboard IDs by which to filter the results.Optional
folder_idsA comma-separated list of folder IDs by which to filter the results.Optional
starredWhether to only return starred dashboards. Possible values: "true" and "false". Possible values are: true, false.Optional
limitThe maximum number of dashboards to return.Optional
pagePage.Optional

Context Output#

PathTypeDescription
Grafana.Dashboard.idNumberDashboard ID.
Grafana.Dashboard.uidStringDashboard UID.
Grafana.Dashboard.titleStringDashboard title.
Grafana.Dashboard.uriStringDashboard URI.
Grafana.Dashboard.urlStringDashboard URL
Grafana.Dashboard.slugStringDashboard slug.
Grafana.Dashboard.typeStringDashboard type.
Grafana.Dashboard.tagsUnknownDashboard tags.
Grafana.Dashboard.isStarredBooleanIs dashboard starred?

Command Example#

!grafana-dashboards-search

Context Example#

{
"Grafana": {
"Dashboard": [
{
"id": 1,
"isStarred": true,
"slug": "",
"tags": [],
"title": "Streaming",
"type": "dash-db",
"uid": "TXSTREZ",
"uri": "db/streaming",
"url": "https://base_url/d/TXSTREZ/streaming"
},
{
"id": 2,
"isStarred": false,
"slug": "",
"tags": [
"tag1"
],
"title": "Streaming Simple",
"type": "dash-db",
"uid": "yzDQUOR7z",
"uri": "db/streaming2",
"url": "https://base_url/d/yzDQUOR7z/streaming2"
}
]
}
}

Human Readable Output#

Existing Dashboards:#

IdUidTitleIs StarredTagsUriUrlTypeSort Meta
1TXSTREZStreamingtruedb/streaminghttps://base_url/d/TXSTREZ/streamingdash-db0
2yzDQUOR7zStreaming Simplefalsetag1db/streaming2https://base_url/d/yzDQUOR7z/streaming2dash-db0

grafana-user-get-by-id#


Gets a user by ID.

Base Command#

grafana-user-get-by-id

Input#

Argument NameDescriptionRequired
user_idUser ID.Required

Context Output#

PathTypeDescription
Grafana.User.idNumberUser ID.
Grafana.User.emailStringUser email.
Grafana.User.nameStringUser name.
Grafana.User.loginStringUser login.
Grafana.User.themeStringUser theme.
Grafana.User.orgIdNumberOrganization ID.
Grafana.User.isGrafanaAdminBooleanIs user a Grafana admin?
Grafana.User.isDisabledBooleanIs user disabled?
Grafana.User.isExternalBooleanIs user external?
Grafana.User.updatedAtDateDate when user was updated.
Grafana.User.createdAtDateDate when user was created.
Grafana.User.avatarUrlStringUser avatar URL.
Grafana.User.authLabelsUnknownUser authentication labels.

Command Example#

!grafana-user-get-by-id user_id=1

Context Example#

{
"Grafana": {
"User": {
"authLabels": [],
"avatarUrl": "/avatar/46d229b033af06a191ff2267bca9ae5",
"createdAt": "2021-06-08T10:57:39Z",
"email": "User@mail",
"id": 1,
"isDisabled": false,
"isExternal": false,
"isGrafanaAdmin": true,
"login": "admin",
"name": "admin",
"orgId": 1,
"theme": "light",
"updatedAt": "2021-09-30T14:46:22Z"
}
}
}

Human Readable Output#

User 1 Results:#

IdEmailNameLoginThemeOrg IdIs Grafana AdminIs D Is abledIs ExternalUpdated AtCreated AtAvatar Url
1User@mailadminadminlight1truefalsefalse2021-09-30T14:46:22Z2021-06-08T10:57:39Zhttps://base_url/avatar/46d229b033af06a191ff2267bca9ae5

grafana-team-get-by-id#


Gets a team by ID.

Base Command#

grafana-team-get-by-id

Input#

Argument NameDescriptionRequired
team_idTeam ID.Required

Context Output#

PathTypeDescription
Grafana.Team.idNumberTeam ID.
Grafana.Team.orgIdNumberTeam organization ID.
Grafana.Team.nameStringTeam name.
Grafana.Team.emailStringTeam email.
Grafana.Team.avatarUrlStringTeam avatar URL.
Grafana.Team.memberCountNumberThe number of team members.
Grafana.Team.permissionNumberNumber of team permissions.

Command Example#

!grafana-team-get-by-id team_id=15

Context Example#

{
"Grafana": {
"Team": {
"avatarUrl": "https://base_url/avatar/f1f97cfa3c828a7352da671a",
"email": "team@test.com",
"id": 15,
"memberCount": 1,
"name": "Test Team",
"orgId": 1,
"permission": 0
}
}
}

Human Readable Output#

Team 15 Results:#

IdOrg IdNameEmailAvatar UrlMember CountPermission
151Test Teamteam@test.comhttps://base_url/avatar/f1f97cfa3c828a7352da671a10

grafana-alert-get-by-id#


Gets an alert by id.

Base Command#

grafana-alert-get-by-id

Input#

Argument NameDescriptionRequired
alert_idAlert ID.Required

Context Output#

PathTypeDescription
Grafana.Alert.idNumberAlert ID.
Grafana.Alert.versionNumberAlert version.
Grafana.Alert.orgIdNumberAlert organization ID.
Grafana.Alert.dashboardIdNumberAlert dashboard ID.
Grafana.Alert.panelIdNumberAlert panel ID.
Grafana.Alert.nameStringAlert name.
Grafana.Alert.messageStringAlert message.
Grafana.Alert.severityStringAlert severity.
Grafana.Alert.stateStringAlert state.
Grafana.Alert.handlerNumberAlert handler.
Grafana.Alert.silencedBooleanWhether the alert was silenced.
Grafana.Alert.executionErrorStringAlert execution error.
Grafana.Alert.frequencyNumberAlert frequency in seconds.
Grafana.Alert.forNumberOnce the alert rule has been firing for more than this duration in nanoseconds, then the alert changes to "Alerting". Otherwise it goes from "OK" to "Pending".
Grafana.Alert.evalDataUnknownThe metric that triggered the alert and made it change to the "Alerting" state.
Grafana.Alert.newStateDateDateThe date of the alert's new state.
Grafana.Alert.stateChangesNumberThe number of time the alert state changes.
Grafana.Alert.createdDateDate the alert was created.
Grafana.Alert.updatedDateDate the alert was updated.
Grafana.Alert.settingsUnknownAlert settings.

Command Example#

!grafana-alert-get-by-id alert_id=1

Context Example#

{
"Grafana": {
"Alert": {
"created": "2021-06-09T15:13:45Z",
"dashboardId": 1,
"evalData": {
"noData": true
},
"executionError": " ",
"for": 60000000000,
"frequency": 600,
"handler": 1,
"id": 1,
"message": "man down!",
"name": "Arseny's Alert",
"newStateDate": "2021-06-09T15:20:01Z",
"orgId": 1,
"panelId": 4,
"settings": {
"alertRuleTags": {
"moshe": "2"
},
"conditions": [
{
"evaluator": {
"params": [
10
],
"type": "gt"
},
"operator": {
"type": "and"
},
"query": {
"datasourceId": 1,
"model": {
"refId": "A",
"scenarioId": "streaming_client",
"stream": {
"noise": 2.2,
"speed": 100,
"spread": 3.5,
"type": "signal"
},
"stringInput": ""
},
"params": [
"A",
"5m",
"now"
]
},
"reducer": {
"params": [],
"type": "avg"
},
"type": "query"
}
],
"executionErrorState": "alerting",
"for": "1m",
"frequency": "10m",
"handler": 1,
"message": "man down!",
"name": "Arseny's Alert",
"noDataState": "no_data",
"notifications": []
},
"severity": "",
"silenced": false,
"state": "no_data",
"stateChanges": 1,
"updated": "2021-06-09T15:14:51Z",
"version": 0
}
}
}

Human Readable Output#

Alert 1 Results:#

IdVersionOrg IdDashboard IdPanel IdNameMessageStateNew State DateState ChangesHandlerSilencedFrequencyForCreatedUpdated
10114Arseny's Alertman down!no_data2021-06-09T15:20:01Z11false600600000000002021-06-09T15:13:45Z2021-06-09T15:14:51Z

grafana-org-list#


Gets organizations.

Base Command#

grafana-org-list

Input#

Argument NameDescriptionRequired
perpageNumber of results to return on a page.Optional
pageIndex of the page of results to retrieve.Optional

Context Output#

PathTypeDescription
Grafana.Organization.idNumberOrganization ID.
Grafana.Organization.nameStringOrganization name.

Command Example#

!grafana-org-list

Context Example#

{
"Grafana": {
"Organization": [
{
"id": 1,
"name": "Main Org."
},
{
"id": 2,
"name": "New Org."
},
{
"id": 12,
"name": "Organization"
}
]
}
}

Human Readable Output#

Existing Organizations:#

IdName
1Main Org.
2New Org.
12Organization

grafana-org-get-by-name#


Gets an organization by name.

Base Command#

grafana-org-get-by-name

Input#

Argument NameDescriptionRequired
nameThe exact name of the organization to get.Required

Context Output#

PathTypeDescription
Grafana.Organization.idNumberOrganization ID.
Grafana.Organization.nameStringOrganization name.
Grafana.Organization.addressUnknownOrganization address.

Command Example#

!grafana-org-get-by-name name="Main Org."

Context Example#

{
"Grafana": {
"Organization": {
"address": {
"address1": "",
"address2": "",
"city": "",
"country": "",
"state": "",
"zipCode": ""
},
"id": 1,
"name": "Main Org."
}
}
}

Human Readable Output#

Organization "Main Org." Results:#

NameIdAddress
Main Org.1address1:
address2:
city:
zipCode:
state:
country:

grafana-org-get-by-id#


Gets an organization by ID.

Base Command#

grafana-org-get-by-id

Input#

Argument NameDescriptionRequired
org_idOrganization ID.Required

Context Output#

PathTypeDescription
Grafana.Organization.idNumberOrganization ID.
Grafana.Organization.nameStringOrganization name.
Grafana.Organization.addressUnknownOrganization address.

Command Example#

!grafana-org-get-by-id org_id=1

Context Example#

{
"Grafana": {
"Organization": {
"address": {
"address1": "",
"address2": "",
"city": "",
"country": "",
"state": "",
"zipCode": ""
},
"id": 1,
"name": "Main Org."
}
}
}

Human Readable Output#

Organization 1 Results:#

IdNameAddress
1Main Org.address1:
address2:
city:
zipCode:
state:
country: