Check_mk dmi and rpm scripts

Hi. I’m trying to understand what the dmi and rpm scripts in /opt/librenms-agent/agent-local do.

I run them and it does present information, but how are these used if I put the scripts into:

/usr/lib/check_mk/local

?

What would I expect on the GUI front end? would I need to configure anything on the front end to support the scripts?

Thanks.

The rpm script, assuming you’re running an RPM package distro, should create a new a new tab on your device called Pkgs.

The dmi script just collects a bit more overview info.
With:


Without:

I don’t think you need to configure anything as long as your agent is accessible and the unix-agent module was properly detected and enabled for your device.

Hi slashdoom. I really appreciate your speedy response.

Yes I simply moved them into place, and the next run of the poller populated the details and added the pkgs tab.

Very nice.

Thanks again.

1 Like

Hi. Just one more query.

I was able to perform this on all machines except the LibreNMS server itself, since the server itself doesn’t run check_mk so couldn’t run the “dmi” script with it (or the rpm script since it’s running CentOS 7).

What do I need to do to get these two check_mk plugin working for the LibreNMS server itself?

Thanks.

Maybe I’m misunderstanding but all you should have to do is install the agent on your LibreNMS server.

https://docs.librenms.org/#Extensions/Agent-Setup/

Follow the systemd steps if it is a CentOS7 box. Then just copy the scripts to the agent directory like you did with the other servers.

Hi slashdoom.

For an endpoint, the https://docs.librenms.org/#Extensions/Agent-Setup/ instructions are valid, but for the LibreNMS server itself, it’s not as the LibreNMS server has it’s own tree under /opt/librenms.

To clarify, for an endpoint following the git clone we have:

[root@endpoint ~]# ll /opt/librenms-agent/
total 88
drwxr-xr-x 2 root root  4096 Sep  2  2017 agent-local
-rwxr-xr-x 1 root root 22016 Sep  2  2017 check_mk_agent
-rw-r--r-- 1 root root 14225 Sep  2  2017 check_mk_agent_freebsd
-rw-r--r-- 1 root root 18063 Sep  2  2017 check_mk_COPYING
-rw-r--r-- 1 root root   140 Sep  2  2017 [email protected]
-rw-r--r-- 1 root root   126 Sep  2  2017 check_mk.socket
-rw-r--r-- 1 root root  2240 Sep  2  2017 check_mk_xinetd
drwxr-xr-x 2 root root    76 Sep  2  2017 debian
-rw-r--r-- 1 root root   639 Sep  2  2017 Makefile
-rwxr-xr-x 1 root root  1324 Sep  2  2017 mk_enplug
drwxr-xr-x 2 root root  4096 Sep  2  2017 snmp

For the LibreNMS server, it’s different and doesn’t have check_mk_agent as shown:

