Skip to content

Commit

Permalink
rename nagios to naemon
Browse files Browse the repository at this point in the history
  • Loading branch information
Hákon Gíslason committed Jun 2, 2017
1 parent 5f159dc commit 6b45668
Show file tree
Hide file tree
Showing 8 changed files with 595 additions and 27 deletions.
30 changes: 15 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NAME= nagios2influx
NAME= naemon2influx
VERSION= 1.0
RELEASE= 01

Expand All @@ -13,7 +13,7 @@ TMPL= ${NAME}.tmpl
all: deb rpm

clean:
@rm -rf ${SPEC} ${RPM} ${DEB} nagios2influx.1.gz nagios2influx.cfg.5.gz ${BUILD}
@rm -rf ${SPEC} ${RPM} ${DEB} naemon2influx.1.gz naemon2influx.cfg.5.gz ${BUILD}

${RPM}: ${SPEC}
@echo "Building ${NAME} rpm ..."
Expand All @@ -26,26 +26,26 @@ rpm: ${RPM}
deb: ${DEB}

install:
@pod2man nagios2influx | gzip > /usr/share/man/man1/nagios2influx.1.gz
@pod2man --section 5 nagios2influx.cfg.pod | gzip > /usr/share/man/man5/nagios2influx.cfg.5.gz
@install -m 0755 nagios-perf /usr/bin
@install -m 0755 nagios2influx /usr/bin
@install -m 0640 nagios2influx.cfg /etc/naemon
@pod2man naemon2influx | gzip > /usr/share/man/man1/naemon2influx.1.gz
@pod2man --section 5 naemon2influx.cfg.pod | gzip > /usr/share/man/man5/naemon2influx.cfg.5.gz
@install -m 0755 naemon-perf /usr/bin
@install -m 0755 naemon2influx /usr/bin
@install -m 0640 naemon2influx.cfg /etc/naemon

${BUILD}:
@mkdir -p ${NAME}-${VERSION}-${RELEASE}

${DEBIAN}: ${BUILD}
@mkdir -p ${DEBIAN}

${DEB}: ${DEBIAN} control nagios2influx.cfg nagios2influx.cfg.pod nagios2influx
${DEB}: ${DEBIAN} control naemon2influx.cfg naemon2influx.cfg.pod naemon2influx
@sed -s 's/__NAME__/${NAME}/g;s/__RELEASE__/${RELEASE}/g;s/__VERSION__/${VERSION}/g;' control > ${DEBIAN}/control
@echo /etc/naemon/nagios2influx.cfg > ${DEBIAN}/conffiles
@mkdir -p ${BUILD}/usr/bin ${BUILD}/etc/nagios ${BUILD}/usr/share/man/man1 ${BUILD}/usr/share/man/man5
@install -m 0755 nagios-perf ${BUILD}/usr/bin
@install -m 0755 nagios2influx ${BUILD}/usr/bin
@install -m 0640 nagios2influx.cfg ${BUILD}/etc/naemon
@pod2man nagios2influx | gzip > ${BUILD}/usr/share/man/man1/nagios2influx.1.gz
@pod2man --section 5 nagios2influx.cfg.pod | gzip > ${BUILD}/usr/share/man/man5/nagios2influx.cfg.5.gz
@echo /etc/naemon/naemon2influx.cfg > ${DEBIAN}/conffiles
@mkdir -p ${BUILD}/usr/bin ${BUILD}/etc/naemon ${BUILD}/usr/share/man/man1 ${BUILD}/usr/share/man/man5
@install -m 0755 naemon-perf ${BUILD}/usr/bin
@install -m 0755 naemon2influx ${BUILD}/usr/bin
@install -m 0640 naemon2influx.cfg ${BUILD}/etc/naemon
@pod2man naemon2influx | gzip > ${BUILD}/usr/share/man/man1/naemon2influx.1.gz
@pod2man --section 5 naemon2influx.cfg.pod | gzip > ${BUILD}/usr/share/man/man5/naemon2influx.cfg.5.gz
@dpkg-deb --build ${BUILD}
@rm -rf ${BUILD}
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
### Forked from https://github.com/PickinA/nagios2influx and adjusted to work out of the box with Naemon with Adagios & Pynag.
### Forked from https://github.com/PickinA/naemon2influx and adjusted to work out of the box with Naemon with Adagios & Pynag.

