Áú»¢¶Ä²©

OpenBSD

OpenBSD is a security-focused, free and open-source, Unix-like operating system based on the Berkeley Software Distribution. Theo de Raadt created OpenBSD in 1995 by forking NetBSD.

Available solutions




This template is for Áú»¢¶Ä²© version: 7.2
Also available for: 7.0 6.4 6.2 6.0

Source:

OpenBSD by Áú»¢¶Ä²© agent

Overview

This is an Official OpenBSD template. It requires Áú»¢¶Ä²© agent 7.2 or newer.

Notes on filesystem (FS) discovery:

  • The ext4/3/2 FS reserves space for privileged usage, typically set at 5% by default.
  • BTRFS allocates a default of 10% of the volume for its own needs.
  • To mitigate potential disasters, FS usage triggers are based on the maximum available space.
    • Utilization formula: pused = 100 - 100 * (available / total - free + available)
  • The FS utilization chart, derived from graph prototypes, reflects FS reserved space as the difference between used and available space from the total volume.

Requirements

Áú»¢¶Ä²© version: 7.2 and higher.

Tested versions

This template has been tested on:

  • OpenBSD

Configuration

Áú»¢¶Ä²© should be configured according to the instructions in the Templates out of the box section.

Setup

Install Áú»¢¶Ä²© agent on OpenBSD according to Áú»¢¶Ä²© documentation.

Macros used

Name Description Default
{$AGENT.TIMEOUT}

Timeout after which the agent is considered unavailable. Works only for agents reachable from Áú»¢¶Ä²© server/proxy (in passive mode).

3m
{$VFS.FS.FSNAME.NOT_MATCHES}

Used for filesystem discovery. Can be overridden on the host or linked template level.

^(/dev|/sys|/run|/proc|.+/shm$)
{$VFS.FS.FSNAME.MATCHES}

Used for filesystem discovery. Can be overridden on the host or linked template level.

.+
{$VFS.FS.FSTYPE.MATCHES}

Used for filesystem discovery. Can be overridden on the host or linked template level.

Macro too long. Please see the template.
{$VFS.FS.FSTYPE.NOT_MATCHES}

Used for filesystem discovery. Can be overridden on the host or linked template level.

^\s$
{$VFS.FS.INODE.PFREE.MIN.CRIT}

The critical threshold of the filesystem metadata utilization.

10
{$VFS.FS.INODE.PFREE.MIN.WARN}

The warning threshold of the filesystem metadata utilization.

20
{$VFS.FS.PUSED.MAX.CRIT}

The critical threshold of the filesystem utilization.

90
{$VFS.FS.PUSED.MAX.WARN}

The warning threshold of the filesystem utilization.

80

Items

Name Description Type Key and additional info
Maximum number of opened files

May be increased by using the sysctl utility or modifying the file /etc/sysctl.conf.

Áú»¢¶Ä²© agent kernel.maxfiles
Maximum number of processes

May be increased by using the sysctl utility or modifying the file /etc/sysctl.conf.

Áú»¢¶Ä²© agent kernel.maxproc
Number of running processes

The number of processes in a running state.

Áú»¢¶Ä²© agent proc.num[,,run]
Number of processes

The total number of processes in any state.

Áú»¢¶Ä²© agent proc.num[]
Host boot time Áú»¢¶Ä²© agent system.boottime
Interrupts per second

Number of interrupts processed.

Áú»¢¶Ä²© agent system.cpu.intr

Preprocessing

  • Change per second:
Processor load (1 min average per core)

Calculated as the system CPU load divided by the number of CPU cores.

Áú»¢¶Ä²© agent system.cpu.load[percpu,avg1]
Processor load (5 min average per core)

Calculated as the system CPU load divided by the number of CPU cores.

Áú»¢¶Ä²© agent system.cpu.load[percpu,avg5]
Processor load (15 min average per core)

Calculated as the system CPU load divided by the number of CPU cores.

