zabbix_export:
  version: '7.0'
  template_groups:
    - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6
      name: Templates/Applications
  templates:
    - uuid: 34f386276a094e8e9a6e46653fdf05b1
      template: 'Nextcloud by HTTP'
      name: 'Nextcloud by HTTP'
      description: |
        This template is designed for monitoring Nextcloud by HTTP via Zabbix, and it works without any external scripts.
          Nextcloud is a suite of client-server software for creating and using file hosting services.
          For more information, see the [`official documentation`](https://docs.nextcloud.com/server/latest/developer_manual/client_apis/OCS/ocs-api-overview.html#)
        
        Generated by official Zabbix template tool "Templator"
      vendor:
        name: Zabbix
        version: 7.0-0
      groups:
        - name: Templates/Applications
      items:
        - uuid: cf89012acb7749a396fc14a705145c91
          name: 'Active users, last 1 hour'
          type: DEPENDENT
          key: nextcloud.serverinfo.active_users.last1h
          description: 'The number of active users in the last 1 hour.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ocs.data.activeUsers.last1hour
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nextcloud.serverinfo.get_data
          tags:
            - tag: component
              value: environment
        - uuid: 355d11e7459a4c599a86b2c08b90fd56
          name: 'Active users, last 5 minutes'
          type: DEPENDENT
          key: nextcloud.serverinfo.active_users.last5m
          description: 'The number of active users in the last 5 minutes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ocs.data.activeUsers.last5minutes
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nextcloud.serverinfo.get_data
          tags:
            - tag: component
              value: environment
        - uuid: 6a28646d56804f9fa4d060af26579881
          name: 'Active users, last 24 hours'
          type: DEPENDENT
          key: nextcloud.serverinfo.active_users.last24hours
          description: 'The number of active users in the last day.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ocs.data.activeUsers.last24hours
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nextcloud.serverinfo.get_data
          tags:
            - tag: component
              value: environment
        - uuid: cca878683ecb4de4b648fa100b579748
          name: 'Apps installed'
          type: DEPENDENT
          key: nextcloud.serverinfo.apps.installed
          description: 'The number of installed applications.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ocs.data.nextcloud.system.apps.num_installed
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nextcloud.serverinfo.get_data
          tags:
            - tag: component
              value: application
          triggers:
            - uuid: b0375ab303e74e7cadd911a4a2e98725
              expression: 'change(/Nextcloud by HTTP/nextcloud.serverinfo.apps.installed)<>0'
              name: 'Number of installed apps has been changed'
              priority: INFO
              description: 'Applications have been installed or removed.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: notice
        - uuid: d53e692d6c7d42fcb8a69e322f434da1
          name: 'Apps update available'
          type: DEPENDENT
          key: nextcloud.serverinfo.apps.update
          description: 'The number of applications for which an update is available.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ocs.data.nextcloud.system.apps.num_updates_available
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nextcloud.serverinfo.get_data
          tags:
            - tag: component
              value: application
          triggers:
            - uuid: 180c82d98b694f27bc44d1fc20ccd06e
              expression: 'last(/Nextcloud by HTTP/nextcloud.serverinfo.apps.update)<>0'
              name: 'Application updates are available'
              priority: WARNING
              description: 'Updates are available for some of the installed applications.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: notice
        - uuid: cc488c36ae0643a7bacb5173935ba608
          name: 'Web server'
          type: DEPENDENT
          key: nextcloud.serverinfo.apps.webserver
          value_type: CHAR
          description: 'Web server description.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ocs.data.server.webserver
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nextcloud.serverinfo.get_data
          tags:
            - tag: component
              value: environment
        - uuid: b018847264af4db3b3969e037734d669
          name: 'CPU load, avg 1m'
          type: DEPENDENT
          key: nextcloud.serverinfo.cpu.avg.1m
          value_type: FLOAT
          description: 'The average system load (the number of processes in the system run queue), last 1 minute.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.ocs.data.nextcloud.system.cpuload.element[0]'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nextcloud.serverinfo.get_data
          tags:
            - tag: component
              value: cpu
          triggers:
            - uuid: 481edcbc45174b35a2d44003aa101817
              expression: 'min(/Nextcloud by HTTP/nextcloud.serverinfo.cpu.avg.1m,5m) > {$NEXTCLOUD.CPU.LOAD.MAX}'
              name: 'CPU load is too high'
              event_name: 'CPU load is too high (over {$NEXTCLOUD.CPU.LOAD.MAX} for 5m)'
              priority: AVERAGE
              description: 'High CPU load.'
              tags:
                - tag: scope
                  value: performance
        - uuid: 1a7ca7bf50f042f7b0f025604cbeb008
          name: 'CPU load, avg 5m'
          type: DEPENDENT
          key: nextcloud.serverinfo.cpu.avg.5m
          value_type: FLOAT
          description: 'The average system load (the number of processes in the system run queue), last 5 minutes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.ocs.data.nextcloud.system.cpuload.element[1]'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nextcloud.serverinfo.get_data
          tags:
            - tag: component
              value: cpu
        - uuid: 06a34d8efcc043bbb027dbbddd37c8a2
          name: 'CPU load, avg 15m'
          type: DEPENDENT
          key: nextcloud.serverinfo.cpu.avg.15m
          value_type: FLOAT
          description: 'The average system load (the number of processes in the system run queue), last 15 minutes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.ocs.data.nextcloud.system.cpuload.element[2]'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nextcloud.serverinfo.get_data
          tags:
            - tag: component
              value: cpu
        - uuid: 725bdfe6f7eb4888b453c8ddd8907ba2
          name: 'Database size'
          type: DEPENDENT
          key: nextcloud.serverinfo.db.size
          units: B
          description: 'Size of database.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ocs.data.server.database.size
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nextcloud.serverinfo.get_data
          tags:
            - tag: component
              value: storage
        - uuid: a1992a76942e4a8ebcd010ca73eed0af
          name: 'Database type'
          type: DEPENDENT
          key: nextcloud.serverinfo.db.type
          value_type: CHAR
          description: 'Database type.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ocs.data.server.database.type
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nextcloud.serverinfo.get_data
          tags:
            - tag: component
              value: environment
        - uuid: 9a244bfd15a94f07a4f88947c10ff4b9
          name: 'Database version'
          type: DEPENDENT
          key: nextcloud.serverinfo.db.version
          value_type: CHAR
          description: 'Database description.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ocs.data.server.database.version
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nextcloud.serverinfo.get_data
          tags:
            - tag: component
              value: environment
          triggers:
            - uuid: d59f8e583cc34c578946607433d254ca
              expression: 'change(/Nextcloud by HTTP/nextcloud.serverinfo.db.version)=1 and length(last(/Nextcloud by HTTP/nextcloud.serverinfo.db.version))>0'
              name: 'Database version has changed'
              event_name: 'Database version has changed (new version: {ITEM.VALUE})'
              priority: INFO
              description: 'The Database version has changed. Acknowledge to close the problem manually.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: notice
        - uuid: 77bfc58708a54e8f89d83c962b7c2dac
          name: 'Free space'
          type: DEPENDENT
          key: nextcloud.serverinfo.freespace
          units: B
          description: 'The amount of free disk space.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ocs.data.nextcloud.system.freespace
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nextcloud.serverinfo.get_data
          tags:
            - tag: component
              value: storage
          triggers:
            - uuid: 6d9d52db83e34d83891cc3bb449d59b2
              expression: 'last(/Nextcloud by HTTP/nextcloud.serverinfo.freespace)<{$NEXTCLOUD.STORAGE.FREE.MIN}'
              name: 'Disk space is low'
              event_name: 'Disk space is low (free < {$NEXTCLOUD.STORAGE.FREE.MIN})'
              priority: AVERAGE
              description: |
                Condition should be the following:
                - the disk free space is less than `{$NEXTCLOUD.STORAGE.FREE.MIN}`;
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: availability
                - tag: scope
                  value: capacity
        - uuid: 8a7fb4062f484de4a8579ebb83b297a2
          name: 'Get server information'
          type: HTTP_AGENT
          key: nextcloud.serverinfo.get_data
          history: '0'
          value_type: TEXT
          authtype: BASIC
          username: '{$NEXTCLOUD.USER.NAME}'
          password: '{$NEXTCLOUD.USER.PASSWORD}'
          description: |
            This item provides useful server information, such as CPU load, RAM usage, disk usage, number of users, etc.
            https://github.com/nextcloud/serverinfo
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
              error_handler: CUSTOM_VALUE
              error_handler_params: '<ocs><meta><status>failure</status><statuscode>999</statuscode><message/></meta><data><message>Unknown error</message></data></ocs>'
            - type: XML_TO_JSON
          timeout: 10s
          url: '{$NEXTCLOUD.SCHEMA}://{$NEXTCLOUD.ADDRESS}/ocs/v2.php/apps/serverinfo/api/v1/info'
          status_codes: '200,401'
          http_proxy: '{$NEXTCLOUD.PROXY}'
          headers:
            - name: OCS-APIRequest
              value: 'true'
          tags:
            - tag: component
              value: raw
        - uuid: 1e96304bec7447329f91875b7beadf7d
          name: 'Memory free'
          type: DEPENDENT
          key: nextcloud.serverinfo.mem.free
          units: B
          description: 'The amount of free RAM.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ocs.data.nextcloud.system.mem_free
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nextcloud.serverinfo.get_data
          tags:
            - tag: component
              value: memory
        - uuid: e4b20717f8ea48f49c8814955cbf5c6d
          name: 'Memory used, in %'
          type: DEPENDENT
          key: nextcloud.serverinfo.mem.pused
          units: '%'
          description: 'RAM usage, in percent.'
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  function getField(data, path) {
                  	var steps = path.split('.');
                  	for (var i = 0; i < steps.length; i++) {
                  		var step = steps[i];
                  		if (typeof data !== 'object' || typeof data[step] === 'undefined') {
                  			throw 'Required field was not found: ' + path;
                  		}
                  
                  		data = data[step];
                  	}
                  
                  	return data;
                  }
                  
                  var data = JSON.parse(value),
                  	mem_total = getField(data,'ocs.data.nextcloud.system.mem_total'),
                  	mem_free = getField(data,'ocs.data.nextcloud.system.mem_free');
                  
                  return Math.ceil(100 - mem_free / mem_total * 100);
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nextcloud.serverinfo.get_data
          tags:
            - tag: component
              value: memory
          triggers:
            - uuid: b1f8786b975c443bac5daf351c29cde5
              expression: 'min(/Nextcloud by HTTP/nextcloud.serverinfo.mem.pused,5m) > {$NEXTCLOUD.MEM.PUSED.MAX}'
              name: 'High memory utilization'
              event_name: 'High memory utilization (>{$NEXTCLOUD.MEM.PUSED.MAX}% for 5m)'
              priority: AVERAGE
              description: 'The system is running out of free memory.'
              tags:
                - tag: scope
                  value: performance
        - uuid: 04f69d7593a045a0815e78d65882c895
          name: 'Memory total'
          type: DEPENDENT
          key: nextcloud.serverinfo.mem.total
          units: B
          description: 'The size of the RAM.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ocs.data.nextcloud.system.mem_total
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nextcloud.serverinfo.get_data
          tags:
            - tag: component
              value: memory
        - uuid: e6a227bd9ae54d0faff1f591219d766f
          name: 'PHP maximum execution time'
          type: DEPENDENT
          key: nextcloud.serverinfo.php.max_execution_time
          units: s
          description: 'By default, the maximum execution time for PHP scripts is set to 30 seconds. If a script runs for longer than 30 seconds, PHP stops the script and reports an error. You can control the amount of time PHP allows scripts to run by changing the ''max_execution_time'' directive in your php.ini file.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ocs.data.server.php.max_execution_time
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nextcloud.serverinfo.get_data
          tags:
            - tag: component
              value: environment
        - uuid: 50e1ce974d154e98a6d2bfce8fed78e1
          name: 'PHP memory free'
          type: DEPENDENT
          key: nextcloud.serverinfo.php.memory.free
          units: B
          description: 'PHP free memory size.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ocs.data.server.php.opcache.memory_usage.free_memory
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nextcloud.serverinfo.get_data
          tags:
            - tag: component
              value: memory
        - uuid: 87819fcbbc9745fa93a47c7043906299
          name: 'PHP memory limit'
          type: DEPENDENT
          key: nextcloud.serverinfo.php.memory.limit
          units: B
          description: 'By default, the PHP memory limit is generally set to 128 MB, but it can be customized based on the application''s specific needs. The php.ini file is usually the standard location to set the PHP memory limit.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ocs.data.server.php.memory_limit
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nextcloud.serverinfo.get_data
          tags:
            - tag: component
              value: memory
        - uuid: 0b8c6ee4a95b49a3b0b7eabf5131e56f
          name: 'PHP memory used, in %'
          type: DEPENDENT
          key: nextcloud.serverinfo.php.memory.pused
          units: '%'
          description: 'PHP memory used percentage'
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  function getField(data, path) {
                  	var steps = path.split('.');
                  	for (var i = 0; i < steps.length; i++) {
                  		var step = steps[i];
                  		if (typeof data !== 'object' || typeof data[step] === 'undefined') {
                  			throw 'Required field was not found: ' + path;
                  		}
                  
                  		data = data[step];
                  	}
                  
                  	return data;
                  }
                  
                  var data = JSON.parse(value),
                  	php_total = getField(data,'ocs.data.server.php.memory_limit'),
                  	php_free = getField(data,'ocs.data.server.php.opcache.memory_usage.used_memory');
                  
                  return Math.ceil(php_free / php_total * 100);
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nextcloud.serverinfo.get_data
          tags:
            - tag: component
              value: memory
          triggers:
            - uuid: ee778919cf91495da4445974afa039e9
              expression: 'min(/Nextcloud by HTTP/nextcloud.serverinfo.php.memory.pused,5m) > {$NEXTCLOUD.PHP.MEM.PUSED.MAX}'
              name: 'High PHP memory utilization'
              event_name: 'High PHP memory utilization (>{$NEXTCLOUD.PHP.MEM.PUSED.MAX}% for 5m)'
              priority: AVERAGE
              description: 'The PHP is running out of free memory.'
              tags:
                - tag: scope
                  value: performance
        - uuid: 1db9f9c33eca4537b9069d358b27ac06
          name: 'PHP memory used'
          type: DEPENDENT
          key: nextcloud.serverinfo.php.memory.used
          units: B
          description: 'PHP memory used'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ocs.data.server.php.opcache.memory_usage.used_memory
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nextcloud.serverinfo.get_data
          tags:
            - tag: component
              value: memory
        - uuid: 5f4eb296e96f4e7f9760ee5e2a2b7064
          name: 'PHP memory wasted'
          type: DEPENDENT
          key: nextcloud.serverinfo.php.memory.wasted
          units: B
          description: 'Memory allocated to the service but not in use.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ocs.data.server.php.opcache.memory_usage.wasted_memory
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nextcloud.serverinfo.get_data
          tags:
            - tag: component
              value: memory
        - uuid: 63acb31d32b143baaca36cf7c1eaf673
          name: 'PHP memory wasted, in %'
          type: DEPENDENT
          key: nextcloud.serverinfo.php.memory.wasted_percentage
          value_type: FLOAT
          units: '%'
          description: 'Memory allocated to the service but not in use, in percent.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ocs.data.server.php.opcache.memory_usage.current_wasted_percentage
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nextcloud.serverinfo.get_data
          tags:
            - tag: component
              value: memory
        - uuid: 080ff2fb09a343cc90e62e9fe640c45c
          name: 'PHP maximum upload file size'
          type: DEPENDENT
          key: nextcloud.serverinfo.php.upload_max_filesize
          units: B
          description: 'By default, the maximum upload file size for PHP scripts is set to 128 megabytes. However, you may want to change this limit. For example, you can set a lower limit to prevent users from uploading large files to your site. To do this, change the ''upload_max_filesize'' and ''post_max_size'' directives.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ocs.data.server.php.upload_max_filesize
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nextcloud.serverinfo.get_data
          tags:
            - tag: component
              value: environment
        - uuid: 59b08f54ce2a4d058f43c09dd1a9c469
          name: 'PHP version'
          type: DEPENDENT
          key: nextcloud.serverinfo.php.version
          value_type: CHAR
          description: 'PHP version'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ocs.data.server.php.version
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nextcloud.serverinfo.get_data
          tags:
            - tag: component
              value: environment
          triggers:
            - uuid: ff6e12cb84bb494a9ffc692b28862a25
              expression: 'change(/Nextcloud by HTTP/nextcloud.serverinfo.php.version)=1 and length(last(/Nextcloud by HTTP/nextcloud.serverinfo.php.version))>0'
              name: 'PHP version has changed'
              event_name: 'PHP version has changed (new version: {ITEM.VALUE})'
              priority: INFO
              description: 'The PHP version has changed. Acknowledge to close the problem manually.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: notice
        - uuid: e02be7c876e8452bbf3722038bac9634
          name: 'Server information status'
          type: DEPENDENT
          key: nextcloud.serverinfo.status
          value_type: CHAR
          description: 'Server information API status'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ocs.meta.message
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nextcloud.serverinfo.get_data
          tags:
            - tag: component
              value: system
          triggers:
            - uuid: b44c435b48264626ae2ec5cb610edac9
              expression: 'last(/Nextcloud by HTTP/nextcloud.serverinfo.status)<>"OK"'
              name: 'Server information unavailable'
              opdata: 'Current state: {ITEM.LASTVALUE}'
              priority: HIGH
              description: 'Failed to get server information.'
              tags:
                - tag: scope
                  value: availability
        - uuid: 2551bef7fa0f4ee0acbfd6bd0c90ef76
          name: 'Swap free'
          type: DEPENDENT
          key: nextcloud.serverinfo.swap.free
          units: B
          description: 'The amount of free swap.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ocs.data.nextcloud.system.swap_free
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nextcloud.serverinfo.get_data
          tags:
            - tag: component
              value: memory
        - uuid: 8a625e77ba964a49945c6367d95f3a88
          name: 'Swap used, in %'
          type: DEPENDENT
          key: nextcloud.serverinfo.swap.pused
          units: '%'
          description: 'Swap usage, in percent.'
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  function getField(data, path) {
                  	var steps = path.split('.');
                  	for (var i = 0; i < steps.length; i++) {
                  		var step = steps[i];
                  		if (typeof data !== 'object' || typeof data[step] === 'undefined') {
                  			throw 'Required field was not found: ' + path;
                  		}
                  
                  		data = data[step];
                  	}
                  
                  	return data;
                  }
                  
                  var data = JSON.parse(value),
                  	swap_total = getField(data,'ocs.data.nextcloud.system.swap_total'),
                  	swap_free = getField(data,'ocs.data.nextcloud.system.swap_free');
                  
                  return Math.ceil(100 - swap_free / swap_total * 100);
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nextcloud.serverinfo.get_data
          tags:
            - tag: component
              value: memory
          triggers:
            - uuid: da09c1862385450196651573aec00178
              expression: 'min(/Nextcloud by HTTP/nextcloud.serverinfo.swap.pused,5m) > {$NEXTCLOUD.SWAP.PUSED.MAX}'
              name: 'High swap utilization'
              event_name: 'High swap utilization (>{$NEXTCLOUD.SWAP.PUSED.MAX}% for 5m)'
              priority: AVERAGE
              description: 'The system is running out of free swap.'
              tags:
                - tag: scope
                  value: performance
        - uuid: 361f440188a3415280e2b5f1b6b5aafb
          name: 'Swap total'
          type: DEPENDENT
          key: nextcloud.serverinfo.swap.total
          units: B
          description: 'The size of the swap memory.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ocs.data.nextcloud.system.swap_total
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nextcloud.serverinfo.get_data
          tags:
            - tag: component
              value: memory
        - uuid: c4939cb87ff8495784e3937c4bc7e34d
          name: Version
          type: DEPENDENT
          key: nextcloud.serverinfo.version
          value_type: CHAR
          description: 'Nextcloud service version.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ocs.data.nextcloud.system.version
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nextcloud.serverinfo.get_data
          tags:
            - tag: component
              value: system
          triggers:
            - uuid: e66591237ce643b0971e69b18a88a7cc
              expression: 'change(/Nextcloud by HTTP/nextcloud.serverinfo.version)=1 and length(last(/Nextcloud by HTTP/nextcloud.serverinfo.version))>0'
              name: 'Version has changed'
              event_name: 'Version has changed (new version: {ITEM.VALUE})'
              priority: INFO
              description: 'Nextcloud version has changed. Acknowledge to close the problem manually.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: notice
      discovery_rules:
        - uuid: 477477630aa14dd8b3940f7b95697893
          name: 'Nextcloud: User discovery'
          type: HTTP_AGENT
          key: nextcloud.user.discovery
          delay: 1h
          authtype: BASIC
          username: '{$NEXTCLOUD.USER.NAME}'
          password: '{$NEXTCLOUD.USER.PASSWORD}'
          filter:
            evaltype: AND
            conditions:
              - macro: '{#NEXTCLOUD.USER}'
                value: '{$NEXTCLOUD.LLD.FILTER.USER.MATCHES}'
              - macro: '{#NEXTCLOUD.USER}'
                value: '{$NEXTCLOUD.LLD.FILTER.USER.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
          lifetime: 1d
          description: 'User discovery.'
          item_prototypes:
            - uuid: eb16b38dd7e94aaa8ff103ffdec16858
              name: 'User "{#NEXTCLOUD.USER}": Display name'
              type: DEPENDENT
              key: 'nextcloud.user.displayname[{#NEXTCLOUD.USER}]'
              value_type: CHAR
              description: 'User visible name.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.ocs.data.displayname
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'nextcloud.user.get_data[{#NEXTCLOUD.USER}]'
              tags:
                - tag: component
                  value: environment
                - tag: user
                  value: '{#NEXTCLOUD.USER}'
            - uuid: ed4fcf54655d49d3971d3ca1a63c6df2
              name: 'User "{#NEXTCLOUD.USER}": Status'
              type: DEPENDENT
              key: 'nextcloud.user.enabled[{#NEXTCLOUD.USER}]'
              description: 'User account status.'
              valuemap:
                name: 'User status'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.ocs.data.enabled
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'nextcloud.user.get_data[{#NEXTCLOUD.USER}]'
              tags:
                - tag: component
                  value: environment
                - tag: user
                  value: '{#NEXTCLOUD.USER}'
              trigger_prototypes:
                - uuid: 402851b8791c4f6da8f513e6e8c51f46
                  expression: 'change(/Nextcloud by HTTP/nextcloud.user.enabled[{#NEXTCLOUD.USER}]) = 1'
                  name: 'User "{#NEXTCLOUD.USER}" status changed'
                  priority: INFO
                  description: 'User account status has changed.'
                  tags:
                    - tag: scope
                      value: notice
            - uuid: 78b3e2a8e7844b0ea5929dbecd8a2ed7
              name: 'User "{#NEXTCLOUD.USER}": Get data'
              type: HTTP_AGENT
              key: 'nextcloud.user.get_data[{#NEXTCLOUD.USER}]'
              history: '0'
              value_type: TEXT
              authtype: BASIC
              username: '{$NEXTCLOUD.USER.NAME}'
              password: '{$NEXTCLOUD.USER.PASSWORD}'
              description: 'Get common information about user'
              preprocessing:
                - type: CHECK_NOT_SUPPORTED
                  parameters:
                    - '-1'
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '<ocs><meta><status>failure</status><statuscode>999</statuscode><message/></meta><data><message>Unknown error</message></data></ocs>'
                - type: XML_TO_JSON
              timeout: 10s
              url: '{$NEXTCLOUD.SCHEMA}://{$NEXTCLOUD.ADDRESS}/ocs/v1.php/cloud/users/{#NEXTCLOUD.USER}'
              status_codes: '200,401'
              http_proxy: '{$NEXTCLOUD.PROXY}'
              headers:
                - name: OCS-APIRequest
                  value: 'true'
              tags:
                - tag: component
                  value: raw
                - tag: user
                  value: '{#NEXTCLOUD.USER}'
            - uuid: d69ff358ddfe4ef3b5cc2f4218495975
              name: 'User "{#NEXTCLOUD.USER}": Last login, days ago'
              type: DEPENDENT
              key: 'nextcloud.user.inactive[{#NEXTCLOUD.USER}]'
              value_type: FLOAT
              units: '!days ago'
              description: 'The number of days since the user has last logged in.'
              valuemap:
                name: 'Last activity'
              preprocessing:
                - type: JAVASCRIPT
                  parameters:
                    - |
                      function getField(data, path) {
                      	var steps = path.split('.');
                      	for (var i = 0; i < steps.length; i++) {
                      		var step = steps[i];
                      		if (typeof data !== 'object' || typeof data[step] === 'undefined') {
                      			throw 'Required field was not found: ' + path;
                      		}
                      
                      		data = data[step];
                      	}
                      
                      	return data;
                      }
                      
                      var data = JSON.parse(value),
                      	lastlogin = getField(data,'ocs.data.lastLogin');
                      
                      if (lastlogin === '0')
                      	return -1
                      
                      return Math.floor((Date.now() - lastlogin) / 1000 / 86400);
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'nextcloud.user.get_data[{#NEXTCLOUD.USER}]'
              tags:
                - tag: component
                  value: environment
                - tag: user
                  value: '{#NEXTCLOUD.USER}'
              trigger_prototypes:
                - uuid: d2392d1b6e974a2da32de3a1f20f54a6
                  expression: 'last(/Nextcloud by HTTP/nextcloud.user.inactive[{#NEXTCLOUD.USER}]) > {$NEXTCLOUD.USER.MAX.INACTIVE:"{#NEXTCLOUD.USER}"}'
                  name: 'User "{#NEXTCLOUD.USER}": inactive'
                  event_name: 'User "{#NEXTCLOUD.USER}": inactive over {$NEXTCLOUD.USER.MAX.INACTIVE:"{#NEXTCLOUD.USER}"} days'
                  priority: INFO
                  description: 'The user has not logged in for more than {$NEXTCLOUD.USER.MAX.INACTIVE:"{#NEXTCLOUD.USER}"} days.'
                  tags:
                    - tag: scope
                      value: notice
            - uuid: ee0911775cb4404586aa38d95a4659a1
              name: 'User "{#NEXTCLOUD.USER}": Language'
              type: DEPENDENT
              key: 'nextcloud.user.language[{#NEXTCLOUD.USER}]'
              value_type: CHAR
              description: 'User language.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.ocs.data.language
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'nextcloud.user.get_data[{#NEXTCLOUD.USER}]'
              tags:
                - tag: component
                  value: environment
                - tag: user
                  value: '{#NEXTCLOUD.USER}'
            - uuid: fbf8643740a748019950eddea3baa79d
              name: 'User "{#NEXTCLOUD.USER}": Last login'
              type: DEPENDENT
              key: 'nextcloud.user.lastLogin[{#NEXTCLOUD.USER}]'
              units: unixtime
              description: 'The time the user has last logged in.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.ocs.data.lastLogin
                  error_handler: DISCARD_VALUE
                - type: MULTIPLIER
                  parameters:
                    - '0.001'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'nextcloud.user.get_data[{#NEXTCLOUD.USER}]'
              tags:
                - tag: component
                  value: environment
                - tag: user
                  value: '{#NEXTCLOUD.USER}'
            - uuid: 289504a5d93243ae8a8e1598c5568f25
              name: 'User "{#NEXTCLOUD.USER}": Quota free space'
              type: DEPENDENT
              key: 'nextcloud.user.quota.free[{#NEXTCLOUD.USER}]'
              units: B
              description: 'The size of the free available space in the user''s storage.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.ocs.data.quota.free
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'nextcloud.user.get_data[{#NEXTCLOUD.USER}]'
              tags:
                - tag: component
                  value: storage
                - tag: user
                  value: '{#NEXTCLOUD.USER}'
            - uuid: 3764a92e1b8b40a29da63202d435f648
              name: 'User "{#NEXTCLOUD.USER}": Quota used space, in %'
              type: DEPENDENT
              key: 'nextcloud.user.quota.pused[{#NEXTCLOUD.USER}]'
              value_type: FLOAT
              units: '%'
              description: 'Usage of the allocated storage space, in percent.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.ocs.data.quota.relative
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'nextcloud.user.get_data[{#NEXTCLOUD.USER}]'
              tags:
                - tag: component
                  value: storage
                - tag: user
                  value: '{#NEXTCLOUD.USER}'
              trigger_prototypes:
                - uuid: e39849b5b7394bd88002441afa27907c
                  expression: 'min(/Nextcloud by HTTP/nextcloud.user.quota.pused[{#NEXTCLOUD.USER}],5m) > {$NEXTCLOUD.USER.QUOTA.PUSED.MAX:"{#NEXTCLOUD.USER}"}'
                  name: 'User "{#NEXTCLOUD.USER}": High quota utilization'
                  event_name: 'User "{#NEXTCLOUD.USER}" High quota utilization (>{$NEXTCLOUD.USER.QUOTA.PUSED.MAX:"{#NEXTCLOUD.USER}"}% for 5m)'
                  priority: WARNING
                  description: 'More than {$NEXTCLOUD.USER.QUOTA.PUSED.MAX:"{#NEXTCLOUD.USER}"} percent of the allocated storage space has been used.'
                  tags:
                    - tag: scope
                      value: capacity
            - uuid: 1d939132880f43438fcf84c46540e1cb
              name: 'User "{#NEXTCLOUD.USER}": Quota total space '
              type: DEPENDENT
              key: 'nextcloud.user.quota.total[{#NEXTCLOUD.USER}]'
              units: B
              description: 'The size of space available in the user''s storage.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.ocs.data.quota.total
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'nextcloud.user.get_data[{#NEXTCLOUD.USER}]'
              tags:
                - tag: component
                  value: storage
                - tag: user
                  value: '{#NEXTCLOUD.USER}'
            - uuid: f0ff887fde504a1f86c0d6c8c4fb1285
              name: 'User "{#NEXTCLOUD.USER}": Quota used space'
              type: DEPENDENT
              key: 'nextcloud.user.quota.used[{#NEXTCLOUD.USER}]'
              units: B
              description: 'The size of the used available space in the user storage.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.ocs.data.quota.used
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'nextcloud.user.get_data[{#NEXTCLOUD.USER}]'
              tags:
                - tag: component
                  value: storage
                - tag: user
                  value: '{#NEXTCLOUD.USER}'
            - uuid: ac6ec7674e544151a4c5457d203d1e90
              name: 'User "{#NEXTCLOUD.USER}": Quota'
              type: DEPENDENT
              key: 'nextcloud.user.quota[{#NEXTCLOUD.USER}]'
              value_type: FLOAT
              units: B
              description: 'The size of space available in the user''s storage.'
              valuemap:
                name: 'Quota type'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.ocs.data.quota.quota
                  error_handler: DISCARD_VALUE
                - type: STR_REPLACE
                  parameters:
                    - none
                    - '-99'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'nextcloud.user.get_data[{#NEXTCLOUD.USER}]'
              tags:
                - tag: component
                  value: storage
                - tag: user
                  value: '{#NEXTCLOUD.USER}'
            - uuid: a1841e2a74dc4238842d1ec6643000ae
              name: 'User "{#NEXTCLOUD.USER}": Storage location'
              type: DEPENDENT
              key: 'nextcloud.user.storageLocation[{#NEXTCLOUD.USER}]'
              value_type: CHAR
              description: 'The location of the user''s store.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.ocs.data.storageLocation
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'nextcloud.user.get_data[{#NEXTCLOUD.USER}]'
              tags:
                - tag: component
                  value: environment
                - tag: user
                  value: '{#NEXTCLOUD.USER}'
          graph_prototypes:
            - uuid: 54e9ed6ca0e44cbb9c7d309e5bc9aa1b
              name: 'Nextcloud: User "{#NEXTCLOUD.USER}": Quota'
              type: PIE
              show_3d: 'YES'
              graph_items:
                - color: 81C784
                  item:
                    host: 'Nextcloud by HTTP'
                    key: 'nextcloud.user.quota.free[{#NEXTCLOUD.USER}]'
                - sortorder: '1'
                  color: FF5722
                  item:
                    host: 'Nextcloud by HTTP'
                    key: 'nextcloud.user.quota.used[{#NEXTCLOUD.USER}]'
            - uuid: 298d3eca259c47b28c03e25b007128fb
              name: 'Nextcloud: User "{#NEXTCLOUD.USER}": Quota, history'
              type: STACKED
              graph_items:
                - color: 81C784
                  item:
                    host: 'Nextcloud by HTTP'
                    key: 'nextcloud.user.quota.free[{#NEXTCLOUD.USER}]'
                - sortorder: '1'
                  color: FF5722
                  item:
                    host: 'Nextcloud by HTTP'
                    key: 'nextcloud.user.quota.used[{#NEXTCLOUD.USER}]'
          timeout: 10s
          url: '{$NEXTCLOUD.SCHEMA}://{$NEXTCLOUD.ADDRESS}/ocs/v1.php/cloud/users?format=json'
          http_proxy: '{$NEXTCLOUD.PROXY}'
          headers:
            - name: OCS-APIRequest
              value: 'true'
          lld_macro_paths:
            - lld_macro: '{#NEXTCLOUD.USER}'
              path: $.user_name
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ocs.data.users
              error_handler: CUSTOM_VALUE
              error_handler_params: '[]'
            - type: JAVASCRIPT
              parameters:
                - 'return JSON.stringify(JSON.parse(value).map(function(user) {return {user_name: user}}));'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
      tags:
        - tag: class
          value: application
        - tag: target
          value: nextcloud
      macros:
        - macro: '{$NEXTCLOUD.ADDRESS}'
          value: 127.0.0.1
          description: 'IP or DNS name of Nextcloud server.'
        - macro: '{$NEXTCLOUD.CPU.LOAD.MAX}'
          value: '95'
          description: 'CPU load threshold (the number of processes in the system run queue).'
        - macro: '{$NEXTCLOUD.LLD.FILTER.USER.MATCHES}'
          value: '.*'
          description: 'Filter of discoverable users by name.'
        - macro: '{$NEXTCLOUD.LLD.FILTER.USER.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'Filter to exclude discovered users by name.'
        - macro: '{$NEXTCLOUD.MEM.PUSED.MAX}'
          value: '90'
          description: 'Memory utilization threshold.'
        - macro: '{$NEXTCLOUD.PHP.MEM.PUSED.MAX}'
          value: '90'
          description: 'PHP memory utilization threshold.'
        - macro: '{$NEXTCLOUD.PROXY}'
          description: 'Proxy HTTP(S) address.'
        - macro: '{$NEXTCLOUD.SCHEMA}'
          value: https
          description: 'HTTP or HTTPS protocol of Nextcloud.'
        - macro: '{$NEXTCLOUD.STORAGE.FREE.MIN}'
          value: 1G
          description: 'Free space threshold.'
        - macro: '{$NEXTCLOUD.SWAP.PUSED.MAX}'
          value: '90'
          description: 'Swap utilization threshold.'
        - macro: '{$NEXTCLOUD.USER.MAX.INACTIVE}'
          value: '30'
          description: 'How many days a user can be inactive.'
        - macro: '{$NEXTCLOUD.USER.NAME}'
          value: root
          description: 'Nextcloud username.'
        - macro: '{$NEXTCLOUD.USER.PASSWORD}'
          type: SECRET_TEXT
          description: 'Nextcloud user password.'
        - macro: '{$NEXTCLOUD.USER.QUOTA.PUSED.MAX}'
          value: '90'
          description: 'Storage utilization threshold.'
      dashboards:
        - uuid: 580aef505caa41619a3296dda70b6512
          name: Nextcloud
          pages:
            - name: 'Nextcloud: Overview'
              widgets:
                - type: item
                  name: 'Nextcloud: Version'
                  width: '6'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nextcloud by HTTP'
                        key: nextcloud.serverinfo.version
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '3'
                    - type: INTEGER
                      name: show.2
                      value: '2'
                - type: graph
                  name: 'Nextcloud: Active users'
                  'y': '2'
                  width: '72'
                  height: '6'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Nextcloud by HTTP'
                        name: 'Nextcloud: Active users'
                    - type: STRING
                      name: reference
                      value: AAAAA
                - type: graph
                  name: 'Nextcloud: CPU load'
                  'y': '8'
                  width: '72'
                  height: '6'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Nextcloud by HTTP'
                        name: 'Nextcloud: CPU load'
                    - type: STRING
                      name: reference
                      value: AAAAB
                - type: graph
                  name: 'Nextcloud: Database size'
                  'y': '14'
                  width: '72'
                  height: '6'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Nextcloud by HTTP'
                        name: 'Nextcloud: Database: size'
                    - type: STRING
                      name: reference
                      value: AAAAC
                - type: graph
                  name: 'Nextcloud: Memory utilization'
                  'y': '20'
                  width: '72'
                  height: '6'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Nextcloud by HTTP'
                        name: 'Nextcloud: Memory utilization'
                    - type: STRING
                      name: reference
                      value: AAAAD
                - type: item
                  name: 'Nextcloud: Web server'
                  x: '6'
                  width: '18'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nextcloud by HTTP'
                        key: nextcloud.serverinfo.apps.webserver
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '3'
                    - type: INTEGER
                      name: show.2
                      value: '2'
                - type: item
                  name: 'Nextcloud: Free space'
                  x: '24'
                  width: '12'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nextcloud by HTTP'
                        key: nextcloud.serverinfo.freespace
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '3'
                    - type: INTEGER
                      name: show.2
                      value: '2'
                - type: item
                  name: 'Nextcloud: Database'
                  x: '36'
                  width: '36'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nextcloud by HTTP'
                        key: nextcloud.serverinfo.db.version
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '3'
                    - type: INTEGER
                      name: show.2
                      value: '2'
            - name: 'Nextcloud: Users'
              widgets:
                - type: graphprototype
                  name: 'Nextcloud: User quota usage'
                  width: '72'
                  height: '24'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'Nextcloud by HTTP'
                        name: 'Nextcloud: User "{#NEXTCLOUD.USER}": Quota, history'
                    - type: STRING
                      name: reference
                      value: AAAAE
                    - type: INTEGER
                      name: rows
                      value: '4'
      valuemaps:
        - uuid: 19c5ab8f192d42f4bd35a969bef3c9d6
          name: 'Last activity'
          mappings:
            - value: '0'
              newvalue: Today
            - value: '1'
              newvalue: Yesterday
            - value: '-1'
              newvalue: Never
            - type: IN_RANGE
              value: 2-7
              newvalue: 'This week'
        - uuid: 18f5c94273b24b88a96bdf9d01b8d63b
          name: 'Quota type'
          mappings:
            - value: '-3'
              newvalue: Unlimited
            - value: '-99'
              newvalue: Unknown
        - uuid: 3265bb49d935495abbcf8b24fbe8ed91
          name: 'User status'
          mappings:
            - value: '0'
              newvalue: Disabled
            - value: '1'
              newvalue: Enabled
  graphs:
    - uuid: 46bd62563ab9414b868818271a8715ee
      name: 'Nextcloud: Active users'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 81C784
          item:
            host: 'Nextcloud by HTTP'
            key: nextcloud.serverinfo.active_users.last5m
        - sortorder: '1'
          color: FFD54F
          item:
            host: 'Nextcloud by HTTP'
            key: nextcloud.serverinfo.active_users.last1h
        - sortorder: '2'
          drawtype: BOLD_LINE
          color: FF5722
          item:
            host: 'Nextcloud by HTTP'
            key: nextcloud.serverinfo.active_users.last24hours
    - uuid: 7dbbcf04d99842f39292a29b1b71b3de
      name: 'Nextcloud: CPU load'
      ymax_type_1: FIXED
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 81C784
          item:
            host: 'Nextcloud by HTTP'
            key: nextcloud.serverinfo.cpu.avg.1m
        - sortorder: '1'
          color: FFD54F
          item:
            host: 'Nextcloud by HTTP'
            key: nextcloud.serverinfo.cpu.avg.5m
        - sortorder: '2'
          drawtype: BOLD_LINE
          color: FF5722
          item:
            host: 'Nextcloud by HTTP'
            key: nextcloud.serverinfo.cpu.avg.15m
    - uuid: fff2891ee9f04a9abc259a4cafd4a2a1
      name: 'Nextcloud: Database: size'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 81C784
          item:
            host: 'Nextcloud by HTTP'
            key: nextcloud.serverinfo.db.size
    - uuid: ced411f851ea4c11805d6bbdd3f20c61
      name: 'Nextcloud: Memory utilization'
      ymax_type_1: FIXED
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 81C784
          item:
            host: 'Nextcloud by HTTP'
            key: nextcloud.serverinfo.mem.pused
        - sortorder: '1'
          color: FFD54F
          item:
            host: 'Nextcloud by HTTP'
            key: nextcloud.serverinfo.swap.pused
        - sortorder: '2'
          drawtype: BOLD_LINE
          color: FF5722
          item:
            host: 'Nextcloud by HTTP'
            key: nextcloud.serverinfo.php.memory.pused
        - sortorder: '3'
          color: 64B5F6
          item:
            host: 'Nextcloud by HTTP'
            key: nextcloud.serverinfo.php.memory.wasted_percentage
