Github

GitHub is a developer platform that allows developers to create, store, manage and share their code. It uses Git software, providing the distributed version control of Git plus access control, bug tracking, software feature requests, task management, continuous integration, and wikis for every project.

Available solutions

Zabbix version 8.0 7.4 7.2 7.0 6.0
Download

GitHub organization by HTTP

Overview

This template is designed for the effortless deployment of GitHub organization monitoring by Zabbix via GitHub REST API and doesn't require any external scripts.

For more details about GitHub REST API, refer to the official documentation.

Requirements

Zabbix version: 8.0 and higher.

Tested versions

This template has been tested on:

  • GitHub API version 2022-11-28

Configuration

Zabbix should be configured according to the instructions in the Templates out of the box section.

Setup

Additional information is available in the official documentation:

  1. Create an access token for monitoring

One of the simplest ways to send authenticated requests is to use a personal access token - either a classic or a fine-grained one.

Classic personal access token

You can create a new classic personal access token by following the instructions in the official documentation.

Additional information about OAuth scopes is available in the official documentation.

Note that authenticated users must have admin access to the repository and the repo scope must be set to get information about self-hosted runners.

In order to gather security and analysis metrics for a repository, the authenticated user must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository.

Fine-grained personal access token

Alternatively, you can use a fine-grained personal access token.

In order to use fine-grained tokens to monitor organization-owned repositories, organizations must opt in to fine-grained personal access tokens and set up a personal access token policy.

The fine-grained token needs to have the following permissions set to provide access to the organization and repository resources:

  • "Actions" repository permissions (read);
  • "Administration" repository permissions (read);
  • "Contents" repository permissions (read);
  • "Issues" repository permissions (read);
  • "Metadata" repository permissions (read);
  • "Pull requests" repository permissions (read).
  1. Set the access token that you've created in step 1 in the {$GITHUB.API.TOKEN} macro
  2. Change the API URL in the {$GITHUB.API.URL} macro if needed (for self-hosted installations)
  3. Set the organization name in the {$GITHUB.ORG.NAME} macro
  4. Set the Copilot monitoring flag to 1 in the {$GITHUB.COPILOT.USED} macro if you want to gather Copilot metrics

Note that the Copilot Metrics API access policy must be enabled for the organization. Only organization owners and billing managers of the parent enterprise can view Copilot metrics.

OAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot, read:org, or read:enterprise scopes to use this endpoint.

The fine-grained token needs to have the following permissions set to provide access to Copilot metrics:

  • "GitHub Copilot Business" organization permissions (read);
  • "Administration" organization permissions (read).
  1. Set the LLD rule filters if needed:
  • Filter repositories by name: {$GITHUB.REPO.NAME.MATCHES}, {$GITHUB.REPO.NAME.NOT_MATCHES};
  • Filter repositories by owner: {$GITHUB.REPO.OWNER.MATCHES}, {$GITHUB.REPO.OWNER.NOT_MATCHES};
  • Filter Copilot IDEs by name: {$GITHUB.COPILOT.IDE.NAME.MATCHES}, {$GITHUB.COPILOT.IDE.NAME.NOT_MATCHES};
  • Filter Copilot models by name: {$GITHUB.COPILOT.MODEL.NAME.MATCHES}, {$GITHUB.COPILOT.MODEL.NAME.NOT_MATCHES};
  • Filter Copilot programming languages by name: {$GITHUB.COPILOT.LANG.NAME.MATCHES}, {$GITHUB.COPILOT.LANG.NAME.NOT_MATCHES}.

Note: Update intervals and timeouts for script items can be changed individually via {$GITHUB.INTERVAL} and {$GITHUB.TIMEOUT} macros with context. Depending on the organization being monitored, it can be adjusted if needed (if you are exceeding rate limits, you can increase update intervals for some script items to stay within per hour request limits). But be aware that it may also affect the triggers (check whether the item is used in triggers and adjust thresholds and/or evaluation periods if needed).

Macros used

Name Description Default
{$GITHUB.API.URL}

Set the API URL here.

https://api.github.com/
{$GITHUB.USER_AGENT}

The user agent that is used in headers for HTTP requests.

Zabbix/8.0
{$GITHUB.API_VERSION}

The API version that is used in headers for HTTP requests.

2022-11-28
{$GITHUB.COPILOT.USED}

The flag for gathering Copilot metrics. If set to a value other than "1", items for Copilot will not be created. If set to "1", the {$GITHUB.ORG.NAME} macro is required.

0
{$GITHUB.ORG.NAME}

Set the organization name here.

{$GITHUB.API.TOKEN}

Set the access token here.

{$GITHUB.INTERVAL}

The update interval for the script items that retrieve data from the API. Can be used with context if needed (check the context values in relevant items).

1m
{$GITHUB.INTERVAL:"get_repo_list"}

The update interval for the script item that retrieves a list of repositories.

15m
{$GITHUB.INTERVAL:"get_copilot_data"}

The update interval for the script item that retrieves Copilot statistics.

1h
{$GITHUB.INTERVAL:"get_copilot_billing"}

The update interval for the script item that retrieves Copilot billing.

1h
{$GITHUB.TIMEOUT}

The timeout threshold for the script items that retrieve data from the API. Can be used with context if needed (check the context values in relevant items).

15s
{$GITHUB.HTTP_PROXY}

The HTTP proxy for script items (set if needed). If the macro is empty, then no proxy is used.

{$HTTP.TLS.VERIFY}

TLS certificate verification for script items: "none" - disabled, "peer" - verify the certificate chain and expiration, "full" - full verification. Any other value enables full verification. To override the setting for this template only, define the macro with the context "GitHub organization", e.g. {$HTTP.TLS.VERIFY:"GitHub organization"}.

full
{$GITHUB.RESULTS_PER_PAGE}

The number of results to fetch per page. Can be used with context and adjusted if needed (check the context values in script parameters of relevant items).

100
{$GITHUB.REPO.NAME.MATCHES}

The repository name regex filter to use in repository discovery - for including.

.+
{$GITHUB.REPO.NAME.NOT_MATCHES}

The repository name regex filter to use in repository discovery - for excluding.

CHANGE_IF_NEEDED
{$GITHUB.REPO.OWNER.MATCHES}

The repository owner regex filter to use in repository discovery - for including.

.+
{$GITHUB.REPO.OWNER.NOT_MATCHES}

The repository owner regex filter to use in repository discovery - for excluding.

CHANGE_IF_NEEDED
{$GITHUB.COPILOT.IDE.NAME.MATCHES}

The Copilot IDE name regex filter to use in Copilot-related metric discovery - for including.

.+
{$GITHUB.COPILOT.IDE.NAME.NOT_MATCHES}

The Copilot IDE name regex filter to use in Copilot-related metric discovery - for excluding.

CHANGE_IF_NEEDED
{$GITHUB.COPILOT.MODEL.NAME.MATCHES}

The Copilot model name regex filter to use in Copilot-related metric discovery - for including.

.+
{$GITHUB.COPILOT.MODEL.NAME.NOT_MATCHES}

The Copilot model name regex filter to use in Copilot-related metric discovery - for excluding.

