Naigos core 3 + nrdp

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
ericssonvietnam
Posts: 239
Joined: Mon Jun 27, 2016 11:05 pm

Naigos core 3 + nrdp

Post by ericssonvietnam »

Hi,

I am trying to integrate nrdp 1.2-1 with nagoios server 3.
nagios-3.5.1-1.el6.x86_64
nrdp-server-1.2-1.noarch
Not sure what is going wrong. I can submit checkresults from command line, but its not reflecting on console against host/service nor its comming to nagios eventlog.

Configuration details:-
Client:

Code: Select all

 cat /etc/nagiosql/services/Ind_winnrpe.cfg
###############################################################################
#
# Service configuration file
#
# Created by: Nagios QL Version 3.2.0
# Date:       2016-09-26 17:16:46
# Version:    Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios QL will overwite all manual settings during the next update
#
###############################################################################

define service {
        #NAGIOSQL_CONFIG_NAME           Ind_winnrpe
        host_name                       Sccm-uat-1
        service_description             Hardware_Details
        display_name                    Hardware_Details
        use                             GenericService
        check_command                   check_dummy!1
        max_check_attempts              1
        check_interval                  1
        retry_interval                  1
        active_checks_enabled           0
        passive_checks_enabled          1
        check_freshness                 1
        freshness_threshold             0
        process_perf_data               1
        register                        1
}

###############################################################################
#
# Service configuration file
#
# END OF FILE
#
###############################################################################

To submit status from comamnd line:-

Code: Select all

[user ~]# ./send_nrdp.sh   -H Sccm-uat-1 -s Hardware_Details -S 1 -o "all is good"  -u "http://localhost.egi.ericsson.com/nrdp" -t mysecrettoken
Sent 1 checks to http://localhost.egi.ericsson.com/nrdp
Do let me know if you need any other details to address this issue.

Moderator Edit: This thread has been moved to the General section as it is a Core question. I will PM you with more details.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Naigos core 3 + nrdp

Post by tgriep »

You may want to look at the NRDP overview guide below and check and see if the permissions and the path to the files are correct.
https://assets.nagios.com/downloads/nrd ... erview.pdf
Also, try going through the Testing the NRDP API section and post any errors that you see while testing.
Be sure to check out our Knowledgebase for helpful articles and solutions!
ericssonvietnam
Posts: 239
Joined: Mon Jun 27, 2016 11:05 pm

Re: Naigos core 3 + nrdp

Post by ericssonvietnam »

I flowed the same guide and after setup, preformed API testing. i can submit check data using both method i.e through URL and command line through send_nrdp.php, without any issue ( at least return code says assure that). But problem is, i check staus is not visible on Nagios Portal and nothing get registered on even logs too.

Kindly, Suggest next step to troubleshoot..!
ericssonvietnam
Posts: 239
Joined: Mon Jun 27, 2016 11:05 pm

Re: Naigos core 3 + nrdp

Post by ericssonvietnam »

I found the fix..write permisson to user nagios was missing on check_result dir.


Now manula check data is getting uplaoded against services.But when same i do from ndrs_win..ists getting stucke..may be looking after logs you can give some clue..

Code: Select all