Áú»¢¶Ä²© agent system.cpu.load[percpu,avg15]
Context switches per second

The combined rate at which all processors on the computer are switched from one thread to another.

Áú»¢¶Ä²© agent system.cpu.switches

Preprocessing

  • Change per second:
CPU idle time

Time the CPU has spent doing nothing.

Áú»¢¶Ä²© agent system.cpu.util[,idle]
CPU interrupt time

Time the CPU has spent servicing hardware interrupts.

Áú»¢¶Ä²© agent system.cpu.util[,interrupt]
CPU nice time

Time the CPU has spent running users' processes that have been niced.

Áú»¢¶Ä²© agent system.cpu.util[,nice]
CPU system time

Time the CPU has spent running the kernel and its processes.

Áú»¢¶Ä²© agent system.cpu.util[,system]
CPU user time

Time the CPU has spent running users' processes that are not niced.

Áú»¢¶Ä²© agent system.cpu.util[,user]
CPU spin time

Time the CPU has spent spinning on a lock.

Áú»¢¶Ä²© agent system.cpu.util[,spin]
Host name

The host name of the system.

Áú»¢¶Ä²© agent system.hostname

Preprocessing

  • Discard unchanged with heartbeat: 1d

Host local time

The local system time of the host.

Áú»¢¶Ä²© agent system.localtime
Free swap space

The free space of the swap volume/file expressed in bytes.

Áú»¢¶Ä²© agent system.swap.size[,free]
Free swap space in %

The free space of the swap volume/file expressed in %.

Áú»¢¶Ä²© agent system.swap.size[,pfree]
Total swap space

Total space of the swap volume/file expressed in bytes.

Áú»¢¶Ä²© agent system.swap.size[,total]
System information

Information as normally returned by uname -a.

Áú»¢¶Ä²© agent system.uname

Preprocessing

  • Discard unchanged with heartbeat: 1d

System uptime Áú»¢¶Ä²© agent system.uptime
Number of logged in users

The number of users who are currently logged in.

Áú»¢¶Ä²© agent system.users.num
Checksum of /etc/passwd Áú»¢¶Ä²© agent vfs.file.cksum[/etc/passwd,sha256]

Preprocessing

  • Discard unchanged with heartbeat: 1h

Available memory

Defined as free + cached + buffers.

Áú»¢¶Ä²© agent vm.memory.size[available]
Total memory

Total memory expressed in bytes.

Áú»¢¶Ä²© agent vm.memory.size[total]
Version of Áú»¢¶Ä²© agent running Áú»¢¶Ä²© agent agent.version

Preprocessing

  • Discard unchanged with heartbeat: 1d

Host name of Áú»¢¶Ä²© agent running Áú»¢¶Ä²© agent agent.hostname

Preprocessing

  • Discard unchanged with heartbeat: 1d

Áú»¢¶Ä²© agent ping

The agent always returns "1" for this item. May be used in combination with nodata() for the availability check.

Áú»¢¶Ä²© agent agent.ping
Áú»¢¶Ä²© agent availability

Used for monitoring the availability status of the agent.

Áú»¢¶Ä²© internal zabbix[host,agent,available]
Get filesystems

The vfs.fs.get key acquires raw information set about the filesystems. Later to be extracted by preprocessing in dependent items.

Áú»¢¶Ä²© agent vfs.fs.get

Triggers