CHANGE_IF_NEEDED
{$GITHUB.COPILOT.LANG.NAME.MATCHES}

The Copilot programming language name regex filter to use in Copilot-related metric discovery - for including.

.+
{$GITHUB.COPILOT.LANG.NAME.NOT_MATCHES}

The Copilot programming language name regex filter to use in Copilot-related metric discovery - for excluding.

CHANGE_IF_NEEDED

Items

Name Description Type Key and additional info
Get repositories

Get a list of repositories for the {$GITHUB.ORG.NAME} organization.

Information about endpoint:

https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#list-organization-repositories

Script github.org.repo.get

Preprocessing

  • Discard unchanged with heartbeat: 3h

Get repositories check

Data collection check.

Dependent item github.org.repo.get.check

Preprocessing

  • JSON Path: $.error

    ⛔️Custom on fail: Set value to: ``

  • Discard unchanged with heartbeat: 3h

Number of repositories

The number of repositories in the organization.

Dependent item github.org.repo.number

Preprocessing

  • JSON Path: $.data.length()

    ⛔️Custom on fail: Set value to: 0

  • Discard unchanged with heartbeat: 3h

Total size of repositories

The total size of repositories in the organization.

Dependent item github.org.repo.total_size

Preprocessing

  • JSON Path: $.data..size.sum()

    ⛔️Custom on fail: Set value to: 0

  • Custom multiplier: 1024

Open issue count

The total number of issues opened in all repositories.

Dependent item github.org.repo.open_issues

Preprocessing

  • JSON Path: $.data..open_issues_count.sum()

    ⛔️Custom on fail: Set value to: 0

  • Discard unchanged with heartbeat: 3h

Number of private repositories

The number of private repositories in the organization.

Dependent item github.org.repo.number_private

Preprocessing

  • JSON Path: $.data..[?(@.private == "true")].length()

    ⛔️Custom on fail: Set value to: 0

  • Discard unchanged with heartbeat: 3h

Number of archived repositories

The number of archived repositories in the organization.

Dependent item github.org.repo.number_archived

Preprocessing

  • JSON Path: $.data..[?(@.archived == "true")].length()

    ⛔️Custom on fail: Set value to: 0

  • Discard unchanged with heartbeat: 3h

Number of disabled repositories

The number of disabled repositories in the organization.

Dependent item github.org.repo.number_disabled

Preprocessing

  • JSON Path: $.data..[?(@.disabled == "true")].length()

    ⛔️Custom on fail: Set value to: 0

  • Discard unchanged with heartbeat: 3h

Number of repository templates

The number of repository templates in the organization.

Dependent item github.org.repo.number_templates

Preprocessing

  • JSON Path: $.data..[?(@.is_template == "true")].length()

    ⛔️Custom on fail: Set value to: 0

  • Discard unchanged with heartbeat: 3h

Get copilot billing

Get information about an organization's Copilot subscription, including seat breakdown and feature policies.

Information about endpoint:

https://docs.github.com/en/rest/copilot/copilot-user-management?apiVersion=2022-11-28#get-copilot-seat-information-and-settings-for-an-organization

Script github.org.copilot.billing_get

Preprocessing

  • JSON Path: $.data[0]

    ⛔️Custom on fail: Discard value

Get copilot billing check

Data collection check.

Dependent item github.org.copilot.billing_get.check

Preprocessing

  • JSON Path: $.error

    ⛔️Custom on fail: Set value to: ``

  • Discard unchanged with heartbeat: 3h

Copilot seats total

The total number of Copilot seats.

Dependent item github.org.copilot.seats_total

Preprocessing

  • JSON Path: $.seat_breakdown.total

    ⛔️Custom on fail: Discard value

  • Discard unchanged with heartbeat: 1h

Copilot seats added

The number of Copilot seats added this cycle.

Dependent item github.org.copilot.seats_added_this_cycle

Preprocessing

  • JSON Path: $.seat_breakdown.added_this_cycle

    ⛔️Custom on fail: Discard value

  • Discard unchanged with heartbeat: 1h

Copilot seats active

The number of Copilot seats active this cycle.

Dependent item github.org.copilot.seats_active_this_cycle

Preprocessing

  • JSON Path: $.seat_breakdown.active_this_cycle

    ⛔️Custom on fail: Discard value

  • Discard unchanged with heartbeat: 1h

Copilot seats inactive

The number of Copilot seats inactive this cycle.

Dependent item github.org.copilot.seats_inactive_this_cycle

Preprocessing

  • JSON Path: $.seat_breakdown.inactive_this_cycle

    ⛔️Custom on fail: Discard value

  • Discard unchanged with heartbeat: 1h

Copilot seats invited

The number of Copilot seats pending invitation.

Dependent item github.org.copilot.seats_pending_invitation

Preprocessing

  • JSON Path: $.seat_breakdown.pending_invitation

    ⛔️Custom on fail: Discard value

  • Discard unchanged with heartbeat: 1h

Copilot seats cancelled

The number of Copilot seats pending cancellation.

Dependent item github.org.copilot.seats_pending_cancellation

Preprocessing

  • JSON Path: $.seat_breakdown.pending_cancellation

    ⛔️Custom on fail: Discard value

  • Discard unchanged with heartbeat: 1h

Get copilot data

Get a breakdown of aggregated metrics for various GitHub Copilot features.

Information about endpoint:

https://docs.github.com/en/rest/copilot/copilot-metrics?apiVersion=2022-11-28#get-copilot-metrics-for-an-organization

Script github.org.copilot.data_get

Preprocessing

  • JSON Path: $.data[0]

    ⛔️Custom on fail: Discard value

  • Discard unchanged with heartbeat: 3h

Get copilot data check

Data collection check.

Dependent item github.org.copilot.data_get.check

Preprocessing

  • JSON Path: $.error

    ⛔️Custom on fail: Set value to: ``

  • Discard unchanged with heartbeat: 3h

Copilot active users

The number of users using Copilot.

Dependent item github.org.copilot.active_users

Preprocessing

  • JSON Path: $.total_active_users

    ⛔️Custom on fail: Discard value

Copilot engaged users

The number of engaged users using Copilot.

Dependent item github.org.copilot.engaged_users

Preprocessing

  • JSON Path: $.total_engaged_users

    ⛔️Custom on fail: Discard value

Triggers

Name Description Expression Severity Dependencies and additional info
GitHub: There are errors in requests to API

Errors have been received in response to API requests. Check the latest values for details.

length(last(/GitHub organization by HTTP/github.org.copilot.data_get.check))>0 or length(last(/GitHub organization by HTTP/github.org.repo.get.check))>0 or length(last(/GitHub organization by HTTP/github.org.copilot.billing_get.check))>0 Average

LLD rule Repository discovery

Name Description Type Key and additional info
Repository discovery

The discovery of repositories.

Dependent item github.org.repo.discovery

Preprocessing

  • JSON Path: $.data

    ⛔️Custom on fail: Discard value

Item prototypes for Repository discovery

