Skip to content

bitts/zabbix_joomla

Repository files navigation

Zabbix Monitoring for Server Hosting CMS Joomla!

GitHub release (latest by date) GitHub last commit GitHub Release Date GitHub repo size

Joomla Logo

Zabbix User Agent to CMS Joomla!

Monitoring script using Zabbix UserPatameter for Joomla application.

References

Template

Usage

To use it, it is necessary to enable script execution as root by editing the /etc/zabbix/zabbix_agentd.conf file and modifying the AllowRoot and User directives

### Option: AllowRoot
# Allow the agent to run as 'root'. If disabled and the agent is started by 'root', the agent
# will try to switch to the user specified by the User configuration option instead.
# Has no effect if started under a regular user.
# 0 - do not allow
#1 - allow
#
# Mandatory: no
# Default:
# AllowRoot=0
AllowRoot=1

### Option: User
# Drop privileges to a specific, existing user on the system.
# Only has effect if run as 'root' and AllowRoot is disabled.
#
# Mandatory: no
# Default:
# User=zabbix
User=root

# Adding running CMS Joomla!
UserParameter=joomla.site[*],/etc/zabbix/zabbix_agentd.d/zabbix_joomla.php $1 $2 $3

For console testing

zabbix_agentd -t joomla.site[{$site},option]

Where {$site} is the Macro with the name of the CMS Host to be monitored

Options for monitoring

virtualhosts

Returns Virtual Host information (apache2 configuration file located in /etc/apache2/sites-avaliables/)

zabbix_agentd -t joomla.site[{$site},virtualhosts]

Output:

{
  "ports":["80","443"],
  "file":"\/etc\/apache2\/sites-avaliable\/site.com.br.conf",
  "documentRoot":"\/var\/www\/site\/",
  "serverName":"www.site.com.br",
  "serverAlias":"site.com.br"
}

folder

Return path of portal files location

zabbix_agentd -t joomla.site[{$site},folder]

Output:

  /var/www/site/

serverName

Returns the name of the Virtual Host

zabbix_agentd -t joomla.site[{$site},serverName]

Output:

  www.site.com.br

serverAlias

Return Virtual Server Alias

zabbix_agentd -t joomla.site[{$site},serverAlias]

Output:

  site.com.br

port

Returns Port(s) used for site publication

zabbix_agentd -t joomla.site[{$site},port]

Output:

  80.443

apacheconf

Return apache settings

zabbix_agentd -t joomla.site[{$site},apacheconf]

Output:

  /etc/apache2/sites-available/site.com.br.conf

jpas

Returns the JPA files contained in the directory and information about those files

zabbix_agentd -t joomla.site[{$site},jpas]

Output:

[
  {
    "size": 554543,
    "size":"541.55 KB",
    "name":"\/var\/www\/site\/\/administrator\/components\/com_akeeba\/Master\/Installers\/angie.jpa",
    "date":"2021-09-01 11:02:56"
  },
  {
    "size": 27120,
    "size":"26.48 KB",
    "name":"\/var\/www\/site\/\/administrator\/components\/com_akeeba\/Master\/Installers\/angie-joomla.jpa",
    "date":"2021-09-01 11:02:56"
  },
  {
    "size":46692,
    "size":"45.6 KB",
    "name":"\/var\/www\/site\/\/administrator\/components\/com_akeeba\/Master\/Installers\/angie-mautic.jpa",
    "date":"2016-09-19 11:31:24"
  },
]

hjpasize

Returns the total size of JPAs contained in the Joomla directory

zabbix_agentd -t joomla.site[{$site},hjpasize]

Output:

  628355

njpas

Returns the total number of JPAs contained in the Joomla directory

zabbix_agentd -t joomla.site[{$site},njpas]

Output:

  3

foldersize

Returns the total size occupied by Joomla files

zabbix_agentd -t joomla.site[{$site},folderssize]

Output:

  623471397

hfoldersize

Returns the total size occupied by Joomla (formatted) files

zabbix_agentd -t joomla.site[{$site},hfolderssize]

Output:

  594.59 MB

permission

Return Joomla file permissions

zabbix_agentd -t joomla.site[{$site},permission]

Output:

  2770

jm_version

Return installed version of Joomla

zabbix_agentd -t joomla.site[{$site},jm_version]

Output:

  3.9.27

jm_lastversion

Returns the latest stable and released version of CMS Joomla

zabbix_agentd -t joomla.site[{$site},jm_lastversion]

Output:

  4.0.3

jm_dataconfiguration

Returns the information contained in the Joomla configuration.php file with some properties

zabbix_agentd -t joomla.site[{$site},jm_dataconfiguration]

Output:

{
  "sitename" : "MySite",
  "editor" : "jce",
  "dbtype" : "mysqli",
  "host" : "localhost",
  "user" : "web_site",
  "dbprefix" : "myjml_",
  "mailfrom" : "support@site.com.br",
  "fromname" : "My Site",
  "smtphost" : "smtp.site.com.br"
}

jm_users

Returns users registered in the application's database with administrative access

zabbix_agentd -t joomla.site[{$site},jm_users]

Output:

{
  "users":[
    {
      "name" : "Super User",
      "username" : "admin",
      "email" : "admin@site.com.br"
    },
    {
      "name" : "security",
      "username" : "security",
      "email" : "seguranca@site.com.br"
    },
    {
      "name" : "Social Communication",
      "username" : "comsoc",
      "email" : "comsoc@site.com.br"
    }
  ]
}

jm_nusers

Returns the total number of users registered in the application's database with administrative access

zabbix_agentd -t joomla.site[{$site},jm_nusers]

Output:

  3