Nginx Librenms applications

 

NginX LibreNMS

Get the script and make it executable:

wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/nginx -O /etc/snmp/nginx && chmod +x /etc/snmp/nginx

Adapt the url in the script to your configuration, eg: 

nano /etc/snmp/nginx

data = urlopen('http://127.0.0.1/nginx_status').read()

Be careful, 'localhost' seems bugging, use 127.0.0.1 instead...

 

vHOST

Adapt your config with:

server {

                listen 127.0.0.1:80;

                server_name 127.0.0.1;

 

                location /nginx_status {

                        stub_status on;

                       access_log   off;

                       allow 127.0.0.1;

                       allow ::1;

                       deny all;

                }

}

nano /etc/nginx/conf.d/librenms.conf

 

server {

 listen      8000;

 server_name 192.168.88.86;

 root        /opt/librenms/html;

 index       index.php;

 

 charset utf-8;

 gzip on;

 gzip_types text/css application/javascript text/javascript application/x-javascript image/svg+xml text/plain text/xsd text/xsl tex>

 location / {

  try_files $uri $uri/ /index.php?$query_string;

 }

 location ~ [^/]\.php(/|$) {

  fastcgi_pass unix:/run/php-fpm-librenms.sock;

  fastcgi_split_path_info ^(.+\.php)(/.+)$;

  include fastcgi.conf;

 }

location /nginx-status {

    stub_status on;

    access_log   off;

    allow 127.0.0.1;

    allow 192.168.88.86;

    allow ::1;

    deny all;

}

 location ~ /\.(?!well-known).* {

  deny all;

 }

}

 

Tested :localhost:8000/nginx_status

sudo Configuration

Adapt your /etc/sudoers with:

Debian-snmp ALL=(ALL) NOPASSWD: /etc/snmp/nginx

 

SNMP Configuration

Adapt your /etc/snmp/snmpd.conf with:

extend nginx /usr/bin/sudo /etc/snmp/nginx

Restart the service.

 

Check Command

Adapt the user and path to your configuration:

sudo -u Debian-snmp /etc/snmp/nginx

 

 

Comments

  1. Goyang Casino Hotel - Las Vegas
    Goyang Casino septcasino Hotel is the official name https://access777.com/ of the property for its goyangfc gaming facilities in the resort Las Vegas. 바카라사이트 The resort's gaming floor, casino, worrione and spa are

    ReplyDelete

Post a Comment

Popular posts from this blog

Installing NFSEN & NFDUMP on Ubuntu and Next integrate with LibreNMS

IP Core Networks | Your Education, Your Choice

How to Install & Integrate Oxidized Into LibreNMS