Nagios client server configuration

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
vuduops
Posts: 81
Joined: Wed Sep 07, 2016 1:34 pm

Re: Nagios client server configuration

Post by vuduops »

I am testing ncpa passive checks. I am trying to test by adding custom plugins like the check_uptime. I have attached the ncpa config on the remote server below and below errors on the nagios server logs. Can you take a look a let me know how to add a custom plugin to the ncpa configuration

Code: Select all


1478725226] Event broker module '/usr/local/nagios/bin/ndomod.o' initialized successfully.
[1478725226] Successfully launched command file worker with pid 32253
[1478725235] SERVICE ALERT: backup1.devdfw.marquee.net;uptime;UNKNOWN;SOFT;1;Unable to run check on non-child node. Revise your query.
[1478725235] SERVICE ALERT: backup1.devdfw.marquee.net;uptime;UNKNOWN;SOFT;2;Unable to run check on non-child node. Revise your query.
[1478725235] SERVICE ALERT: backup1.devdfw.marquee.net;uptime;UNKNOWN;HARD;3;Unable to run check on non-child node. Revise your query.
[1478725235] SERVICE NOTIFICATION: nagiosadmin;backup1.devdfw.marquee.net;uptime;UNKNOWN;xi_service_notification_handler;Unable to run check on non-child node. Revise your query.
[1478725236] wproc: NOTIFY job 0 from worker Core Worker 32236 is a non-check helper but exited with return code 255
[1478725236] wproc:   host=backup1.devdfw.marquee.net; service=uptime; contact=nagiosadmin
[1478725236] wproc:   early_timeout=0; exited_ok=1; wait_status=65280; error_code=0;
[1478725236] wproc: GLOBAL SERVICE EVENTHANDLER job 0 from worker Core Worker 32240 is a non-check helper but exited with return code 255
[1478725236] wproc:   early_timeout=0; exited_ok=1; wait_status=65280; error_code=0;
[1478725236] wproc: GLOBAL SERVICE EVENTHANDLER job 0 from worker Core Worker 32233 is a non-check helper but exited with return code 255
[1478725236] wproc:   early_timeout=0; exited_ok=1; wait_status=65280; error_code=0;
[1478725236] wproc: GLOBAL SERVICE EVENTHANDLER job 0 from worker Core Worker 32242 is a non-check helper but exited with return code 255
[1478725236] wproc:   early_timeout=0; exited_ok=1; wait_status=65280; error_code=0;

Code: Select all

[[email protected] var]# cat /usr/local/ncpa/etc/ncpa.cfg
[listener]
uid = nagios
certificate = adhoc
loglevel = info
ip = 0.0.0.0
gid = nagcmd
logfile = var/ncpa_listener.log
port = 5693
pidfile = var/ncpa_listener.pid
# Available versions: PROTOCOL SSLv2, SSLv3, TLSv1
ssl_version = TLSv1

[passive]
uid = nagios
handlers = nrds,nrdp
loglevel = info
gid = nagcmd
sleep = 5
logfile = var/ncpa_passive.log
pidfile = var/ncpa_passive.pid

[nrdp]
token = nagios
hostname = backup1.devdfw.marquee.net
parent = https://10.230.99.19/nrdp/

[nrds]
URL = None
CONFIG_VERSION = None
TOKEN = None
CONFIG_NAME = None
CONFIG_OS = None

[api]
community_string = nagiospassword

[plugin directives]
#plugin_path = plugins/ /usr/lib64/nagios/plugins/
plugin_path = /usr/lib64/nagios/plugins
.sh = /bin/sh $plugin_name $plugin_args
.ps1 = powershell -ExecutionPolicy Bypass -File $plugin_name $plugin_args
.vbs = cscript $plugin_name $plugin_args //NoLogo