nagios2influx takes Nagios/Naemon performance data and writes it directly into InfluxDB's time sequence database in order that this data might be presented, for example using Grafana.
naemon2influx takes Nagios/Naemon performance data and writes it directly into InfluxDB's time sequence database in order that this data might be presented, for example using Grafana.

The motivation for this plugin came when I failed to to get other projects, based that were around the carbon/graphite interface, to work. I had no need for Graphite and thought there should be a simpler and more straight forward solution. I had previously used the nagiosgraph plugin (indeed still do) to display graphic historic data from Nagios. However I wanted to get the performance data into other dashboards where data is gathered from other sources, while still alowing me to use legecy systems of graphing. Further, I didn't want to create a separate service that could fail, I wanted something that would use Nagios's internal scheduler to operate.
The motivation for this plugin came when I failed to to get other projects, based that were around the carbon/graphite interface, to work. I had no need for Graphite and thought there should be a simpler and more straight forward solution. I had previously used the naemongraph plugin (indeed still do) to display graphic historic data from Nagios. However I wanted to get the performance data into other dashboards where data is gathered from other sources, while still alowing me to use legecy systems of graphing. Further, I didn't want to create a separate service that could fail, I wanted something that would use Nagios's internal scheduler to operate.

## Installation

Expand Down Expand Up @@ -46,11 +46,11 @@ as appropriate. (Note for the debian version you need to be root or sudo)

If you wish to install by hand here is the RPM manifest.
```
-rw-rw---- 1 naemon naemon /etc/naemon/nagios2influx.cfg
-rwxr-xr-x 1 root root /usr/bin/nagios-perf
-rwxr-xr-x 1 root root /usr/bin/nagios2influx
-rw-r--r-- 1 root root /usr/share/man/man1/nagios2influx.1.gz
-rw-r--r-- 1 root root /usr/share/man/man5/nagios2influx.cfg.5.gz
-rw-rw---- 1 naemon naemon /etc/naemon/naemon2influx.cfg
-rwxr-xr-x 1 root root /usr/bin/naemon-perf
-rwxr-xr-x 1 root root /usr/bin/naemon2influx
-rw-r--r-- 1 root root /usr/share/man/man1/naemon2influx.1.gz
-rw-r--r-- 1 root root /usr/share/man/man5/naemon2influx.cfg.5.gz
```
`# sudo make install `

Expand All @@ -65,15 +65,15 @@ Ensure that you have service checks producing performace data in the standard fo
Ensure that these service have process_perf_data=1

```
pynag add command command_name=process-service-perfdata-nagios2influx command_line='/usr/local/bin/nagios-perf > /tmp/nagios-perf 2>&1'
pynag add command command_name=process-service-perfdata-naemon2influx command_line='/usr/bin/naemon-perf > /tmp/naemon-perf 2>&1'
pynag config --set process_performance_data=1
pynag config --set service_perfdata_file_processing_command=process-service-perfdata-nagios2influx
pynag config --set service_perfdata_file_processing_command=process-service-perfdata-naemon2influx
pynag config --set service_perfdata_file_mode=a
pynag config --set service_perfdata_file_processing_interval=15
pynag config --set service_perfdata_file_template='$TIMET$\t$HOSTNAME$\t$SERVICECHECKCOMMAND$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEPERFDATA$'
pynag config --set service_perfdata_file=/var/lib/naemon/service-perfdata
```
The above configuration will write a performace datafile into the location, and of the format expected by the default nagios2influx.cfg configuration. If you wish to change the location or format of this file then see the nagios2influx man pages on how change the configuration.
The above configuration will write a performace datafile into the location, and of the format expected by the default naemon2influx.cfg configuration. If you wish to change the location or format of this file then see the naemon2influx man pages on how change the configuration.

It is recommended that once you have grafana dashboards presenting data for each host, to add action_url properties to your host templates of the form:

Expand Down
2 changes: 1 addition & 1 deletion control
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Package: nagios2influx
Package: naemon2influx
Section: net
Architecture: all
Version: __VERSION__-__RELEASE__
Expand Down
10 changes: 10 additions & 0 deletions naemon-perf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#! /bin/bash
if [[ -f /var/lib/naemon/service-perfdata ]]
then
/usr/bin/naemon2influx -n
retval=$?
if [[ $retval == 0 ]]
then
/usr/bin/naemon2influx
fi
fi
Loading

0 comments on commit 6b45668

Please sign in to comment.