{"id":316,"date":"2019-05-14T14:05:01","date_gmt":"2019-05-14T14:05:01","guid":{"rendered":"https:\/\/blog.iabsolute.com\/?p=316"},"modified":"2019-05-14T14:05:01","modified_gmt":"2019-05-14T21:05:01","slug":"nagios-nsclient-and-module","status":"publish","type":"post","link":"https:\/\/blog.iabsolute.com\/?p=316","title":{"rendered":"nagios \u2013 nsclient++ and module"},"content":{"rendered":"\n<p>Version:1.0\nStartHTML:000000196\nEndHTML:000021947\nStartFragment:000010813\nEndFragment:000021879\nStartSelection:000010813\nEndSelection:000021875\nSourceURL:http:\/\/blogs.iabsolute.com\/?p=400\n\nnagios \u2013 nsclient++ and module \u00ab  Blogs IT Networking\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<\/p>\n\n\n\n<p>Here is my Nsclient configuration.<\/p>\n\n\n\n<p>;####### Here y can start #######<\/p>\n\n\n\n<p>[modules]<br>;# NSCLIENT++ MODULES<br>;# A list with DLLs to load at startup.<br>; You will need to enable some of these for NSClient++ to work.<br>; ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !<br>; * *<br>; * N O T I C E ! ! ! \u2013 Y O U H A V E T O E D I T T H I S *<br>; * *<br>; ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !<br>FileLogger.dll<br>CheckSystem.dll<br>CheckDisk.dll<br>NSClientListener.dll<br>NRPEListener.dll<br>SysTray.dll<br>CheckEventLog.dll<br>CheckHelpers.dll<br>;CheckWMI.dll<br>;<br>; RemoteConfiguration IS AN EXTREM EARLY IDEA SO DONT USE FOR PRODUCTION ENVIROMNEMTS!<br>;RemoteConfiguration.dll<br>; NSCA Agent is a new beta module use with care!<br>NSCAAgent.dll<br>; LUA script module used to write your own \u201ccheck deamon\u201d (sort of) early beta.<br>LUAScript.dll<br>; Script to check external scripts and\/or internal aliases, early beta.<br>CheckExternalScripts.dll<br>; Check other hosts through NRPE extreme beta and probably a bit dangerous!<br>NRPEClient.dll<br>; Extreamly early beta of a task-schedule checker<br>CheckTaskSched.dll<\/p>\n\n\n\n<p>[Settings]<br>;# OBFUSCATED PASSWORD<br>; This is the same as the password option but here you can store the password in an obfuscated manner.<br>; *NOTICE* obfuscation is *NOT* the same as encryption, someone with access to this file can still figure out the<br>; password. Its just a bit harder to do it at first glance.<br>;obfuscated_password=Jw0KAUUdXlAAUwASDAAB<br>;<br>;# PASSWORD<br>; This is the password (-s) that is required to access NSClient remotely. If you leave this blank everyone will be able to access the daemon remotly.<br>;password=secret-password<br>;<br>;# ALLOWED HOST ADDRESSES<br>; This is a comma-delimited list of IP address of hosts that are allowed to talk to the all daemons.<br>; If leave this blank anyone can access the deamon remotly (NSClient still requires a valid password).<br>; The syntax is host or ip\/mask so 192.168.0.0\/24 will allow anyone on that subnet access<br>allowed_hosts=207.182.137.60<br>;<br>;# USE THIS FILE<br>; Use the INI file as opposed to the registry if this is 0 and the use_reg in the registry is set to 1<br>; the registry will be used instead.<br>use_file=1<\/p>\n\n\n\n<p>[log]<br>;# LOG DEBUG<br>; Set to 1 if you want debug message printed in the log file (debug messages are always printed to stdout when run with -test)<br>;debug=1<br>;<br>;# LOG FILE<br>; The file to print log statements to<br>;file=NSC.log<br>;<br>;# LOG DATE MASK<br>; The format to for the date\/time part of the log entry written to file.<br>;date_mask=%Y-%m-%d %H:%M:%S<\/p>\n\n\n\n<p>[NSClient]<br>;# ALLOWED HOST ADDRESSES<br>; This is a comma-delimited list of IP address of hosts that are allowed to talk to NSClient deamon.<br>; If you leave this blank the global version will be used instead.<br>allowed_hosts=207.182.137.60<br>;<br>;# NSCLIENT PORT NUMBER<br>; This is the port the NSClientListener.dll will listen to.<br>port=12489<br>;<br>;# BIND TO ADDRESS<br>; Allows you to bind server to a specific local address. This has to be a dotted ip adress not a hostname.<br>; Leaving this blank will bind to all avalible IP adresses.<br>;bind_to_address=<br>;<br>;# SOCKET TIMEOUT<br>; Timeout when reading packets on incoming sockets. If the data has not arrived withint this time we will bail out.<br>;socket_timeout=30<\/p>\n\n\n\n<p>[NRPE]<br>;# NRPE PORT NUMBER<br>; This is the port the NRPEListener.dll will listen to.<br>port=5666<br>;<br>;# COMMAND TIMEOUT<br>; This specifies the maximum number of seconds that the NRPE daemon will allow plug-ins to finish executing before killing them off.<br>;command_timeout=60<br>;<br>;# COMMAND ARGUMENT PROCESSING<br>; This option determines whether or not the NRPE daemon will allow clients to specify arguments to commands that are executed.<br>;allow_arguments=0<br>;<br>;# COMMAND ALLOW NASTY META CHARS<br>; This option determines whether or not the NRPE daemon will allow clients to specify nasty (as in |`&amp;&gt;&lt;\u2019\u201d\\[]{}) characters in arguments.<br>;script_dir=c:\\my\\script\\dir<\/p>\n\n\n\n<p>[External Scripts]<br>;check_es_long=scripts\\long.bat<br>;check_es_ok=scripts\\ok.bat<br>;check_es_nok=scripts\\nok.bat<br>;check_vbs_sample=cscript.exe \/\/T:30 \/\/NoLogo scripts\\check_vb.vbs<\/p>\n\n\n\n<p>[External Alias]<br>;alias_cpu=checkCPU warn=80 crit=90 time=5m time=1m time=30s<br>;alias_disk=CheckDriveSize MinWarn=10% MinCrit=5% CheckAll FilterType=FIXED<br>;alias_service=checkServiceState CheckAll<br>;alias_mem=checkMem MaxWarn=80% MaxCrit=90% ShowAll type=physical<\/p>\n\n\n\n<p>; [includes]<br>;# The order when used is \u201creversed\u201d thus the last included file will be \u201cfirst\u201d<br>;# Included files can include other files (be carefull only do basic recursive checking)<br>;<br>; myotherfile.ini<br>; real.ini<\/p>\n\n\n\n<p>[NSCA Agent]<br>;# CHECK INTERVALL (in seconds)<br>; How often we should run the checks and submit the results.<br>;interval=5<br>;<br>;# ENCRYPTION METHOD<br>; This option determines the method by which the send_nsca client will encrypt the packets it sends<br>; to the nsca daemon. The encryption method you choose will be a balance between security and<br>; performance, as strong encryption methods consume more processor resources.<br>; You should evaluate your security needs when choosing an encryption method.<br>;<br>; Note: The encryption method you specify here must match the decryption method the nsca daemon uses<br>; (as specified in the nsca.cfg file)!!<br>; Values:<br>; 0 = None (Do NOT use this option)<br>; 1 = Simple XOR (No security, just obfuscation, but very fast)<br>; 2 = DES<br>; 3 = 3DES (Triple DES)<br>; 4 = CAST-128<br>; 6 = xTEA<br>; 8 = BLOWFISH<br>; 9 = TWOFISH<br>; 11 = RC2<br>; 14 = RIJNDAEL-128 (AES)<br>; 20 = SERPENT<br>;encryption_method=14<br>;<br>;# ENCRYPTION PASSWORD<br>; This is the password\/passphrase that should be used to encrypt the sent packets.<br>;password=<br>;<br>;# BIND TO ADDRESS<br>; Allows you to bind server to a specific local address. This has to be a dotted ip adress not a hostname.<br>; Leaving this blank will bind to \u201cone\u201d local interface.<br>; \u2014 not supported as of now \u2014<br>;bind_to_address=<br>;<br>;# LOCAL HOST NAME<br>; The name of this host (if empty \u201ccomputername\u201d will be used.<br>;hostname=<br>;<br>;# NAGIOS SERVER ADDRESS<br>; The address to the nagios server to submit results to.<br>;nsca_host=192.168.0.1<br>;<br>;# NAGIOS SERVER PORT<br>; The port to the nagios server to submit results to.<br>;nsca_port=5667<br>;<\/p>\n\n\n\n<p>;# CHECK COMMAND LIST<br>; The checks to run everytime we submit results back to nagios<br>; Any command(alias\/key) starting with a host_ is sent as HOST_COMMAND others are sent as SERVICE_COMMANDS<br>; where the alias\/key is used as service name.<br>;<br>[NSCA Commands]<br>;my_cpu_check=checkCPU warn=80 crit=90 time=20m time=10s time=4<br>;my_mem_check=checkMem MaxWarn=80% MaxCrit=90% ShowAll type=page<br>;my_svc_check=checkServiceState CheckAll exclude=wampmysqld exclude=MpfService<br>;host_check=check_ok<\/p>\n\n\n\n<p>[NRPE Handlers]<br>;# COMMAND DEFINITIONS<br>;# Command definitions that this daemon will run.<br>;# Can be either NRPE syntax:<br>;command[check_users]=\/usr\/local\/nagios\/libexec\/check_users -w 5 -c 10<br>;# Or simplified syntax:<br>;test=c:\\test.bat foo $ARG1$ bar<br>;check_disk1=\/usr\/local\/nagios\/libexec\/check_disk -w 5 -c 10<br>;# Or even loopback (inject) syntax (to run internal commands)<br>;# This is a way to run \u201cNSClient\u201d commands and other internal module commands such as check eventlog etc.<br>;check_cpu=inject checkCPU warn=80 crit=90 5 10 15<br>;check_eventlog=inject CheckEventLog Application warn.require.eventType=error warn.require.eventType=warning critical.require.eventType=error critical.exclude.eventType=info truncate=1024 descriptions<br>;check_disk_c=inject CheckFileSize ShowAll MaxWarn=1024M MaxCrit=4096M File:WIN=c:\\ATI\\*.*<br>;# But be careful:<br>; dont_check=inject dont_check This will \u201cloop forever\u201d so be careful with the inject command\u2026<br>;# Check some escapings\u2026<br>; check_escape=inject CheckFileSize ShowAll MaxWarn=1024M MaxCrit=4096M \u201cFile: foo \\\u201d WIN=c:\\\\WINDOWS\\\\*.*\u201d<br>;# Some real world samples<br>;nrpe_cpu=inject checkCPU warn=80 crit=90 5 10 15<br>;nrpe_ok=scripts\\ok.bat<br>;check_multi_line=scripts\\multi_line.bat<br>;#<br>;# The sample scripts<br>;#<br>;check_long=scripts\\long.bat<br>;check_ok=scripts\\ok.bat<br>;check_nok=scripts\\xlong.bat<br>;check_vbs=cscript.exe \/\/T:30 \/\/NoLogo scripts\\check_vb.vbs<\/p>\n\n\n\n<p>;# REMOTE NRPE PROXY COMMANDS<br>; A list of commands that check other hosts.<br>; Used by the NRPECLient module<br>[NRPE Client Handlers]<br>check_other=-H 192.168.0.1 -p 5666 -c remote_command -a arguments<\/p>\n\n\n\n<p>; # here ends #####<\/p>\n\n\n\n<p>add the ports Nagios-nrpe 5666 and Nagios-Nsclient \u2013 12489 to be oped only to nagios server.<\/p>\n\n\n\n<p>This is the configuration for monitoring nagios host for windows client.<\/p>\n\n\n\n<p>### Here starts #############<\/p>\n\n\n\n<p>define host{<br>use windows-server ; Inherit default values from a template<br>host_name Netech-prod ; The name we\u2019re giving to this host<br>alias Netech-Production ; name associated with the host<br>address 22.147.45.1 ; IP address of the host<br>}<br>define service{<br>use generic-service<br>host_name Netech-prod<br>service_description Uptime<br>check_command check_nt!UPTIME<br>}<br>define service{<br>use generic-service<br>host_name Netech-prod<br>service_description CPU Load<br>check_command check_nt!CPULOAD!-l 5,80,90<br>}<br>define service{<br>use generic-service<br>host_name Netech-prod<br>service_description Memory Usage<br>check_command check_nt!MEMUSE!-w 80 -c 90<br>}<br>define service{<br>use generic-service<br>host_name Netech-prod<br>service_description C:\\ Drive Space<br>check_command check_nt!USEDDISKSPACE!-l c -w 80 -c 90<br>}<\/p>\n\n\n\n<p>define service{<br>use generic-service<br>host_name Netech-prod<br>service_description W3SVC<br>check_command check_nt!SERVICESTATE!-d SHOWALL -l W3SVC<br>}<br>define service{<br>use generic-service<br>host_name Netech-prod<br>service_description Explorer<br>check_command check_nt!PROCSTATE!-d SHOWALL -l Explorer.exe<br>}<br>define service{<br>use generic-service<br>host_name Netech-prod<br>service_description MSSQL-server<br>check_command check_nt!PROCSTATE!-d SHOWALL -l sqlservr.exe<br>}<\/p>\n\n\n\n<p>define service{<br>use generic-service<br>host_name Netech-prod<br>service_description IIS-webserver<br>check_command check_nt!PROCSTATE!-d SHOWALL -l inetinfo.exe<br>}<\/p>\n\n\n\n<p>define service{<br>use generic-service<br>host_name Netech-mantis<br>service_description FTP<br>check_command check_ftp<br>}<\/p>\n\n\n\n<p>define service{<br>use generic-service<br>host_name Netech-prod<br>service_description Netech-portal<br>check_command check_http!-u <a href=\"http:\/\/www.touchmemobile.com\/index.aspx\">http:\/\/www.touchmemobile.com\/index.aspx<\/a> -t 5 -s \u201cMobile\u201d<br>}<br>### here ends #####33<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Version:1.0 StartHTML:000000196 EndHTML:000021947 StartFragment:000010813 EndFragment:000021879 StartSelection:000010813 EndSelection:000021875 SourceURL:http:\/\/blogs.iabsolute.com\/?p=400 nagios \u2013 nsclient++ and module \u00ab Blogs IT Networking Here is my Nsclient configuration. ;####### Here y can start ####### [modules];# NSCLIENT++ MODULES;# A list with DLLs to load at startup.; You &hellip; <a href=\"https:\/\/blog.iabsolute.com\/?p=316\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-316","post","type-post","status-publish","format-standard","hentry","category-nagios"],"_links":{"self":[{"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=\/wp\/v2\/posts\/316","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=316"}],"version-history":[{"count":1,"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=\/wp\/v2\/posts\/316\/revisions"}],"predecessor-version":[{"id":317,"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=\/wp\/v2\/posts\/316\/revisions\/317"}],"wp:attachment":[{"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=316"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=316"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=316"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}