[passive checks]
%HOSTNAME%|cpu usage = /cpu/percent --warning 20 --critical 30
%HOSTNAME%|swap usage = /memory/swap/percent --warning 40 --critical 80
%HOSTNAME%|memory usage = /memory/virtual/percent --warning 60 --critical 80
%HOSTNAME%|uptime = /usr/lib64/nagios/plugins/check_uptime -w 60\:
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Nagios client server configuration

Post by avandemore »

Apparently this is a known bug and fixed in NCPA 2.0+. Can you try this and let us know the result:

https://assets.nagios.com/downloads/ncpa/dev/
Previous Nagios employee
vuduops
Posts: 81
Joined: Wed Sep 07, 2016 1:34 pm

Re: Nagios client server configuration

Post by vuduops »

No that did not help.Upgrading the ncpa 2.0 broke the default ncpa agent checks.I am trying understand how can I add custom nrpe plugins to ncpa.cfg. What are the config changes required on the client and the monitoring server to add custom plugins on centos server.

any help regarding this is appreciated.

Code: Select all


[1478730156] SERVICE ALERT: backup1.devdfw.marquee.net;hobbit;OK;HARD;3;OK - 10.230.99.19: rta 0.009ms, lost 0%
[1478730156] SERVICE NOTIFICATION: nagiosadmin;backup1.devdfw.marquee.net;hobbit;OK;xi_service_notification_handler;OK - 10.230.99.19: rta 0.009ms, lost 0%
[1478730156] wproc: NOTIFY job 0 from worker Core Worker 28932 is a non-check helper but exited with return code 255
[1478730156] wproc:   host=backup1.devdfw.marquee.net; service=hobbit; contact=nagiosadmin
[1478730156] wproc:   early_timeout=0; exited_ok=1; wait_status=65280; error_code=0;
[1478730156] wproc: GLOBAL SERVICE EVENTHANDLER job 0 from worker Core Worker 28933 is a non-check helper but exited with return code 255
[1478730156] wproc:   early_timeout=0; exited_ok=1; wait_status=65280; error_code=0;

Thanks
Krishna
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Nagios client server configuration

Post by avandemore »

Did you review this? https://assets.nagios.com/downloads/ncp ... ing-checks

Can you show the log regarding the default checks?
Previous Nagios employee
vuduops
Posts: 81
Joined: Wed Sep 07, 2016 1:34 pm

Re: Nagios client server configuration

Post by vuduops »

Yes, The documentation is not clear on how to add nagios plugins to the ncpa config. I have added the check similar to the syntax shown but I see the checks are failing.

Here are logs on the remote server

Code: Select all


2016-11-10 21:56:49,060 12894 ERROR Cannot parse passive directive for logmaxmb, name malformed, skipping.
2016-11-10 21:56:49,060 12894 ERROR Cannot parse passive directive for gid, name malformed, skipping.
2016-11-10 21:56:49,060 12894 ERROR Cannot parse passive directive for logbackups, name malformed, skipping.
2016-11-10 21:56:49,061 12894 ERROR Cannot parse passive directive for uid, name malformed, skipping.
2016-11-10 21:56:49,061 12894 INFO Running check: /cpu/percent --warning 20 --critical 30
2016-11-10 21:56:50,066 12894 INFO Running check: /memory/swap/percent --warning 40 --critical 80
2016-11-10 21:56:50,069 12894 INFO Running check: /memory/virtual/percent --warning 60 --critical 80
2016-11-10 21:56:50,071 12894 INFO Running check: /usr/lib64/nagios/plugins/check_ssh
2016-11-10 21:56:50,076 12894 INFO Starting new HTTPS connection (1): 10.230.99.19
2016-11-10 21:56:50,093 12894 INFO Message from NRDP server: OK
2016-11-10 21:56:50,093 12894 INFO Meta output from NRDP server: 4 checks processed.
2016-11-10 21:56:55,101 12894 INFO Establishing passive handler: Handler
2016-11-10 21:56:55,102 12894 ERROR Cannot parse passive directive for loglevel, name malformed, skipping.
2016-11-10 21:56:55,102 12894 ERROR Cannot parse passive directive for logmaxmb, name malformed, skipping.
2016-11-10 21:56:55,102 12894 ERROR Cannot parse passive directive for gid, name malformed, skipping.
2016-11-10 21:56:55,102 12894 ERROR Cannot parse passive directive for logbackups, name malformed, skipping.
2016-11-10 21:56:55,103 12894 ERROR Cannot parse passive directive for uid, name malformed, skipping.
2016-11-10 21:56:55,103 12894 INFO Running check: /cpu/percent --warning 20 --critical 30
2016-11-10 21:56:56,108 12894 INFO Running check: /memory/swap/percent --warning 40 --critical 80
2016-11-10 21:56:56,110 12894 INFO Running check: /memory/virtual/percent --warning 60 --critical 80
2016-11-10 21:56:56,113 12894 INFO Running check: /usr/lib64/nagios/plugins/check_ssh

