Changes

From SME Server
Jump to navigationJump to search
3,244 bytes added ,  09:40, 10 May 2020
Line 1: Line 1: −
{{Languages}}
+
{{Languages|Zabbix}}
   −
===Maintainer===
+
{{Incomplete}}
[mailto:daniel@firewall-services.com[[User:VIP-ire|Daniel B.]]] from [http://www.firewall-services.com Firewall Services]
        −
{{Incomplete}}
+
===Maintainer===
 
+
[mailto:daniel@firewall-services.com][[User:VIP-ire|Daniel B.]] from [http://www.firewall-services.com Firewall Services]
 
=== Description ===
 
=== Description ===
   Line 132: Line 131:  
=== Full documentation ===
 
=== Full documentation ===
   −
This wiki page is not a complete guide for Zabbix, but just a starting point to run it on your SME Server using this contrib.
+
A complete documentation is available as a PDF file here http://www.zabbix.com/documentation.php
For a complete documentation, please refer to the project documentation: http://www.zabbix.com/documentation.php
+
You'll also find some useful informations on the official [http://www.zabbix.com/wiki/doku.php wiki] of the project and the [http://www.zabbix.com/forum/ forum].
 +
 
 +
{{Note box|This wiki page is not a complete guide for Zabbix, but just a starting point to run it on your SME Server using this contrib.
 +
For a complete documentation, please refer to the project documentation: http://www.zabbix.com/documentation.php}}
    
=== Versions ===
 
=== Versions ===
Here are informations about the latest release of each component:
+
The following is the information about the latest release of each component:
{{ #smeversion: smeserver-zabbix-server }}
+
{{#smeversion: smeserver-zabbix-server }}
{{ #smeversion: zabbix-server }}
+
{{#smeversion: smeserver-zabbix-agent }}
{{ #smeversion: smeserver-zabbix-agent }}
  −
{{ #smeversion: zabbix-agent }}
  −
{{ #smeversion: smeserver-zabbix-proxy }}
  −
{{ #smeversion: zabbix-proxy }}
  −
 
  −
 
  −
 
      
=== Requirements ===
 
=== Requirements ===
*SME Server 7.X
+
*SME Server 7.X (9.X or higher for zabbix-server)
*php-bcmath (smeserver-zabbix-server only): if you have the standard php4 packages, it should be ok. If you have upgraded to php5 from centosplus repo, you should manually install php-bcmath package
+
*php>=5.4 for zabbix server only, hence you will need to first install smeserver-php-scl on SME9 and set php54 or higher as default php version
    
=== Components ===
 
=== Components ===
Line 155: Line 150:  
Zabbix is composed of four major components:
 
Zabbix is composed of four major components:
 
*The server (the main part). The server will store and analyse the different data, send alerts, etc...
 
*The server (the main part). The server will store and analyse the different data, send alerts, etc...
*The web interface (which is automatically installed with the server with this contrib)
+
*The web interface (which is automatically installed with the server with this contrib).
*The agent, which gathers informations on the different hosts you monitor
+
*The agent, which gathers informations on the different hosts you monitor.
*The proxy, which is an optional part, can be used to collect performance and availability data locally, and send it to the server
+
*The proxy, which is an optional part, can be used to collect performance and availability data locally, and send it to the server.
    
==== Server ====
 
==== Server ====
   −
The server is the core component of Zabbix software. It uses one database (MySQL in this contrib) to store configuration, performance and integrity informations. The server can check network services with simple check (ICMP, TCP etc...) for agent-less monitoring, it can monitor network devices using SNMP and is also the central component to which agent report informations (agent can work in active, passive, or both mode). The server will also analyse all the informations and send alerts depending on very flexible triggers.
+
The server is the core component of Zabbix software. It uses one database (MySQL in this contrib) to store configuration, performance and integrity information. The server can check network services with simple check (ICMP, TCP etc...) for agent-less monitoring, it can monitor network devices using SNMP and is also the central component to which agent report information (agent can work in active, passive, or both mode). The server will also analyse all the information and send alerts depending on very flexible triggers.
   −
===== Installation =====
+
===== Installation on SME9=====
 +
First enable the needed repo: Firewall service and REMI
 +
{{:Fws}}
 +
{{:Remi-safe}}
 +
 
 +
signal-event yum-modify
    
to install Zabbix server, just use yum:
 
to install Zabbix server, just use yum:
  yum --enablerepo=smecontribs install smeserver-zabbix-server
+
  yum --enablerepo=smecontribs,fws,remi-safe install smeserver-zabbix-server --exclude=smeserver-zabbix-proxy
 +
NB: the --exclude=smeserver-zabbix-proxy is due to a conflict in late 2019 on SME9 as FWS started using zabbix from zabbix repo instead of building it. We will fix this for SME10 in few months.
 +
 
 +
then go to your server-manager to set php5.4 or higher as default php for your SME, or you will not be able to access to zabbix web gui, or just issue the following
 +
config setprop php54 PhpModule enabled  #replace here with php55 or php56 if you have other needs
 +
signal-event php-update
 +
 
 +
then you will have to either tweak the default configuration as explain in next step or just issue :
 +
signal-event zabbix-server-update
 +
 
 +
then go to your web interface : https://yourserveradress/zabbix
    
===== DB Parameters =====
 
===== DB Parameters =====
Line 178: Line 188:  
*'''JabberPassword''': Password for the account (for "JabberAccount")
 
*'''JabberPassword''': Password for the account (for "JabberAccount")
 
*'''JabberTLS''': (enabled|disabled) Does your Jabber server requires TLS security
 
*'''JabberTLS''': (enabled|disabled) Does your Jabber server requires TLS security
{{Note box|The different Jabber settings above are not for the built-in jabber notification function (because I couldn't get it working as my server requires TLS and the built-in feature do not support it). But I've included a external script using sendxmpp to send the notification. You should have a media called 'xmpp' in zabbix administration. }}  
+
{{Note box|The different Jabber settings above are not for the built-in jabber notification function (because I couldn't get it working as my server requires TLS and the built-in features do not support it). But I've included a external script using sendxmpp to send the notification. You should have a media called 'xmpp' in zabbix administration. }}  
    
*'''NodeID''': The node ID of your server. If you don't use distributed monitoring (just one central Zabbix server), you should let this to 0
 
*'''NodeID''': The node ID of your server. If you don't use distributed monitoring (just one central Zabbix server), you should let this to 0
Line 196: Line 206:  
===== Web Interface =====
 
===== Web Interface =====
   −
The main web interface is available (if not disabled with teh key WebAccess) on https://server.domain.tld/zabbix.
+
The main web interface is available (if not disabled with the key WebAccess) on https://server.domain.tld/zabbix.
The default user is '''admin''', with password '''zabbix''' (you should change this password ASAP)
+
The default user is '''Admin''' (with uppercase A as first letter), with password '''zabbix''' (you should change this password ASAP)
    
Here are some screenshots of what you can get with zabbix
 
Here are some screenshots of what you can get with zabbix
Line 212: Line 222:       −
For more screenshots, you can have a look at the project website [http://www.zabbix.com/screenshots.php here]
+
For more screenshots, visit the project website [http://www.zabbix.com/screenshots.php here]
    
==== Agent ====
 
==== Agent ====
   −
Zabbix agent is a very small daemon which will gather informations about the host being monitored, and report it to one or several server(s) (or proxy(s)).
+
Zabbix agent is a very small daemon which will gather information about the host being monitored, and report it to one or several server(s) (or proxy(s)).
 
Agents can run in active or passive mode (or both):
 
Agents can run in active or passive mode (or both):
 
*In active mode, the agent will make outgoing connection to the server (port 10051 by default).
 
*In active mode, the agent will make outgoing connection to the server (port 10051 by default).
 
*In passive mode, the server will connect to the agent (on port 10050 by default).  
 
*In passive mode, the server will connect to the agent (on port 10050 by default).  
   −
Please read Chap. 2.3.4.ZABBIX Agent page 39 and Chap. 3.3.ZABBIX Agent (UNIX, standalone daemon) of the manual for more informations on Zabbix agent.
+
Please read Chap. 2.3.4.ZABBIX Agent page 39 and Chap. 3.3.ZABBIX Agent (UNIX, standalone daemon) of the manual for more information on Zabbix agent.
 +
 
 +
===== Installation  SME9 =====
 +
first enable the needed repo: Firewall service 
 +
{{:Fws}}
   −
===== Installation =====
+
and EPEL
 +
{{:Epel}}
 +
signal-event yum-modify
    
to install Zabbix agent, just use yum:
 
to install Zabbix agent, just use yum:
  yum --enablerepo=smecontribs install smeserver-zabbix-agent
+
  yum --enablerepo=smecontribs,fws,epel install smeserver-zabbix-agent
       
This package will download at least the following dependencies:
 
This package will download at least the following dependencies:
 +
*zabbix (very small package with just common directories used by all zabbix components)
 
*zabbix-agent (the agent)
 
*zabbix-agent (the agent)
 
*smeserver-remoteuseraccess: this contrib is needed because it provides needed templates metadata for /etc/sudoers.
 
*smeserver-remoteuseraccess: this contrib is needed because it provides needed templates metadata for /etc/sudoers.
Line 242: Line 259:  
*'''access''': (public|private) If you want to open the agent on the public interface (only useful if passive is enabled). If you set this to 'public' you should use the AllowHosts key to limit the access
 
*'''access''': (public|private) If you want to open the agent on the public interface (only useful if passive is enabled). If you set this to 'public' you should use the AllowHosts key to limit the access
 
*'''active''': (enabled|disabled) Do you want to enabled the active mode
 
*'''active''': (enabled|disabled) Do you want to enabled the active mode
*'''passvie''': (enabled|disabled) Do you want to enable the passive mode
+
*'''passive''': (enabled|disabled) Do you want to enable the passive mode
 
*'''status''': (enabled|disabled) Should the service be automatically started
 
*'''status''': (enabled|disabled) Should the service be automatically started
 +
 +
 +
 +
Once you have everything configured like you want, just issue
 +
signal-event zabbix-agent-update
 +
 +
to expand the templates and restart the needed services.
 +
 +
===== Remote client with encryption =====
 +
on the client do:
 +
openssl rand -hex 32 > /etc/zabbix/zabbix_agentd.psk
 +
chown :zabbix /etc/zabbix/zabbix_agentd.psk
 +
chmod 640 /etc/zabbix/zabbix_agentd.psk
 +
signal-event zabbix-agent-update
 +
cat /etc/zabbix/zabbix_agentd.psk
 +
 +
you might also need a public access there:
 +
config setprop zabbix-agent  Servers IP1,IP2 access public  active disabled passive enabled AllowHosts IP1,IP2
 +
signal-event zabbix-agent-update
 +
 +
On the Zabbix server interface for this client select :
 +
# Connections to host: psk
 +
# Connections from host: psk
 +
# PSK identity: domain.name-agent
 +
# psk: [paste here the output of cat /etc/zabbix/zabbix_agentd.psk]
 +
 +
===== agent on the local zabbix server =====
 +
<syntaxhighlight lang="bash">
 +
# config setprop zabbix-agent  access localhost  Servers localhost  active disabled  passive enabled
 +
# signal-event zabbix-agent-update
 +
</syntaxhighlight>
    
===== Additional checks =====
 
===== Additional checks =====
Line 250: Line 298:  
Configuring the corresponding checks on the server can be quite long. You can have a look at the [http://sme.firewall-services.com/downloads/zabbix/zabbix_SME.zip templates] I use to monitor SME Servers. This archive contains some templates/items/graphs/triggers in XML format (exported from Zabbix). You can use the Import/Export functionality of Zabbix (Manual Chap. 8.XML IMPORT AND EXPORT page 154) to import it on your server.
 
Configuring the corresponding checks on the server can be quite long. You can have a look at the [http://sme.firewall-services.com/downloads/zabbix/zabbix_SME.zip templates] I use to monitor SME Servers. This archive contains some templates/items/graphs/triggers in XML format (exported from Zabbix). You can use the Import/Export functionality of Zabbix (Manual Chap. 8.XML IMPORT AND EXPORT page 154) to import it on your server.
   −
You can also have a look at the configuration file /etc/zabbix/zabbix_agentd.conf to see the commands used to return the corresponding values. You'll also find for each UserParameter informations on how to create the corresponding item on the server.
+
You can also have a look at the configuration file /etc/zabbix/zabbix_agentd.conf to see the commands used to return the corresponding values. You'll also find for each UserParameter information on how to create the corresponding item on the server.
   −
Please, read chapter 4.11.User Parameters page 119 of the manual to have more informations on how UserParameters works.
+
Please, read chapter 4.11.User Parameters page 119 of the manual to have more information on how UserParameters work.
    
*External IP:
 
*External IP:
Line 258: Line 306:     
*Incoming mails statistics:
 
*Incoming mails statistics:
**'''mail.in.denied.dnsbl''': number of emails rejected by DNSBL since the last run
  −
**'''mail.in.denied.rhsbl''': number of emails rejected by RHSBL since the last run
  −
**'''mail.in.denied.clamav''': number of emails rejected by CLAMAV since the last run
  −
**'''mail.in.denied.earlytalker''': number of emails rejected by EARLYTALKER since the last run
  −
**'''mail.in.denied.basicheaders''': number of emails rejected by BASICHEADERS since the last run
  −
**'''mail.in.denied.goodrcptto''': number of emails rejected by GOODRCPTTO since the last run
  −
**'''mail.in.denied.spamhelo''': number of emails rejected by SPAMHELO since the last run
  −
**'''mail.in.denied.total''': sum of rejected emails (sum of the above checks) since the last run
  −
**'''mail.in.denied.spam''': number of emails rejected by SPAMASSASSIN since the last run
  −
**'''mail.in.denied.other''': number of emails rejected by others checks since the last run
  −
**'''mail.in.queued.spam''': number of emails queued but marked as spam by SPAMASSASSIN since the last run
  −
**'''mail.in.queued''': number of emails queued (HAM) since the last run
  −
**'''mail.in.total''': number of emails received since the last run (accept + denied)
     −
*Outgoing mails statistics
+
{{Note box|Since version 0.1-28 of smeserver-zabbix-agent, the keys to retrieve emails statistics has changed. The value retrieved here are for the last 10 Minutes (the statistics are updated with a cronjob every 10 minutes), so you should configured these items to be refreshed every 600 seconds}}
**'''mail.out.total''': sum of outgoing emails since the last run
+
 
**'''mail.out.success''': number of successful transmitted emails since the last run
+
**'''mail.in[dnsbl]''': number of emails rejected by DNSBL
**'''mail.out.deferral''': number of deferred emails since the last run
+
**'''mail.in[rhsbl]''': number of emails rejected by RHSBL
**'''mail.out.failure''': number of failures since the last run
+
**'''mail.in[clamav]''': number of emails rejected by CLAMAV
 +
**'''mail.in[check_earlytalker]''': number of emails rejected by EARLYTALKER
 +
**'''mail.in[check_basicheaders]''': number of emails rejected by BASICHEADERS
 +
**'''mail.in[check_goodrcptto]''': number of emails rejected by GOODRCPTTO
 +
**'''mail.in[check_spamhelo]''': number of emails rejected by SPAMHELO
 +
**'''mail.in[total_denied]''': sum of rejected emails (sum of the above checks)
 +
**'''mail.in[spam_denied]''': number of emails rejected by SPAMASSASSIN
 +
**'''mail.in[other_denied]''': number of emails rejected by others checks
 +
**'''mail.in[spam_queued]''': number of emails queued but marked as spam by SPAMASSASSIN
 +
**'''mail.in[queued]''': number of emails queued (HAM)
 +
**'''mail.in[total]''': number of emails received (accept + denied)
 +
 
 +
*Outgoing mails statistics:
 +
**'''mail.out[total]''': sum of outgoing emails
 +
**'''mail.out[success]''': number of successful transmitted emails
 +
**'''mail.out[deferral]''': number of deferred emails
 +
**'''mail.out[failure]''': number of failures
   −
*Memory/Swap usage
+
*Memory/Swap usage:
 
**'''vm.memory.size.used''': Actually used memory in bytes
 
**'''vm.memory.size.used''': Actually used memory in bytes
 
**'''vm.memory.size.pused''': Actually used memory in %
 
**'''vm.memory.size.pused''': Actually used memory in %
 
**'''system.swap.size.used''': Actually used swap space in bytes
 
**'''system.swap.size.used''': Actually used swap space in bytes
   −
*MySQL Informations
+
*MySQL Information:
 
**'''mysql.uptime''': uptime of mysql server in seconds
 
**'''mysql.uptime''': uptime of mysql server in seconds
 
**'''mysql.threads''': number of threads
 
**'''mysql.threads''': number of threads
Line 297: Line 348:  
**'''net.if.out.external''': Equivalent to net.if.out[ethX,bytes]
 
**'''net.if.out.external''': Equivalent to net.if.out[ethX,bytes]
   −
*UPS status
+
{{Note box|Since version 0.1-38 of smeserver-zabbix-agent, the keys to retrieve UPS informations has changed. You now have to select the name of your UPS on the server side. The default name for an UPS in SME is '''UPS'''}}
**'''ups.load''': Current load (in %) of your UPS
+
 
**'''ups.battery.charge''': Current charge (in %) of the battery
+
*UPS status:
**'''ups.status''': Current status of the UPS (OL, OB, OL CHRG etc...)
+
**'''ups.load[UPS]''': Current load (in %) of your UPS
**'''ups.model''': Model of the UPS
+
**'''ups.battery.charge[UPS]''': Current charge (in %) of the battery
 +
**'''ups.status[UPS]''': Current status of the UPS (OL, OB, OL CHRG etc...)
 +
**'''ups.model[UPS]''': Model of the UPS
   −
*Raid Array Monitoring
+
*Raid Array Monitoring:
 
**'''raid.sw.status''': Current status of your software Raid (all array)
 
**'''raid.sw.status''': Current status of your software Raid (all array)
 
**'''raid.mega.status''': Current status of your mega raid based raid array (for example, the perc5/6(i) are megaraid based). Requires additional MegaCLI package available from here: [http://www.lsi.com/storage_home/products_home/internal_raid/megaraid_sas/]
 
**'''raid.mega.status''': Current status of your mega raid based raid array (for example, the perc5/6(i) are megaraid based). Requires additional MegaCLI package available from here: [http://www.lsi.com/storage_home/products_home/internal_raid/megaraid_sas/]
Line 309: Line 362:  
==== Proxy ====
 
==== Proxy ====
   −
Zabbix proxy is a lightweight daemon. It will act as a server for agents, will cache locally (in a mysql database) the informations, and send it to the server it belongs to. This is useful to monitor networks elements behind a firewall.
+
Zabbix proxy is a lightweight daemon. It will act as a server for agents, will cache locally (in a mysql database) the information, and send it to the server it belongs to. This is useful to monitor networks elements behind a firewall.
   −
===== Installation =====
+
===== Installation SME9=====
 +
first enable the needed repo: Firewall service 
 +
{{:Fws}}
    +
signal-event yum-modify
 
to install Zabbix proxy, just use yum:
 
to install Zabbix proxy, just use yum:
  yum --enablerepo=smecontribs install smeserver-zabbix-proxy
+
  yum --enablerepo=smecontribs,fws install smeserver-zabbix-proxy
    
===== DB Parameters =====
 
===== DB Parameters =====
Line 334: Line 390:  
{{Note box|After installation, the agent is configured for active checks only. Here, we disable the active checks, and enable the passive ones.}}
 
{{Note box|After installation, the agent is configured for active checks only. Here, we disable the active checks, and enable the passive ones.}}
   −
Then, just add a host in Zabbix, pointing to localhost. Remember, if you use the active mode (agent send informations to the server), so you'll have to name the host <hostname>.<domain.tld>, then enter 127.0.0.1 in the IP address field.
+
Then, just add a host in Zabbix, pointing to localhost.
    
Now you can start adding items (type agent (active or passive depending on the mode you use on the agent)) to this new host.
 
Now you can start adding items (type agent (active or passive depending on the mode you use on the agent)) to this new host.
Line 343: Line 399:  
  signal-event zabbix-agent-update
 
  signal-event zabbix-agent-update
    +
{{Warning box|If you use active checks, you need to name the host in zabbix server hostname.domainname.tld (check the file /etc/zabbix/zabbix_agentd.conf, the directive Hostname). If you don't do that, checks won't work}}
   −
You can download [http://sme.firewall-services.com/downloads/zabbix/zabbix_SME.zip here] an archive with some XML exports of the templates I use to monitor my servers. Just extract the archive, and import the templates you want in Zabbix (using the Import/Export menu of zabbix configuration)
+
You can download [http://repo.firewall-services.com/misc/monitoring/templates_zabbix.zip here] an archive with some XML exports of the templates I use to monitor my servers. Just extract the archive, and import the templates you want in Zabbix (using the Import/Export menu of zabbix configuration)
    
Each XML file represent a template in Zabbix
 
Each XML file represent a template in Zabbix
Line 363: Line 420:  
Please raise bugs under the SME-Contribs section in [http://bugs.contribs.org/enter_bug.cgi bugzilla]
 
Please raise bugs under the SME-Contribs section in [http://bugs.contribs.org/enter_bug.cgi bugzilla]
 
and select the smeserver-zabbix component or use on of this link:
 
and select the smeserver-zabbix component or use on of this link:
 +
====smeserver-zabbix-proxy====
 +
new bug for {{BugzillaFileBug|product=SME%20Contribs|component=smeserver-zabbix-proxy|title=proxy}}
 +
{{#bugzilla:columns=id,product,version,status,summary |sort=id|order=desc |component=smeserver-zabbix-zabbix-proxy|noresultsmessage="No open bugs found."}}
 +
 +
====smeserver-zabbix-agent====
 +
new bug for {{BugzillaFileBug|product=SME%20Contribs|component=smeserver-zabbix-agent|title=agent}}
 +
{{#bugzilla:columns=id,product,version,status,summary |sort=id|order=desc |component=smeserver-zabbix-agent|noresultsmessage="No open bugs found."}}
 +
 +
====smeserver-zabbix-server====
 +
new bug for {{BugzillaFileBug|product=SME%20Contribs|component=smeserver-zabbix-server|title=server}}
 +
{{#bugzilla:columns=id,product,version,status,summary |sort=id|order=desc |component=smeserver-zabbix-server|noresultsmessage="No open bugs found."}}
 +
   −
{{BugzillaFileBug|product=SME%20Contribs|component=smeserver-zabbix-server|title=server}}{{BugzillaFileBug|product=SME%20Contribs|component=smeserver-zabbix-agent|title=agent}}{{BugzillaFileBug|product=SME%20Contribs|component=smeserver-zabbix-proxy|title=proxy}}
      
----
 
----
 
[[Category:Contrib]]
 
[[Category:Contrib]]
 +
[[Category:Administration:Monitoring]]
Super Admin, Wiki & Docs Team, Bureaucrats, Interface administrators, Administrators
3,240

edits

Navigation menu