9/27/2016 3:55:00 PM ---Starting NRDS Transaction--- :
9/27/2016 3:55:00 PM Diagnostic mode : False
9/27/2016 3:55:00 PM base NRDP address locked and loaded : http://nagiosuat.egi.ericsson.com/nrdp/?token=uatclient&cmd=
9/27/2016 3:55:00 PM XML being passed to check for updates : http://nagiosuat.egi.ericsson.com/nrdp/?token=uatclient&cm
d=updatenrds&XMLDATA=<?xml version='1.0' ?><configs><config><name>Ind_winnrpe</name><version>0</version></config></conf
igs>
9/27/2016 3:55:00 PM running Post routine.. :
9/27/2016 3:55:00 PM ignoring certificate errors : 13056
9/27/2016 3:55:00 PM Post Data.... :
9/27/2016 3:55:00 PM address..... : http://nagiosuat.egi.ericsson.com/nrdp/?token=uatclient&cmd=updatenrds&XMLDATA=<?xm
l version='1.0' ?><configs><config><name>Ind_winnrpe</name><version>0</version></config></configs>
9/27/2016 3:55:00 PM NRDP response to update query : NO REQUEST HANDLER
9/27/2016 3:55:00 PM new plugins available : check_hwinfo.swf
9/27/2016 3:55:00 PM downloading plugin to : C:\PROGRA~1\Nagios\NRDS_Win\plugins\check_hwinfo.swf
9/27/2016 3:55:00 PM downloading new plugin : check_hwinfo.swf
9/27/2016 3:55:00 PM new plugin URL : http://nagiosuat.egi.ericsson.com/nrdp/?token=uatclient&cmd=getplugin&plugin=chec
k_hwinfo.swf&os=Windows&os_ver=6.1.7601&arch=AMD64
9/27/2016 3:55:00 PM downloading new file : http://nagiosuat.egi.ericsson.com/nrdp/?token=uatclient&cmd=getplugin&plugi
n=check_hwinfo.swf&os=Windows&os_ver=6.1.7601&arch=AMD64
9/27/2016 3:55:00 PM running Post routine.. :
9/27/2016 3:55:00 PM ignoring certificate errors : 13056
9/27/2016 3:55:00 PM Post Data.... :
9/27/2016 3:55:00 PM address..... : http://nagiosuat.egi.ericsson.com/nrdp/?token=uatclient&cmd=getplugin&plugin=check_
hwinfo.swf&os=Windows&os_ver=6.1.7601&arch=AMD64
9/27/2016 3:55:01 PM command to be run : C:\PROGRA~1\Nagios\NRDS_Win\plugins\check_hwinfo.swf
9/27/2016 3:55:01 PM command line executing : cmd /c C:\PROGRA~1\Nagios\NRDS_Win\plugins\check_hwinfo.swf > %temp%\outp
ut.txt

My config.

Code: Select all

[settings]
CONFIG_VERSION=0
CONFIG_NAME=Ind_winnrpe
URL=http://nagiosuat.egi.ericsson.com/nrdp
TOKEN=uatclient
PLUGIN_DIR=C:\Program Files\Nagios\NRDS_Win\plugins
UPDATE_CONFIG=1
UPDATE_PLUGINS=1
LOG_FILE=C:\Program Files\Nagios\NRDS_Win\logs\NRDS_debug.log

[services]
command[Hardware_Details] = $PLUGIN_DIR$\check_hwinfo.swf

[extensions]
vbs = cscript //nologo //T:10 $CHECK_COMMAND$
ps1 = powershell -ExecutionPolicy Bypass -File $CHECK_COMMAND$
Any help will be appreciated.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Naigos core 3 + nrdp

Post by tgriep »

Do you see any errors in the Apache error logs on the Nagios server?
Do you have SSL enabled for the Apache web server?
Be sure to check out our Knowledgebase for helpful articles and solutions!
ericssonvietnam
Posts: 239
Joined: Mon Jun 27, 2016 11:05 pm

Re: Naigos core 3 + nrdp

Post by ericssonvietnam »

No: SSL is not enabled for apache nor there any hint in logs.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Naigos core 3 + nrdp

Post by tgriep »

Can you post your NRDS_Win.vbs file so we can view it?
Be sure to check out our Knowledgebase for helpful articles and solutions!
ericssonvietnam
Posts: 239
Joined: Mon Jun 27, 2016 11:05 pm

Re: Naigos core 3 + nrdp

Post by ericssonvietnam »

.wsf scripts are not allowed to upload. hence the code..

Code: Select all

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' "check_hwinfo.wsf"
'
' This script was initially developed by Anstat Pty Ltd for internal use,
' and has kindly been made available to the Open Source community for
' redistribution and further development under the terms of the
' GNU General Public License: http://www.gnu.org/licenses/gpl.html
' 
' This script is supplied 'as-is', in the hope that it will be useful, but
' neither Anstat Pty Ltd nor the authors make any warranties or guarantees
' as to its correct operation, including its intended function.
' 
' Or in other words:
'         Test it yourself, and make sure it works for YOU.
' 
' Authors: George Hansper, Richard Balaganeshan
'                                   e-mail:  [email protected]
'
<job>
<runtime>
  <description>
Show one-line summary of Hardware information, displayed as:
	[Motherboard:Model:Serial][n:CPU:MHz:L2Cache:FSB][Memory:ECC:Module/Module/...][disk_size:Raid:...]
