{"id":7216,"date":"2022-11-04T11:13:27","date_gmt":"2022-11-04T11:13:27","guid":{"rendered":"https:\/\/blog.ssdnodes.com\/blog\/?p=7216"},"modified":"2025-05-18T12:37:17","modified_gmt":"2025-05-18T12:37:17","slug":"how-to-configure-zabbix-notifications","status":"publish","type":"post","link":"https:\/\/www.ssdnodes.com\/blog\/how-to-configure-zabbix-notifications\/","title":{"rendered":"How to Configure Zabbix Notifications"},"content":{"rendered":"<h1>How to Configure Zabbix Notifications<\/h1>\n<h2>Introduction<\/h2>\n<p>Zabbix is an open-source software that monitors the availability and performance of IT infrastructure components. Zabbix server can be installed on any Linux distribution.<\/p>\n<\/p>\n<p>Zabbix provides real-time monitoring of thousands of metric data that it fetches from servers, virtual machines, network devices, and web applications. Analyzing the data Zabbix gathers will give you a general idea of the health of your servers and web applications, in addition to helping you detect potential problems before your users report them.<\/p>\n<p>Zabbix has several methods for collecting metrics. These include agentless monitoring of user services and client-server architecture.<\/p>\n<p>To monitor a server and collect data from it, Zabbix uses an <em>agent<\/em> that gathers data from different services and sends it to the Zabbix monitoring server. Zabbix supports encrypted communication between the monitoring server and its monitored clients. This ensures that your data is transferred securely over the network.<\/p>\n<p>Zabbix provides a web interface that allows you to monitor your servers (also known as Zabbix clients) and their internal services and manage system settings.<\/p>\n<p>In this tutorial, you will set up email notifications for monitoring a server with Zabbix.<\/p>\n<h2>Prerequisites<\/h2>\n<p>To follow this tutorial, you need:<\/p>\n<ul>\n<li>A <em>Zabbix monitoring server<\/em> that will have the Zabbix server installed. See <a href=\"https:\/\/www.ssdnodes.com\/blog\/how-to-install-zabbix-on-ubuntu-22-04\/\">How to Install Zabbix on Ubuntu 22.04<\/a> for our guide to learn how to install Zabbix.<\/li>\n<li>A <em>Zabbix monitored client<\/em> that will have the Zabbix agent installed and will be monitored using the Zabbix web interface that's installed on the <em>monitoring server<\/em>. See our <a href=\"https:\/\/www.ssdnodes.com\/blog\/how-to-use-zabbix-to-monitor-an-ubuntu-server\/\">How to Use Zabbix to Monitor an Ubuntu Server<\/a> guide to learn how to monitor a server.<\/li>\n<\/ul>\n<p>Zabbix supports multiple types of notifications: Email, Slack, Telegram, SMS, and <a href=\"https:\/\/www.zabbix.com\/integrations?cat=notifications_alerting\" target=\"_blank\" rel=\"noopener\">many others<\/a>. This tutorial will show you how to configure email notifications.<\/p>\n<h1>Setting up your Email<\/h1>\n<p>To set up email notifications, click on <strong>Administration<\/strong> on the Lefthand menu of the Zabbix web interface, then click <strong>Media Types<\/strong>. Then click on <strong>Email<\/strong>.<\/p>\n<p>You can adjust the SMTP options to match the settings of your email service. This tutorial will use Gmail's SMTP.<\/p>\n<p>Gmail users should type in <code>smtp.gmail.com<\/code> in the <strong>SMTP server<\/strong> field. <code>465<\/code> for the <strong>SMTP port<\/strong> field. <code>gmail.com<\/code> for the <strong>SMTP helo<\/strong>. Then add your email address in the <strong>SMTP email<\/strong> field. Next, choose <strong>SSL\/TLS<\/strong> for the <strong>Connection security<\/strong> field, and <strong>Username and password<\/strong> for <strong>Authentication<\/strong>. Type in your email address for the <strong>Username<\/strong> field, and for the <strong>Password<\/strong> field, enter your Google <strong>App Password<\/strong>. Click <strong>Update<\/strong> as a final step.<\/p>\n<p>You can now test sending notifications.<\/p>\n<p>Click the <strong>Test<\/strong> underlined button.<\/p>\n<p>A pop-up window will appear. Enter your email address into the <strong>Send to<\/strong> field, then click <strong>Test<\/strong>. You should receive a <strong>test successful message<\/strong> at the top of the widget.<\/p>\n<p>Close the pop-up by clicking the <strong>Cancel<\/strong> button.<\/p>\n<p>Next, create a new user. In the left navigation bar, click on <strong>Administration<\/strong> and then <strong>Users<\/strong>. A list of users will appear. Next, click on the <strong>Create user<\/strong> button at the top-right corner of your screen.<\/p>\n<p>In the <strong>Alias<\/strong> field, enter your username and create a new password. Next, add this user to the administrator\u2019s group. In the Groups field, type in <strong>Zabbix administrators<\/strong> and then select the group from the list.<\/p>\n<p>Next, in the <strong>Media<\/strong> tab, click on the <strong>Add<\/strong> underlined link. A pop-up titled <strong>Media<\/strong> should appear.<\/p>\n<p>Choose the <strong>Email<\/strong> option from <strong>Type<\/strong> drop-down menu. In the <strong>Send to<\/strong> box, enter your email address. The rest of the options can be left as is. Finally, click the <strong>Add<\/strong> button.<\/p>\n<p>Next, in the <strong>Permissions<\/strong> tab. From the <strong>User type<\/strong> drop-down menu, select <strong>Zabbix Super Admin<\/strong>. Then click <strong>Add<\/strong> to create the user.<\/p>\n<h4>Warning:<\/h4>\n<p><strong>Using the default password is not safe. In order to change the password of the built-in user 'Admin' click on it. Then click 'Change password'.<\/strong><\/p>\n<p>You will now need to enable notifications. Click on the <strong>Configuration<\/strong> tab, then click on <strong>Actions<\/strong>. A pre-configured action will appear. This will allow you to send notifications to all Zabbix administrators. Click on the name to review and modify its settings. The default parameters will be used for this tutorial. To enable it, click on the <strong>Disabled<\/strong> button in the <strong>Status<\/strong> column.<\/p>\n<p>You are now ready to start receiving alerts.<\/p>\n<h1>Generating and Sending an Email Test Alert<\/h1>\n<p>This step will create a test alert that verifies everything is connected. We will create a large file that triggers a notification, because Zabbix automatically tracks the free space on your server. The check takes place every hour, so it may take a while before the notification is triggered.<\/p>\n<p>Make a temporary file large enough to trigger Zabbix\u2019s file system usage alert.<\/p>\n<p>Log in to your monitored server with SSH, then, find out how much space you have left on your server using <code>df<\/code>:<\/p>\n<pre><code>df -h<\/code><\/pre>\n<p>The command <code>df<\/code> will show you how much your file system is using in terms of disk space. The <code>-h<\/code> tells <code>df<\/code> to show human-readable output:<\/p>\n<pre><code>Filesystem      Size  Used Avail Use% Mounted on\n\/dev\/vda1        38G  1G   37G    2% \/<\/code><\/pre>\n<p>Here, the free space is 37 GB. So, to trigger a Zabbix you can use the <code>fallocate<\/code> command to create a large temporary file that takes up 35 GB of your disk space:<\/p>\n<pre><code>fallocate -l 35G \/tmp\/temp.img<\/code><\/pre>\n<p>Zabbix will send you an alert about the amount of free disk space and it will run the action which you configured for sending the notification message. This may take about an hour. You can check your inbox for the message from the Zabbix server, and you should see a warning message that tells you that your disk space is low.<\/p>\n<p>To view the notification and details, you can also navigate to the Zabbix <strong>Dashboard<\/strong> and the <strong>Monitoring<\/strong> tab.<\/p>\n<p>You can then delete the test file to free up space on you server:<\/p>\n<pre><code>rm -f \/tmp\/temp.img<\/code><\/pre>\n<p>This should make the alert disappear on the Zabbix web interface.<\/p>\n<h2>Congrats<\/h2>\n<p>You now have a mechanism to monitor your server with email notifications. To find out more about Zabbix notifications, take a look at the <a href=\"https:\/\/www.zabbix.com\/integrations?cat=notifications_alerting\" target=\"_blank\" rel=\"noopener\">Zabbix documentation<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to Configure Zabbix Notifications Introduction Zabbix is an open-source software that monitors the availability and performance of IT infrastructure components. Zabbix server can be installed on any Linux distribution. Zabbix provides real-time monitoring of thousands of metric data that it fetches from servers, virtual machines, network devices, and web applications. Analyzing the data Zabbix  &#8230;<\/p>\n","protected":false},"author":19,"featured_media":7250,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[18,30],"tags":[192],"class_list":["post-7216","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops","category-tutorials","tag-zabbix"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/posts\/7216","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/users\/19"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/comments?post=7216"}],"version-history":[{"count":3,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/posts\/7216\/revisions"}],"predecessor-version":[{"id":12989,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/posts\/7216\/revisions\/12989"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/media\/7250"}],"wp:attachment":[{"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/media?parent=7216"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/categories?post=7216"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/tags?post=7216"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}