Nagios monitoring server log

Code: Select all

[[email protected] var]# tail -10f nagios.log 
[1478814754] wproc:   early_timeout=0; exited_ok=1; wait_status=65280; error_code=0;
[1478814754] wproc: GLOBAL SERVICE EVENTHANDLER job 1143 from worker Core Worker 14770 is a non-check helper but exited with return code 255
[1478814754] wproc:   early_timeout=0; exited_ok=1; wait_status=65280; error_code=0;
[1478814763] SERVICE ALERT: backup1.devdfw.marquee.net;ssh;UNKNOWN;HARD;3;Unable to run check on non-child node. Revise your query.
[1478814763] SERVICE NOTIFICATION: nagiosadmin;backup1.devdfw.marquee.net;ssh;UNKNOWN;xi_service_notification_handler;Unable to run check on non-child node. Revise your query.
[1478814764] wproc: GLOBAL SERVICE EVENTHANDLER job 1143 from worker Core Worker 14769 is a non-check helper but exited with return code 255
[1478814764] wproc:   early_timeout=0; exited_ok=1; wait_status=65280; error_code=0;
[1478814764] wproc: NOTIFY job 1143 from worker Core Worker 14771 is a non-check helper but exited with return code 255
[1478814764] wproc:   host=backup1.devdfw.marquee.net; service=ssh; contact=nagiosadmin
[1478814764] wproc:   early_timeout=0; exited_ok=1; wait_status=65280; error_code=0;
-Krishna
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Nagios client server configuration

Post by avandemore »

What are the contents of https://<Your NCPA IP>:5693/api/

Are you sure you're reviewing https://assets.nagios.com/downloads/ncp ... uction-api ?
Previous Nagios employee
vuduops
Posts: 81
Joined: Wed Sep 07, 2016 1:34 pm

Re: Nagios client server configuration

Post by vuduops »

I am not using the listener to review the checks. I am able to see the results on the nagios server. My question is what is the syntax to add more plugin directories to the plugin_path under the "[plugin directives]". Adding I am using the below syntax and it is now working.

plugin_path = plugins/ /usr/lib64/nagios/plugins/

Also what would be the syntax to add the check to ncpa.cfg incase I add the plugin under "/usr/lib64/nagios/plugins/" and want to run it . Since the below line is not working ...

%HOSTNAME%|entropy = check_entropy.py

Thanks
Krishna
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Nagios client server configuration

Post by avandemore »

NCPA Active Check documentation is defined here:

https://assets.nagios.com/downloads/ncp ... ctive.html

It should also be noted NCPA is functionally equivalent to SNMP. If you find NCPA too difficult, you can accomplish the same thing with modifications to SNMP and traps if you need passive checks.
Previous Nagios employee
vuduops
Posts: 81
Joined: Wed Sep 07, 2016 1:34 pm

Re: Nagios client server configuration

Post by vuduops »