Example:
	[Dell:PowerEdge 2850:ABCDE1S][2:Xeon:3600 MHz:2048 KB:800 MHz][4096 M:Multi-bit ECC:2048M/2048M/0/0/0/0][sda=683.1 G:MegaRAID,LD 0 RAID5  699G,521X][Red Hat Enterprise Linux ES release 4 (Nahant Update 3)]


NRPE Usage:
	command[check_hwinfo]=c:\winnt\system32\cscript.exe //NoLogo //T:10 c:\nrpe_nt\check_hwinfo.wsf
	command[check_hwinfo_csv]=c:\winnt\system32\cscript.exe //NoLogo //T:10 c:\nrpe_nt\check_hwinfo.wsf /sep:","

</description>
  <named
    name="h"
    helpstring="This Help"
    type="simple"
    required="false" 
  />
  <named
    name="sep"
    helpstring="Separation character(s) - use csv for quoted comma-separated output"
    type="simple"
    required="false" 
  />
  <example>
Example: check_hwinfo.wsf /sep:","
  </example>
</runtime>
<script language="VBScript">

' Output format:
' [Motherboard:Model:Serial][n:CPU:MHz:L2Cache:FSB][Memory:ECC:Module/Module/...][disk_size/...:Raid/...]
' [Dell:PowerEdge 2850:ABCDE1S][2:Xeon:3600 MHz:2048 KB:800 MHz][4096 M:Multi-bit ECC:2048M/2048M/0/0/0/0][sda=683.1 G:MegaRAID,LD 0 RAID5  699G,521X][Red Hat Enterprise Linux ES release 4 (Nahant Update 3)]



Dim strComputer,strSep
Const strCSV = ""","""

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Help
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
If Wscript.Arguments.Named.Exists("h")  Then
      Wscript.Echo "Plugin help screen:"
      Wscript.Arguments.ShowUsage()
      Wscript.Quit(intUnknown)
End If

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Sep
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
If Wscript.Arguments.Named.Exists("sep")  Then
      strSep = Wscript.Arguments.Named("sep")
      If ( strSep = "csv" ) Then
          strSep = strCSV
      End If
Else
      strSep = ":"
End If


strComputer = "."

