Hi,
I’m having trouble configuring postgres application in libreNMS
Environment
Device:
Linux hveficent-ThinkPad-E570 4.13.0-31-generic #34~16.04.1-Ubuntu SMP Fri Jan 19 17:11:01 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
psql (PostgreSQL) 10.1
NET-SNMP version: 5.7.3
Steps to reproduce
1: Copy the shell script, postgres, to the desired host (the host must be added to LibreNMS devices)
wget https://github.com/librenms/librenms-agent/raw/master/snmp/postgres -O /etc/snmp/postgres
2: Make the script executable
chmod +x /etc/snmp/postgres
3: Install the Nagios check check_postgres.pl on your system.
git clone https://github.com/bucardo/check_postgres.git
cd check_postgres
perl Makefile.PL
make
env -i make test
make install
check_postgres.pl --version # check_postgres.pl version 2.23.0
4: Edit postgres file, I modified this script because I wasn’t unable to configure .pgpass properly:
#set the user here to use
#be sure to set up the user in .pgpass for the user snmpd is running as
DBuser=postgres
password=postgres
host=localhost
port=5432
# You may want to disable totalling for the postgres DB as that can make the total graphs artificially noisy.
# 1 = don't total stats for the DB postgres
# 0 = include postgres in the totals
ignorePG=1;
#make sure the paths are right for your system
cpg='/usr/local/bin/check_postgres.pl'
$cpg -u $DBuser --dbpass=$password -H $host -p $port --action dbstats | awk -F ' ' '
After save script I run it and suppose it works
>./postgres
5
860
8
1798
70907
0
0
0
0
0
0
0
521950
31552
1
86
47
2 2540 4 1652 128073 0 0 0 0 0 0 0 1326119 39680 0 0 0 postgres
5 860 8 1798 70907 0 0 0 0 0 0 0 521950 31552 1 86 47 11.0-account_tax_balance
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 template1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 template0
5: Edit snmpd.conf file and add following line in extending the agent section.
extend postgres /etc/snmp/postgres
6: Restart snmpd service
sudo systemctl restart snmpd
Then I go to MyDevice/Edit/Add postgres App, but when I go to see the app it is like this:
Note: I’m running LibreNMS dockerized
https://github.com/hveficent/docker-librenms.git
Validate output
root@librenms:/opt/librenms# ./validate.php
Component | Version |
---|---|
LibreNMS | 1.35-142-g2755763 |
DB Schema | 232 |
PHP | 7.0.22-0ubuntu0.16.04.1 |
MySQL | 10.2.12-MariaDB-10.2.12+maria~jessie |
RRDTool | 1.5.5 |
SNMP | NET-SNMP 5.7.3 |
==================================== |
[OK] Database connection successful
[OK] Database schema correct
[FAIL] You have a different system timezone () than the php configured timezone (CET)
[FIX] Please correct either your system timezone or your timezone set in php.ini.
[WARN] IPv6 is disabled on your server, you will not be able to add IPv6 devices.
[WARN] Your local git contains modified files, this could prevent automatic updates.
[FIX] You can fix this with ./scripts/github-remove
Modified Files:
html/plugins/Test/Test.inc.php
html/plugins/Test/Test.php
[FAIL] We have found some files that are owned by a different user than librenms, this will stop you updating automatically and / or rrd files being updated causing graphs to fail.
[FIX] chown -R librenms:librenms /opt/librenms
Files:
/opt/librenms/composer.phar
/opt/librenms/cache/os_defs.cache
[FAIL] The rrd folder has improper permissions.
[FIX] chmod ug+rw /opt/librenms/rrd
After fixing chmod issues same is happening
What am I doing wrong??
Thanks!