Ports API :404 Page not found error!

Don’t know why ports API alone not working on my environment. Rest of the API calls are working fine.

curl -H ‘X-Auth-Token: fd4de84aada7a8b21b’ http://10.11.12.209/api/v0/ports

<html><head><title>404 Page Not Found</title><style>body{margin:0;padding:30px;font:12px/1.5 Helvetica,Arial,Verdana,sans-serif;}h1{margin:0;font-size:48px;font-weight:normal;line-height:48px;}strong{display:inline-block;width:65px;}</style></head><body><h1>404 Page Not Found</h1><p>The page you are looking for could not be found. Check the address bar to ensure your URL is spelled correctly. If all else fails, you can visit our home page at the link below.</p><a href="/">Visit the Home Page</a></body></html>

Any suggestions ?

Check your web server config against the install docs.

If you are using nginx especially this part:

 location @librenms {
  rewrite api/v0(.*)$ /api_v0.php/$1 last;
  rewrite ^(.+)$ /index.php/$1 last;
 }

Thanks for your reply.

I’m using Apache webserver. not Nginx

<VirtualHost *:80>
  DocumentRoot /opt/librenms/html/
  ServerName  librenms.example.com
  CustomLog /opt/librenms/logs/access_log combined
  ErrorLog /opt/librenms/logs/error_log
  AllowEncodedSlashes NoDecode
  <Directory "/opt/librenms/html/">
    Require all granted
    AllowOverride All
    Options FollowSymLinks MultiViews
  </Directory>
</VirtualHost>

Did you enable mod_rewrite as the docs says?

a2ensite librenms.conf
a2enmod rewrite
systemctl restart apache2

There is no rewrite rule configuration method on the docs. I followed this one
http://docs.librenms.org/Installation/Installation-CentOS-7-Apache/ .

Is that ports API issue related to rewrite configuration issue ?. If possible, please share me the docs link.

Thanks

The re-write rule is in the .htaccess.

Oh, that bit I wrote is only in the Ubuntu install docs. Looks like it is enabled by default for CentOS 7.
httpd -M and look for rewrite_module (shared).

Please also run ./validate.php

Output status of both validate.php and httpd modules

[root@librenms librenms]# ./validate.php

[OK] Database connection successful
[WARN] Your local git contains modified files, this could prevent automatic updates.
Modified files:
mibs/avaya/AV-SME-PLATFORM-MIB.mib
mibs/avaya/AV-SME-PLATFORM-PROD-MIB.mib
mibs/avaya/AVAYAGEN-MIB.mib
mibs/avaya/IPO-MIB.mib
mibs/avaya/IPO-PHONES-MIB.mib
mibs/avaya/IPO-PROD-MIB.mib
[root@librenms librenms]#
[root@librenms librenms]#
[root@librenms librenms]# httpd -M | grep rewrite
rewrite_module (shared)
[root@librenms librenms]#

It should say the version at the top of validate.php.

I suspect you are very out of date. Please run ./daily.sh

Yes, it says “I’m running an outdated version”. But the running build was Nov 2016 one.

Is the Port API added on latest build version ?. Wasn’t it available on this version?

Output:

Component Version
LibreNMS 95626de6ce9bc7bad6070ceb0ad281c6597123f1
DB Schema 148
PHP 7.0.12
MySQL 5.5.50-MariaDB
RRDTool 1.4.8
SNMP NET-SNMP 5.7.2

==========================================================

[WARN] Your install is out of date, last update: Sun, 06 Nov 2016 14:32:38 +0000

You need to get it updated, that isn’t even the last stable release… LibreNMS changes a lot, so I can’t even begin to list the differences.

thanks for your suggestion. is there any possible/scripts available to update the my LibreNMS ?.

As daily.sh script doesn’t update my build.

[root@librenms librenms]# ./daily.sh
Updating SQL-Schema OK
Cleaning up DB OK
[root@librenms librenms]#

After run this command, still its show my branch is outdated one.

I got it. update was disabled in config.php file. Now I can update my Librenms to latest build. Once again, thanks for your support.

If you want to reduce the chance of things breaking, but still keep up to date, use the stable channel.

http://docs.librenms.org/General/Updating/#configuring-the-update-channel