### Install and Enable SSH
Source: https://docs.observium.org/install_rhel
Commands to install, enable, and start the SSH server for remote access.
```bash
yum install openssh
```
```bash
systemctl enable sshd
systemctl start sshd
```
--------------------------------
### Enable and Start HTTPD Service
Source: https://docs.observium.org/install_rhel
Configure the httpd service to start automatically on server reboot and then start the service immediately.
```bash
systemctl enable httpd
systemctl start httpd
```
--------------------------------
### Enable and start net-snmpd
Source: https://docs.observium.org/device_bsd
Commands to enable the service at boot and start it immediately.
```shell
sysrc snmpd_enable=YES
echo 'snmpd_conffile="/usr/local/etc/snmpd.conf"' >/etc/rc.conf.d/snmpd
service snmpd start
```
--------------------------------
### Configure Installation Directories
Source: https://docs.observium.org/config_options
Sets the base paths for temporary files, installation, HTML, RRD data, and logs.
```PHP
$config['temp_dir'] = "/tmp";
$config['install_dir'] = "/opt/observium";
$config['html_dir'] = $config['install_dir'] . "/html";
$config['rrd_dir'] = $config['install_dir'] . "/rrd";
$config['log_dir'] = $config['install_dir'] . "/logs";
$config['nagplug_dir'] = '/usr/lib/nagios/plugins';
```
--------------------------------
### Start Net-SNMP service on OpenBSD
Source: https://docs.observium.org/device_bsd
Commands to start the netsnmpd daemon and enable it at boot.
```bash
/etc/rc.d/netsnmpd start
rcctl enable netsnmpd
```
--------------------------------
### Download and Install Observium
Source: https://docs.observium.org/install_rhel
Creates the installation directory and downloads the latest Community Edition tarball.
```bash
mkdir -p /opt/observium && cd /opt
```
```bash
wget http://www.observium.org/observium-community-latest.tar.gz
tar zxvf observium-community-latest.tar.gz
```
--------------------------------
### Download and Run Observium Install Script
Source: https://docs.observium.org/install_debian
Manually download the Observium installation script using wget and then execute it.
```bash
wget https://www.observium.org/observium_installscript.sh
sudo bash ./observium_installscript.sh
```
--------------------------------
### Install wget on Debian/Ubuntu
Source: https://docs.observium.org/install_debian
Install the wget utility if it is not already present on your system.
```bash
apt install wget
```
--------------------------------
### Start MySQL Server
Source: https://docs.observium.org/tuning
This command is used to start the MySQL server after configuration changes have been made.
```bash
service mysql start
```
--------------------------------
### Install RANCID and Subversion
Source: https://docs.observium.org/rancid
Install the necessary packages for RANCID and version control.
```bash
apt-get install rancid subversion
```
```bash
dnf install rancid subversion
```
--------------------------------
### Example sysDescr Strings
Source: https://docs.observium.org/developing/add_os
Common examples of sysDescr strings returned by various network devices.
```text
Juniper Networks, Inc. m320 internet router, kernel JUNOS 10.1R3.7 #0: 2010-07-10 05:44:37 UTC builder@queth.juniper.net:/volume/build/junos/10.1/release/10.1R3.7/obj-i386/bsd/sys/compile/JUNIPER Build date: 2010-07-10 05:00:11 UTC Copyright (c) 1996
Redback Networks SmartEdge OS Version SEOS-12.1.1.12p1-Release
NetApp Release 8.1.2 7-Mode: Tue Oct 30 19:56:51 PDT 2012
ArubaOS (MODEL: Aruba6000), Version 6.1.3.10 (39813)
```
--------------------------------
### Install Monitoring Plugins on RedHat/CentOS/Fedora
Source: https://docs.observium.org/probes
Install the EPEL repository and the required monitoring plugins on RHEL-based systems.
```bash
yum install epel-release
```
```bash
yum install --skip-broken nagios-plugins-all
```
--------------------------------
### Perform API Requests
Source: https://docs.observium.org/api
Examples of various GET requests to retrieve device data and filter results.
```http
GET /api/v0/devices/
```
```http
GET /api/v0/devices/1/
```
```http
GET /api/v0/devices/test.company.com/
```
```http
GET /api/v0/devices/?os=ios
```
--------------------------------
### Hosts File Entry Example
Source: https://docs.observium.org/autodiscovery
Example of adding entries to the /etc/hosts file on Observium for device resolution. These entries map IP addresses to hostnames.
```bash
# IPaddress Hostname
192.168.186.1 device1.domain.com
192.168.186.2 device2.domain.com
```
--------------------------------
### Install Monitoring Plugins on Debian/Ubuntu
Source: https://docs.observium.org/probes
Install the standard monitoring plugin packages on Debian-based systems.
```bash
sudo apt install monitoring-plugins-basic monitoring-plugins-common monitoring-plugins-standard
```
--------------------------------
### Install net-snmp
Source: https://docs.observium.org/device_bsd
Use the package manager to install the net-snmp utility.
```shell
pkg install net-snmp
```
--------------------------------
### Configure Interface Alias in Debian/Ubuntu
Source: https://docs.observium.org/device_linux
Example configuration for /etc/network/interfaces.
```text
# eth0: Transit: YourISP Inc. Leased Line
iface eth0 inet static
....
```
--------------------------------
### Sensor Discovery Output Example
Source: https://docs.observium.org/developing/add_mib
Example output from running the sensor discovery process, showing device information and sensor module details including OID processing.
```text
##### Starting discovery run at 2022-04-04 14:37:26 #####
##### starline.observium.org [780] #####
o OS Type uec-starline
o SNMP Version v2c
o Last discovery 2022-04-04 14:36:51
o Last duration 0.92 seconds
##### Module Start: sensors #####
o UEC-STARLINE-MIB cpmAcInfTotLineCurrDemand [+] cpmAcInfLineCurrDemand [++++]
o Duration 0.7934s
##### starline.observium.org [780] completed discovery modules at 2022-04-04 14:37:27 #####
o Discovery time 0.7966 seconds
##### Finished discovery run at 2022-04-04 14:37:27 #####
o Devices Discovered 1
o Discovery Time 0.828 secs
o Memory usage 20MB (peak: 20MB)
o MySQL Usage Cell[39/0.018s] Row[112/0.027s] Rows[40/0.018s] Column[1/0s] Update[1/0.003s] Insert[1/0.002s] Delete[1/0.001s]
o RRDTool Usage
```
--------------------------------
### Initialize Observium Configuration
Source: https://docs.observium.org/install_rhel
Commands to prepare the installation directory and initialize the default configuration file.
```bash
cd observium
```
```bash
cp config.php.default config.php
```
--------------------------------
### System Setup and Apache Configuration
Source: https://docs.observium.org/install_rhel
Commands to set up RRD directories, Apache logs, and a virtual host configuration.
```bash
mkdir rrd
chown apache:apache rrd
```
```apache
DocumentRoot /opt/observium/html/
ServerName observium.domain.com
CustomLog /opt/observium/logs/access_log combined
ErrorLog /opt/observium/logs/error_log
AllowOverride All
Options FollowSymLinks MultiViews
Require all granted
```
```bash
mkdir /opt/observium/logs
chown apache:apache /opt/observium/logs
```
--------------------------------
### Install and configure Net-SNMP on OpenBSD
Source: https://docs.observium.org/device_bsd
Installation command and configuration file content for net-snmp on OpenBSD.
```bash
pkg_add net-snmp
```
```text
# Listen for connections on all interfaces (both IPv4 *and* IPv6)
agentAddress udp:161,udp6:[::1]:161
# Full view access
view all included .1
# Default access to full view
rocommunity community_string default -V all
# System contact and location
syslocation Rack/Room/Building, Street, City, Country [GPSX,Y]
syscontact Contact Person
# Disk Monitoring
includeAllDisks 10%
# This line allows Observium to detect the host OS if the distro script is installed
extend .1.3.6.1.4.1.2021.7890.1 distro /usr/local/bin/distro
# This lines allows Observium to detect hardware, vendor and serial
extend .1.3.6.1.4.1.2021.7890.2 hardware /sbin/sysctl -n hw.product
extend .1.3.6.1.4.1.2021.7890.3 vendor /sbin/sysctl -n hw.vendor
extend .1.3.6.1.4.1.2021.7890.4 serial /sbin/sysctl -n hw.serialno
# This line allows Observium to collect an accurate uptime
extend boottime /sbin/sysctl -n kern.boottime
```
--------------------------------
### Database API Example Queries
Source: https://docs.observium.org/developing/code_structure
Examples demonstrating how to use the database API functions for fetching, updating, deleting, and inserting data. The `parameters` array is used for safe value substitution.
```php
dbFetchRows('SELECT * FROM ports WHERE device_id = ?', array($device['device_id']));
dbUpdate(array('last_discovered' => array('NULL')), 'devices', '`device_id` = ?', array($device['device_id']));
dbDelete('device_graphs', "`device_id` = ? AND `graph` = ?", array($device['device_id'], $graph));
dbInsert(array('device_id' => $device['device_id'], 'graph' => $graph, 'enabled' => $value), 'device_graphs');
dbFetchCell("SELECT COUNT(*) FROM `ports` WHERE `device_id` = ? AND `ifType` = 'adsl'", array($device['device_id']));
```
--------------------------------
### Install WMIC Binary
Source: https://docs.observium.org/device_windows
Commands to download, extract, and move the static WMIC binary to the system path.
```bash
wget https://www.observium.org/files/wmic_1.3.16_static_64bit.tar.gz
tar zxvf wmic_1.3.16_static_64bit.tar.gz
mv wmic winexe /usr/bin
```
--------------------------------
### Configure OpenBSD snmpd.conf
Source: https://docs.observium.org/device_bsd
Example configuration for /etc/snmpd.conf using SNMPv2c. Replace community_string with your own.
```text
# Default listens on all addresses for SNMPv3 only; "listen on" overrides this
# See snmpd.conf(5) for more options (tcp, alternative ports, trap listener)
#listen on 192.0.2.1 # SNMPv3 on one specific address
#listen on 0.0.0.0 snmpv2c snmpv3 # All IPv4 addresses, both v2c + v3
#listen on :: snmpv2c snmpv3 # All IPv6 addresses, both v2c + v3
#listen on 127.0.0.1 snmpv2c # IPv4 localhost only, v2c
listen on 0.0.0.0 snmpv2c
# Define a RO community if you use SNMPv2c (there is no default)
read-only community community_string
# At least one user must be defined to use SNMPv3
#user "user1" auth hmac-sha1 authkey "password123" enc aes enckey "321drowssap"
#user "user2" auth hmac-sha256 authkey "password456" enc aes enckey "654drowssap"
# Send traps from snmpd(8) to one or more receivers
#trap receiver nms.localdomain.local community PAV9kpE02gDPvAi source-address 192.0.2.1
# Adjust the local system information
system contact "Contact Person "
system location "Rack/Room/Building, Street, City, Country [GPSX,Y]"
# Required by some management software
system services 74
```
--------------------------------
### Install curl on Debian/Ubuntu
Source: https://docs.observium.org/install_debian
Install the curl utility if it is not already present on your system.
```bash
apt install curl
```
--------------------------------
### Update Observium Installation
Source: https://docs.observium.org/updating
Standard command to update the installation files and synchronize the database.
```text
svn update
```
```text
./discovery.php -u
```
--------------------------------
### BIND DNS Record Example
Source: https://docs.observium.org/autodiscovery
Example of adding DNS records for device resolution in BIND. Ensure these records match the hostnames configured on your devices.
```dns
device1 IN A 192.168.186.1
device2 IN A 192.168.186.2
```
--------------------------------
### Install xinetd Package
Source: https://docs.observium.org/unix_agent
Installs the xinetd service, which is an alternative to systemd for managing network services like the Observium agent.
```bash
sudo apt-get install xinetd
```
--------------------------------
### Automated Observium Installation with wget
Source: https://docs.observium.org/install_debian
Use this command to automatically install Observium on Ubuntu and Debian systems using wget.
```bash
sudo bash <(wget -qO- https://www.observium.org/observium_installscript.sh)
```
--------------------------------
### QNap NAS-MIB Sensor Data Example
Source: https://docs.observium.org/developing/add_mib
Example of sensor data collected from a QNap NAS using its MIB, showing details like HDD description, temperature, model, and capacity.
```text
NAS-MIB::hdDescr.1 = STRING: "HDD1"
NAS-MIB::hdTemperature.1 = STRING: "41 C/105 F"
NAS-MIB::hdStatus.2 = INTEGER: ready(0)
NAS-MIB::hdModel.1 = STRING: "ST6000VN0001-1SF17Z"
NAS-MIB::hdCapacity.1 = STRING: "5.46 TB"
NAS-MIB::hdSmartInfo.1 = STRING: "GOOD"
```
--------------------------------
### API Parameter Examples
Source: https://docs.observium.org/graph_api
Commonly used parameters for configuring graph output.
```text
type=port_bits
```
```text
from=-8h
```
```text
to=now
```
```text
id=1,2,3
```
```text
height=300
```
```text
width=800
```
```text
device=1
```
```text
legend=no
```
```text
title=no
```
--------------------------------
### Install Postfix MTA on Ubuntu/Debian
Source: https://docs.observium.org/alerting_transports
Command to install the Postfix MTA, which is recommended for handling email notifications locally on the Observium server.
```bash
apt-get install postfix
```
--------------------------------
### Automated Observium Installation with curl
Source: https://docs.observium.org/install_debian
Use this command to automatically install Observium on Ubuntu and Debian systems using curl.
```bash
sudo bash <(curl -Ls https://www.observium.org/observium_installscript.sh)
```
--------------------------------
### Memory Pool MIB Data Example
Source: https://docs.observium.org/developing/definitions
Example output from a memory pool MIB, showing index, name, utilization, and size metrics.
```Text
MY-MEMORY-MIB::myMemoryPoolIndex.1 = INTEGER: 1
MY-MEMORY-MIB::myMemoryPoolName.1 = STRING: memory
MY-MEMORY-MIB::myMemoryPoolCurrentUtilization.1 = INTEGER: 42
MY-MEMORY-MIB::myMemoryPoolLowestUtilization.1 = INTEGER: 29
MY-MEMORY-MIB::myMemoryPoolLargestUtilization.1 = INTEGER: 65
MY-MEMORY-MIB::myMemoryPoolSize.1 = INTEGER: 524288
MY-MEMORY-MIB::myMemoryPoolUsed.1 = INTEGER: 219556
MY-MEMORY-MIB::myMemoryPoolFree.1 = INTEGER: 304728
MY-MEMORY-MIB::myMemoryPoolWarning.1 = INTEGER: 90
MY-MEMORY-MIB::myMemoryPoolCritical.1 = INTEGER: 100
```
--------------------------------
### WMI Query Output Example
Source: https://docs.observium.org/device_windows
Expected output format when a WMI query is successfully executed.
```bash
$ /usr/bin/wmic --user='user' --password='password' --workgroup='OBSERVIUM' --delimiter=## --namespace='root\CIMV2' //win.server "SELECT Name FROM Win32_ComputerSystem"
CLASS: Win32_ComputerSystem
Name
WIN
```
--------------------------------
### Match Linux Swap Memory Pools
Source: https://docs.observium.org/alert_checker
Example configuration to target specific memory pools across Linux devices.
```text
1
2
```
```text
Device OS equals linux
Memory Pool Description match swap*
```
--------------------------------
### Configure Cron Jobs
Source: https://docs.observium.org/install_rhel
Example content for /etc/cron.d/observium to automate discovery and polling tasks.
```cron
# Run a complete discovery of all devices once every 6 hours
33 */6 * * * root /opt/observium/observium-wrapper discovery >> /dev/null 2>&1
# Run automated discovery of newly added devices every 5 minutes
*/5 * * * * root /opt/observium/observium-wrapper discovery --host new >> /dev/null 2>&1
# Run multithreaded poller wrapper every 5 minutes
*/5 * * * * root /opt/observium/observium-wrapper poller >> /dev/null 2>&1
```
--------------------------------
### Navigate to Observium Directory
Source: https://docs.observium.org/install_debian
Change the current directory to the newly created Observium installation directory.
```bash
cd observium
```
--------------------------------
### Install Observium Dependencies on Ubuntu 20.04 (PHP 7.4)
Source: https://docs.observium.org/install_debian
Installs necessary packages for Observium on Ubuntu 20.04, including PHP 7.4 components, web server, database client, and monitoring tools.
```bash
apt install libapache2-mod-php7.4 php7.4-cli php7.4-mysql php7.4-gd php7.4-json php7.4-bcmath \
php7.4-mbstring php7.4-opcache php7.4-curl php-apcu php-pear snmp fping rrdtool whois \
mysql-server mysql-client subversion mtr-tiny ipmitool graphviz imagemagick apache2 \
python3-mysqldb python3-pymysql python-is-python3
```
--------------------------------
### Setup MySQL Database and Insert Schema
Source: https://docs.observium.org/install_debian
Run the discovery script to set up the MySQL database and insert the default schema. Errors in SQL revisions are acceptable.
```bash
./discovery.php -u
```
--------------------------------
### Install snmp_passpersist
Source: https://docs.observium.org/device_linux
Install the required Python package for ifAlias support.
```bash
sudo pip install snmp_passpersist
```
--------------------------------
### Insert data example
Source: https://docs.observium.org/developing/database
Insert a new device record into the devices table using an associative array.
```PHP
$data = [
'hostname' => 'new_device.example.com',
'sysName' => 'New Device',
'os' => 'linux',
'hardware' => 'x86_64',
'version' => '1.0',
'features' => 'N/A',
'location' => 'Data Center 1'
];
$inserted_id = dbInsert($data, 'devices');
echo "Inserted device with ID: {$inserted_id}\n";
```
--------------------------------
### Install APCu Extension
Source: https://docs.observium.org/tuning
Install the APCu PHP extension for userspace caching.
```bash
aptitude install php-apcu
```
--------------------------------
### Manage OpenBSD snmpd service
Source: https://docs.observium.org/device_bsd
Commands to test configuration, enable, and start the default OpenBSD snmpd service.
```bash
/etc/rc.d/snmpd configtest
echo "snmpd_flags=" >> /etc/rc.conf.local
/etc/rc.d/snmpd start
```
--------------------------------
### PostgreSQL Agent Output Format
Source: https://docs.observium.org/apps
Example of the expected output format from the PostgreSQL monitoring script.
```text
<<>>
version:9.0
cCount:73
tDbs:27
tUsr:26
tHst:56
idle:68
select:1
update:4
delete:0
other:0
xact_commit:3877928925
xact_rollback:234675
blks_read:262519882524
blks_hit:364900385160
tup_returned:17779368975702
tup_fetched:55929009703
tup_inserted:545241370
tup_updated:417124828
tup_deleted:476435080
```
--------------------------------
### Add Initial Observium User
Source: https://docs.observium.org/install_debian
Create the first user for Observium. Use a level of 10 for administrative privileges.
```bash
./adduser.php
```
--------------------------------
### Install Agent Scripts in Local Directory
Source: https://docs.observium.org/unix_agent
An alternative method to enable agent scripts by placing them directly into the /usr/lib/observium_agent/local directory.
```bash
sudo mkdir -p /usr/lib/observium_agent/local
scp /opt/observium/scripts/agent-local/os user@your_server:/usr/lib/observium_agent/local
```
--------------------------------
### Install rrdcached package
Source: https://docs.observium.org/rrdcached
Install the required rrdcached package using the apt package manager.
```bash
apt -q install rrdcached
```
--------------------------------
### Define PHP Arrays in Configuration
Source: https://docs.observium.org/config_options
Demonstrates two equivalent methods for initializing and appending to configuration arrays.
```PHP
$config['rancid_configs'] = array("/var/rancid/network1/configs",
"/var/rancid/network2/configs");
```
```PHP
$config['rancid_configs'][] = "/var/rancid/network1/configs";
$config['rancid_configs'][] = "/var/rancid/network2/configs";
```
--------------------------------
### Install Observium Packages for RHEL/CentOS 7
Source: https://docs.observium.org/install_rhel
Installs core dependencies and updates the system for RHEL/CentOS 7.
```bash
yum update
```
```bash
yum install wget.x86_64 httpd.x86_64 php.x86_64 php-opcache.x86_64 php-mysql.x86_64 php-gd.x86_64 \
php-posix php-pear.noarch cronie.x86_64 net-snmp.x86_64 net-snmp-utils.x86_64 \
fping.x86_64 mariadb-server.x86_64 mariadb.x86_64 MySQL-python.x86_64 rrdtool.x86_64 \
subversion.x86_64 jwhois.x86_64 ipmitool.x86_64 graphviz.x86_64 ImageMagick.x86_64 \
php-sodium.x86_64
```
```bash
yum install libvirt.x86_64
```
--------------------------------
### Install Observium Packages for RHEL/CentOS 8
Source: https://docs.observium.org/install_rhel
Installs core dependencies and configures Python for RHEL/CentOS 8.
```bash
yum install wget httpd php php-opcache php-mysqlnd php-gd php-posix php-pear cronie net-snmp \
net-snmp-utils fping mariadb-server mariadb rrdtool subversion whois ipmitool graphviz \
ImageMagick php-sodium python3 python3-mysql python3-PyMySQL
```
```bash
alternatives --set python /usr/bin/python3
```
```bash
yum install libvirt
```
--------------------------------
### Configure Libvirt Protocols
Source: https://docs.observium.org/config_options
Specify the protocols Observium should use to discover virtual machines. The order matters; the first successful protocol is used.
```php
$config['libvirt_protocols'] = array("qemu+ssh","xen+ssh");
```
--------------------------------
### Install Observium Packages for RHEL/CentOS 9
Source: https://docs.observium.org/install_rhel
Installs the core dependencies required for Observium on RHEL/CentOS 9.
```bash
dnf install wget httpd php php-opcache php-mysqlnd php-gd php-posix php-pear cronie net-snmp \
net-snmp-utils fping mariadb-server mariadb rrdtool subversion whois ipmitool graphviz \
ImageMagick php-sodium python3 python3-PyMySQL -y
```
```bash
dnf install libvirt
```
--------------------------------
### Configure Multiple Static Sensors
Source: https://docs.observium.org/statics
Example of configuring multiple static sensors, including UPS temperature and battery voltage. Ensure correct device ID, class, OID, and description are provided.
```php
// UPS temperature sensors
$config['sensors']['static'][] = [
'device_id' => '456',
'class' => 'temperature',
'oid' => '1.3.6.1.4.1.5491.2.7.1.2.1.1.1.8.0',
'descr' => 'UPS Internal Temperature',
'multiplier' => 1,
'limit' => 60,
'limit_warn' => 50
];
// Custom voltage monitoring
$config['sensors']['static'][] = [
'device_id' => '456',
'class' => 'voltage',
'oid' => '1.3.6.1.4.1.5491.2.7.1.2.1.1.1.3.0',
'descr' => 'Battery Voltage',
'multiplier' => 0.1,
'limit' => 14.4,
'limit_low' => 10.8
];
```
--------------------------------
### Install RADIUS Module for PHP 5.6
Source: https://docs.observium.org/authentication
Commands to install and enable the PHP radius module on Ubuntu 14.04.
```Bash
sudo apt-get install php5-radius
sudo cp /etc/php5/conf.d/radius.ini /etc/php5/mods-available/
sudo php5enmod radius
sudo service apache2 restart
```
--------------------------------
### Initialize RANCID Folder Structure
Source: https://docs.observium.org/rancid
Create the required directory structure for RANCID.
```bash
su - rancid
/var/lib/rancid/bin/rancid-cvs
```
```bash
su - rancid
rancid-cvs
```
--------------------------------
### PHP Fatal Error Log Example
Source: https://docs.observium.org/faq
Example of a memory exhaustion error message found in Apache logs.
```text
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 92 bytes) in
/opt/observium/includes/dbFacile.php on line 234, referer: https://observium/com/alert_check/alert_test_id=10/
```
--------------------------------
### Configure Apache Virtual Host for Observium
Source: https://docs.observium.org/install_debian
Set up an Apache virtual host to serve the Observium web interface. Ensure the `/opt/observium/logs` directory exists and has appropriate write permissions for Apache.
```apache
DocumentRoot /opt/observium/html/
ServerName observium.domain.com
CustomLog /opt/observium/logs/access_log combined
ErrorLog /opt/observium/logs/error_log
AllowOverride All
Options FollowSymLinks MultiViews
```
--------------------------------
### Telegram API Response Example
Source: https://docs.observium.org/alerting_transports
Example JSON response from the Telegram getUpdates API containing chat identifiers.
```json
{"ok":true,"result":[{"update_id":382866198,
"message":{"message_id":2,"from":{"id":123456784,"first_name":"Mike","last_name":"Stupalov","username":"stupalov"},"chat":{"id":123456784,"first_name":"Mike","last_name":"Stupalov","username":"stupalov","type":"private"},"date":1459367993,"text":"\/start start"}},{"update_id":382866199,
"message":{"message_id":3,"from":{"id":123456784,"first_name":"Mike","last_name":"Stupalov","username":"stupalov"},"chat":{"id":-487654321,"title":"TestGroup","type":"group"},"date":1459368048,"text":"\/start"}}]}
```
--------------------------------
### Perform Initial Discovery and Poll
Source: https://docs.observium.org/install_debian
Run these commands to perform an initial discovery and polling cycle to populate data for new devices. Ensure the scripts are executable.
```bash
./discovery.php -h all
./poller.php -h all
```
--------------------------------
### Inspect Probe Plugin Help
Source: https://docs.observium.org/probes
View the command-line help documentation for a specific probe plugin to understand available arguments.
```bash
/usr/lib/nagios/plugins/check_pop -h
```
--------------------------------
### Install RADIUS Module for PHP 7.x
Source: https://docs.observium.org/authentication
Commands to install and enable the PHP radius module on modern Debian/Ubuntu systems.
```Bash
sudo apt install php-radius
sudo phpenmod radius
sudo service apache2 restart
```
--------------------------------
### Configure Active Directory STARTTLS
Source: https://docs.observium.org/authentication
Set STARTTLS behavior for the connection.
```PHP
$config['auth_ad_starttls'] = 'no';
```
--------------------------------
### Enable and Start Systemd Socket
Source: https://docs.observium.org/unix_agent
Reloads the systemd daemon, enables, and starts the Observium agent socket to manage agent connections.
```bash
systemctl daemon-reload
systemctl enable observium_agent.socket
systemctl start observium_agent.socket
```
--------------------------------
### Add Initial Device to Monitor
Source: https://docs.observium.org/install_debian
Add the first device to be monitored by Observium. Specify the hostname, community string, and SNMP version.
```bash
./add_device.php v2c
```
--------------------------------
### Configure MySQL/MariaDB Database
Source: https://docs.observium.org/install_rhel
Commands to enable the database service, set the root password, and create the required database and user for Observium.
```bash
systemctl enable mariadb
systemctl start mariadb
```
```bash
/usr/bin/mysqladmin -u root password ''
```
```bash
mysql -u root -p
mysql> CREATE DATABASE observium DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
mysql> GRANT ALL PRIVILEGES ON observium.* TO 'observium'@'localhost' IDENTIFIED BY '';
mysql> exit;
```
--------------------------------
### Manage Users and Devices
Source: https://docs.observium.org/install_rhel
Commands to add administrative users, monitor new devices, and perform initial data polling.
```bash
cd /opt/observium
./adduser.php
```
```bash
./add_device.php v2c
```
```bash
./discovery.php -h all
./poller.php -h all
```
--------------------------------
### Kohler Generator Status Example
Source: https://docs.observium.org/developing/add_mib
Example of a status OID value from the Kohler GCon-MIB, indicating the generator controller's communication status.
```text
KohlerGCon-MIB::gconStatus.1 = INTEGER: good(1)
```
--------------------------------
### Initialize Temporary Directory
Source: https://docs.observium.org/tuning
Command to create the temporary directory based on the systemd configuration.
```bash
systemd-tmpfiles --create /etc/tmpfiles.d/php-cli-opcache.conf
```
--------------------------------
### Compare SNMP GETBULK performance with different max-repetitions
Source: https://docs.observium.org/tuning
Examples demonstrating the time difference when using -Cr10 versus -Cr100 with snmpbulkwalk.
```bash
root@observium:/opt/observium# time snmpbulkwalk -v2c -Cr10 test.observium.org hrSWRunTable | wc -l
1577
real 0m22.206s
user 0m0.012s
sys 0m0.004s
```
```bash
root@observium:/opt/observium# time snmpbulkwalk -v2c -Cr100 test.observium.org hrSWRunTable | wc -l
1575
real 0m7.259s
user 0m0.012s
sys 0m0.000s
```
--------------------------------
### Configure Fping Path
Source: https://docs.observium.org/install_rhel
Locate the fping binary and update the configuration file with the correct path.
```bash
[root@observium-centos observium]# which fping
/usr/sbin/fping
```
```bash
$config['fping'] = "/usr/sbin/fping";
```
--------------------------------
### Get Device Information via IRC
Source: https://docs.observium.org/irc_bot
Use the '!device' command in IRC to get basic information about a specific device. The bot will respond with details like OS, version, and uptime.
```irc
!device switch01.foo.bar
id101 ios 12.2(33)SXH4 ADVENTERPRISEK9_WAN Up 263 days, 3h 45m 11s
```
--------------------------------
### Copy xinetd Configuration File
Source: https://docs.observium.org/unix_agent
Copies the example xinetd configuration file for the Observium agent to the server's xinetd directory.
```bash
scp /opt/observium/scripts/observium_agent_xinetd user@your_server:/etc/xinetd.d/observium_agent_xinetd
```
--------------------------------
### GET Endpoints - Fetching Data
Source: https://docs.observium.org/api
Observium provides various GET endpoints to retrieve network device information, alerts, and other metrics. These endpoints support filtering and pagination for efficient data retrieval.
```APIDOC
## GET /alerts/
### Description
Fetch Alerts. Supports filtering by `device_id`, `status`, `entity_type`, `entity_id`, and `alert_test_id`.
### Endpoint
`/alerts/` or `/alerts/`
## GET /alert_checks/
### Description
Fetch Alert Checks.
### Endpoint
`/alert_checks/` or `/alert_checks/`
## GET /address/
### Description
Fetch IPv4/6 addresses. Supports filtering by `af` (ipv4, ipv6), `device_id`, and `port_id`.
### Endpoint
`/address/`
## GET /bills/
### Description
Fetch Bills.
### Endpoint
`/bills/`
## GET /counters/
### Description
Fetch Counter data. Supports filtering by `group_id`, `device_id`, `counter_id`, `entity_id`, `entity_type`, `entity_state`, `counter_class`, `counter_descr`, and `counter_event`.
### Endpoint
`/counters/`
## GET /devices/
### Description
Fetch Devices. Supports filtering by `group`, `sysname`, `location`, `os`, `version`, `features`, `type`, `status`, `ignore`, `disabled`, and `graph`.
### Endpoint
`/devices/` or `/devices/` or `/devices/`
## GET /entity///
### Description
Fetch a single entity by its type and ID. This is a generic endpoint for any entity.
### Endpoint
`/entity///`
## GET /inventory/
### Description
Fetch inventory information (entPhysical). Supports filtering by `device_id`, `os`, `entPhysicalModelName`, `entPhysicalSerialNum`, `entPhysicalDescr`, `entPhysicalClass`, and `deleted`.
### Endpoint
`/inventory/`
## GET /mempools/
### Description
Fetch Mempools. Supports filtering by `group_id`, `device_id`, and `mempool_descr`.
### Endpoint
`/mempools/`
## GET /neighbours/
### Description
Fetch Neighbours. Supports filtering by `device_id`, `device_b`, `port_id`, `port_b`, `protocol`, `platform`, `version`, `active`, and `remote_port_id`.
### Endpoint
`/neighbours/`
## GET /ports/
### Description
Fetch Ports. Supports filtering by `location`, `device_id`, `group`, `disable`, `deleted`, `ignore`, `ifSpeed`, `ifType`, `hostname`, `ifAlias`, `ifDescr`, `port_descr_type`, `errors`, `alerted`, `state`, `cbqos`, and `mac_accounting`.
### Endpoint
`/ports/` or `/ports/`
## GET /printersupplies/
### Description
Fetch Printer Supplies. Supports filtering by `group_id`, `device_id`, `supply_type`, `supply_colour`, and `supply_descr`.
### Endpoint
`/printersupplies/`
## GET /processors/
### Description
Fetch Processor information. Supports filtering by `group_id`, `device_id`, and `processor_descr`.
### Endpoint
`/processors/`
## GET /sensors/
### Description
Fetch Sensors. Supports filtering by `metric`, `group`, `group_id`, `device_id`, `entity_id`, `entity_type`, `sensor_descr`, `sensor_type`, `id`, and `event`.
### Endpoint
`/sensors/`
## GET /status/
### Description
Fetch Status. Supports filtering by `group_id`, `device_id`, `id`, `class`, and `event`.
### Endpoint
`/status/`
## GET /storage/
### Description
Fetch Storage information. Supports filtering by `group_id`, `device_id`, and `storage_descr`.
### Endpoint
`/storage/`
### Field Filtering
Some endpoints allow filtering results by field using the `fields` parameter (comma-separated list).
### Pagination
Some endpoints support pagination using `pagesize` and `pageno` parameters.
```
--------------------------------
### Configure Discovery Cron Jobs
Source: https://docs.observium.org/discovery
Standard cron configuration for running discovery and handling new devices.
```bash
33 */6 * * * root /opt/observium/observium-wrapper discovery >> /dev/null 2>&1
```
```bash
*/5 * * * * root /opt/observium/observium-wrapper discovery --host new >> /dev/null 2>&1
```
--------------------------------
### Install Observium Dependencies on Ubuntu 22.04 (PHP 8.1)
Source: https://docs.observium.org/install_debian
Installs necessary packages for Observium on Ubuntu 22.04, including PHP 8.1 components, web server, database client, and monitoring tools.
```bash
apt install libapache2-mod-php8.1 php8.1-cli php8.1-mysql php8.1-gd php8.1-bcmath php8.1-mbstring \
php8.1-opcache php8.1-curl php-apcu php-pear snmp fping mysql-server mysql-client rrdtool subversion \
whois mtr-tiny ipmitool graphviz imagemagick apache2 python3-mysqldb python3-pymysql python-is-python3
```
--------------------------------
### Install Observium Dependencies on Ubuntu 24.04 (PHP 8.3)
Source: https://docs.observium.org/install_debian
Installs necessary packages for Observium on Ubuntu 24.04, including PHP 8.3 components, web server, database client, and monitoring tools.
```bash
apt install php8.3-cli php8.3-mysql php8.3-gd php8.3-bcmath php8.3-mbstring php8.3-opcache \
php8.3-curl php-apcu php-pear snmp fping mysql-client rrdtool subversion whois mtr-tiny ipmitool \
libvirt-clients python3-mysqldb python3-pymysql python-is-python3 libapache2-mod-php8.3 graphviz \
imagemagick mysql-server apache2
```
--------------------------------
### Enable Pseudowires Collection
Source: https://docs.observium.org/config_options
Enable collection of pseudowire statistics on supported hardware by setting this to 1.
```php
$config['enable_pseudowires'] = 1; # Enable Pseudowires
```
--------------------------------
### Install Observium Dependencies on Ubuntu 26.04 (PHP 8.4)
Source: https://docs.observium.org/install_debian
Installs necessary packages for Observium on Ubuntu 26.04, including PHP 8.4 components, web server, database client, and monitoring tools.
```bash
apt install php8.4-cli php8.4-mysql php8.4-gd php8.4-bcmath php8.4-mbstring php8.4-opcache \
php8.4-curl php-apcu php-pear snmp fping mysql-client rrdtool subversion whois mtr-tiny ipmitool \
libvirt-clients python3-mysqldb python3-pymysql python-is-python3 libapache2-mod-php8.4 graphviz \
imagemagick mysql-server apache2
```
--------------------------------
### Install Observium Dependencies on Debian 11 (PHP 7.4)
Source: https://docs.observium.org/install_debian
Installs necessary packages for Observium on Debian 11, including PHP 7.4 components, web server, database client, and monitoring tools. Uses MariaDB.
```bash
apt install libapache2-mod-php7.4 php7.4-cli php7.4-mysql php7.4-gd php7.4-json php7.4-bcmath \
php7.4-mbstring php7.4-opcache php7.4-apcu php7.4-curl php-pear snmp fping rrdtool whois \
mariadb-server mariadb-client subversion mtr-tiny ipmitool graphviz imagemagick apache2 \
python3-mysqldb python3-pymysql python-is-python3
```
--------------------------------
### Create MySQL Database and User (Debian)
Source: https://docs.observium.org/install_debian
Commands to create a MySQL database and user for Observium on Debian systems. Ensure you replace '' with your desired password.
```sql
mysql -u root -p
mysql> CREATE DATABASE observium DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
mysql> GRANT ALL PRIVILEGES ON observium.* TO 'observium'@'localhost' IDENTIFIED BY '';
```
--------------------------------
### Install Observium Dependencies on Debian 12 (PHP 8.2)
Source: https://docs.observium.org/install_debian
Installs necessary packages for Observium on Debian 12, including PHP 8.2 components, web server, database client, and monitoring tools. Uses MariaDB.
```bash
apt install libapache2-mod-php8.2 php8.2-cli php8.2-mysql php8.2-gd php8.2-bcmath php8.2-mbstring \
php8.2-opcache php8.2-apcu php8.2-curl php-json php-pear snmp fping mariadb-server \
mariadb-client python3-mysqldb python-is-python3 python3-pymysql rrdtool subversion whois mtr-tiny \
ipmitool graphviz imagemagick apache2
```
--------------------------------
### Configure MySQL Credentials for Observium Agent
Source: https://docs.observium.org/apps
Create a PHP configuration file with MySQL credentials for the Observium agent. This file should contain the username and password for the monitoring user.
```php
';
?>
```
--------------------------------
### Install Observium Dependencies on Debian 13 (PHP 8.4)
Source: https://docs.observium.org/install_debian
Installs necessary packages for Observium on Debian 13, including PHP 8.4 components, web server, database client, and monitoring tools. Uses MariaDB.
```bash
apt install php8.4-cli php8.4-mysql php8.4-gd php8.4-bcmath php8.4-mbstring php8.4-opcache \
php8.4-apcu php8.4-curl php-json php-pear snmp fping mariadb-client python3-mysqldb python3-pymysql \
python-is-python3 rrdtool subversion whois mtr-tiny ipmitool libvirt-clients \
libapache2-mod-php8.4 graphviz imagemagick mariadb-server apache2
```
--------------------------------
### Check rsyslogd version
Source: https://docs.observium.org/syslog
Command to verify the installed version of rsyslogd.
```bash
rsyslogd -v
```
--------------------------------
### Create Observium Directory
Source: https://docs.observium.org/install_debian
Creates the directory structure for Observium and navigates into the parent directory.
```bash
mkdir -p /opt/observium && cd /opt
```
--------------------------------
### API Response Format
Source: https://docs.observium.org/api
Example of a JSON response returned by the API.
```json
{
"status": "ok",
"count": 2,
"devices": {
"277": {
"device_id": "277",
"hostname": "router-1.company.com",
"sysObjectID": ".1.3.6.1.4.1.9.1.620",
"sysDescr": "Cisco IOS Software, 1841 Software (C1841-IPBASE-M), Version 15.0(1)M4, RELEASE SOFTWARE (fc1)\r\nTechnical Support: http://www.cisco.com/techsupport\r\nCopyright
(c) 1986-2010 by Cisco Systems, Inc.\r\nCompiled Thu 28-Oct-10 15:40 by prod_rel_team",
"version": "15.0(1)M4",
"hardware": "CISCO1841",
"features": "IPBASE",
"os": "ios",
...
},
"278": {
"device_id": "278",
"hostname": "router-b.company.com", }
"sysObjectID": ".1.3.6.1.4.1.9.1.620",
"sysDescr": "Cisco IOS Software, 1841 Software (C1841-IPBASE-M), Version 15.0(1)M4, RELEASE SOFTWARE (fc1)\r\nTechnical Support: http://www.cisco.com/techsupport\r\nCopyright
(c) 1986-2010 by Cisco Systems, Inc.\r\nCompiled Thu 28-Oct-10 15:40 by prod_rel_team",
"version": "15.0(1)M4",
"hardware": "CISCO1841",
"features": "IPBASE",
"os": "ios",
...
}
}
}
```
--------------------------------
### GET /alert_checks/{alert_check_id}
Source: https://docs.observium.org/api
Fetches details for a single alert checker.
```APIDOC
## GET /alert_checks/{alert_check_id}
### Description
Retrieves information about a specific alert checker.
### Method
GET
### Endpoint
/api/v0/alert_checks/{alert_check_id}/
### Parameters
#### Path Parameters
- **alert_check_id** (integer) - Required - The unique identifier of the alert checker.
### Response
#### Success Response (200)
- **status** (string) - Status of the operation
- **alert_check** (object) - The alert checker details
#### Response Example
{
"status": "ok",
"alert_check": {"alert_test_id": "12"}
}
```
--------------------------------
### Configure Application Counters
Source: https://docs.observium.org/statics
Example of configuring custom counters for application metrics like database queries or errors. Ensure correct device ID, class, OID, and description are provided.
```php
// Database query counter
$config['counters']['static'][] = [
'device_id' => '101',
'class' => 'counter',
'oid' => '1.3.6.1.4.1.99999.1.1.1.0',
'descr' => 'Database Queries',
'multiplier' => 1,
'counter_unit' => 'qps'
];
// Custom error counter
$config['counters']['static'][] = [
'device_id' => '101',
'class' => 'errors',
'oid' => '1.3.6.1.4.1.99999.1.2.1.0',
'descr' => 'Application Errors',
'multiplier' => 1
];
```
--------------------------------
### Get User ID
Source: https://docs.observium.org/developing/authentication
Return the unique identifier for the specified user.
```php
function auth_user_id($username)
```
--------------------------------
### Get User Level
Source: https://docs.observium.org/developing/authentication
Return the access level of the specified user.
```php
function auth_user_level($username)
```