Name Description Type Key and additional info
[{#REPO_OWNER}/{#REPO_NAME}]: Get data

Get {$GITHUB.REPO.NAME} repository data.

Dependent item github.org.repo.get_data[{#NODE_ID}]

Preprocessing

  • JSON Path: $.data[?(@.node_id == '{#NODE_ID}')].first()

    ⛔️Custom on fail: Set value to: {}

[{#REPO_OWNER}/{#REPO_NAME}]: Fork count

The number of repository forks.

Dependent item github.org.repo.forks_count[{#NODE_ID}]

Preprocessing

  • JSON Path: $.forks_count

    ⛔️Custom on fail: Set value to: 0

  • Discard unchanged with heartbeat: 3h

[{#REPO_OWNER}/{#REPO_NAME}]: Stargazer count

The number of stargazers in the repository.

Dependent item github.org.repo.stargazers_count[{#NODE_ID}]

Preprocessing

  • JSON Path: $.stargazers_count

    ⛔️Custom on fail: Set value to: 0

  • Discard unchanged with heartbeat: 3h

[{#REPO_OWNER}/{#REPO_NAME}]: Watcher count

The number of watchers in the repository.

Dependent item github.org.repo.watchers_count[{#NODE_ID}]

Preprocessing

  • JSON Path: $.watchers_count

    ⛔️Custom on fail: Set value to: 0

  • Discard unchanged with heartbeat: 3h

[{#REPO_OWNER}/{#REPO_NAME}]: Open issue count

The number of issues opened in the repository.

Dependent item github.org.repo.open_issues[{#NODE_ID}]

Preprocessing

  • JSON Path: $.open_issues_count

    ⛔️Custom on fail: Set value to: 0

  • Discard unchanged with heartbeat: 3h

[{#REPO_OWNER}/{#REPO_NAME}]: Size

The size of the repository, in kilobytes.

Dependent item github.org.repo.size[{#NODE_ID}]

Preprocessing

  • JSON Path: $.size

    ⛔️Custom on fail: Set value to: 0

  • Custom multiplier: 1024

[{#REPO_OWNER}/{#REPO_NAME}]: Language

The language of the repository.

Dependent item github.org.repo.language[{#NODE_ID}]

Preprocessing

  • JSON Path: $.language

    ⛔️Custom on fail: Discard value

  • Does not match regular expression: ^null$

    ⛔️Custom on fail: Discard value

  • Discard unchanged with heartbeat: 3h

[{#REPO_OWNER}/{#REPO_NAME}]: Is private

Whether the repository is private.

Dependent item github.org.repo.is_private[{#NODE_ID}]

Preprocessing

  • JSON Path: $.private

    ⛔️Custom on fail: Discard value

  • Boolean to decimal
  • Discard unchanged with heartbeat: 3h

[{#REPO_OWNER}/{#REPO_NAME}]: Is a fork

Whether the repository is a fork.

Dependent item github.org.repo.is_fork[{#NODE_ID}]

Preprocessing

  • JSON Path: $.fork

    ⛔️Custom on fail: Discard value

  • Boolean to decimal
  • Discard unchanged with heartbeat: 3h

[{#REPO_OWNER}/{#REPO_NAME}]: Is a template

Whether the repository is a template.

Dependent item github.org.repo.is_template[{#NODE_ID}]

Preprocessing

  • JSON Path: $.is_template

    ⛔️Custom on fail: Discard value

  • Boolean to decimal
  • Discard unchanged with heartbeat: 3h

[{#REPO_OWNER}/{#REPO_NAME}]: Is archived

Whether the repository is archived.

Dependent item github.org.repo.archived[{#NODE_ID}]

Preprocessing

  • JSON Path: $.archived

    ⛔️Custom on fail: Discard value

  • Boolean to decimal
  • Discard unchanged with heartbeat: 3h

[{#REPO_OWNER}/{#REPO_NAME}]: Visibility

Visibility type of the repository.

Dependent item github.org.repo.visibility[{#NODE_ID}]

Preprocessing

  • JSON Path: $.visibility

    ⛔️Custom on fail: Discard value

  • JavaScript: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 3h

[{#REPO_OWNER}/{#REPO_NAME}]: Pushed at

The time when the repository was pushed.

Dependent item github.org.repo.pushed_at[{#NODE_ID}]

Preprocessing

  • JSON Path: $.pushed_at

  • JavaScript: return Math.floor(new Date(value) / 1000);

  • Discard unchanged with heartbeat: 3h

[{#REPO_OWNER}/{#REPO_NAME}]: Created at

The time when the repository was created.

Dependent item github.org.repo.created_at[{#NODE_ID}]

Preprocessing

  • JSON Path: $.created_at

  • JavaScript: return Math.floor(new Date(value) / 1000);

  • Discard unchanged with heartbeat: 1d

[{#REPO_OWNER}/{#REPO_NAME}]: Updated at

The time when the repository was updated.

Dependent item github.org.repo.updated_at[{#NODE_ID}]

Preprocessing

  • JSON Path: $.updated_at

  • JavaScript: return Math.floor(new Date(value) / 1000);

  • Discard unchanged with heartbeat: 3h

[{#REPO_OWNER}/{#REPO_NAME}]: Advanced Security

Whether GitHub Advanced Security for the repository is enabled. For standalone Code Scanning or Secret Protection products, this value cannot be collected.

Dependent item github.org.repo.advanced_security[{#NODE_ID}]

Preprocessing

  • JSON Path: $.security_and_analysis.advanced_security.status

    ⛔️Custom on fail: Set value to: disabled

  • JavaScript: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 1d

[{#REPO_OWNER}/{#REPO_NAME}]: Secret Scanning

Whether GitHub Secret Scanning for the repository is enabled.

Dependent item github.org.repo.secret_scanning[{#NODE_ID}]

Preprocessing

  • JSON Path: $.security_and_analysis.secret_scanning.status

    ⛔️Custom on fail: Set value to: disabled

  • JavaScript: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 1d

[{#REPO_OWNER}/{#REPO_NAME}]: Secret Protection

Whether GitHub Secret Protection for the repository is enabled.

Dependent item github.org.repo.secret_protection[{#NODE_ID}]

Preprocessing

  • JSON Path: The text is too long. Please see the template.

    ⛔️Custom on fail: Set value to: disabled

  • JavaScript: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 1d

[{#REPO_OWNER}/{#REPO_NAME}]: Secret Scanning non-provider patterns

Whether GitHub Secret Scanning non-provider patterns for the repository are enabled.

Dependent item github.org.repo.secret_scanning_non_provider_patterns[{#NODE_ID}]

Preprocessing

  • JSON Path: The text is too long. Please see the template.

    ⛔️Custom on fail: Set value to: disabled

  • JavaScript: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 1d

[{#REPO_OWNER}/{#REPO_NAME}]: Secret Scanning Validity Checks

Whether GitHub Secret Scanning validity checks for the repository are enabled.

Dependent item github.org.repo.secret_scanning_validity_checks[{#NODE_ID}]

Preprocessing

  • JSON Path: The text is too long. Please see the template.

    ⛔️Custom on fail: Set value to: disabled

  • JavaScript: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 1d

[{#REPO_OWNER}/{#REPO_NAME}]: Secret Scanning AI Detection

Whether GitHub Secret Scanning AI Detection for the repository is enabled.

Dependent item github.org.repo.secret_ai_detection[{#NODE_ID}]

Preprocessing

  • JSON Path: $.security_and_analysis.secret_scanning_ai_detection.status

    ⛔️Custom on fail: Set value to: disabled

  • JavaScript: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 1d

LLD rule Copilot IDE chat discovery

Name Description Type Key and additional info
Copilot IDE chat discovery

The discovery of Copilot IDE chats.

Dependent item github.org.copilot_ide_chat.discovery

Preprocessing

  • JSON Path: $.copilot_ide_chat.editors

    ⛔️Custom on fail: Discard value

Item prototypes for Copilot IDE chat discovery

Name Description Type Key and additional info
IDE [{#IDE_NAME}]: Engaged users

The number of engaged users using Copilot in {#IDE_NAME}.

Dependent item github.org.copilot_ide_chat.engaged_users[{#IDE_NAME}]

Preprocessing

  • JSON Path: The text is too long. Please see the template.

    ⛔️Custom on fail: Set value to: 0

LLD rule IDE [{#IDE_NAME}]: Model discovery

Name Description Type Key and additional info
IDE [{#IDE_NAME}]: Model discovery

The discovery of models used in the {#IDE_NAME} Copilot chat.

Dependent item github.org.copilot_ide_model.discovery[{#IDE_NAME}]

Preprocessing

  • JSON Path: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

Item prototypes for IDE [{#IDE_NAME}]: Model discovery

Name Description Type Key and additional info
IDE [{#IDE_NAME}/{#MODEL_NAME}]: Total chats

The number of Copilot chats with the {#MODEL_NAME} model in {#IDE_NAME}.

Dependent item github.org.copilot_ide_model.total_chats[{#IDE_NAME},{#MODEL_NAME}]

Preprocessing

  • JSON Path: The text is too long. Please see the template.

IDE [{#IDE_NAME}/{#MODEL_NAME}]: Engaged users

The number of engaged users using the Copilot {#MODEL_NAME} model in {#IDE_NAME}.

Dependent item github.org.copilot_ide_model.engaged_users[{#IDE_NAME},{#MODEL_NAME}]

Preprocessing

  • JSON Path: The text is too long. Please see the template.

    ⛔️Custom on fail: Set value to: 0

IDE [{#IDE_NAME}/{#MODEL_NAME}]: Chat copy events

The number of Copilot chat copy events caused by the {#MODEL_NAME} model in {#IDE_NAME}.

Dependent item github.org.copilot_ide_model.chat_copy_events[{#IDE_NAME},{#MODEL_NAME}]

Preprocessing

  • JSON Path: The text is too long. Please see the template.

IDE [{#IDE_NAME}/{#MODEL_NAME}]: Chat insertion events

The number of Copilot chat insertion events caused by the {#MODEL_NAME} model in {#IDE_NAME}.

Dependent item github.org.copilot_ide_model.chat_insertion_events[{#IDE_NAME},{#MODEL_NAME}]

Preprocessing

  • JSON Path: The text is too long. Please see the template.

LLD rule Copilot IDE code completion discovery

Name Description Type Key and additional info
Copilot IDE code completion discovery

The discovery of Copilot IDE code completions.

Dependent item github.org.copilot_completion.discovery

Preprocessing

  • JSON Path: $.copilot_ide_code_completions.editors

    ⛔️Custom on fail: Discard value

Item prototypes for Copilot IDE code completion discovery

Name Description Type Key and additional info
IDE [{#IDE_NAME}]: Engaged users

The number of engaged users using Copilot in {#IDE_NAME}.

Dependent item github.org.copilot_completion.engaged_users[{#IDE_NAME}]

Preprocessing

  • JSON Path: The text is too long. Please see the template.

    ⛔️Custom on fail: Set value to: 0

LLD rule IDE [{#IDE_NAME}]: Model discovery

Name Description Type Key and additional info
IDE [{#IDE_NAME}]: Model discovery

The discovery of models used in the {#IDE_NAME} Copilot chat.

Dependent item github.org.copilot_completion_model.discovery[{#IDE_NAME}]

Preprocessing

  • JSON Path: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

Item prototypes for IDE [{#IDE_NAME}]: Model discovery

Name Description Type Key and additional info
{#IDE_NAME} [{#MODEL_NAME}]: Engaged users

The number of engaged users using the Copilot {#MODEL_NAME} model in {#IDE_NAME}.

Dependent item github.org.copilot_completion_model.engaged_users[{#IDE_NAME},{#MODEL_NAME}]

Preprocessing

  • JSON Path: The text is too long. Please see the template.

    ⛔️Custom on fail: Set value to: 0

LLD rule {#IDE_NAME} [{#MODEL_NAME}]: Language discovery

Name Description Type Key and additional info
{#IDE_NAME} [{#MODEL_NAME}]: Language discovery

The discovery of programming languages used by the {#MODEL_NAME} model in the {#IDE_NAME} Copilot chat.

Dependent item github.org.copilot_completion_language.discovery[{#IDE_NAME},{#MODEL_NAME}]

Preprocessing

  • JSON Path: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

Item prototypes for {#IDE_NAME} [{#MODEL_NAME}]: Language discovery

Name Description Type Key and additional info
{#IDE_NAME} [{#MODEL_NAME}/{#LANG_NAME}]: Engaged users

The number of engaged users using the Copilot {#MODEL_NAME} model in {#IDE_NAME} for code in {#LANG_NAME}.

Dependent item github.org.copilot_completion_language.engaged_users[{#IDE_NAME},{#MODEL_NAME},{#LANG_NAME}]

Preprocessing

  • JSON Path: The text is too long. Please see the template.

    ⛔️Custom on fail: Set value to: 0

{#IDE_NAME} [{#MODEL_NAME}/{#LANG_NAME}]: Code suggestions

The number of code suggestions in {#LANG_NAME} provided by the Copilot {#MODEL_NAME} model in {#IDE_NAME}.

Dependent item github.org.copilot_completion_language.code_suggestions[{#IDE_NAME},{#MODEL_NAME},{#LANG_NAME}]

Preprocessing

  • JSON Path: The text is too long. Please see the template.

{#IDE_NAME} [{#MODEL_NAME}/{#LANG_NAME}]: Code acceptances

The number of code acceptances in {#LANG_NAME} by users for suggestions provided by the Copilot {#MODEL_NAME} model in {#IDE_NAME}.

Dependent item github.org.copilot_completion_language.code_acceptances[{#IDE_NAME},{#MODEL_NAME},{#LANG_NAME}]

Preprocessing

  • JSON Path: The text is too long. Please see the template.

{#IDE_NAME} [{#MODEL_NAME}/{#LANG_NAME}]: Acceptance rate

The percentage of code acceptances in {#LANG_NAME} for the Copilot {#MODEL_NAME} model in {#IDE_NAME}.

Calculated github.org.copilot_completion_language.acceptance_rate[{#IDE_NAME},{#MODEL_NAME},{#LANG_NAME}]

Preprocessing

  • Discard unchanged with heartbeat: 1h

{#IDE_NAME} [{#MODEL_NAME}/{#LANG_NAME}]: Total code lines suggested

The total number of code lines in {#LANG_NAME} suggested by the Copilot {#MODEL_NAME} model in {#IDE_NAME}.

Dependent item github.org.copilot_completion_language.lines_suggested[{#IDE_NAME},{#MODEL_NAME},{#LANG_NAME}]

Preprocessing

  • JSON Path: The text is too long. Please see the template.

{#IDE_NAME} [{#MODEL_NAME}/{#LANG_NAME}]: Total code lines accepted

The total number of code lines in {#LANG_NAME} suggested by the Copilot {#MODEL_NAME} model in {#IDE_NAME} and accepted by users.

Dependent item github.org.copilot_completion_language.lines_accepted[{#IDE_NAME},{#MODEL_NAME},{#LANG_NAME}]

Preprocessing

  • JSON Path: The text is too long. Please see the template.

{#IDE_NAME} [{#MODEL_NAME}/{#LANG_NAME}]: Line acceptance rate

The percentage of code lines accepted in {#LANG_NAME} for the Copilot {#MODEL_NAME} model in {#IDE_NAME}.

Calculated github.org.copilot_completion_language.line_acceptance_rate[{#IDE_NAME},{#MODEL_NAME},{#LANG_NAME}]

Preprocessing

  • Discard unchanged with heartbeat: 1h

LLD rule Copilot.com chat model discovery

Name Description Type Key and additional info
Copilot.com chat model discovery

The discovery of chats on copilot.com.

Dependent item github.org.copilot_web_chat.discovery

Preprocessing

  • JSON Path: $.copilot_dotcom_chat.models

    ⛔️Custom on fail: Discard value

Item prototypes for Copilot.com chat model discovery

Name Description Type Key and additional info
Copilot.com [{#MODEL_NAME}]: Total chats

The number of chats with the {#MODEL_NAME} model on copilot.com.

Dependent item github.org.copilot_web_model.total_chats[{#MODEL_NAME}]

Preprocessing

  • JSON Path: The text is too long. Please see the template.

Copilot.com [{#MODEL_NAME}]: Engaged users

The number of engaged users using the {#MODEL_NAME} model on copilot.com.

Dependent item github.org.copilot_web_model.engaged_users[{#MODEL_NAME}]

Preprocessing

  • JSON Path: The text is too long. Please see the template.

    ⛔️Custom on fail: Set value to: 0

LLD rule Copilot.com PR discovery

Name Description Type Key and additional info
Copilot.com PR discovery

The discovery of pull requests on copilot.com.

Dependent item github.org.copilot_pull_request.discovery

Preprocessing

  • JSON Path: $.copilot_dotcom_pull_requests.repositories

    ⛔️Custom on fail: Discard value

Item prototypes for Copilot.com PR discovery

Name Description Type Key and additional info
Repo [{#REPO_NAME}]: Engaged users

The number of engaged users working with PRs on copilot.com.

Dependent item github.org.copilot_pull_request.engaged_users[{#REPO_NAME}]

Preprocessing

  • JSON Path: The text is too long. Please see the template.

    ⛔️Custom on fail: Set value to: 0

LLD rule Repo [{#REPO_NAME}]: Model discovery

Name Description Type Key and additional info
Repo [{#REPO_NAME}]: Model discovery

The discovery of models used for work with PRs.

Dependent item github.org.copilot_pr_model.discovery[{#REPO_NAME}]

Preprocessing

  • JSON Path: The text is too long. Please see the template.

    ⛔️Custom on fail: Discard value

Item prototypes for Repo [{#REPO_NAME}]: Model discovery

Name Description Type Key and additional info
{#REPO_NAME} [{#MODEL_NAME}]: PR summaries created

The number of PR summaries created by the Copilot {#MODEL_NAME} model.

Dependent item github.org.copilot_pr_model.summaries_created[{#REPO_NAME},{#MODEL_NAME}]

Preprocessing

  • JSON Path: The text is too long. Please see the template.

{#REPO_NAME} [{#MODEL_NAME}]: Engaged users

The number of engaged users using the Copilot {#MODEL_NAME} model for work with PRs.

Dependent item github.org.copilot_pr_model.engaged_users[{#REPO_NAME},{#MODEL_NAME}]

Preprocessing

  • JSON Path: The text is too long. Please see the template.

    ⛔️Custom on fail: Set value to: 0

LLD rule Copilot IDE code language discovery

Name Description Type Key and additional info
Copilot IDE code language discovery

The discovery of Copilot IDE code completion languages.

Dependent item github.org.copilot_ide_lang.discovery

Preprocessing

  • JSON Path: $.copilot_ide_code_completions.languages

    ⛔️Custom on fail: Discard value

Item prototypes for Copilot IDE code language discovery

Name Description Type Key and additional info
Language [{#LANG_NAME}]: Engaged users

The number of engaged users working with code in {#LANG_NAME}.

Dependent item github.org.copilot_ide_lang.engaged_users[{#LANG_NAME}]

Preprocessing

  • JSON Path: The text is too long. Please see the template.

    ⛔️Custom on fail: Set value to: 0

GitHub repository by HTTP

Overview

This template is designed for the effortless deployment of GitHub repository monitoring by Zabbix via GitHub REST API and doesn't require any external scripts.

For more details about GitHub REST API, refer to the official documentation.

Requirements

Zabbix version: 8.0 and higher.

Tested versions

This template has been tested on:

  • GitHub API version 2022-11-28

Configuration

Zabbix should be configured according to the instructions in the Templates out of the box section.

Setup

GitHub limits the number of REST API requests that you can make within a specific amount of time, which also depends on whether you are authenticated or not, the plan, and the token type used. Many REST API endpoints require authentication or return additional information if you are authenticated. Additionally, you can make more requests per hour when you are authenticated.

Additional information is available in the official documentation:

  1. Create an access token for monitoring

One of the simplest ways to send authenticated requests is to use a personal access token - either a classic or a fine-grained one.

Classic personal access token

You can create a new classic personal access token by following the instructions in the official documentation.

For public repositories, no additional permission scopes are required. For monitoring to work on private repositories, the repo scope must be set to have full control of private repositories.

Additional information about OAuth scopes is available in the official documentation.

Note that authenticated users must have admin access to the repository and the repo scope must be set to get information about self-hosted runners.

Fine-grained personal access token

Alternatively, you can use a fine-grained personal access token.

In order to use fine-grained tokens to monitor organization-owned repositories, organizations must opt in to fine-grained personal access tokens and set up a personal access token policy.

The fine-grained token needs to have the following permissions set to provide access to the repository resources:

  • "Actions" repository permissions (read);
  • "Administration" repository permissions (read);
  • "Contents" repository permissions (read);
  • "Issues" repository permissions (read);
  • "Metadata" repository permissions (read);
  • "Pull requests" repository permissions (read).
  1. Set the access token that you've created in step 1 in the {$GITHUB.API.TOKEN} macro
  2. Change the API URL in the {$GITHUB.API.URL} macro if needed (for self-hosted installations)
  3. Set the repository owner name in the {$GITHUB.REPO.OWNER} macro
  4. Set the repository name in the {$GITHUB.REPO.NAME} macro
  5. Set the LLD rule filters if needed (you may want to use them to stay within rate limits as on large repositories, LLD rules may generate a lot of script items):
  • Filter repository branches by name: {$GITHUB.BRANCH.NAME.MATCHES}, {$GITHUB.BRANCH.NAME.NOT_MATCHES};
  • Filter repository workflows by name: {$GITHUB.WORKFLOW.NAME.MATCHES}, {$GITHUB.WORKFLOW.NAME.NOT_MATCHES};
  • Filter repository workflows by state: {$GITHUB.WORKFLOW.STATE.MATCHES}, {$GITHUB.WORKFLOW.STATE.NOT_MATCHES};
  • Filter self-hosted runners by name: {$GITHUB.RUNNER.NAME.MATCHES}, {$GITHUB.RUNNER.NAME.NOT_MATCHES};
  • Filter self-hosted runners by OS: {$GITHUB.RUNNER.OS.MATCHES}, {$GITHUB.RUNNER.OS.NOT_MATCHES}.

Note: Update intervals and timeouts for script items can be changed individually via {$GITHUB.INTERVAL} and {$GITHUB.TIMEOUT} macros with context. Depending on the repository being monitored, it can be adjusted if needed (if you are exceeding rate limits, you can increase update intervals for some script items to stay within per hour request limits). But be aware that it may also affect the triggers (check whether the item is used in triggers and adjust thresholds and/or evaluation periods if needed).

Macros used

Name Description Default
{$GITHUB.API.URL}

Set the API URL here.

https://api.github.com/
{$GITHUB.USER_AGENT}

The user agent that is used in headers for HTTP requests.

Zabbix/8.0
{$GITHUB.API_VERSION}

The API version that is used in headers for HTTP requests.

2022-11-28
{$GITHUB.REPO.OWNER}

Set the repository owner here.

{$GITHUB.REPO.NAME}

Set the repository name here.

{$GITHUB.API.TOKEN}

Set the access token here.

{$GITHUB.INTERVAL}

The update interval for the script items that retrieve data from the API. Can be used with context if needed (check the context values in relevant items).

1m
{$GITHUB.INTERVAL:regex:"get_(tags|releases|issues)_count"}

The update interval for the script items that retrieve the number of tags, releases, issues, and pull requests (total, open, closed).

1h
{$GITHUB.INTERVAL:"get_repo"}

The update interval for the script item that retrieves the repository information.

15m
{$GITHUB.INTERVAL:"get_(branches|workflows)"}

The update interval for the script items that retrieve the branches and workflows. Used only for related metric discovery.

1h
{$GITHUB.INTERVAL:"get_runners"}

The update interval for the script item that retrieves the information about self-hosted runners.

15m
{$GITHUB.INTERVAL:regex:"get_last_run:.+"}

The update interval for the script items that retrieve the information about the last workflow run results.

15m
{$GITHUB.INTERVAL:regex:"get_commits_count:.+"}

The update interval for the script items that retrieve the commits count in discovered branches.

1h
{$GITHUB.TIMEOUT}

The timeout threshold for the script items that retrieve data from the API. Can be used with context if needed (check the context values in relevant items).

15s
{$GITHUB.HTTP_PROXY}

The HTTP proxy for script items (set if needed). If the macro is empty, then no proxy is used.

{$HTTP.TLS.VERIFY}

TLS certificate verification for script items: "none" - disabled, "peer" - verify the certificate chain and expiration, "full" - full verification. Any other value enables full verification. To override the setting for this template only, define the macro with the context "GitHub repository", e.g. {$HTTP.TLS.VERIFY:"GitHub repository"}.

full
{$GITHUB.RESULTS_PER_PAGE}

The number of results to fetch per page. Can be used with context and adjusted if needed (check the context values in script parameters of relevant items).

100
{$GITHUB.WORKFLOW.NAME.MATCHES}

The repository workflow name regex filter to use in workflow-related metric discovery - for including.

.+
{$GITHUB.WORKFLOW.NAME.NOT_MATCHES}

The repository workflow name regex filter to use in workflow-related metric discovery - for excluding.

CHANGE_IF_NEEDED
{$GITHUB.WORKFLOW.STATE.MATCHES}

The repository workflow state regex filter to use in workflow-related metric discovery - for including.

active
{$GITHUB.WORKFLOW.STATE.NOT_MATCHES}

The repository workflow state regex filter to use in workflow-related metric discovery - for excluding.

CHANGE_IF_NEEDED
{$GITHUB.BRANCH.NAME.MATCHES}

The repository branch name regex filter to use in branch-related metric discovery - for including.

.+
{$GITHUB.BRANCH.NAME.NOT_MATCHES}

The repository branch name regex filter to use in branch-related metric discovery - for excluding.

CHANGE_IF_NEEDED
{$GITHUB.RUNNER.NAME.MATCHES}

The repository self-hosted runner name regex filter to use in discovering metrics related to the self-hosted runner - for including.

.+
{$GITHUB.RUNNER.NAME.NOT_MATCHES}

The repository self-hosted runner name regex filter to use in discovering metrics related to the self-hosted runner - for excluding.

CHANGE_IF_NEEDED
{$GITHUB.RUNNER.OS.MATCHES}

The repository self-hosted runner OS regex filter to use in discovering metrics related to the self-hosted runner - for including.

.+
{$GITHUB.RUNNER.OS.NOT_MATCHES}

The repository self-hosted runner OS regex filter to use in discovering metrics related to the self-hosted runner - for excluding.

CHANGE_IF_NEEDED
{$GITHUB.REQUESTS.UTIL.WARN}

The threshold percentage of utilized API requests in a Warning trigger expression.

80
{$GITHUB.REQUESTS.UTIL.HIGH}

The threshold percentage of utilized API requests in a High trigger expression.

90
{$GITHUB.WORKFLOW.STATUS.QUEUED.THRESH}

The time threshold used in the trigger of a workflow run that has been in the queue for too long. Can be used with context if needed.

1h
{$GITHUB.WORKFLOW.STATUS.IN_PROGRESS.THRESH}

The time threshold used in the trigger of a workflow run that has been in the queue for too long. Can be used with context if needed.

24h

Items

Name Description Type Key and additional info
Get self-hosted runners

Get the self-hosted runners of the repository.

Note that admin access to the repository is required to use this endpoint:

https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-a-repository

Script github.repo.runners.get

Preprocessing

  • Check for error using a regular expression: API rate limit exceeded<br>\0

    ⛔️Custom on fail: Discard value

Get self-hosted runner check

Carry out a self-hosted runners data collection check.

Dependent item github.repo.runners.get.check

Preprocessing

  • JSON Path: $.error

    ⛔️Custom on fail: Set value to: ``

  • Discard unchanged with heartbeat: 3h

Number of releases

The number of releases in the repository. Note that this number also includes draft releases.

Information about endpoint:

https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#list-releases

Script github.repo.releases.count

Preprocessing

  • Check for error using a regular expression: API rate limit exceeded<br>\0

    ⛔️Custom on fail: Discard value

  • Discard unchanged with heartbeat: 6h

Number of tags

The number of tags in the repository.

Information about endpoint:

https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#list-repository-tags

Script github.repo.tags.count

Preprocessing

  • Check for error using a regular expression: API rate limit exceeded<br>\0

    ⛔️Custom on fail: Discard value

  • Discard unchanged with heartbeat: 6h

Get issue count

Get the count of issues and pull requests in the repository (total, open, closed).

Information about endpoint for issues:

https://docs.github.com/en/rest/issues/issues?apiVersion=2022-11-28#list-repository-issues

Information about endpoint for pull requests:

https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#list-pull-requests

Script github.repo.issues.get

Preprocessing

  • Check for error using a regular expression: API rate limit exceeded<br>\0

    ⛔️Custom on fail: Discard value

Number of issues

The total number of issues in the repository.

Dependent item github.repo.issues.total

Preprocessing

  • JSON Path: $.issues.total

Number of open issues

The number of open issues in the repository.

Dependent item github.repo.issues.open

Preprocessing

  • JSON Path: $.issues.open

Number of closed issues

The number of closed issues in the repository.

Dependent item github.repo.issues.closed

Preprocessing

  • JSON Path: $.issues.closed

Number of PRs

The total number of pull requests in the repository.

Dependent item github.repo.pr.total

Preprocessing

  • JSON Path: $.pr.total

Number of open PRs

The number of open pull requests in the repository.

Dependent item github.repo.pr.open

Preprocessing

  • JSON Path: $.pr.open

Number of closed PRs

The number of closed pull requests in the repository.

Dependent item github.repo.pr.closed

Preprocessing

  • JSON Path: $.pr.closed

Request limit

API request limit.

Information about request limits in GitHub REST API documentation:

https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28

Dependent item github.repo.requests.limit

Preprocessing

  • JSON Path: $.headers['x-ratelimit-limit']

  • Discard unchanged with heartbeat: 3h

Requests used

The number of used API requests.

Information about request limits in GitHub REST API documentation:

https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28

Dependent item github.repo.requests.used

Preprocessing

  • JSON Path: $.headers['x-ratelimit-used']

Request limit utilization, in %

The calculated utilization of the API request limit in %.

Information about request limits in GitHub REST API documentation:

https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28

Dependent item github.repo.requests.util

Preprocessing

  • JavaScript: The text is too long. Please see the template.

Get repository

Get the general repository information. If the repository is not a fork, the community profile metrics are also retrieved.

Information about endpoint:

https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#get-a-repository

Information about community profile metrics:

https://docs.github.com/en/rest/metrics/community?apiVersion=2022-11-28#get-community-profile-metrics

Script github.repo.repository.get
Get repository data check

Data collection check.

Dependent item github.repo.repository.get.check

Preprocessing

  • JSON Path: $.error

    ⛔️Custom on fail: Set value to: ``

  • Discard unchanged with heartbeat: 3h

Repository is a fork

Indicates whether the repository is a fork.

Dependent item github.repo.repository.is_fork

Preprocessing

  • JSON Path: $.data..fork.first()

  • Boolean to decimal
  • Discard unchanged with heartbeat: 6h

Repository size

The size of the repository.

Dependent item github.repo.repository.size

Preprocessing

  • JSON Path: $.data..size.first()

  • Custom multiplier: 1024

  • Discard unchanged with heartbeat: 3h

Repository stargazers

The number of GitHub users who have starred the repository.

Dependent item github.repo.repository.stargazers

Preprocessing

  • JSON Path: $.data..stargazers_count.first()

  • Discard unchanged with heartbeat: 3h

Repository watchers

The number of GitHub users who are subscribed to the repository.

Dependent item github.repo.repository.watchers

Preprocessing

  • JSON Path: $.data..subscribers_count.first()

  • Discard unchanged with heartbeat: 3h

Repository forks

The number of repository forks.

Dependent item github.repo.repository.forks.count

Preprocessing

  • JSON Path: $.data..forks_count.first()

  • Discard unchanged with heartbeat: 3h

Get workflows

Get the repository workflows.

Information about endpoint:

https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#list-repository-workflows

Script github.repo.workflows.get

Preprocessing

  • Check for error using a regular expression: API rate limit exceeded<br>\0

    ⛔️Custom on fail: Discard value

Get branches

Get the repository branches.

Information about endpoint:

https://docs.github.com/en/rest/branches/branches?apiVersion=2022-11-28#list-branches

Script github.repo.branches.get

Preprocessing

  • Check for error using a regular expression: API rate limit exceeded<br>\0

    ⛔️Custom on fail: Discard value

Triggers

Name Description Expression Severity Dependencies and additional info
GitHub: No access to repository self-hosted runners

Admin access to the repository is required to use this endpoint:
https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-a-repository

find(/GitHub repository by HTTP/github.repo.runners.get.check,,"iregexp","Must have admin rights to Repository")=1 Average
GitHub: The total number of issues has increased

The total number of issues has increased which means that either a new issue (or multiple) has been opened.

last(/GitHub repository by HTTP/github.repo.issues.total)>last(/GitHub repository by HTTP/github.repo.issues.total,#2) Warning
GitHub: The total number of PRs has increased

The total number of pull requests has increased which means that either a new pull request (or multiple) has been opened.

last(/GitHub repository by HTTP/github.repo.pr.total)>last(/GitHub repository by HTTP/github.repo.pr.total,#2) Info
GitHub: API request limit utilization is high

The API request limit utilization is high. It can be lowered by increasing the update intervals for script items (by setting up higher values in corresponding context macros).

The trigger will be resolved automatically if the limit usage drops 5% below the trigger threshold.

Information about request limits in GitHub REST API documentation:
https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28

max(/GitHub repository by HTTP/github.repo.requests.util,1h)>{$GITHUB.REQUESTS.UTIL.WARN} Warning Depends on:
  • GitHub: API request limit utilization is very high
GitHub: API request limit utilization is very high

The API request limit utilization is very high. It can be lowered by increasing the update intervals for script items (by setting up higher values in corresponding context macros).

The trigger will be resolved automatically if the limit usage drops 5% below the trigger threshold.

Information about request limits in GitHub REST API documentation:
https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28

max(/GitHub repository by HTTP/github.repo.requests.util,1h)>{$GITHUB.REQUESTS.UTIL.HIGH} Average
GitHub: There are errors in requests to API

Errors have been received in response to API requests. Check the latest values for details.

length(last(/GitHub repository by HTTP/github.repo.repository.get.check))>0 Average

LLD rule Workflow discovery

Name Description Type Key and additional info
Workflow discovery

Discovers repository workflows. By default, only the active workflows are discovered.

Information about endpoint:

https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#list-repository-workflows

Dependent item github.repo.workflows.discovery

Preprocessing

  • JSON Path: $.data

Item prototypes for Workflow discovery

Name Description Type Key and additional info
Workflow [{#WORKFLOW_NAME}]: Get last run

Get the data about the last workflow run.

Information about endpoint:

https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-workflow

Script github.repo.workflows.last_run.get[{#WORKFLOW_NAME}]

Preprocessing

  • Check for error using a regular expression: API rate limit exceeded<br>\0

    ⛔️Custom on fail: Discard value

  • JSON Path: $.data.first()

Workflow [{#WORKFLOW_NAME}]: Last run status

The status of the last workflow run. Possible values:

0 - queued

1 - in_progress

2 - completed

10 - unknown

Dependent item github.repo.workflows.last_run.status[{#WORKFLOW_NAME}]

Preprocessing

  • JSON Path: $.status

  • JavaScript: The text is too long. Please see the template.

Workflow [{#WORKFLOW_NAME}]: Last run conclusion

The conclusion of the last workflow run. Possible values:

0 - success

1 - failure

2 - neutral

3 - cancelled

4 - skipped

5 - timed_out

6 - action_required

10 - unknown

Dependent item github.repo.workflows.last_run.conclusion[{#WORKFLOW_NAME}]

Preprocessing

  • JSON Path: $.conclusion

  • JavaScript: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 1h

Workflow [{#WORKFLOW_NAME}]: Last run start date

The date when the last workflow run was started.

Dependent item github.repo.workflows.last_run.start_date[{#WORKFLOW_NAME}]

Preprocessing

  • JSON Path: $.run_started_at

  • JavaScript: return Math.floor(new Date(value) / 1000);

  • Discard unchanged with heartbeat: 3h

Workflow [{#WORKFLOW_NAME}]: Last run update date

The date when the last workflow run was updated.

Dependent item github.repo.workflows.last_run.update_date[{#WORKFLOW_NAME}]

Preprocessing

  • JSON Path: $.updated_at

  • JavaScript: return Math.floor(new Date(value) / 1000);

  • Discard unchanged with heartbeat: 3h

Workflow [{#WORKFLOW_NAME}]: Last run duration

The duration of the last workflow run.

Dependent item github.repo.workflows.last_run.duration[{#WORKFLOW_NAME}]

Preprocessing

  • JavaScript: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 3h

Trigger prototypes for Workflow discovery

Name Description Expression Severity Dependencies and additional info
GitHub: Workflow [{#WORKFLOW_NAME}]: The workflow has been in the queue for too long

The last workflow run has been in the "queued" status for too long. This may mean that it has failed to be assigned to a runner. The default threshold is provided as an example and can be adjusted for relevant workflows with context macros.

last(/GitHub repository by HTTP/github.repo.workflows.last_run.status[{#WORKFLOW_NAME}])=0 and changecount(/GitHub repository by HTTP/github.repo.workflows.last_run.status[{#WORKFLOW_NAME}],{$GITHUB.WORKFLOW.STATUS.QUEUED.THRESH:"workflow_queued:{#WORKFLOW_NAME}"})=0 Warning
GitHub: Workflow [{#WORKFLOW_NAME}]: The workflow has been in progress for too long

The last workflow run has been in the "in_progress" status for too long. The default threshold is provided as an example and can be adjusted for relevant workflows with context macros.

last(/GitHub repository by HTTP/github.repo.workflows.last_run.status[{#WORKFLOW_NAME}])=1 and changecount(/GitHub repository by HTTP/github.repo.workflows.last_run.status[{#WORKFLOW_NAME}],{$GITHUB.WORKFLOW.STATUS.IN_PROGRESS.THRESH:"workflow_in_progress:{#WORKFLOW_NAME}"})=0 Warning
GitHub: Workflow [{#WORKFLOW_NAME}]: The workflow has failed

The last workflow run has returned a "failure" conclusion.

last(/GitHub repository by HTTP/github.repo.workflows.last_run.conclusion[{#WORKFLOW_NAME}])=1 Warning

LLD rule Branch discovery

Name Description Type Key and additional info
Branch discovery

Discovers repository branches.

Information about endpoint:

https://docs.github.com/en/rest/branches/branches?apiVersion=2022-11-28#list-branches

Dependent item github.repo.branches.discovery

Preprocessing

  • JSON Path: $.data

Item prototypes for Branch discovery

Name Description Type Key and additional info
Branch [{#BRANCH_NAME}]: Number of commits

Get the number of commits in the branch.

Information about endpoint:

https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28#list-commits

Script github.repo.branches.commits.total[{#BRANCH_NAME}]

Preprocessing

  • Check for error using a regular expression: API rate limit exceeded<br>\0

    ⛔️Custom on fail: Discard value

  • Discard unchanged with heartbeat: 6h

LLD rule Self-hosted runner discovery

Name Description Type Key and additional info
Self-hosted runner discovery

Discovers self-hosted runners of the repository.

Note that admin access to the repository is required to use this endpoint:

https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-a-repository

Dependent item github.repo.runners.discovery

Preprocessing

  • JSON Path: $.data

    ⛔️Custom on fail: Discard value

  • JavaScript: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 1h

Item prototypes for Self-hosted runner discovery

Name Description Type Key and additional info
Runner [{#RUNNER_NAME}]: Busy

Indicates whether the runner is currently executing a job.

Dependent item github.repo.runners.busy[{#RUNNER_NAME}]

Preprocessing

  • JSON Path: $.data[?(@.id == "{#RUNNER_ID}")].busy.first()

  • Boolean to decimal
  • Discard unchanged with heartbeat: 1h

Runner [{#RUNNER_NAME}]: Online

Indicates whether the runner is connected to GitHub and is ready to execute jobs.

Dependent item github.repo.runners.online[{#RUNNER_NAME}]

Preprocessing

  • JSON Path: $.data[?(@.id == "{#RUNNER_ID}")].status.first()

  • JavaScript: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 1h

Trigger prototypes for Self-hosted runner discovery

Name Description Expression Severity Dependencies and additional info
GitHub: Runner [{#RUNNER_NAME}]: The runner has become offline

The runner was online previously, but is currently not connected to GitHub. This could be because the machine is offline, the self-hosted runner application is not running on the machine, or the self-hosted runner application cannot communicate with GitHub.

last(/GitHub repository by HTTP/github.repo.runners.online[{#RUNNER_NAME}],#2)=1 and last(/GitHub repository by HTTP/github.repo.runners.online[{#RUNNER_NAME}])=0 Warning

LLD rule Discovery of community profile metrics

Name Description Type Key and additional info
Discovery of community profile metrics

Discovers community profile metrics (the repository must not be a fork).

Information about community profile metrics:

https://docs.github.com/en/rest/metrics/community?apiVersion=2022-11-28#get-community-profile-metrics

Dependent item github.repo.community_profile.discovery

Preprocessing

  • JavaScript: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 6h

Item prototypes for Discovery of community profile metrics

Name Description Type Key and additional info
Health percentage score

The health percentage score is defined as a percentage of how many of the recommended community health files are present.

For more information, see the documentation:

https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/about-community-profiles-for-public-repositories

Dependent item github.repo.repository.health[{#SINGLETON}]

Preprocessing

  • JSON Path: $.data..zbx_community_profile.health_percentage.first()

  • Discard unchanged with heartbeat: 1h

Feedback

Please report any issues with the template at https://support.zabbix.com

You can also provide feedback, discuss the template, or ask for help at ZABBIX forums

Articles and documentation

+ Propose new article

Didn't find integration you need?