Skip to content

Add a check command for NETGEAR monitoring#10753

Open
DsgnrFH wants to merge 2 commits intomasterfrom
feature/netgear-checkcommand
Open

Add a check command for NETGEAR monitoring#10753
DsgnrFH wants to merge 2 commits intomasterfrom
feature/netgear-checkcommand

Conversation

@DsgnrFH
Copy link

@DsgnrFH DsgnrFH commented Mar 11, 2026

No description provided.

@DsgnrFH DsgnrFH requested a review from Al2Klimov March 11, 2026 09:17
@DsgnrFH DsgnrFH self-assigned this Mar 11, 2026
@cla-bot cla-bot bot added the cla/signed label Mar 11, 2026
Copy link
Member

@Al2Klimov Al2Klimov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Make the GitHub actions green
  • Add documentation to doc/10-icinga-template-library.md
  • In a GitHub comment, give an example config file to throw into /etc/icinga2/conf.d of a default Icinga2 install – with a Service that uses your check command to prove latter works

@DsgnrFH
Copy link
Author

DsgnrFH commented Mar 11, 2026

  • Make the GitHub actions green

    • Add documentation to doc/10-icinga-template-library.md

    • In a GitHub comment, give an example config file to throw into /etc/icinga2/conf.d of a default Icinga2 install – with a Service that uses your check command to prove latter works

Create the following file:
/etc/icinga2/conf.d/netgear.conf
With the following contents:
object Host "netgear-switch" {
import "generic-host"
address = "192.168.0.239"
}

object CheckCommand "netgear" {
command = [ PluginDir + "/check_netgear" ]
arguments = {
"-base-url" = "$netgear_base_url$"
"-username" = {
value = "$netgear_username$"
required = true
}
"-password" = {
value = "$netgear_password$"
required = true
}
}
}

apply Service "netgear-status" {
import "generic-service"

check_command = "netgear"
vars.netgear_base_url = "http://192.168.0.239"
vars.netgear_username = "admin"
vars.netgear_password = "password"

assign where host.name == "netgear-switch"
}

@oxzi
Copy link
Member

oxzi commented Mar 11, 2026

@DsgnrFH: Please communicate the changes you have done to address review comments. Just add a comment in each thread to say that you have addressed it, and, if non obvious, how and where you did so.

@DsgnrFH
Copy link
Author

DsgnrFH commented Mar 11, 2026

Waiting for the checks to complete...

@DsgnrFH DsgnrFH requested a review from Al2Klimov March 12, 2026 07:37
@Al2Klimov Al2Klimov dismissed their stale review March 12, 2026 13:19

OP addressed review

@Al2Klimov Al2Klimov requested a review from oxzi March 12, 2026 13:19
Copy link
Member

@oxzi oxzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before merging, please squash all your commits.

@Al2Klimov
Copy link
Member

Actually, right to "Enable auto-merge", there's a dropdown allowing to "Squash and merge". We already did this with #9062.

@Al2Klimov Al2Klimov dismissed their stale review March 13, 2026 12:20

OP addressed review

@DsgnrFH DsgnrFH force-pushed the feature/netgear-checkcommand branch from 0dafc66 to 3df9b2f Compare March 16, 2026 16:44
@DsgnrFH
Copy link
Author

DsgnrFH commented Mar 16, 2026

Commits squashed, ready to merge or further reviews

@Al2Klimov Al2Klimov self-requested a review March 17, 2026 10:10
Copy link
Member

@Al2Klimov Al2Klimov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test

object Service "netgear" {
  host_name = NodeName
  check_command = "netgear"

  vars.netgear_base_url = "http://$check_address$"
  vars.netgear_username = "admin"
  vars.netgear_password = "password"
}

works:

states: critical=1
\_  Device Info: Uptime - 0 days, 4 hrs, 9 mins, 32 secs
    \_  CPU Usage: 4.81%
    \_  RAM Usage: 32.77%
    \_  Temperature
        \_  sensor-System1: 32.0°C
        \_  sensor-MAC: 33.0°C
        \_  sensor-System2: 31.0°C
    \_  Fans
        \_  FAN-1: 5118 RPM

E.g vars.netgear_fan_critical = 9000 also works:

states: warning=1
\_  Device Info: Uptime - 0 days, 4 hrs, 12 mins, 20 secs
    \_  CPU Usage: 5.39%
    \_  RAM Usage: 32.77%
    \_  Temperature
        \_  sensor-System1: 32.0°C
        \_  sensor-MAC: 33.0°C
        \_  sensor-System2: 31.0°C
    \_  Fans
        \_  FAN-1: 5118 RPM


Name | Description
-----------------------------|----------------------------------------------------------------------------------
netgear\_base\_url | **Required.** Base URL of the NETGEAR API (example: "http://$check_address$").
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
netgear\_base\_url | **Required.** Base URL of the NETGEAR API (example: "http://$check_address$").
netgear\_base\_url | **Required.** Base URL of the NETGEAR API (example: `http://$check_address$`).

@Al2Klimov Al2Klimov requested review from TheSyscall and oxzi March 17, 2026 15:42
repeat_key = true
}
"-noperfdata" = {
set_if = "$netgear_noperfdata$"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
set_if = "$netgear_noperfdata$"
set_if = "$netgear_hide_perfdata$"

netgear\_fan\_critical | **Optional.** Fan speed critical threshold (default: 5000).
netgear\_stats\_warning | **Optional.** Port statistics warning threshold (default: 5).
netgear\_stats\_critical | **Optional.** Port statistics critical threshold (default: 20).
netgear\_mode | **Optional.** Output modes to enable `{basic|ports|poe|all}` (repeatable). Default: `basic`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit weird, and not on your part. It seems like GitHub's Markdown render now cannot handle a | within a monospace code. Consider the following rendered output:

Image

I was able to reproduce this in this very text box.

| a | b
----|------
| a | `a|b`

Results in:

a b
a `a

Thus, maybe change this line as follows:

Suggested change
netgear\_mode | **Optional.** Output modes to enable `{basic|ports|poe|all}` (repeatable). Default: `basic`.
netgear\_mode | **Optional.** Output modes to enable. Array of `basic`, `ports`, `poe`, `all`. Default: `[ "basic" ]`.

netgear\_stats\_warning | **Optional.** Port statistics warning threshold (default: 5).
netgear\_stats\_critical | **Optional.** Port statistics critical threshold (default: 20).
netgear\_mode | **Optional.** Output modes to enable `{basic|ports|poe|all}` (repeatable). Default: `basic`.
netgear\_ports | **Optional.** Ports to check (repeatable). Default: `1,2,3,4,5,6,7,8`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
netgear\_ports | **Optional.** Ports to check (repeatable). Default: `1,2,3,4,5,6,7,8`.
netgear\_ports | **Optional.** Ports to check as an array. Default: `[ 1,2,3,4,5,6,7,8 ]`.

@Al2Klimov Al2Klimov removed the request for review from TheSyscall March 18, 2026 13:24
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.

4 participants