571 words

check_mk Livestatus API for Nagios

Build the Livestatus api server

Install the build deps

Build deps Ubuntu 18.04:

  • librrd-dev
  • libboost-all-dev

Browse to https://checkmk.com/download/sources-download

Grab the latest "Stand-alone source code of MK Livestatus" link

wget https://download.checkmk.com/checkmk/1.5.0p25/mk-livestatus-1.5.0p25.tar.gz

Unpack it, configure it for Nagios4 support, build it

tar -xvzf mk-livestatus-1.5.0p25.tar.gz
cd  mk-livestatus-1.5.0p25/
 ./configure --with-nagios4

Snag the built file from the src directory src/livestatus.o

Install the Livestatus api server

Install deps Ubuntu 18.04:

  • libboost-system1.65.1
  • check-mk-livestatus
  • xinetd

Replace the original livestatus.o executable in /usr/lib/check_mk/

Define it as a Nagios broker module in nagios.cfg:

broker_module=/usr/lib/check_mk/livestatus.o /run/nagios/livestatus.sock

Restart nagios to ensure that Nagios can create the socket in the /run/nagios path which should already exist if NRPE is running on the system.

Create the livestatus xinetd service

service livestatus
        type        = UNLISTED
        port        = 6557
        socket_type = stream
        protocol    = tcp
        wait        = no
        cps         = 100 3
        instances   = 500
        per_source  = 250
        flags       = NODELAY
        user        = nagios
        server      = /usr/bin/unixcat
        server_args = /run/nagios/livestatus.sock
        disable     = no
#       only_from   =

Enable xinetd:

 systemctl enable --now xinetd

Test the socket service locally to make sure that livestatus is working OK

 echo 'GET contacts' | unixcat /run/nagios/livestatus.sock 

NetApp Command CheatSheet


Administratively turning on or off an ethernet port:

::*> network port modify -node somenode-01 -port e0f -up-admin true


Working with the event log

Show only a certain severity or higher:

::> event log show -severity ERROR

Show a certain type of error (supports wildcards)

::> event log show -event secd.cifsAuth.*

Show events that are !not a certain type of error (supports wildcards)

::> event log show -event !sec*

Network troubleshooting

Ping a remote host (eg a domain controller) from the LIF of a vserver

::> network ping -lif somesvm_cifs_nfs_lif1 -vserver some_svm -destination dc.college.edu

Verify L1 connectivity (ONTAP 9.8+)

::> network port reachability show -detail -node -port 

Data Management

Adding inodes / increasing max file count

Default max files can be somewhat low on NetApp if you are working with large amounts of small files. Defaults shown under example below.

::> volume modify -vserver nfsshare -volume some_vol -files 31876689

Default inode max


Active Directory

Setting preferred domain controllers

What determines an AD DC discovered status?

NetApp - Add Network Conns

Adding a new network LAG and vlans

Physical port & interface group steps

  • Select member physical interfaces
  • Install SFPs and patches
  • Network admin configures LACP LAG on switches
  • Create interface group
    • Dynamic multimode, probably IP based LB
    • Example command:
network port ifgrp create -node cluster-1-01 -ifgrp a0a -distr-func ip -mode multimode
  • Add ports to interface group
    • Example command:
network port ifgrp add-port -node cluster-1-01 -ifgrp a0a -port e0b

network port ifgrp add-port -node cluster-1-01 -ifgrp a0a -port e0c

Vlan configuration

After the LAG is up and working properly, you can add vlans.
Define them by using the standard naming scheme to identify the vlan tag, for example: 'a0a-76' would mean add vlan 76 to interface group a0a.

network port vlan create -node cluster-1-01 -vlan-name  a0a-76