iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Need a server to try this on? Antihost offers Linux VPS plans with NVMe storage, full root access and a 14-day free trial.
To send Nagios notifications to Alerta on Ubuntu, install the nagios-alerta bridge, give it an Alerta API key with write:alerts, store that key in Nagios’ protected resource file, and attach host and service notification commands to a contact. After reloading Nagios, a synthetic WARNING should appear in the Alerta web interface and in a resource-filtered CLI query.
How the Nagios-to-Alerta path works
Nagios Core remains responsible for checking hosts and services, deciding when a state change warrants notification, and expanding its macros. The alerta-nagios event-handler script translates that notification into an Alerta alert and submits it to the Alerta API. Alerta then stores, correlates, displays, and routes the alert according to its own rules.
Free tools Windows power users keep installed
One-click scans. No signup required.
The data path is therefore:
- Nagios performs a host or service check.
- The check reaches a notification state such as WARNING, CRITICAL, UNKNOWN, or DOWN.
- Nagios invokes a host or service notification command for an eligible contact.
alerta-nagiosmaps the Nagios values and sends an API request.- Alerta accepts the request if the endpoint and key are valid, then exposes the alert in its UI and query interface.
A failed check and a failed notification are different problems. Nagios can show a problem correctly while the bridge is unable to authenticate or reach Alerta, so troubleshooting must examine both systems.
Requirements and compatibility
Prepare every item in this table before changing production notification rules.
#1 Best Overall
- Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
- With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
- Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
- Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
- Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.
| Requirement | What to verify | Why it matters |
|---|---|---|
| Nagios Core | Version 4.x or later, running on the Ubuntu host | The integration is designed for Nagios Core 4 notification macros and command processing. |
| Ubuntu installation | A supported Ubuntu release with the Nagios configuration layout identified for that release | Package names and paths can vary between Ubuntu releases. |
| Alerta server | Running and reachable from the Nagios host | The bridge must make an API request over the network. |
| Alerta credentials | An API key that includes write:alerts |
A read-only key cannot create Nagios alerts. |
| Python | Python 3.6 or later on the Nagios host | The nagios-alerta package requires a current Python 3 runtime. |
| Network policy | Outbound access from the Nagios host to the Alerta API, including the API port | DNS, firewall, proxy, or TLS interception problems can prevent delivery even when local commands are correct. |
Canonical’s Ubuntu Nagios guide uses the nagios4 and nagios-nrpe-plugin packages and keeps core configuration under /etc/nagios4. Confirm the exact package and path names for the Ubuntu release you are deploying; do not assume that a path from one release exists unchanged on another.
Install and verify Nagios Core on Ubuntu
Install the Ubuntu packages
If Nagios is not already installed, the package-based starting point is:
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →sudo apt update
sudo apt install nagios4 nagios-nrpe-plugin
The NRPE plugin is not required by the Alerta bridge itself, but it is included in Canonical’s standard Nagios Core installation procedure and is commonly needed when checks run on remote Linux hosts.
Confirm the service and configuration path
sudo systemctl status nagios
ls -la /etc/nagios4
sudo find /etc/nagios4 -maxdepth 3 -type f | sort
Some installations use a split layout in which object files are under a directory such as /etc/nagios/objects, while the Ubuntu package commonly references /etc/nagios4. Use the paths named by the active nagios.cfg rather than copying a path blindly from another server.
Validate before adding notifications
Run Nagios’ configuration check with the binary and main configuration file supplied by your package. A typical Ubuntu package check is:
sudo nagios4 -v /etc/nagios4/nagios.cfg
Do not reload until the validation ends without errors. Warnings may be acceptable only when you understand them; an undefined command, contact, macro, or object prevents a reliable notification test.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchInstall the nagios-alerta bridge
Install the Python package on the same host that runs Nagios. Use the Python environment that will own the executable:
python3 --version
python3 -m pip install nagios-alerta
which alerta-nagios
alerta-nagios --help
The integration requires Python 3.6 or later. If your distribution separates system packages from administrator-installed packages, use the packaging method approved for that Ubuntu release, or install into a dedicated virtual environment and reference that environment’s executable in the Nagios command definition. The important check is that the Nagios service account can execute the exact path returned by which alerta-nagios.
Record the path rather than assuming /usr/local/bin/alerta-nagios. A virtual-environment installation, a distribution package, and a user-local pip installation can place the script in different directories. Test the command as the account that Nagios uses, not only as your interactive shell user.
Rank #2
- Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
- Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
- Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
- Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
- Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth
Configure the Alerta endpoint and protect the API key
Create the bridge configuration
The integration can read an endpoint and key from an Alerta configuration file. Create /etc/nagios/alerta.conf with an [alerta] section. Use the API base endpoint required by your Alerta deployment and keep the key out of shared command definitions.
[alerta]
endpoint = https://ALERTA_API_HOST/api
key = ALERTA_WRITE_KEY
ALERTA_API_HOST and ALERTA_WRITE_KEY above represent the values for your installation; replace them with the real endpoint and key in the file. If your deployment uses a non-default API path or a proxy, use the endpoint documented by that Alerta server. Do not append an arbitrary path or assume that the web UI URL is the API URL.
Set restrictive permissions
sudo chown root:nagios /etc/nagios/alerta.conf
sudo chmod 640 /etc/nagios/alerta.conf
sudo -u nagios test -r /etc/nagios/alerta.conf
The final test must succeed for the account that executes notifications. If your service uses a different group or account, adjust ownership to the local policy. A file that is readable only by root causes a confusing failure: an administrator can run the script successfully while Nagios cannot.
Alternative command-line credentials
The tutorial also supports passing the endpoint and key as command-line options. This is useful for a one-off diagnostic, but it exposes the key through process listings, shell history, job logs, or Nagios configuration backups. Prefer the protected configuration file for normal operation. If you must use command-line credentials temporarily, remove them after the test and rotate the key if it may have been exposed.
Define Nagios notification commands
Nagios needs separate commands for service notifications and host notifications because their macros differ. Put the definitions in the commands file included by your active configuration, commonly /etc/nagios/objects/commands.cfg or the equivalent file under /etc/nagios4.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
The bridge needs values for the environment, resource, service, state, event, and plugin output. The following template shows the required mapping with standard Nagios macros. Option spelling can differ between integration releases, so compare the flags with the output of alerta-nagios --help installed on your host before reloading.
Service notification command
define command {
command_name notify-service-by-alerta
command_line /usr/local/bin/alerta-nagios --environment "$ _HOSTALERTA_ENV$" --resource "$HOSTNAME$" --service "$SERVICEDESC$" --state "$SERVICESTATE$" --event "$NOTIFICATIONTYPE$" --output "$SERVICEOUTPUT$"
}
Remove the space between the dollar sign and macro name if you copy the example; it is shown separated here only to keep the macro visually distinct in prose. A production command must contain the normal Nagios macro form, for example $_HOSTALERTA_ENV$. If your integration release uses short options rather than the descriptive long options shown above, substitute the names reported by --help while preserving the same six values.
Define the environment as a host custom variable or another controlled value. Keeping it in configuration rather than hard-coding “production” into every command makes it harder to send a development alert into a production Alerta environment by mistake.
Host notification command
define command {
command_name notify-host-by-alerta
command_line /usr/local/bin/alerta-nagios --environment "$ _HOSTALERTA_ENV$" --resource "$HOSTNAME$" --state "$HOSTSTATE$" --event "$NOTIFICATIONTYPE$" --output "$HOSTOUTPUT$"
}
Host notifications do not have a service description. They use the host state and host output instead. Keep the resource as the host name so that host and service alerts can be correlated in Alerta.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Rank #3
- 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
- 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
- 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
- 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
- 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.
Use the installed executable path
Replace /usr/local/bin/alerta-nagios with the path returned by which alerta-nagios if they differ. Nagios services often have a smaller PATH than an interactive login shell, so an unqualified alerta-nagios may work at a prompt and fail when invoked by Nagios.
Keep credentials out of command definitions
If your chosen integration syntax requires a key argument, reference a Nagios resource macro rather than typing the key into commands.cfg. In /etc/nagios/resource.cfg, add a protected macro such as:
$USER10$=ALERTA_WRITE_KEY
Then reference $USER10$ in the command definition according to the integration’s documented key option. Restrict the resource file to the Nagios administrator and service account. The bridge configuration file and the resource file should not be world-readable, committed to a public configuration repository, or included in routine support bundles without redaction.
Attach the commands to a contact
Defining a command does nothing until a contact or contact group uses it. Add both notification commands to the contact that should receive Alerta events, then choose notification periods and options that match your operating policy.
define contact {
contact_name alerta-notifications
use generic-contact
host_notification_commands notify-host-by-alerta
service_notification_commands notify-service-by-alerta
host_notification_period 24x7
service_notification_period 24x7
}
The exact contact template names vary by the object files installed on your Ubuntu system. The material points are the two command names and the notification periods. If you use a contact group, ensure the group is assigned to the relevant hosts and services through their hostgroups, servicegroups, or explicit contact assignments.
Notification options still apply. A contact that is limited to recovery notifications will not receive the initial WARNING. A contact restricted to particular service states will not receive UNKNOWN or CRITICAL events. Check the effective host and service definitions rather than assuming that adding a command to a contact automatically enables every state.
Validate and reload Nagios safely
- Run the configuration validator against the active main configuration file.
- Fix every error involving command names, macro syntax, contact assignments, or object includes.
- Confirm that the Nagios service account can read the Alerta configuration and execute the bridge.
- Reload Nagios so the new command and contact definitions become active.
sudo nagios4 -v /etc/nagios4/nagios.cfg
sudo systemctl reload nagios
If your package uses a different binary or service unit, use the names shown by systemctl status and the package documentation. A reload preserves the running daemon while applying configuration; restarting is not necessary merely to add notification commands.
Send a synthetic WARNING and verify delivery
Run a development test
Use the bridge directly before waiting for a real outage. Supply a development environment, a test resource such as web01, a service name, the WARNING state, an event value, and recognizable output such as “Test alert from Nagios.” The installed script’s help output is authoritative for the exact long or short option names.
alerta-nagios --environment dev --resource web01 --service HTTP --state WARNING --event PROBLEM --output "Test alert from Nagios"
If your version uses short flags, translate the same fields to its documented syntax rather than guessing. Run the command as the Nagios service account when possible so file permissions and network access match a real notification:
Rank #4
- 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
- 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
- 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
- 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
- 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.
sudo -u nagios /usr/local/bin/alerta-nagios --help
sudo -u nagios /usr/local/bin/alerta-nagios --environment dev --resource web01 --service HTTP --state WARNING --event PROBLEM --output "Test alert from Nagios"
Check the Alerta web interface
Open the Alerta UI for the development environment and search for resource web01. Confirm that the alert has the expected resource, service, severity, environment, event, and text. A visible alert proves that the API accepted the request; it does not by itself prove that Nagios invoked the command, which is why the direct test and a real notification test are separate steps.
Query from the CLI
alerta query --filter resource=web01
The query should return the synthetic alert. If several tests use the same resource, distinguish them by service, timestamp, or output text. After the direct test succeeds, force or schedule a controlled Nagios WARNING and confirm that the command definition produces the same result.
Clean up test data
Close, acknowledge, or remove the test alert according to your Alerta operating procedure, and return the test service to its normal state. Keep development and production environment names distinct so a test cannot be mistaken for an incident.
Recommended Free Tools
Severity and state mapping
The integration converts Nagios states into Alerta severities as follows:
| Nagios condition | Alerta severity | Applies to |
|---|---|---|
| CRITICAL | critical |
Service notifications |
| WARNING | warning |
Service notifications |
| UNKNOWN | indeterminate |
Service notifications |
| OK | normal |
Service recovery notifications |
| DOWN | major |
Host notifications |
| UP | normal |
Host recovery notifications |
This mapping preserves the difference between a service that is degraded, a service that is failing, and a host that is unreachable. Do not rewrite all states to one generic severity in a wrapper unless your incident policy explicitly requires that loss of fidelity.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Production hardening and operating choices
Protect secrets and reduce exposure
- Keep the API key in
resource.cfgor the protected Alerta configuration file, not in a public command definition. - Use the least-privileged key that can create alerts: it needs
write:alerts, not broad administrative rights. - Restrict file ownership and permissions, and rotate the key if it appears in shell history, process output, logs, or a backup.
- Use the Alerta endpoint’s intended TLS configuration and verify certificate trust from the Nagios host.
Separate environments
Tag development, staging, and production notifications explicitly. Test with dev first, then run a controlled production test only during an approved window. A shared resource name such as web01 is safe only when the environment field prevents collisions.
Choose direct notifications or an event broker
The notification-command design described here is straightforward: Nagios calls the bridge when a contact is eligible for a notification. Alerta’s integrations reference also describes a Nagios Event Broker option that forwards host and service check results and can suppress events during downtime. Consider that design when you need check-result-level integration or centralized suppression. Compare the choices on host versus service coverage, credential storage, environment tagging, state fidelity, and how operators verify delivery.
| Decision axis | Notification commands | Event Broker approach |
|---|---|---|
| Trigger | Runs when Nagios sends a contact notification | Forwards check results through the broker |
| Downtime behavior | Depends on Nagios notification suppression and contact rules | Integration can apply suppression during downtime |
| Configuration effort | Commands, contacts, macros, and reload | Broker module installation and broker-specific configuration |
| Credential handling | Resource file or bridge configuration | Still requires secure API credentials |
| Verification | Direct bridge test, Nagios notification, UI, or CLI query | Check-result flow plus the same Alerta verification |
Start with notification commands when you need alerts only for Nagios notifications and want the smallest change. Evaluate the broker when suppression and check-result coverage are central requirements.
Plan for duplicate and recovery events
Nagios may notify repeatedly while a problem remains active, depending on notification intervals and escalation rules. Configure those Nagios policies deliberately and use Alerta’s environment, resource, and service fields consistently so repeated events correlate with the intended alert. Recovery notifications should use the same resource and service identifiers as the problem notification, allowing Alerta to mark the alert normal rather than creating an unrelated record.
Best Value
- 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
- 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
- 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
- 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
- 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.
Troubleshooting by symptom
which alerta-nagios returns nothing
The package was installed into a different Python environment, or its scripts directory is not on your shell’s PATH. Locate the environment’s bin directory, run python3 -m pip show nagios-alerta, and put the absolute executable path in command_line. Then test that path as the Nagios service account.
Nagios reports an unknown command
The commands file is not included, the command name does not exactly match the contact definition, or Nagios was not reloaded after the file changed. Run the validator and inspect the active nagios.cfg for the relevant cfg_file or cfg_dir entry.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsThe command runs manually but not from Nagios
Compare the interactive user with the Nagios service account. Check execute permission on every parent directory, read permission on alerta.conf or resource.cfg, and the absolute executable path. Also check whether the service account inherits a proxy, CA bundle, or environment variable that your login shell provides.
Alerta returns an authorization error
Verify that the key is the one loaded by the bridge and that it has write:alerts. A key that can query alerts but cannot create them is insufficient. Check for whitespace copied into the key, an unreadable configuration file, or an unintended command-line value overriding the file.
The endpoint cannot be reached
Resolve the Alerta hostname from the Nagios host, test the configured port through the firewall, and inspect proxy and TLS settings. Confirm that the endpoint is the API endpoint rather than only the Alerta web UI address. Review the bridge’s stderr output and the Nagios service log for the underlying connection or certificate error.
The alert appears with the wrong severity or fields
Inspect the macro values passed by Nagios. Service commands must use service macros such as $SERVICESTATE$ and $SERVICEOUTPUT$; host commands must use $HOSTSTATE$ and $HOSTOUTPUT$. Verify that the event, environment, resource, and service arguments are not swapped and that shell quoting preserves spaces in plugin output.
Recommended Free Tools
The direct test works but a real WARNING does not
Check notification eligibility: the service may be in a scheduled downtime, notifications may be disabled, the contact may not be assigned, or the contact’s notification options may exclude WARNING. Review the service’s notification interval and period, then force a controlled state change and inspect the Nagios log for the notification command invocation.
A repeatable deployment checklist
- Nagios Core 4.x or later is installed and its active configuration path is known.
- Python 3.6 or later and
nagios-alertaare installed on the Nagios host. which alerta-nagiosidentifies an executable path usable by the Nagios account.- The Alerta endpoint is reachable and the API key includes
write:alerts. - The key is stored in a protected configuration or resource file.
- Host and service commands pass the correct environment, resource, state, event, and output fields.
- The commands are attached to an active contact or contact group.
- The configuration validator completes without errors before reload.
- A development WARNING test appears in the Alerta UI and in
alerta query --filter resource=web01. - A controlled Nagios-generated notification produces the same result, and the test alert is closed afterward.
Once those checks pass, Nagios can continue to own monitoring and notification policy while Alerta provides a centralized view of host and service events. Keep the bridge executable path, key location, environment convention, and verification query in your operations runbook so upgrades and incident troubleshooting do not depend on one administrator’s shell history.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