As I had mentioned earlier I looking to set up passive check. I have gone through the documentation and it is unclear on how to add plugins in a different directory.

I am not looking to for links. I have been able to google and find the documentation about setting up ncpa passive checks. What I am looking for is how to add a third party checks in a different directory. If someone can confirm the configuration on how to add the third party check on a remote server that will be great.

Thanks
Krishna
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Nagios client server configuration

Post by avandemore »

The links provided do explain this, but there are some caveats to the process. NCPA is in a state of transition right now which is why direct answers aren't easy. Also neglecting to provide the information requested doesn't help matters such as the output I requested. For example here is such output from a dummy system:

Code: Select all

{
  "value": {
    "root": {
      "services": [], 
      "processes": [], 
      "user": {
        "count": [
          1, 
          "c"
        ], 
        "list": [
          [
            "root"
          ], 
          "name"
        ]
      }, 
      "memory": {
        "swap": {
          "total": [
            2147479552, 
            "b"
          ], 
          "percent": [
            0.2, 
            "%"
          ], 
          "free": [
            2143322112, 
            "B"
          ], 
          "used": [
            4157440, 
            "B"
          ]
        }, 
        "virtual": {
          "available": [
            1062133760, 
            "b"
          ], 
          "total": [
            1929261056, 
            "b"
          ], 
          "percent": [
            44.9, 
            "%"
          ], 
          "free": [
            261988352, 
            "B"
          ], 
          "used": [
            1667272704, 
            "B"
          ]
        }
      }, 
      "interface": {
        "lo": {
          "packets_sent": [
            927722, 
            "c"
          ], 
          "dropin": [
            0, 
            "c"
          ], 
          "bytes_recv": [
            229822137, 
            "b"
          ], 
          "packets_recv": [
            927722, 
            "c"
          ], 
          "errin": [
            0, 
            "c"
          ], 
          "dropout": [
            0, 
            "c"
          ], 
          "bytes_sent": [
            229822137, 
            "b"
          ], 
          "errout": [
            0, 
            "c"
          ]
        }, 
        "enp0s3": {
          "packets_sent": [
            884684, 
            "c"
          ], 
          "dropin": [
            0, 
            "c"
          ], 
          "bytes_recv": [
            1433144475, 
            "b"
          ], 
          "packets_recv": [
            13042162, 
            "c"
          ], 
          "errin": [
            0, 
            "c"
          ], 
          "dropout": [
            0, 
            "c"
          ], 
          "bytes_sent": [
            550138658, 
            "b"
          ], 
          "errout": [
            0, 
            "c"
          ]
        }
      }, 
      "disk": {
        "logical": {
          "|boot": {
            "total_size": [
              520794112, 
              "b"
            ], 
            "used_percent": [
              41.1, 
              "%"
            ], 
            "used": [
              214065152, 
              "b"
            ], 
            "free": [
              306728960, 
              "b"
            ], 
            "device_name": [
              [
                "/dev/sda1"
              ], 
              "name"
            ]
          }, 
          "|home": {
            "total_size": [
              20222836736, 
              "b"
            ], 
            "used_percent": [
              0.2, 
              "%"
            ], 
            "used": [
              33796096, 
              "b"
            ], 
            "free": [
              20189040640, 
              "b"
            ], 
            "device_name": [
              [
                "/dev/mapper/centos-home"
              ], 
              "name"
            ]
          }, 
          "|": {
            "total_size": [
              41427873792, 
              "b"
            ], 
            "used_percent": [
              7.2, 
              "%"
            ], 
            "used": [
              2976378880, 
              "b"
            ], 
            "free": [
              38451494912, 
              "b"
            ], 
            "device_name": [
              [
                "/dev/mapper/centos-root"
              ], 
              "name"
            ]
          }
        }, 
        "physical": {
          "sr0": {
            "read_time": [
              2, 
              "ms"
            ], 
            "read_bytes": [
              49152, 
              "b"
            ], 
            "write_count": [
              0, 
              "c"
            ], 
            "write_time": [
              0, 
              "ms"
            ], 
            "write_bytes": [
              0, 
              "b"
            ], 
            "read_count": [
              12, 
              "c"
            ]
          }, 
          "sda2": {
            "read_time": [
              334399, 
              "ms"
            ], 
            "read_bytes": [
              693708288, 
              "b"
            ], 
            "write_count": [
              2596808, 
              "c"
            ], 
            "write_time": [
              25635741, 
              "ms"
            ], 
            "write_bytes": [
              19076805120, 
              "b"
            ], 
            "read_count": [
              33522, 
              "c"
            ]
          }, 
          "sda1": {
            "read_time": [
              4751, 
              "ms"
            ], 
            "read_bytes": [
              26622464, 
              "b"
            ], 
            "write_count": [
              83, 
              "c"
            ], 
            "write_time": [
              13912, 
              "ms"
            ], 
            "write_bytes": [
              2134016, 
              "b"
            ], 
            "read_count": [
              555, 
              "c"
            ]
          }, 
          "dm-2": {
            "read_time": [
              387, 
              "ms"
            ], 
            "read_bytes": [
              629248, 
              "b"
            ], 
            "write_count": [
              58963, 
              "c"
            ], 
            "write_time": [
              589481, 
              "ms"
            ], 
            "write_bytes": [
              183302144, 
              "b"
            ], 
            "read_count": [
              149, 
              "c"
            ]
          }, 
          "dm-0": {
            "read_time": [
              337508, 
              "ms"
            ], 
            "read_bytes": [
              690777088, 
              "b"
            ], 
            "write_count": [
              2752420, 
              "c"
            ], 
            "write_time": [
              75255467, 
              "ms"
            ], 
            "write_bytes": [
              18889013760, 
              "b"
            ], 
            "read_count": [
              33422, 
              "c"
            ]
          }, 
          "dm-1": {
            "read_time": [
              8056, 
              "ms"
            ], 
            "read_bytes": [
              1871872, 
              "b"
            ], 
            "write_count": [
              1096, 
              "c"
            ], 
            "write_time": [
              807217, 
              "ms"
            ], 
            "write_bytes": [
              4489216, 
              "b"
            ], 
            "read_count": [
              318, 
              "c"
            ]
          }
        }
      }, 
      "system": {
        "node": [
          [
            "avandemore-centos7.nagios.com"
          ], 
          "name"
        ], 
        "machine": [
          [
            "x86_64"
          ], 
          "name"
        ], 
        "uptime": [
          [
            706921.0
          ], 
          "s"
        ], 
        "version": [
          [
            "#1 SMP Mon Oct 24 16:09:20 UTC 2016"
          ], 
          "name"
        ], 
        "release": [
          [
            "3.10.0-327.36.3.el7.x86_64"
          ], 
          "name"
        ], 
        "agent_version": [
          [
            "1.8.1"
          ], 
          ""
        ], 
        "system": [
          [
            "Linux"
          ], 
          "name"
        ], 
        "processor": [
          [
            "x86_64"
          ], 
          "name"
        ]
      }, 
      "agent": {
        "plugin": [
          "utils.sh", 
          "check_dummy", 
          "check_rrdtraf.php", 
          "check_snmp_mem.pl", 
          "check_nna.py", 
          "check_smtp_send", 
          "check_pop", 
          "check_bpi.php", 
          "check_pnp_rrds.pl", 
          "check_email_delivery", 
          "check_xisla.php", 
          "check_asterisk.pl", 
          "utils.pm", 
          "check_snmp_css_main.pl", 
          "check_cluster", 
          "check_mysql_health", 
          "check_imap_receive", 
          "check_nwstat", 
          "check_udp", 
          "check_ntp", 
          "check_rrdtraf", 
          "check_postgres.pl", 
          "check_ifoperstatus", 
          "check_smtp", 
          "check_mssql_server.py", 
          "check_snmp_linkproof_nhr.pl", 
          "check_nagios_performance.php", 
          "check_mrtgtraf", 
          "check_snmp_vrrp.pl", 
          "check_wave", 
          "check_ups", 
          "check_flexlm", 
          "check_ifoperstatnag", 
          "check_file_age", 
          "urlize", 
          "folder_watch.pl", 
          "check_nntps", 
          "check_snmp_storage.pl", 
          "check_mssql", 
          "check_load", 
          "check_by_ssh", 
          "check_wmi_plus.conf", 
          "check_esx3.pl", 
          "check_ftp_fully", 
          "check_snmp_load.pl", 
          "check_hpjd", 
          "check_ntp_time", 
          "check_disk_smb", 
          "check_rpc", 
          "check_snmp_cpfw.pl", 
          "check_wmi_plus.ini", 
          "check_mssql_database.py", 
          "check_snmp_win.pl", 
          "check_nagiosxiserver.php", 
          "check_nagioslogserver.php", 
          "check_mongodb.py", 
          "check_simap", 
          "send_nsca", 
          "check_procs", 
          "check_webinject.sh", 
          "check_nt", 
          "process_perfdata.pl", 
          "check_mountpoints.sh", 
          "check_snmp_boostedge.pl", 
          "check_snmp_process.pl", 
          "check_bl", 
          "check_ssh", 
          "check_mrtg", 
          "negate", 
          "check_sensors", 
          "check_time", 
          "check_tcp", 
          "check_ntp_peer", 
          "check_mysql_query", 
          "check_jabber", 
          "check_mysql", 
          "check_ifstatus", 
          "check_nntp", 
          "check_snmp", 
          "check_dir", 
          "check_nagios", 
          "check_dig", 
          "check_snmp_storage_wizard.pl", 
          "check_snmp_load_wizard.pl", 
          "check_tftp.sh", 
          "check_snmp_process_wizard.pl", 
          "check_snmp_nsbox.pl", 
          "check_snmp_env.pl", 
          "check_breeze", 
          "check_snmp_int.pl", 
          "check_ldap", 
          "check_iostat", 
          "check_nrpe", 
          "check_email_delivery_epn", 
          "check_sip", 
          "check_ide_smart", 
          "check_ncpa.py", 
          "check_snmp_generic.pl", 
          "check_dns", 
          "check_uptime", 
          "check_swap", 
          "check_domain.php", 
          "check_spop", 
          "check_fping", 
          "check_radius_adv", 
          "check_imap", 
          "check_users", 
          "check_real", 
          "check_ping", 
          "check_win_snmp_disk.pl", 
          "check_log", 
          "check_em01.pl", 
          "check_wmi_plus.pl", 
          "check_email_loop.pl", 
          "check_overcr", 
          "check_mailq", 
          "check_disk", 
          "check_oracle", 
          "check_apt", 
          "check_ircd", 
          "check_ftp", 
          "check_smtp_send_epn", 
          "check_ssmtp", 
          "check_icmp", 
          "check_ldaps", 
          "check_snmp_css.pl", 
          "check_clamd", 
          "check_dhcp", 
          "check_http", 
          "check_imap_receive_epn"
        ]
      }, 
      "cpu": {
        "count": [
          [
            2
          ], 
          "c"
        ], 
        "idle": [
          [
            684945.78, 
            683886.38
          ], 
          "ms"
        ], 
        "percent": [], 
        "system": [
          [
            3408.75, 
            3272.07
          ], 
          "ms"
        ], 
        "user": [
          [
            17078.73, 
            17637.01
          ], 
          "ms"
        ]
      }
    }
  }
}
Given such information it's easier to work with as long as it is in scope.

If you like you can raise specific questions to the developers here:

https://github.com/NagiosEnterprises/ncpa
Previous Nagios employee
Locked