[root@librenms ~]# ll /opt/librenms/
total 2496
-rwxr-xr-x    1 librenms librenms    8572 Oct 31  2017 addhost.php
-rwxr-xr-x    1 librenms librenms     928 Nov 28  2017 adduser.php
-rwxr-xr-x    1 librenms librenms    1826 Jan  2 00:15 alerts.php
drwxrwxr-x    8 librenms librenms     111 May 31 15:01 app
-rw-rw-r--    1 librenms librenms    1646 May 31 15:01 artisan
-rw-r--r--    1 librenms librenms   10887 Jan 30 00:15 AUTHORS.md
-rw-r--r--    1 librenms librenms     130 Apr  3 00:15 axisaudio_c3003.snmprec
-rwxrwxr-x    1 librenms librenms    6294 Sep  2  2017 billing-calculate.php
drwxrwxr-x    3 librenms librenms      51 May 31 15:01 bootstrap
-rwxr-xr-x    1 librenms librenms    1835 May  1 00:15 build-base.php
-rw-rw-r--    1 librenms librenms   53935 Sep  2  2017 build.sql
drwxrwxr-x    2 librenms librenms      77 Jun  1 00:20 cache
-rw-r--r--.   1 librenms librenms     144 May  1  2016 CHANGELOG
-rwxr-xr-x    1 librenms librenms    1913 May  1 00:15 check-services.php
-rw-r--r--    1 librenms librenms     249 Apr  3 00:15 ciena-sds_8700.snmprec
-rw-rw-r--    1 librenms librenms      92 Sep  2  2017 CODE_OF_CONDUCT.md
-rw-rw-r--    1 librenms librenms    3096 May 31 15:01 composer.json
-rw-rw-r--    1 librenms librenms  174980 May 31 15:01 composer.lock
-rwxr-xr-x    1 librenms librenms 1849094 May  5 00:15 composer.phar
drwxrwxr-x    2 librenms librenms    4096 May 31 15:01 config
-rwxr-xr-x    1 librenms librenms    3126 Apr 29 23:02 config.php
-rw-r--r--    1 librenms librenms    1834 Apr  3 00:15 config.php.default
-rwxrwxr-x    1 librenms librenms     253 Sep  2  2017 config_to_json.php
drwxr-xr-x.   2 librenms librenms      73 Sep  2  2017 contrib
-rw-rw-r--    1 librenms librenms     171 Mar  7 17:43 CONTRIBUTING.md
-rwxrwxr-x    1 librenms librenms     876 Sep  2  2017 cronic
-rw-r--r--    1 librenms librenms    9541 Apr  3 00:15 daily.php
-rwxrwxr-x    1 librenms librenms   10554 Mar  7 17:43 daily.sh
drwxrwxr-x    5 librenms librenms      51 May 31 15:01 database
-rwxrwxr-x    1 librenms librenms     566 Sep  2  2017 delhost.php
-rwxr-xr-x    1 librenms librenms    5074 Jan 30 00:15 discovery.php
-rwxrwxr-x    1 librenms librenms   13314 Mar  7 17:43 discovery-wrapper.py
-rwxrwxr-x    1 librenms librenms    2229 Sep  2  2017 dist-pollers.php
drwxr-xr-x.  10 librenms librenms    4096 Nov 28  2017 doc
drwxr-xr-x.  10 librenms librenms    4096 May 31 15:01 html
drwxr-xr-x.  10 librenms librenms    4096 May 31 15:01 includes
-rwxrwxr-x    1 librenms librenms     980 Sep  2  2017 irc.php
drwxr-xr-x.  11 librenms librenms    4096 Apr  3 00:15 lib
drwxrwxr-x   13 librenms librenms    4096 May 31 15:01 LibreNMS
-rw-rw-r--    1 librenms librenms     490 Sep  2  2017 librenms.cron
-rw-r--r--    1 librenms librenms     738 Nov 28  2017 librenms.nonroot.cron
drwxr-xr-x.   2 librenms librenms      48 May  1  2016 licenses
-rw-r--r--.   1 librenms librenms   35334 May  1  2016 LICENSE.txt
drwxrwxr-x+   2 librenms librenms      91 Oct 31  2017 logs
drwx------    2 librenms librenms      43 May 24 09:23 mail
-rw-r--r--    1 librenms librenms    1506 Apr  3 00:15 Makefile
drwxr-xr-x. 170 librenms librenms   40960 May 31 15:01 mibs
drwxr-xr-x.   2 librenms librenms    4096 May 31 15:01 misc
-rw-rw-r--    1 librenms librenms    6466 May 31 15:01 mkdocs.yml
-rw-rw-r--    1 librenms librenms    1063 May 31 15:01 package.json
-rwxrwxr-x    1 librenms librenms    3841 Sep  2  2017 pbin.sh
-rw-rw-r--    1 librenms librenms    1188 May 31 15:01 phpunit.xml
-rwxrwxr-x    1 librenms librenms    6329 Sep  2  2017 poll-billing.php
-rwxr-xr-x    1 librenms librenms    5910 May  1 00:15 poller.php
-rwxrwxr-x    1 librenms librenms   14369 Sep  2  2017 poller-service.py
-rwxr-xr-x    1 librenms librenms   13462 Nov 28  2017 poller-wrapper.py
-rw-rw-r--    1 librenms librenms     480 Sep  2  2017 readmegen.yml
-rw-r--r--    1 librenms librenms   10819 Oct 31  2017 README.md
-rwxrwxr-x    1 librenms librenms     845 Sep  2  2017 renamehost.php
drwxrwxr-x    5 librenms librenms      42 May 31 15:01 resources
drwxrwxr-x    2 librenms librenms      71 May 31 15:01 routes
drwxrwxr-x+  13 librenms librenms    4096 Jun  1 11:04 rrd
drwxr-xr-x.   5 librenms librenms    4096 May 31 15:01 scripts
-rw-rw-r--    1 librenms librenms     563 May 31 15:01 server.php
-rwxrwxr-x    1 librenms librenms   13274 Sep  2  2017 services-wrapper.py
-rw-rw-r--    1 librenms librenms      65 Sep  2  2017 snmp.conf.example
-rw-rw-r--    1 librenms librenms     791 May 31 15:01 snmpd.conf.example
-rwxrwxr-x    1 librenms librenms    8844 May 31 15:01 snmp-scan.py
-rwxrwxr-x    1 librenms librenms     993 Sep  2  2017 snmptrap.php
drwxr-xr-x.   2 librenms librenms    8192 May 31 15:01 sql-schema
drwxrwxr-x+   6 librenms librenms      58 May 31 15:01 storage
-rwxrwxr-x    1 librenms librenms     602 Sep  2  2017 syslog.php
drwxr-xr-x.   6 librenms librenms    4096 May 31 15:01 tests
-rwxr-xr-x    1 librenms librenms    5926 May  1 00:15 validate.php
drwxrwxr-x   40 librenms librenms    4096 Jun  1 00:15 vendor
-rw-rw-r--    1 librenms librenms     549 May 31 15:01 webpack.mix.js

So I can’t see how the git clone won’t clobber the /opt/librenms directory and possibly cause problems for the librenms install or future updates.

Should the instructions be updated to install the check_mk stuff into a directory other than /opt/librenms ?

Thanks.

It should be a different directory already. /opt/librenms vs. /opt/librenms-agent, right?

Hi slashdoom. Yes you are correct, I overlooked that.

Being in different directories, I went through and followed the process and all worked.

Really happy, good software :slight_smile:

Thanks again.

1 Like