The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.3.15 (Linux)
File Line Function
/showthread.php 895 errorHandler->error

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Module stays in "Not Initialized"
Hi! I wrote a new module yesterday that detects, if a Windows NIC works in 1 GBit or in 100 MBit mode. It's status is NORMAL, if it is in 1 GBit mode, CRITICAL otherwise. The data is transmitted from the agent to the server -- I get a "data graph" which contains the right values. But the modules is shown as "Not Initialized" and does not show up. All my other modules work fine.

configuration in pandora_agent.conf :
module_plugin cscript.exe //B "c:\Program Files\pandora_agent\util\nic.vbs"

<description><![CDATA[NIC Connect Speed of Realtek PCIe GBE Family Controller]]></description>

' Agent Plugin to get network adapter info
' Execute as module_plugin cscript //B nic.vbs

Option Explicit

Dim strComputer, objWMIService, colItems, objItem, Speed, Name, Status

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_NetworkAdapter WHERE NetEnabled='True' AND NOT Name LIKE '%VMware%' ")

on error resume next

For Each objItem in colItems

Speed=objItem.Speed / 1000000


if Speed=1000 then
elseif Speed=100 then
end if

WScript.StdOut.WriteLine "<module>"
WScript.StdOut.WriteLine " <name><![CDATA[NIC_Speed]]></name>"
WScript.StdOut.WriteLine " <type><![CDATA[generic_data]]></type>"
WScript.StdOut.WriteLine " <description><![CDATA[NIC Connect Speed of " & Name & "]]></description>"
WScript.StdOut.WriteLine " <unit><![CDATA[MBit/s]]></unit>"
WScript.StdOut.WriteLine " <module_group><![CDATA[Networking]]></module_group>"
WScript.StdOut.WriteLine " <data><![CDATA[" & Speed & "]]></data>"
WScript.StdOut.WriteLine " <status><![CDATA[" & Status & "]]></status>"
WScript.StdOut.WriteLine "</module>"


WScript.Quit 0
Messages In This Thread
Module stays in "Not Initialized" - by annomatik - 01-26-2020, 04:57 PM

Users browsing this thread: 1 Guest(s)

(c) 2006-2018 Artica Soluciones Tecnológicas. Contents of this wiki are under Create Common Attribution v3 licence. | |

Theme © MyBB Themes