Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Module stays in "Not Initialized"
#1
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"

output:
<module>
<name><![CDATA[NIC_Speed]]></name>
<type><![CDATA[generic_data]]></type>
<description><![CDATA[NIC Connect Speed of Realtek PCIe GBE Family Controller]]></description>
<unit><![CDATA[MBit/s]]></unit>
<module_group><![CDATA[Networking]]></module_group>
<data><![CDATA[1000]]></data>
<status><![CDATA[NORMAL]]></status>
</module>

nic.vbs:
' 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
Name=objItem.Name

Status="UNKNOWN"

if Speed=1000 then
Status="NORMAL"
elseif Speed=100 then
Status="CRITICAL"
else
Status="UNKNOWN"
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>"

Next

WScript.Quit 0
 Reply
#2
Hello, Annomatik,

What version of PandoraFMS are you using? At the beginning of the month there was a change in the Perl operation that caused that none of the new modules would work correctly. Here is a post from our blog that will explain everything better.

https://pandorafms.com/blog/2020-perl/

We recommend you to update the PandoraFMS server with the sourceforge packages.

Greetings
Diego
 Reply
#3
Oh. I haven't updated Pandora FMS in a longer while since it just worked :-)

My console shows Pandora FMS 7.0NG.730, Build PC181217, MR23, so I guess I haven't updated in longer than a year which makes sense. What's the best / quickest version to update everything to the current version?

I'm on Raspbian Stretch / Raspberry Pi 3B+.
 Reply
#4
Hello Annomatik,

Pandora FMS is based on 3 components that should be updated, if possible regularly. These components are: The web console, the database and the server. To update each one of them follow the documentation that I put in the link.

https://pandorafms.com/docs/index.php?ti...xo_Upgrade

Both the console and the database can be updated through the online update manager, which you will find in the console itself at the bottom of the menu. But the server must be done "by hand". In any case following the documentation you should not have problems.

Greetings
Diego
 Reply
#5
Hi! It worked -- thanks! But apparently, the community version only supports manual console / db update. I have updated the console with "./pandora_console_upgrade -p /var/www/html/pandora_console" and updated the db with the info from here https://pandorafms.org/forum/archive/ind...11725.html.

Thank you!
 Reply


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. | pandorafms.com | pandorafms.org

Theme © MyBB Themes