Name Description Expression Severity Dependencies and additional info
OpenBSD: Configured max number of opened files is too low on {HOST.NAME} last(/OpenBSD by Áú»¢¶Ä²© agent/kernel.maxfiles)<1024 Info
OpenBSD: Configured max number of processes is too low on {HOST.NAME} last(/OpenBSD by Áú»¢¶Ä²© agent/kernel.maxproc)<256 Info
OpenBSD: Too many processes running on {HOST.NAME} avg(/OpenBSD by Áú»¢¶Ä²© agent/proc.num[,,run],5m)>30 Warning
OpenBSD: Too many processes on {HOST.NAME} avg(/OpenBSD by Áú»¢¶Ä²© agent/proc.num[],5m)>300 Warning
OpenBSD: Processor load is too high on {HOST.NAME} avg(/OpenBSD by Áú»¢¶Ä²© agent/system.cpu.load[percpu,avg1],5m)>5 Warning
OpenBSD: Hostname was changed on {HOST.NAME} last(/OpenBSD by Áú»¢¶Ä²© agent/system.hostname,#1)<>last(/OpenBSD by Áú»¢¶Ä²© agent/system.hostname,#2) Info
OpenBSD: Lack of free swap space on {HOST.NAME}

It probably means that the systems requires more physical memory.

last(/OpenBSD by Áú»¢¶Ä²© agent/system.swap.size[,pfree])<50 Warning
OpenBSD: Host information was changed on {HOST.NAME} last(/OpenBSD by Áú»¢¶Ä²© agent/system.uname,#1)<>last(/OpenBSD by Áú»¢¶Ä²© agent/system.uname,#2) Info
OpenBSD: {HOST.NAME} has just been restarted change(/OpenBSD by Áú»¢¶Ä²© agent/system.uptime)<0 Info
OpenBSD: /etc/passwd has been changed on {HOST.NAME} last(/OpenBSD by Áú»¢¶Ä²© agent/vfs.file.cksum[/etc/passwd,sha256],#1)<>last(/OpenBSD by Áú»¢¶Ä²© agent/vfs.file.cksum[/etc/passwd,sha256],#2) Warning
OpenBSD: Lack of available memory on server {HOST.NAME} last(/OpenBSD by Áú»¢¶Ä²© agent/vm.memory.size[available])<20M Average
OpenBSD: Áú»¢¶Ä²© agent is not available

For passive checks only; the availability of the agent(s) and a host is used with {$AGENT.TIMEOUT} as the time threshold.

max(/OpenBSD by Áú»¢¶Ä²© agent/zabbix[host,agent,available],{$AGENT.TIMEOUT})=0 Average Manual close: Yes

LLD rule Network interface discovery

Name Description Type Key and additional info
Network interface discovery

Used for the discovery of network interfaces.

Áú»¢¶Ä²© agent net.if.discovery

Item prototypes for Network interface discovery

Name Description Type Key and additional info
Interface {#IFNAME}: Incoming network traffic Áú»¢¶Ä²© agent net.if.in[{#IFNAME}]

Preprocessing

  • Change per second:
  • Custom multiplier: 8

Interface {#IFNAME}: Outgoing network traffic Áú»¢¶Ä²© agent net.if.out[{#IFNAME}]

Preprocessing

  • Change per second:
  • Custom multiplier: 8

LLD rule Mounted filesystem discovery

Name Description Type Key and additional info
Mounted filesystem discovery

The discovery of mounted filesystems with different types.

Dependent item vfs.fs.dependent.discovery

Preprocessing

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

  • Discard unchanged with heartbeat: 1h

Item prototypes for Mounted filesystem discovery

Name Description Type Key and additional info
FS [{#FSNAME}]: Get data

Intermediate data of {#FSNAME} filesystem.

Dependent item vfs.fs.dependent[{#FSNAME},data]

Preprocessing

  • JSON Path: $.[?(@.fsname=='{#FSNAME}')].first()

FS [{#FSNAME}]: Option: Read-only

The filesystem is mounted as read-only. It is available only for Áú»¢¶Ä²© agents 6.4 and higher.

Dependent item vfs.fs.dependent[{#FSNAME},readonly]

Preprocessing

  • JSON Path: $.options

    ??Custom on fail: Discard value

  • Regular expression: `(?:^

FS [{#FSNAME}]: Inodes: Free, in %

Free metadata space expressed in %.

Dependent item vfs.fs.dependent.inode[{#FSNAME},pfree]

Preprocessing

  • JSON Path: $.inodes.pfree

FS [{#FSNAME}]: Space: Available

Available storage space expressed in bytes.

Dependent item vfs.fs.dependent.size[{#FSNAME},free]

Preprocessing

  • JSON Path: $.bytes.free

FS [{#FSNAME}]: Space: Available, in %

Deprecated metric.

Space availability expressed as a percentage, calculated using the current and maximum available spaces.

Dependent item vfs.fs.dependent.size[{#FSNAME},pfree]

Preprocessing

  • JSON Path: $.bytes.pfree

FS [{#FSNAME}]: Space: Used, in %

Calculated as the percentage of currently used space compared to the maximum available space.

Dependent item vfs.fs.dependent.size[{#FSNAME},pused]

Preprocessing

  • JSON Path: $.bytes.pused

FS [{#FSNAME}]: Space: Total

Total space expressed in bytes.

Dependent item vfs.fs.dependent.size[{#FSNAME},total]

Preprocessing

  • JSON Path: $.bytes.total

FS [{#FSNAME}]: Space: Used

Used storage expressed in bytes.

Dependent item vfs.fs.dependent.size[{#FSNAME},used]

Preprocessing

  • JSON Path: $.bytes.used

Trigger prototypes for Mounted filesystem discovery

Name Description Expression Severity Dependencies and additional info
OpenBSD: FS [{#FSNAME}]: Filesystem has become read-only

The filesystem has become read-only, possibly due to an I/O error. Available only for Áú»¢¶Ä²© agents 6.4 and higher.

last(/OpenBSD by Áú»¢¶Ä²© agent/vfs.fs.dependent[{#FSNAME},readonly],#2)=0 and last(/OpenBSD by Áú»¢¶Ä²© agent/vfs.fs.dependent[{#FSNAME},readonly])=1 Average Manual close: Yes
OpenBSD: FS [{#FSNAME}]: Running out of free inodes

Disk writing may fail if index nodes are exhausted, leading to error messages like "No space left on device" or "Disk is full", despite available free space.

min(/OpenBSD by Áú»¢¶Ä²© agent/vfs.fs.dependent.inode[{#FSNAME},pfree],5m)<{$VFS.FS.INODE.PFREE.MIN.CRIT:"{#FSNAME}"} Average
OpenBSD: FS [{#FSNAME}]: Running out of free inodes

Disk writing may fail if index nodes are exhausted, leading to error messages like "No space left on device" or "Disk is full", despite available free space.

min(/OpenBSD by Áú»¢¶Ä²© agent/vfs.fs.dependent.inode[{#FSNAME},pfree],5m)<{$VFS.FS.INODE.PFREE.MIN.WARN:"{#FSNAME}"} Warning Depends on:
  • OpenBSD: FS [{#FSNAME}]: Running out of free inodes
OpenBSD: FS [{#FSNAME}]: Space is critically low

The volume's space usage exceeds the {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}% limit.
The trigger expression is based on the current used and maximum available spaces.
Event name represents the total volume space, which can differ from the maximum available space, depending on the filesystem type.

min(/OpenBSD by Áú»¢¶Ä²© agent/vfs.fs.dependent.size[{#FSNAME},pused],5m)>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} Average Manual close: Yes
OpenBSD: FS [{#FSNAME}]: Space is low

The volume's space usage exceeds the {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}% limit.
The trigger expression is based on the current used and maximum available spaces.
Event name represents the total volume space, which can differ from the maximum available space, depending on the filesystem type.

min(/OpenBSD by Áú»¢¶Ä²© agent/vfs.fs.dependent.size[{#FSNAME},pused],5m)>{$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"} Warning Manual close: Yes
Depends on:
  • OpenBSD: FS [{#FSNAME}]: Space is critically low

Feedback

Please report any issues with the template at

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

Articles and documentation

+ Propose new article

Didn't find what you are looking for?