Function GetWMIServices()
        Set GetWMIServices = GetObject("winmgmts:" _
            & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
End Function

Set objWMIService = GetWMIServices()

On Error Resume Next

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Model and Serial Number (aka "service tag")
Dim strModel(2)
Dim strMessage

Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystemProduct",,48)
For Each objItem in colItems
    ' eg Dell
    strModel(0) = Trim(objItem.Vendor)
    ' eg Poweredge 800
    strModel(1) = Trim(objItem.Name)
    ' Service Tag
    strModel(2) = Trim(objItem.IdentifyingNumber)
Next

' CPU Speed   [nCpus:Model:MHz:L2 cache:FSB]
Dim strCPU(4)
Dim ndx
Dim strCpuSockets(0)
Dim nCpuSockets
Dim nCpuSocketFound
Dim nCpus

nCpuSockets = 0
nCpus = 0
Set colItems = objWMIService.ExecQuery("Select * from Win32_Processor")
For Each objItem in colItems
    nCpuSocketFound = 0
    For ndx = 0 to nCpuSockets
        if ( strCpuSockets(ndx) = objItem.SocketDesignation ) Then
            nCpuSocketFound = 1
            Exit For
        End If
    Next
    If ( nCpuSocketFound = 0 ) Then
       nCpuSockets = nCpuSockets + 1
       Redim strCpuSockets(nCpuSockets-1)
       strCpuSockets(nCpuSockets-1) = objItem.SocketDesignation
       if ( NOT objItem.DeviceID = "" ) Then
           nCpus = nCpus+1
           strCPU(1) = Trim(objItem.Name)
           strCPU(2) = objItem.CurrentClockSpeed & " MHz"
           strCPU(3) = objItem.L2CacheSize & " KB"
           strCPU(4) = objItem.ExtClock & " MHz"
       End If
    End If
Next

strCPU(0) = nCpus

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Memory  [Memory:ECC:Modules/...]
Dim strMem(2)
Dim strMemModules()
Dim nMemModules
Dim nTotalBytes
nMemModules = 0
nMemorySlots = 0
nTotalBytes = 0
Set colItems = objWMIService.ExecQuery("Select * from Win32_PhysicalMemoryArray")
For Each objItem in colItems
        if( objItem.MemoryErrorCorrection =7 ) Then
            strMem(1) = "CRC ECC"
        ElseIf ( objItem.MemoryErrorCorrection = 6 ) Then
            strMem(1) = "Multi-bit ECC"
        ElseIf ( objItem.MemoryErrorCorrection = 5 ) Then
            strMem(1) = "Single-bit ECC"
        ElseIf ( objItem.MemoryErrorCorrection = 4 ) Then
            strMem(1) = "Parity"
        ElseIf ( objItem.MemoryErrorCorrection = 3 ) Then
            strMem(1) = "Non-ECC"
        Else
            strMem(1) = "Non-ECC (unknown)"
        End If
        nMemorySlots = objItem.MemoryDevices
Next

ReDim strMemModules(nMemorySlots-1)
for ndx = 0 to nMemorySlots
    strMemModules(ndx) = 0
Next

Set colItems = objWMIService.ExecQuery("Select * from Win32_PhysicalMemory")
For Each objItem in colItems
    nTotalBytes = nTotalBytes + objItem.Capacity
    strMemModules(nMemModules) = ( objItem.Capacity  / 1024 / 1024 ) & "M"
    nMemModules = nMemModules + 1
    'Wscript.Echo ( objItem.Capacity  / 1024 / 1024 ) & "M"
Next
strMem(2) = Join(strMemModules,"/")

strMem(0) = FormatNumber(( nTotalBytes  / 1024 / 1024 ),0,TristateFalse,TristateFalse,TristateFalse) & "M"

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Disk and RAID status [disk_size/...:Raid]
Dim strDisk()
Dim nDisks
Dim strRaid()
Dim strDiskInfo(1)
nDisks = 0
strRaid = ""
Set colItems = objWMIService.ExecQuery("Select * from Win32_DiskDrive")
For Each objItem in colItems
	nDisks = nDisks + 1
	ReDim Preserve strDisk(nDisks-1)
	ReDim Preserve strRaid(nDisks-1)
	strDisk(nDisks-1) = FormatNumber((objItem.Size / 1024 / 1024 /1024) ,0,TristateFalse,TristateFalse,TristateFalse) & " G"
	'if ( InStr(Lcase(objItem.Model), "raid" ) > 0 ) Then
		strRaid(nDisks-1) = Trim(objItem.Model) & ""
	'Else
		strDisk(nDisks-1) = strDisk(nDisks-1)
	'	strRaid(nDisks-1) = "No Raid"
	'End If
Next
' strDisk(nDisks) = strRaid
strDiskInfo(0) = Join(strDisk," / ")
strDiskInfo(1) = Join(strRaid," / ")

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim strOSInfo
Set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
For Each objItem in colItems
	strOSInfo = objItem.Caption
Next

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
if ( strSep = ":" ) Then
	strMessage = "[" & Join(strModel, strSep) & "][" & Join(strCPU,strSep) & "][" & Join(strMem,strSep) & "][" & Join(strDiskInfo,strSep) & "][" & strOSInfo & "]"
Else
	strMessage = Join(strModel, strSep) & strSep & Join(strCPU,strSep) & strSep & Join(strMem,strSep) & strSep & Join(strDiskInfo,strSep) & strSep & strOSInfo
	If ( strSep = strCSV ) Then
		strMessage = """" & strMessage & """"
	End If
End If


Wscript.Echo strMessage
WScript.Quit(0)

</script>
</job>
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Naigos core 3 + nrdp

Post by dwhitfield »

@ericssonvietnam, could you update your NRDP from https://github.com/NagiosEnterprises/nrdp ?

The problem with fixing a VBS script that works with an old version is that when you eventually upgrade, it may break that VBS script.

Also, is there any particular reason you are using Nagios Core 3.5 rather than 4.2.0 (https://www.nagios.org/downloads/core-stay-informed/)? I'm guessing it is because of https://dl.fedoraproject.org/pub/epel/6 ... x86_64.rpm, but if you could clarify, that would help us determine if you should also upgrade
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Naigos core 3 + nrdp

Post by dwhitfield »

Also, can you add wsf = cscript //nologo //T:10 $CHECK_COMMAND$ to your NRDS config?
Locked