Pandora FMS community forums
Problem adding new module in Windows agent - Printable Version

+- Pandora FMS community forums (https://pandorafms.org/forum)
+-- Forum: Pandora FMS (https://pandorafms.org/forum/forum-3.html)
+--- Forum: Advanced troubleshooting and problems (https://pandorafms.org/forum/forum-11.html)
+--- Thread: Problem adding new module in Windows agent (/thread-881.html)



Problem adding new module in Windows agent - walterft - 07-12-2009

Hi,

I'm new in Pandora and I'm reading the available documentation about this application. However, I have a problem when I want to add a module to check something with a agent in a Windows environment.

I added in the module section of file pandora_agent.conf this new module definition:

Code:
module_begin
module_name TEST
module_type generic_data
module_exec c:\test.bat
module_description Listening test
module_end

Test.bat is a dummy file (only to test). When execute this file prints:
Code:
C:\>test.bat
<module>
<name>TEST1</name>
<data>10</data>
<type>generic_data</type>
</module>
C:\>

The pandora_debug.log has:
Code:
2009-07-13 02:25:51 Run begin
2009-07-13 02:25:51 Pandora_Windows_Service::checkConfig: Remote configuration disabled
2009-07-13 02:25:51 Run ServicioReg
2009-07-13 02:25:51 Run MSN_Messenger
2009-07-13 02:25:51 Run ReceivedPackets
2009-07-13 02:25:51 Executing: cmd.exe /c "netstat -s | grep "Packets Received" | tr -d " " | cut -f 2 -d "=" | tr -d "\n""
2009-07-13 02:25:52 Run TEST
2009-07-13 02:25:52 Executing: cmd.exe /c "c:\test.bat"
2009-07-13 02:25:52 Run Listen_Conn
2009-07-13 02:25:52 Executing: cmd.exe /c "netstat -an | grep LISTEN | wc -l | tr -d " ""
2009-07-13 02:25:52 Run FreeDiskC
2009-07-13 02:25:52 Run CPUUse0
2009-07-13 02:25:53 Run FreeMemory
2009-07-13 02:25:53 Run Logevents
2009-07-13 02:25:53 ServicioReg getXML begin
2009-07-13 02:25:53 ServicioReg getXML end
2009-07-13 02:25:53 MSN_Messenger getXML begin
2009-07-13 02:25:53 MSN_Messenger getXML end
2009-07-13 02:25:53 ReceivedPackets getXML begin
2009-07-13 02:25:53 ReceivedPackets getXML end
2009-07-13 02:25:53 TEST getXML begin
2009-07-13 02:25:53 TEST getXML end
2009-07-13 02:25:53 Listen_Conn getXML begin
2009-07-13 02:25:53 Listen_Conn getXML end
2009-07-13 02:25:53 FreeDiskC getXML begin
2009-07-13 02:25:53 FreeDiskC getXML end
2009-07-13 02:25:53 CPUUse0 getXML begin
2009-07-13 02:25:53 CPUUse0 getXML end
2009-07-13 02:25:53 FreeMemory getXML begin
2009-07-13 02:25:53 FreeMemory getXML end
2009-07-13 02:25:53 Logevents getXML begin
2009-07-13 02:25:53 Logevents getXML end
2009-07-13 02:25:53 Copying XML on C:\Windows\Temp\AGENT1.5145.data
2009-07-13 02:25:53 Next execution on 30 seconds

And the file AGENT1.5145.data:
Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<agent_data agent_name="AGENT1" version="2.1(Build 090224)" timestamp="2009-07-12 23:25:53" interval="30" os="Microsoft Windows XP Professional" os_version="Service Pack 3">
    <module>
        <name>ServicioReg</name>
        <type>generic_proc</type>
        <data>1</data>
        <description>Eventlog Service</description>
    </module>
    <module>
        <name>MSN_Messenger</name>
        <type>generic_proc</type>
        <data>1</data>
        <description>Microsoft Messenger (MSN)</description>
    </module>
    <module>
        <name>ReceivedPackets</name>
        <type>generic_data</type>
        <data></data>
        <description>Received packets</description>
    </module>
    <module>
        <name>TEST</name>
        <type>generic_data</type>
        <description>Listening test</description>
    </module>
    <module>
        <name>Listen_Conn</name>
        <type>generic_data</type>
        <data>27</data>
        <description>Listening connections</description>
    </module>
    <module>
        <name>FreeDiskC</name>
        <type>generic_data</type>
        <data>5058</data>
        <description>Free space on drive C:</description>
    </module>
    <module>
        <name>CPUUse0</name>
        <type>generic_data</type>
        <data>7</data>
        <description>CPU#0 usage</description>
    </module>
    <module>
        <name>FreeMemory</name>
        <type>generic_data</type>
        <data>1608</data>
        <description>Amount of free memory.</description>
    </module>
    <module>
        <name>Logevents</name>
        <type>generic_data_string</type>
        <data></data>
        <description>Log Events</description>
    </module>
</agent_data>

The problem is the <data> section in the module TEST is not present in the xml generated and the module doesn't show in the server.

This threads are related: Dudas pandora inicio and Ejecutando vbs en el agente de Windows

Regards,


Problem adding new module in Windows agent - suzdal - 07-14-2009

see this documment

http://openideas.info/wiki/index.php?title=Pandora:Windows_Agent


Problem adding new module in Windows agent - manu - 07-17-2009

Open your CMD and execute this:

cmd.exe /c "c:\test.bat"

Do you get the data field there?