• English日本語한국어
  • Log inStart now

Lighttpd integration

With our Lighttpd dashboard, your team can monitor outcome measures and inventory data. Lighttpd monitoring provides important information to help you construct a complete picture of your web server's performance. This performance data includes uptime, network in bytes and packets, number of connections, and more. Metric data can be seen on our pre-built dashboards, and you can also create your own custom searches, graphs, and alert policies. Our Lighttpd integration uses a NRI-Flex setup.

After setting up the integration with New Relic, see your data in dashboards like these, right out of the box.

Install the infrastructure agent

To get data into New Relic, install our infrastructure agent. Our infrastructure agent collects and ingests data so you can keep track of your app's performance. The version should be 1.10.7 or later to support NRI-Flex integration.

You can install the infrastructure agent two different ways:

Integrate Lighttpd with New Relic

Once installed, the infrastructure agent can ingest data from your app and send it to New Relic, but you still need to integrate – or establish a line of communication – between the agent and your app. Once integrated, you can get started with an out of the box monitoring solution for your Lighttpd app.

Step 1 of 4

Manually configure the lighttpd.conf file

To export metrics on the url, use the following steps:

  1. Go to lighttpd config file path.
cd /etc/lighttpd/
  1. Open lighttpd.conf file to edit.
sudo nano lighttpd.conf
  1. Add mod_status inside server.modules object.
  2. Add status.status-url = /server-status after server.modules.
  3. Update server.document-root with the lighttpd file path /var/www/html/lighttpd-webpage
  4. Update server.port on which you're running lighttpd.
server.port to 9880.
  1. Run or on the browser to check server related metrics.

Here is a sample configuration file:

server.modules = (
server.document-root = "/var/www/html/lighttpd-webpage"
server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
server.errorlog = "/var/log/lighttpd/error.log"
server.pid-file = "/run/lighttpd.pid"
server.username = "www-data"
server.groupname = "www-data"
server.port = 9880
status.status-url = "/server-status”
Step 2 of 4

NRI-Flex configuration

First, follow the installation steps of nri-flex from nri-flex repository

Once you've installed the infrastructure agent on your host, nri-flex binary is also installed.

To create a flex configuration file follow these steps:

  1. Create a file named lighttpd-http-config.yml on the below path.


  2. Using this sample configuration file as a guide, modify your lighttpd-http-config.yml file. Keep the following in mind:

    • You can replace base_url and url with your application url. Refer to nri-flex url documentation for further details.
    • You can also convert the metrics format which you get through url by using regular expressions in regex_matches > expression.
    • The event_type is also adjustable. The value in event_type can be used to store metrics in the New Relic platform.

    Once your configuration file is updated, it will look like this:

- name: nri-flex
# interval: 30s
name: lighttpdFlex
base_url: http://lighttpd.net/
- event_type: status
url: status?format=plain
- cache: status?format=plain
split_by: ": "
snake_to_camel: true
- name: nri-flex
interval: 10s
# timeout: 5s
name: test
- run: curl 'http://lighttpd.net/status?auto'
split_by: ": "
- expression: (\w+ \w+|\w+):(\N+)\n(\w+ \w+|\w+):(\N+)\n(\w+ \w+|\w+):(\N+)\n(\w+ \w+|\w+):(\N+)\n(\w+ \w+|\w+):(\N+)\n(\w+ \w+|\w+):(\N+)\n(\w+ \w+|\w+):(\N+)\n(\w+ \w+|\w+):(\N+)
Step 3 of 4

Restart the New Relic infra agent and lighttpd service

To restart the New Relic infra agent follow these instructions and run this command.

sudo systemctl restart lighttpd.service && sudo systemctl restart newrelic-infra.service
Step 4 of 4

Query your data using NRQL

You can use this sample query to view your Lighttpd metrics captured on one.newrelic.com:

FROM lighttpdStatusSample SELECT * LIMIT MAX
FROM lighttpdStatusSample2 SELECT * LIMIT MAX

Here, ‘lighttpdStatusSample’ and ‘lighttpdStatusSample2’ should match with the ‘event_type’ which you have mentioned in the nri-flex config file.

Here's an example of NRQL query checking the server status.

FROM lighttpdStatusSample SELECT latest(BusyServers) TIMESERIES AUTO

See Lighttpd metrics in a dashboard

With only the infrastructure agent installed and instrumented with your app, you can view your raw data in our Metrics & events. Our default transform that raw data into charts and graphs, which provide a bird's eye view of your system's health. To install our default dashboards, go to our Lighttpd instant observability page.

To instrument the Lighttpd quickstart and to see metrics and alerts, you can also follow our Lighttpd quickstart page by clicking on the “Install now” button.

What's next?

To learn more about building NRQL queries and generating dashboards, check out these docs:

Copyright © 2023 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.