### Install 360 Monitoring Agent on Debian Source: https://docs.360monitoring.com/docs/360-monitoring-installation Installs the 360 Monitoring agent on Debian GNU/Linux systems. This involves installing necessary Python packages via apt-get and pip, downloading the agent configuration file, and then using the agent command-line tool to generate a server ID with a user token obtained from the 360 Monitoring UI. Finally, it configures and starts the agent as a systemd service. ```shell apt-get install python3-dev python3-setuptools python3-pip pip3 install agent360 wget -O /etc/agent360.ini https://monitoring.platform360.io/agent360.ini agent360 hello USERTOKEN /etc/agent360-token.ini chmod 644 /etc/systemd/system/agent360.service systemctl daemon-reload systemctl enable agent360 systemctl start agent360 ``` -------------------------------- ### Install 360 Monitoring on Plesk via CLI (Manual API Token Entry) Source: https://docs.360monitoring.com/docs/360-monitoring-installation Connects a Plesk server to 360 Monitoring by prompting the user to enter the API token directly in the command line. This is useful for interactive installations where the token is not stored in a file. It requires separate commands for server connection, monitoring setup, and agent installation. ```shell plesk ext platform360 --connect-server -p360-key-file - plesk ext platform360 --monitoring-setup -p360-key-file - plesk ext monitoring --cloud --install-monitoring-agent ``` -------------------------------- ### Install 360 Monitoring on Plesk via CLI (API Token from File) Source: https://docs.360monitoring.com/docs/360-monitoring-installation Connects a Plesk server to 360 Monitoring using API credentials stored in a file. Assumes the API token file has appropriate read/write permissions for the owner. This method involves multiple commands to establish the connection, set up monitoring, and install the agent. ```shell plesk ext platform360 --connect-server -p360-key-file /path/to/file/with/secret plesk ext platform360 --monitoring-setup -p360-key-file /path/to/file/with/secret plesk ext monitoring --cloud --install-monitoring-agent ``` -------------------------------- ### Install Dependencies for VM Plugin (Debian/Ubuntu) Source: https://docs.360monitoring.com/docs/virtual-machine-plugin Installs the necessary Debian/Ubuntu packages required for the Virtual Machine Plugin. This includes `python-libxml2` for XML parsing and `libvirt-dev` for libvirt development headers. ```bash apt-get install python-libxml2 libvirt-dev ``` -------------------------------- ### Install OpenVPN Status Package (Python) Source: https://docs.360monitoring.com/docs/openvpn-plugin Installs the necessary Python package for parsing OpenVPN status logs. Use pip or pip3 depending on your Python environment. ```shell pip install openvpn-status ``` ```shell pip3 install openvpn-status ``` -------------------------------- ### Install libvirt-python for VM Plugin (pip) Source: https://docs.360monitoring.com/docs/virtual-machine-plugin Installs the `libvirt-python` library using pip, which is a Python binding for libvirt used by the Virtual Machine Plugin. Supports both Python 2 and Python 3 installations. ```bash pip install libvirt-python ``` ```bash pip3 install libvirt-python ``` -------------------------------- ### Install MySQL-python Dependency Source: https://docs.360monitoring.com/docs/mysql-plugin Commands to install the MySQL-python library, a key dependency for the MySQL plugin. Supports Debian/Ubuntu and CentOS/RHEL systems, as well as installation via pip. ```bash sudo apt-get install python-mysqldb # or yum install MySQL-python # or pip install MySQL-python ``` ```bash sudo apt-get install python3-mysqldb # or pip3 install mysqlclient # (mysql-devel is required on CentOS: yum install mysql-devel) ``` -------------------------------- ### MySQL Plugin Test Output Example Source: https://docs.360monitoring.com/docs/mysql-plugin Example JSON output from testing the MySQL plugin, illustrating the structure and types of metrics collected from the MySQL server. ```json { "aborted_clients": 0, "aborted_connects": 0, "binlog_cache_disk_use": 0, "binlog_cache_use": 0, "bytes_received": 0, "bytes_sent": 0, "com_delete": 0, "com_delete_multi": 0, "com_insert": 0, "com_insert_select": 0, "com_load": 0, "com_replace": 0, "com_replace_select": 0, "com_select": 0, "com_update": 0, "com_update_multi": 0, "connections": 0, "created_tmp_disk_tables": 0, "created_tmp_files": 0, "created_tmp_tables": 0, "key_read_requests": 0, "key_reads": 0, "key_write_requests": 0, "key_writes": 0, "max_used_connections": 2.0, "open_files": 6.0, "open_tables": 71.0, "opened_tables": 0, "qcache_free_blocks": 1.0, "qcache_free_memory": 67091584.0, "qcache_hits": 0, "qcache_inserts": 0, "qcache_lowmem_prunes": 0, "qcache_not_cached": 0, "qcache_queries_in_cache": 0, "qcache_total_blocks": 1.0, "questions": 0, "select_full_join": 0, "select_full_range_join": 0, "select_range": 0, "select_range_check": 0, "select_scan": 0, "slave_open_temp_tables": 0.0, "slow_launch_threads": 0, "slow_queries": 0, "sort_range": 0, "sort_rows": 0, "sort_scan": 0, "table_locks_immediate": 0, "table_locks_waited": 0, "threads_cached": 1.0, "threads_connected": 1.0, "threads_created": 0, "threads_running": 1.0, "uptime": 59949.0 } ``` -------------------------------- ### Test Exim Plugin Source: https://docs.360monitoring.com/docs/exim-queue-size-plugin Executes a command to test the Exim plugin's installation and configuration. It uses 'sudo -u agent360 agent360 test exim' and expects a JSON output indicating the queue size. ```json exim:{"queue_size": 0} ``` -------------------------------- ### Install 360 Monitoring on Plesk via CLI (Environment Variable) Source: https://docs.360monitoring.com/docs/360-monitoring-installation Installs 360 Monitoring on a Plesk server using an API token provided via the P360_API_KEY environment variable. This method is suitable for automated or script-based deployments. It requires setting the environment variable before executing the Plesk commands for connection, setup, and agent installation. Remember to unset the variable afterward for security. ```shell export P360_API_KEY= plesk ext platform360 --connect-server plesk ext platform360 --monitoring-setup plesk ext monitoring --cloud --install-monitoring-agent unset P360_API_KEY ``` -------------------------------- ### Install 360 Monitoring Agent on Fedora/CentOS (Python 2.6/2.7) Source: https://docs.360monitoring.com/docs/360-monitoring-installation Installs the 360 Monitoring agent on older Fedora and CentOS versions (6 and earlier) that use Python 2.6 or 2.7. It utilizes yum for package installation and easy_install for installing the agent and its dependencies like netifaces and psutil. ```shell yum install python-devel python-setuptools gcc easy_install agent360 netifaces psutil ``` -------------------------------- ### Test CloudLinux Plugin Installation Source: https://docs.360monitoring.com/docs/cloudlinux-plugin This command tests the CloudLinux plugin's installation and configuration. A successful test will output JSON data related to collected metrics, such as 'cloudlinux:{"metrics": 0.....}'. ```bash agent360 test cloudlinux ``` -------------------------------- ### Install 360 Monitoring Agent on Fedora/CentOS (Python 3) Source: https://docs.360monitoring.com/docs/360-monitoring-installation Installs the 360 Monitoring agent on newer Fedora and CentOS versions (7 and later) that use Python 3. It uses yum to install the required Python 3 development packages and gcc, and then pip3 to install the agent. ```shell yum install python36-devel python36 gcc pip3 install agent360 ``` -------------------------------- ### Docker Plugin Test Output Source: https://docs.360monitoring.com/docs/docker-plugin Example JSON output from testing the Docker plugin. It displays the total number of containers and detailed statistics for each container, including CPU usage, disk I/O, and memory utilization. ```json { "containers": 2, "goofy_lewin": { "cpu": "0.00", "disk_in_bytes": 0, "disk_out_bytes": 0, "mem_pct": "0.05", "mem_total_bytes": 1040501964.8, "mem_usage_bytes": 483328.0, "net_in_bytes": 0, "net_out_bytes": 0 }, "pensive_austin": { "cpu": "0.00", "disk_in_bytes": 0, "disk_out_bytes": 0, "mem_pct": "0.05", "mem_total_bytes": 1040501964.8, "mem_usage_bytes": 483328.0, "net_in_bytes": 0, "net_out_bytes": 0 } } ``` -------------------------------- ### Example mdstat Plugin Output Source: https://docs.360monitoring.com/docs/software-raid-plugin Demonstrates the JSON output from the mdstat plugin, showing the status of different RAID devices (md0, md1, md2). The output includes metrics like active, faulty, read_only, and resync for each device. ```json mdstat: { "md0": { "active": 1, "faulty": 0, "read_only": 0, "resync": 0 }, "md1": { "active": 1, "faulty": 0, "read_only": 0, "resync": 0 }, "md2": {"active": 1, "faulty": 0, "read_only": 0, "resync": 0 } } ``` -------------------------------- ### Upgrade Agent360 on Windows using Installer Source: https://docs.360monitoring.com/docs/update-the-monitoring-agent Installs the latest version of agent360 on Windows silently. The installer executable needs to be downloaded from the GitHub releases page. After installation, the agent service must be restarted. ```cmd SetupAgent360-v1.3.4.exe /nohello /verysilent net stop Agent360 && net start Agent360 ``` -------------------------------- ### Update GRUB and Reboot System Source: https://docs.360monitoring.com/docs/installation-with-grsecurity These commands are executed after modifying the GRUB configuration file. `update-grub` applies the changes to the bootloader configuration, and `reboot` restarts the system to load the new kernel parameters. These commands require root privileges. ```bash sudo update-grub sudo reboot ``` -------------------------------- ### PHP-FPM Plugin Test Output Source: https://docs.360monitoring.com/docs/php-fpm-plugin Example JSON output from testing the PHP-FPM agent plugin. This shows the structure and types of metrics collected by the plugin. ```json phpfpm: { "accepted_conn": 3015, "accepted_conn_per_second": 0.0, "active_processes": 1, "idle_processes": 0, "listen_queue": 0, "listen_queue_len": 128, "max_active_processes": 1, "max_children_reached": 0, "max_listen_queue": 1, "pool": "www", "process_manager": "ondemand", "slow_requests": 0, "start_since": 294686, "start_time": 1492504250, "total_processes": 1 } ``` -------------------------------- ### Create MySQL User for Monitoring Source: https://docs.360monitoring.com/docs/mysql-plugin SQL commands to create a MySQL user ('agent360') with specific privileges required for the monitoring plugin. Includes variations for Plesk and standard MySQL/MariaDB installations, including permissions for `performance_schema` and replication monitoring. ```sql plesk db "CREATE USER 'agent360'@'127.0.0.1' IDENTIFIED BY 'safeandsecurepassword'" ``` ```sql sudo mysql -e "CREATE USER 'agent360'@'127.0.0.1' IDENTIFIED BY 'safeandsecurepassword';" sudo mysql -e "GRANT PROCESS ON *.* TO 'agent360'@'127.0.0.1';" sudo mysql -e "GRANT SELECT ON performance_schema.* TO 'agent360'@'127.0.0.1';" ``` ```sql sudo mysql -e "grant replica monitor on *.* to 'agent360'@'127.0.0.1';" ``` ```sql sudo mysql -e "GRANT REPLICATION CLIENT ON *.* TO 'agent360'@'localhost';" ``` -------------------------------- ### Check grsecurity Status with sysctl Source: https://docs.360monitoring.com/docs/installation-with-grsecurity This command checks if grsecurity is enabled on the system by querying kernel parameters. It outputs a list of grsecurity-related settings if found; otherwise, no output indicates grsecurity is not active. No specific input is required beyond running the command. ```bash sysctl -a | grep grsecurity ``` -------------------------------- ### Add Server Metrics using Command Line CURL Source: https://docs.360monitoring.com/docs/add-metrics-to-a-server This example shows how to add metrics to a server directly from the command line using CURL. It sends a POST request with a JSON payload containing metric data points to the 360 Monitoring API. This method is useful for scripting and quick testing. ```bash curl -X POST -H "Content-type: application/json" -d "{ \"metrics\" :[{\"metric\":\"motherboard.temp\",\"points\":[[1523439139, 20],[1523439339, 40],[1523439539, 70]]}]}" https://api.eu.monitoring.platform360.io/v1/server/5aafddba3a2bbd3ae5230aa30/store?token=3318e3223ac57e7aa5269a4aaf1abc1a2 ``` -------------------------------- ### MongoDB Plugin Metrics Output (JSON) Source: https://docs.360monitoring.com/docs/mongodb-plugin Example JSON output from the MongoDB plugin, showcasing the various metrics collected. This includes information on assertions, connections, memory usage, and operation latencies. ```json { "asserts.msg": 0, "asserts.regular": 0, "asserts.rollovers": 0, "asserts.user": 0, "asserts.warning": 0, "connections.available": 50743, "connections.current": 457, "connections.totalCreated": 0, "mem": { "bits": 64, "mapped": 0, "mappedWithJournal": 0, "resident": 29966, "supported": true, "virtual": 45514 }, "opLatencies.commands.latency": 0, "opLatencies.commands.ops": 0, "opLatencies.reads.latency": 0, "opLatencies.reads.ops": 0, "opLatencies.writes.latency": 0, "opLatencies.writes.ops": 0, "opcounters.command": 0, "opcounters.delete": 0, "opcounters.getmore": 0, "opcounters.insert": 0, "opcounters.query": 0, "opcounters.update": 0 } ``` -------------------------------- ### Asterisk Plugin Test Output Example Source: https://docs.360monitoring.com/docs/asterisk-plugin This JSON output represents a successful test of the Asterisk plugin. It shows the current count for 'calls' and 'incomingcalls', indicating the plugin is correctly reporting metrics. ```json asterisk:{"calls": 0,"incomingcalls": 0} ``` -------------------------------- ### GET /v1/server/{SERVER_ID}/metrics?output=png Source: https://docs.360monitoring.com/docs/export-charts-directly-to-png-format Fetches a server's metric data directly as a PNG image. This endpoint allows you to specify various parameters to customize the chart, such as the metric type, specific keys, device IDs, value ranges, and dimensions. ```APIDOC ## GET /v1/server/{SERVER_ID}/metrics?output=png ### Description This endpoint retrieves a server's metric data and returns it as a PNG image. It supports customization through query parameters to select specific metrics, keys, devices, and visual properties of the chart. ### Method GET ### Endpoint `https://api.eu.monitoring.platform360.io/v1/server/{SERVER_ID}/metrics` ### Parameters #### Path Parameters - **SERVER_ID** (string) - Required - The unique identifier for the server. #### Query Parameters - **token** (string) - Required - Your API authentication token. - **output** (string) - Required - Set to `png` to receive the chart as a PNG image. - **metric** (string) - Required - The type of metric to retrieve (e.g., `cpu`, `memory`). - **key** (string) - Optional - Comma-separated list of specific metric keys to display (e.g., `i:idle,st:steal`). If omitted, all keys are returned. - **device** (string) - Optional - Comma-separated list of device IDs to filter by (e.g., `0,1`). - **min** (number) - Optional - The minimum value for the Y-axis. - **max** (number) - Optional - The maximum value for the Y-axis. - **width** (integer) - Optional - The desired width of the generated PNG image in pixels. - **height** (integer) - Optional - The desired height of the generated PNG image in pixels. ### Request Example ```bash https://api.eu.monitoring.platform360.io/v1/server/YOUR_SERVER_ID/metrics?token=YOUR_API_TOKEN&output=png&metric=cpu&key=i:idle,st:steal&width=1200&height=300 ``` ### Response #### Success Response (200) - **uri** (string) - A temporary URL pointing to the generated PNG image. #### Response Example ```json { "uri": "https:\/\/api.eu.monitoring.platform360.io\/tmp\/JwAKsZH3LrtFAfTIdbFhPb48uEfvTwaC31mvO3yAu2g5h9OultMaFQj9dyE65PI8.png" } ``` ``` -------------------------------- ### Configure GRUB for grsecurity Access Source: https://docs.360monitoring.com/docs/installation-with-grsecurity This snippet demonstrates how to modify the GRUB configuration to grant 360 Monitoring access to the /proc directory when grsecurity is enabled. It involves editing the GRUB_CMDLINE_LINUX_DEFAULT line to include the `grsec_proc_gid` parameter with the agent's group ID. This requires root privileges to edit the file and update GRUB. ```bash GRUB_CMDLINE_LINUX_DEFAULT="noquiet nosplash net.ifnames=0 biosdevname=0 grsec_proc_gid=123" ``` -------------------------------- ### Test Redis Plugin Output (agent360 test) Source: https://docs.360monitoring.com/docs/redis-plugin This example demonstrates the expected JSON output when testing the Redis plugin using the `agent360 test redis_stat` command. The output includes metrics like `uptime_in_seconds`, indicating the plugin is successfully collecting data from Redis. ```json redis_stat: { "uptime_in_seconds": 59949.0,... } ``` -------------------------------- ### Use Configuration Values in a 360 Monitoring Plugin Source: https://docs.360monitoring.com/docs/custom-plugins This Python plugin demonstrates how to retrieve configuration values from `agent360-custom.ini`. It uses the `config` object passed to the `run` method to get a URL, fetches data using `urllib2`, parses JSON, and returns results. ```python #!/usr/bin/env python import plugins import json import urllib2 class Plugin(plugins.BasePlugin): __name__ = 'fridge' def run(self, config): request = urllib2.Request(config.get(__name__, 'location')) raw_response = urllib2.urlopen(request) fridge_data = json.loads(raw_response.read(), object_hook=ascii_encode_dict) results = {'milk': fridge_data['milk'], 'eggs': fridge_data['eggs']} return results if __name__ == '__main__': Plugin().execute() ``` ```bash # Example configuration in /etc/agent360-custom.ini: [fridge] enabled = yes location = http://192.168.0.100/fridge.json ``` -------------------------------- ### Upgrade Agent360 on Linux using Pip Source: https://docs.360monitoring.com/docs/update-the-monitoring-agent Upgrades the agent360 package to the latest version using pip. Requires pip to be installed and configured. After upgrading, the agent service needs to be restarted. ```console pip3 install agent360 --upgrade service agent360 restart ``` -------------------------------- ### Testing the WP Toolkit Plugin Source: https://docs.360monitoring.com/docs/wp-toolkit-plugin Command to execute for testing the functionality of the WP Toolkit plugin. This command initiates a test run of the plugin's operations. ```bash agent360 test wp-toolkit ``` -------------------------------- ### Test VM Plugin Source: https://docs.360monitoring.com/docs/virtual-machine-plugin Executes a command to test the Virtual Machine Plugin and verify that it is collecting data. Requires root privileges via sudo and runs the agent360 test command for the 'vms' plugin. ```bash sudo -u agent360 agent360 test vms ``` -------------------------------- ### Test OpenVPN Plugin (agent360) Source: https://docs.360monitoring.com/docs/openvpn-plugin Executes a test command for the OpenVPN plugin using the agent360 utility. Requires root privileges or running as the agent360 user. ```shell sudo -u agent360 agent360 test openvpn ``` -------------------------------- ### Grant Sudo Access for Exim Source: https://docs.360monitoring.com/docs/exim-queue-size-plugin Appends a line to the /etc/sudoers file to grant the 'agent360' user passwordless sudo access to run the 'exim -bpc' command. This is a crucial dependency for the plugin to function. ```bash agent360 ALL=(ALL) NOPASSWD: /usr/sbin/exim ``` -------------------------------- ### Configure Exim Plugin Source: https://docs.360monitoring.com/docs/exim-queue-size-plugin Appends configuration lines to the agent360-custom.ini file to enable the Exim plugin. This involves adding a section for 'exim' and setting 'enabled' to 'yes'. ```text [exim] enabled = yes ``` -------------------------------- ### Test Apt Updates Plugin Source: https://docs.360monitoring.com/docs/apt-updates-plugin Command to test the apt-updates plugin functionality after configuration. ```bash sudo -u agent360 agent360 test apt-updates ``` -------------------------------- ### Configure sudoers for agent360 Source: https://docs.360monitoring.com/docs/cpu-temperature-plugin This snippet shows the line to add to the /etc/sudoers file to allow the agent360 user to execute kamctl without a password. Ensure this is done carefully to maintain system security. ```bash agent360 ALL=(ALL) NOPASSWD: /usr/sbin/kamctl ``` -------------------------------- ### Test a Custom Plugin with Agent360 CLI Source: https://docs.360monitoring.com/docs/custom-plugins These bash commands demonstrate how to test a custom plugin using the `agent360 test` command. It shows how to check the plugin's output and how to enable it by editing the configuration file. ```bash agent360 info ``` ```bash sudo -u agent360 agent360 test fridge ``` ```bash # Example output: fridge: {"eggs": 4,"milk": 10} ``` ```bash # Enable plugin in configuration file # /etc/agent360-custom.ini [fridge] enabled = yes ``` -------------------------------- ### Manual Uninstallation Commands for 360 Monitoring Source: https://docs.360monitoring.com/docs/uninstalling-360-monitoring-new-new Shell commands to manually uninstall the 360 Monitoring agent. This includes stopping and disabling the systemd service, removing configuration files, and uninstalling the Python package. It assumes the agent is managed by systemd and installed via pip. ```shell systemctl stop agent360 systemctl disable agent360 rm -f /etc/systemd/system/agent360 rm -f /etc/agent360.ini rm -f /etc/agent360-token.ini pip uninstall agent360 userdel agent360 ``` -------------------------------- ### Configure sudoers for Apt Updates Plugin Source: https://docs.360monitoring.com/docs/apt-updates-plugin This configuration allows the agent360 user to run apt-get commands without a password, which is necessary for the plugin to function. ```bash agent360 ALL=(ALL) NOPASSWD: /usr/bin/apt-get ``` -------------------------------- ### Test CPU Temperature Plugin Source: https://docs.360monitoring.com/docs/cpu-temperature-plugin This command is used to test the functionality of the CPU temperature plugin. It is executed with root privileges, switching to the agent360 user to run the test. ```bash sudo -u agent360 agent360 test temp ``` -------------------------------- ### Uninstall 360 Monitoring Agent (Older Version with systemd) Source: https://docs.360monitoring.com/docs/uninstalling-360-monitoring This snippet is for uninstalling the 360 Monitoring agent on older versions (0.963) using systemd. It includes stopping and disabling the agent service, removing its systemd unit file, and deleting the agent's installation directory. ```shell systemctl stop agent360 systemctl disable agent360 rm -f /etc/systemd/system/agent360 rm -rf /opt/agent360/ ``` -------------------------------- ### Configure sudoers for lveinfo command Source: https://docs.360monitoring.com/docs/cloudlinux-db-governor-plugin This configuration allows the agent360 to execute the 'lveinfo' command without requiring a password, which is necessary for the CloudLinux DB Governor plugin to gather metrics. ```bash agent360 ALL=(ALL) NOPASSWD: /usr/sbin/lveinfo ``` -------------------------------- ### Configure OpenVPN Plugin in agent360-custom.ini Source: https://docs.360monitoring.com/docs/openvpn-plugin Enables the OpenVPN plugin and specifies the path to the OpenVPN status log file within the agent360 configuration. ```ini [openvpn] enabled=yes status_path = /etc/openvpn/openvpn-status.log ``` -------------------------------- ### Test Unbound Plugin with agent360 Source: https://docs.360monitoring.com/docs/unbound-dns-plugin Command to test the Unbound DNS plugin after configuration. This command should be run as a privileged user (e.g., root) to execute the agent360 test command for the unbound plugin. ```bash sudo -u agent360 agent360 test unbound ``` -------------------------------- ### Create a Basic 360 Monitoring Plugin in Python Source: https://docs.360monitoring.com/docs/custom-plugins This Python code defines a simple custom plugin for 360 Monitoring. It inherits from `plugins.BasePlugin` and implements a `run` method that returns a dictionary of monitoring results. The plugin is saved in the agent's plugin directory and executed. ```python #!/usr/bin/env python import plugins class Plugin(plugins.BasePlugin): __name__ = 'fridge' def run(self, *unused): results = {'milk': 10, 'eggs': 4} return results if __name__ == '__main__': Plugin().execute() ``` -------------------------------- ### Configure Apache Plugin for 360Monitoring Source: https://docs.360monitoring.com/docs/apache These configuration lines set up the Apache plugin for 360Monitoring. It involves enabling the plugin and specifying the URL for the Apache status page within the agent configuration file. ```text Listen 7050 ServerName server.local SetHandler server-status Order deny,allow Deny from all Allow from 127.0.0.1 ``` ```text [httpd] enabled = true status_page_url = http://127.0.0.1:7050/httpd-status?auto ``` -------------------------------- ### Test MySQL Plugin Source: https://docs.360monitoring.com/docs/mysql-plugin Command to test the MySQL plugin's functionality and expected output format. Displays a JSON object containing various performance metrics reported by the MySQL server. ```bash agent360 --test mysql ``` -------------------------------- ### Configure Sudoers for Unbound Control Source: https://docs.360monitoring.com/docs/unbound-dns-plugin This configuration allows the agent360 user to execute unbound-control commands without a password. Ensure this line is added to your /etc/sudoers file to grant necessary permissions for the plugin to function. ```bash agent360 ALL=(ALL) NOPASSWD: /usr/sbin/unbound-control ``` -------------------------------- ### Verify agent360 Process User Source: https://docs.360monitoring.com/docs/run-the-monitoring-agent-as-the-root-user A command to list running processes and filter for agent360, useful for verifying that the agent is running under the intended user (e.g., root). Displays process details including the user account. ```bash ps aux | grep agent360 ``` -------------------------------- ### Enable VM Plugin Configuration Source: https://docs.360monitoring.com/docs/virtual-machine-plugin Enables the Virtual Machine Plugin by adding the relevant section to the agent360 custom configuration file. This ensures the plugin is active and collects VM metrics. ```text [vms] enabled = yes ``` -------------------------------- ### Test 360monitoring Minecraft Plugin Source: https://docs.360monitoring.com/docs/minecraft-plugin This command tests the agent360 Minecraft plugin to verify data collection. Running this command as the agent360 user will output any metrics gathered from the configured Minecraft servers. This is a crucial step before restarting the agent. ```bash sudo -u agent360 agent360 test minecraft ``` -------------------------------- ### Enable NGiNX Status Page Configuration Source: https://docs.360monitoring.com/docs/nginx-plugin This configuration snippet enables the NGiNX stub_status module, making NGiNX performance metrics accessible via a specific URL. Ensure NGiNX is compiled with the `--with-http_stub_status_module` and adjust the listen port if necessary. The status page is only accessible from the NGiNX server itself. ```text server { listen 127.0.0.1:8080; server_name localhost; location /status_page { stub_status on; allow 127.0.0.1; deny all; } } ``` -------------------------------- ### Configure Docker Plugin Source: https://docs.360monitoring.com/docs/docker-plugin Enables the Docker plugin by adding configuration lines to the agent360-custom.ini file. This is a simple text-based configuration to activate the plugin's monitoring capabilities. ```text [docker] enabled = yes ``` -------------------------------- ### Sudoers Configuration for cPanel WP Toolkit Source: https://docs.360monitoring.com/docs/wp-toolkit-plugin This configuration snippet is required for cPanel users to allow the agent360 process to execute the 'wp-toolkit' command without a password. It specifies the user, terminal, and the command that can be run. ```shell agent360 ALL=(ALL) NOPASSWD: /usr/local/bin/wp-toolkit ``` -------------------------------- ### Restart Agent360 Service Source: https://docs.360monitoring.com/docs/apt-updates-plugin Command to restart the agent360 service after plugin configuration changes. ```bash service agent360 restart ``` -------------------------------- ### Test PowerDNS Plugin Source: https://docs.360monitoring.com/docs/powerdns-plugin Command to test the PowerDNS plugin's functionality. Requires running as the agent360 user. ```bash sudo -u agent360 agent360 test powerdns ``` -------------------------------- ### Automatic Uninstallation Script for 360 Monitoring Source: https://docs.360monitoring.com/docs/uninstalling-360-monitoring-new-new A shell command to automatically download and execute the 360 Monitoring uninstallation script from a remote GitHub repository. This script automates the uninstallation process. It attempts to use curl first, then falls back to wget. ```shell sh <(curl https://raw.githubusercontent.com/plesk/kb-scripts/master/360-monitoring-uninstall/360-monitoring-uninstall.sh || wget -O - https://raw.githubusercontent.com/plesk/kb-scripts/master/360-monitoring-uninstall/360-monitoring-uninstall.sh) ``` -------------------------------- ### Configure MySQL Plugin Source: https://docs.360monitoring.com/docs/mysql-plugin Configuration settings for the MySQL plugin within the `agent360-custom.ini` file. Specifies connection details like username, password, host, database, and port. ```ini [mysql] enabled=yes username=agent360 password=safeandsecurepassword host=127.0.0.1 database=performance_schema port=3306 socket=null ``` -------------------------------- ### API Authentication Source: https://docs.360monitoring.com/docs/api All API requests require an API key to be included via the 'key' query string parameter. API access is available on the Business and Enterprise plans. ```APIDOC ## API Authentication ### Description All API requests require an API key to be included via the `key` query string parameter. API access is available on the Business and Enterprise plans. ### Method GET (for most requests, authentication applies to all) ### Endpoint `/[your_endpoint]?key=[your_api_key]` ### Parameters #### Query Parameters - **key** (string) - Required - Your API key for authentication. ``` -------------------------------- ### Configure 360monitoring Minecraft Plugin Source: https://docs.360monitoring.com/docs/minecraft-plugin This configuration snippet enables the Minecraft plugin for the agent360 monitoring tool. It specifies the servers to monitor via a comma-separated list of host:port combinations. Ensure the agent360 service is restarted after applying changes. ```text [minecraft] enabled=yes hosts=127.0.0.1:8000,127.0.0.2:8000... ``` -------------------------------- ### Configure PowerDNS Authoritative Server Plugin Source: https://docs.360monitoring.com/docs/powerdns-plugin Configuration settings for enabling and connecting to the PowerDNS Authoritative Server plugin. Requires specifying statistics URL and API key. ```text [powerdns] enabled=yes statistics_url= api_key=changeme ``` -------------------------------- ### Configure Software RAID Plugin Source: https://docs.360monitoring.com/docs/software-raid-plugin Enables the mdstat plugin by adding configuration lines to the agent360-custom.ini file. This activates the monitoring of software RAID status. ```text [mdstat] enabled = yes ``` -------------------------------- ### Enable Unbound Plugin in agent360-custom.ini Source: https://docs.360monitoring.com/docs/unbound-dns-plugin This configuration snippet enables the Unbound DNS plugin by adding the relevant section to the agent360-custom.ini file. Ensure this file exists and is accessible for the agent. ```ini [unbound] enabled=yes ``` -------------------------------- ### Test Disk Status Plugin (smartmontools) Source: https://docs.360monitoring.com/docs/disk-status-plugin Command to test the Disk Status plugin's functionality when using smartmontools for drive monitoring. This verifies the plugin is correctly configured and operational. ```bash agent360 test diskstatus ``` -------------------------------- ### NGiNX Plugin Test Output Source: https://docs.360monitoring.com/docs/nginx-plugin This JSON output represents the expected metrics reported by the NGiNX plugin after successful configuration and testing. It includes metrics like requests per second, active connections, and various status indicators. This is used to verify that the plugin is correctly gathering data. ```json { "nginx":{ "accepts": 505768, "accepts_per_second": 0, "active_connections": 198, "handled": 505768, "handled_per_second": 0, "reading": 0, "requests": 8335225, "requests_per_second": 0, "waiting": 196, "writing": 2 } } ``` -------------------------------- ### Configure Redis Plugin (agent360-custom.ini) Source: https://docs.360monitoring.com/docs/redis-plugin This configuration snippet shows how to enable the Redis plugin in the agent360-custom.ini file. It specifies the host, port, and optional database and password for connecting to Redis. Ensure these settings match your Redis instance. ```text [redis_stat] enabled=yes host=127.0.0.1 port=6379 ;db=dbname ;password=safeandsecurepassword ``` -------------------------------- ### Configure Kamailio Plugin Source: https://docs.360monitoring.com/docs/kamailio-plugin Enables the Kamailio monitoring plugin by adding configuration to the agent360-custom.ini file. This setting activates the plugin's monitoring capabilities. ```text [kamailio] enabled = yes ``` -------------------------------- ### Configure Agent360 for Asterisk Plugin Source: https://docs.360monitoring.com/docs/asterisk-plugin This snippet shows how to enable the Asterisk plugin in the agent360 configuration file. It requires adding a specific section to the `/etc/agent360-custom.ini` file to activate monitoring. ```text [asterisk] enabled = yes ``` -------------------------------- ### Configure MongoDB Plugin (agent360-custom.ini) Source: https://docs.360monitoring.com/docs/mongodb-plugin This snippet shows the configuration settings for the MongoDB plugin in the agent360-custom.ini file. It enables the plugin and specifies the connection string for the MongoDB instance. ```text [mongodb] enabled=yes connection_string=mongodb://username:password@127.0.0.1:27017/admin ``` -------------------------------- ### Enable Apache Status Page Configuration Source: https://docs.360monitoring.com/docs/apache This configuration snippet enables the Apache status page by defining a location and specifying access controls. It ensures the status page is only accessible from the local machine. ```text SetHandler server-status Order deny,allow Deny from all Allow from 127.0.0.1 ``` -------------------------------- ### Enable CloudLinux Plugin in agent360 Source: https://docs.360monitoring.com/docs/cloudlinux-plugin This configuration snippet shows how to enable the CloudLinux plugin by editing the agent360 custom configuration file. It requires adding a specific section to the '/etc/agent360-custom.ini' file. ```ini [cloudlinux] enabled = yes ``` -------------------------------- ### Configure PowerDNS Recursor Server Plugin Source: https://docs.360monitoring.com/docs/powerdns-plugin Additional configuration settings for enabling the PowerDNS plugin for recursor servers. Includes CA file, CA path, and timeout settings. ```text ca_file=filename ca_path=path timeout=10 ``` -------------------------------- ### Confirm agent360 process monitoring on CloudLinux Source: https://docs.360monitoring.com/docs/cloudlinux-and-cagefs This command verifies that the agent360 process is correctly configured and visible for monitoring after applying CageFS exclusions. ```shell sudo -u agent360 agent360 test process ``` -------------------------------- ### Apache2 Configuration for PHP-FPM Status Source: https://docs.360monitoring.com/docs/php-fpm-plugin Configuration for Apache2 to serve the PHP-FPM status page. This involves defining a handler, an alias, and configuring an external FastCGI server, with specific directives for the status page location. ```apache # Define a named handler AddHandler php7-fcgi .php # Generate an alias pointing to /usr/lib/cgi-bin/php[VersionNumber]-fcgi Alias /php7-fcgi /usr/lib/cgi-bin/php7-fcgi # Configure an external server handling your upcoming requests (note where the alias is pointing towards) FastCgiExternalServer /usr/lib/cgi-bin/php7-fcgi -socket /var/run/php/php7.0-fpm.sock -pass-header Authorization # only on if fpm-status is match. You might want to put this into your concrete vhost.conf file. For the testing, fastcgi.conf should work. Order deny,allow Deny from all Allow from 127.0.0.1 # set the before defined handler here SetHandler php7-fcgi # use the handler for the action handling virtual requests Action php7-fcgi /php7-fcgi virtual ``` -------------------------------- ### Configure agent360 for NGiNX Monitoring Source: https://docs.360monitoring.com/docs/nginx-plugin This configuration adds the NGiNX plugin to the agent360 configuration file. It enables the plugin and specifies the URL for the NGiNX status page. Ensure the `status_page_url` points to the correct location where the NGiNX status page is accessible. ```agent360-custom.ini [nginx] enabled = yes status_page_url = http://127.0.0.1:8080/status_page ``` -------------------------------- ### Configure Ignored Partitions (agent360-custom.ini) Source: https://docs.360monitoring.com/docs/diskusage-plugin This configuration snippet demonstrates how to add custom partitions to be ignored by the disk usage plugin. It requires the agent360 version 1.3.2 or higher and is added to the `/etc/agent360-custom.ini` file under the `[diskusage]` section. ```ini [diskusage] enabled = true exclude = /dev/loop,/dev/snap,/squashfs,/cagefs-skeleton ``` -------------------------------- ### Sudoers Configuration for Plesk WP Toolkit Source: https://docs.360monitoring.com/docs/wp-toolkit-plugin This configuration snippet is required for Plesk users to allow the agent360 process to execute the 'plesk' command without a password. It specifies the user, terminal, and the command that can be run. ```shell agent360 ALL=(ALL) NOPASSWD: /usr/sbin/plesk ``` -------------------------------- ### Configure Apt Updates Plugin Settings Source: https://docs.360monitoring.com/docs/apt-updates-plugin This configuration enables the apt-updates plugin and sets its polling interval. It is added to the agent360-custom.ini file. ```ini [apt-updates] enabled = yes interval = 3600 ``` -------------------------------- ### Enable PHP-FPM Status Page Configuration Source: https://docs.360monitoring.com/docs/php-fpm-plugin This snippet shows how to enable the PHP-FPM status page by modifying the PHP-FPM pool configuration. It requires setting the 'pm.status_path' directive. ```ini pm.status_path = /status_phpfpm ``` -------------------------------- ### Test Apache Plugin Metrics Output Source: https://docs.360monitoring.com/docs/apache This JSON output represents the metrics reported by the Apache plugin after a successful test. It includes various worker statuses, request rates, bandwidth usage, and server uptime. ```json { "BusyWorkers": "1", "BytesPerReq": "1183.62", "BytesPerSec": "20.1089", "CleanupWorkers": 0, "ClosingWorkers": 0, "ConnsAsyncClosing": "0", "ConnsAsyncKeepAlive": "0", "ConnsAsyncWriting": "0", "ConnsTotal": "0", "DnsWorkers": 0, "FinishingWorkers": 0, "IdleWorkers": 49, "KeepaliveWorkers": 0, "LoggingWorkers": 0, "ParentServerConfigGeneration": "2", "ParentServerMPMGeneration": "1", "ReadingWorkers": 0, "ServerMPM": "event", "ServerUptimeSeconds": "69102", "ServerVersion": "Apache/2.4.18 (Ubuntu)", "Total Accesses": "1174", "Total kBytes": "1357", "Uptime": "69102", "WritingWorkers": 1, "requests_per_second": 0 } ``` -------------------------------- ### Nginx Configuration for PHP-FPM Status Source: https://docs.360monitoring.com/docs/php-fpm-plugin Configuration for Nginx to serve the PHP-FPM status page. It sets up a location block to pass requests to the FastCGI process manager, restricting access to localhost. ```nginx server { listen 127.0.0.1:8080; server_name localhost; location /status_phpfpm { fastcgi_pass 127.0.0.1:9000; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; allow 127.0.0.1; deny all; } } ``` -------------------------------- ### Upgrade agent360 for Python 3 Source: https://docs.360monitoring.com/docs/disk-status-plugin Command to upgrade the agent360 package for systems running Python 3. This is essential for maintaining the monitoring agent's functionality and compatibility. ```bash pip3 install agent360 --upgrade ``` -------------------------------- ### Enable Disk Status Plugin Source: https://docs.360monitoring.com/docs/disk-status-plugin Configuration snippet for the agent360-custom.ini file to enable the Disk Status plugin. This involves setting the 'enabled' parameter to 'yes' under the [diskstatus] section. ```text [diskstatus] enabled = yes ``` -------------------------------- ### Agent360 PHP-FPM Plugin Configuration Source: https://docs.360monitoring.com/docs/php-fpm-plugin Configuration file snippet for the agent360 custom settings to enable and configure the PHP-FPM plugin. It specifies the URL for the PHP-FPM status page. ```ini [phpfpm] enabled = yes status_page_url = http://127.0.0.1:8080/status_phpfpm?json ``` -------------------------------- ### Test MongoDB Plugin (agent360 CLI) Source: https://docs.360monitoring.com/docs/mongodb-plugin Command to test the MongoDB plugin using the agent360 command-line interface. This helps verify that the plugin is correctly configured and can retrieve data from the MongoDB instance. ```shell sudo -u agent360 agent360 test mongodb ``` -------------------------------- ### Add Server Metrics using PHP with CURL Source: https://docs.360monitoring.com/docs/add-metrics-to-a-server This snippet demonstrates how to add metrics to a server using PHP and the CURL library. It constructs a JSON payload with timestamped data points for a specified metric and sends it to the 360 Monitoring API. Ensure you have CURL enabled in your PHP environment. ```php "motherboard.temp", "points" => $data_points); //Submit several metric sets at once... //$payload['metrics'][] = array("metric" => "motherboard.fanspeed", "points" => $data_points); $ch = curl_init('https://api.eu.monitoring.platform360.io/v1/server/'.$server_id.'/store?token='.$api_token); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen(json_encode($payload))) ); $result = curl_exec($ch); echo $result; ?> ``` -------------------------------- ### Enable CloudLinux DB Governor plugin in agent360 Source: https://docs.360monitoring.com/docs/cloudlinux-db-governor-plugin This configuration snippet enables the CloudLinux DB Governor plugin within the agent360 monitoring system by adding specific lines to the agent360-custom.ini file. ```ini [cloudlinux-dbgov] enabled = yes ``` -------------------------------- ### WP Toolkit Plugin Configuration Source: https://docs.360monitoring.com/docs/wp-toolkit-plugin This configuration block enables the WP Toolkit plugin and sets its polling interval. It should be added to the '/etc/agent360-custom.ini' file. The interval is set in seconds. ```text [wp-toolkit] enabled = yes interval = 3600 ``` -------------------------------- ### Test Disk Status Plugin (nvme-cli) Source: https://docs.360monitoring.com/docs/disk-status-plugin Command to test the Disk Status plugin's integration with nvme-cli for NVME drive monitoring. This confirms the specific NVME monitoring is active and functioning. ```bash agent360 test diskstatus-nvme ``` -------------------------------- ### Modify init.d Service for Root User Source: https://docs.360monitoring.com/docs/run-the-monitoring-agent-as-the-root-user Adjusts the init.d script to execute the agent360 service as the root user. This may involve changing a 'proguser' variable or modifying the 'start-stop-daemon' command to use 'root' for the user ID ('chuid'). ```bash # If proguser variable exists: # sed -i 's/proguser=agent360/proguser=root/' /etc/init.d/agent360 # If start-stop-daemon line needs modification: sed -i 's/--chuid agent360/--chuid root/' /etc/init.d/agent360 ``` -------------------------------- ### Enable CPU Temperature Plugin in agent360-custom.ini Source: https://docs.360monitoring.com/docs/cpu-temperature-plugin This configuration snippet enables the CPU temperature plugin by adding the necessary section and setting to the agent360-custom.ini file. This is a simple key-value pair configuration. ```ini [temp] enabled = yes ``` -------------------------------- ### Enable NVME Disk Status Plugin Source: https://docs.360monitoring.com/docs/disk-status-plugin Additional configuration for agent360-custom.ini to enable specific monitoring for NVME drives. This requires adding the [diskstatus-nvme] section with 'enabled' set to 'yes'. ```text [diskstatus-nvme] enabled = yes ``` -------------------------------- ### Rate Limiting Source: https://docs.360monitoring.com/docs/api The number of API requests is currently limited to 1500 requests per key per hour. Each request returns headers indicating the current limit and status. ```APIDOC ## Request Limit ### Description The number of API requests is currently limited to 1500 requests per key per hour. Each request returns the following headers with the current limit and status. ### Headers - **RateLimit-Limit** (integer) - The maximum number of requests allowed in the current window. - **RateLimit-Remaining** (integer) - The number of requests remaining in the current window. - **RateLimit-Reset** (integer) - The timestamp when the rate limit will reset. ### Error Response (429) Upon reaching the limit, the API returns HTTP status code 429 (request limit exceeded). ```json { "error":"Rate limit exceeded." } ``` ``` -------------------------------- ### Restart Agent360 Service Source: https://docs.360monitoring.com/docs/custom-plugins This bash command is used to restart the 360 Monitoring agent after enabling or modifying custom plugins. This ensures that the agent picks up the latest configuration and plugin changes. ```bash service agent360 restart ``` -------------------------------- ### API Request Limit Headers Source: https://docs.360monitoring.com/docs/api These headers indicate the current status of API request limits. 'RateLimit-Limit' shows the maximum requests allowed per hour, 'RateLimit-Remaining' shows how many requests are left, and 'RateLimit-Reset' indicates when the limit will reset. These are standard HTTP response headers. ```http RateLimit-Limit: 1500 RateLimit-Remaining: 993 RateLimit-Reset: 1452042000 ``` -------------------------------- ### Exclude agent360 from CageFS using sysctl.conf Source: https://docs.360monitoring.com/docs/cloudlinux-and-cagefs This snippet shows how to add a line to the sysctl.conf file to exclude the agent360 process from CageFS. This is a crucial step for enabling process-level monitoring. ```shell fs.proc_super_gid=GROUPID ```