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:
- Our guided install is a CLI tool that inspects your system and installs the infrastructure agent alongside the application monitoring agent that best works for your system. To learn more about how our guided install works, check out our Guided install overview.
- If you'd rather install our infrastructure agent manually, you can follow a tutorial for manual installation for Linux, Windows, or macOS.
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.
Manually configure the lighttpd.conf file
To export metrics on the url 127.0.0.1:9880/server-status?format=plain
, use the following steps:
- Go to lighttpd config file path.
cd /etc/lighttpd/
- Open
lighttpd.conf
file to edit.
sudo nano lighttpd.conf
- Add
mod_status
insideserver.modules
object. - Add status.status-url =
/server-status
after server.modules. - Update
server.document-root
with the lighttpd file path/var/www/html/lighttpd-webpage
- Update
server.port
on which you're running lighttpd.
server.port to 9880.
- Run
127.0.0.1:9880/server-status?auto
or127.0.0.1:9880/server-status?format=plain
on the browser to check server related metrics.
Here is a sample configuration file:
server.modules = ( "mod_indexfile", "mod_access”, "mod_alias", "mod_redirect”, "mod_status")
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 = 9880status.status-url = "/server-status”
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:
Create a file named
lighttpd-http-config.yml
on the below path.Path:
/etc/newrelic-infra/integrations.dUsing this sample configuration file as a guide, modify your
lighttpd-http-config.yml
file. Keep the following in mind:- You can replace
base_url
andurl
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 inevent_type
can be used to store metrics in the New Relic platform.
Once your configuration file is updated, it will look like this:
- You can replace
---integrations: - name: nri-flex # interval: 30s config: name: lighttpdFlex global: base_url: http://lighttpd.net/ apis: - event_type: status url: status?format=plain - event_type: {'<THE_PLACE_WHERE_METRICS_ARE_CAPTURED>'} commands: - cache: status?format=plain split_by: ": " snake_to_camel: true
- name: nri-flex interval: 10s # timeout: 5s config: name: test apis: - event_type: {'<THE_PLACE_WHERE_METRICS_ARE_CAPTURED>'} commands: - run: curl 'http://lighttpd.net/status?auto' split_by: ": " regex_matches: - 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+)
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
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:
- Introduction to the query builder to create basic and advanced queries.
- Introduction to dashboards to customize your dashboard and carry out different actions.
- Manage your dashboard to adjust your display mode, or to add more content to your dashboard.