I can’t seem to get Librenms to use the sysname instead of IP. I am running 1.37 and have also tried the master branch.
I have $config[‘force_ip_to_sysname’] = true; set in /opt/librenms/config.php
I can’t seem to get Librenms to use the sysname instead of IP. I am running 1.37 and have also tried the master branch.
I have $config[‘force_ip_to_sysname’] = true; set in /opt/librenms/config.php
please run validate.php
and post the results and also post your config.php
====================================
Component | Version
--------- | -------
LibreNMS | 1.37
DB Schema | 240
PHP | 7.0.25-0ubuntu0.16.04.1
MySQL | 10.0.34-MariaDB-0ubuntu0.16.04.1
RRDTool | 1.5.5
SNMP | NET-SNMP 5.7.3
====================================
[OK] Database connection successful
[WARN] Your schema (240) is newer than than expected (237). If you just switch to the stable release from the daily release, your database is in between releases and this will be resolved with the next release.
[FAIL] Database: incorrect column (services/service_ds)
[FAIL] We have detected that your database schema may be wrong, please report the following to us on IRC or the community site (https://t.libren.ms/5gscd):
[FIX] Run the following SQL statements to fix.
SQL Statements:
ALTER TABLE `services` CHANGE `service_ds` `service_ds` varchar(255) NOT NULL;
[FAIL] You have no timezone set for php.
[FIX] http://php.net/manual/en/datetime.configuration.php#ini.date.timezone
<?php
## Have a look in defaults.inc.php for examples of settings you can set here. DO NOT EDIT defaults.inc.php!
$config[‘force_ip_to_sysname’] = true;
$config['update_channel'] = 'release';
### Database config
$config['db_host'] = 'localhost';
$config['db_port'] = '3306';
$config['db_user'] = 'librenms';
$config['db_pass'] = 'password';
$config['db_name'] = 'librenms';
$config['db_socket'] = '';
// This is the user LibreNMS will run as
//Please ensure this user is created and has the correct permissions to your install
$config['user'] = 'librenms';
### Locations - it is recommended to keep the default
#$config['install_dir'] = "/opt/librenms";
### This should *only* be set if you want to *force* a particular hostname/port
### It will prevent the web interface being usable form any other hostname
#$config['base_url'] = "http://librenms.company.com";
### Enable this to use rrdcached. Be sure rrd_dir is within the rrdcached dir
### and that your web server has permission to talk to rrdcached.
#$config['rrdcached'] = "unix:/var/run/rrdcached.sock";
### Default community
$config['snmp']['community'] = array("public");
### Authentication Model
$config['auth_mechanism'] = "mysql"; # default, other options: ldap, http-auth
#$config['http_auth_guest'] = "guest"; # remember to configure this user if you use http-auth
### List of RFC1918 networks to allow scanning-based discovery
#$config['nets'][] = "10.0.0.0/8";
#$config['nets'][] = "172.16.0.0/12";
#$config['nets'][] = "192.168.0.0/16";
# Update configuration
#$config['update_channel'] = 'release'; # uncomment to follow the monthly release channel
#$config['update'] = 0; # uncomment to completely disable updates
Works for me although it doesn’t have an effect everywhere so be specific in where it’s not working for you.
Looking at the dashboard, and inventory it is all using the IP, not the sysname. Could this also be a vendor specific issue? I am just testing with a Fortigate right now.
Also, I fixed the DB scheme issue.
No, sounds like they haven’t got support right now. If the devices page shows right then it means more code needs to be updated.
Odd. I would double check your config.php inside of /opt/librenms
Make sure it has no errors.
ip to sysname should look like this
$config['force_ip_to_sysname'] = true;
Here is the entire config.php again, I don’t see any issues.
ubuntu:/opt/librenms$ vi config.php
<?php
## Have a look in defaults.inc.php for examples of settings you can set here. DO NOT EDIT defaults.inc.php!
$config[‘force_ip_to_sysname’] = true;
$config['update_channel'] = 'release';
### Database config
$config['db_host'] = 'localhost';
$config['db_port'] = '3306';
$config['db_user'] = 'librenms';
$config['db_pass'] = 'password';
$config['db_name'] = 'librenms';
$config['db_socket'] = '';
// This is the user LibreNMS will run as
//Please ensure this user is created and has the correct permissions to your install
$config['user'] = 'librenms';
### Locations - it is recommended to keep the default
#$config['install_dir'] = "/opt/librenms";
### This should *only* be set if you want to *force* a particular hostname/port
### It will prevent the web interface being usable form any other hostname
#$config['base_url'] = "http://librenms.company.com";
### Enable this to use rrdcached. Be sure rrd_dir is within the rrdcached dir
### and that your web server has permission to talk to rrdcached.
#$config['rrdcached'] = "unix:/var/run/rrdcached.sock";
### Default community
$config['snmp']['community'] = array("public");
### Authentication Model
$config['auth_mechanism'] = "mysql"; # default, other options: ldap, http-auth
#$config['http_auth_guest'] = "guest"; # remember to configure this user if you use http-auth
### List of RFC1918 networks to allow scanning-based discovery
#$config['nets'][] = "10.0.0.0/8";
#$config['nets'][] = "172.16.0.0/12";
#$config['nets'][] = "192.168.0.0/16";
# Update configuration
#$config['update_channel'] = 'release'; # uncomment to follow the monthly release channel
#$config['update'] = 0; # uncomment to completely disable updates
~
"config.php" [readonly] 42L, 1710C
Try copying-pasting it again from here it looks like you have an error in it with quotes and spaces.
$config['force_ip_to_sysname'] = true;
Perfect, that was it, everything looking correct now. Thanks!