VMware Cloud Community
Dieter_C
Contributor
Contributor

Fortimail Plugin

I wrote a plugin for a fortimail device but I get the following error:

This resource is turned off or has not been configured properly.
The problem is: Invalid configuration: Error contacting resource: Unable to connect to SNMP Agent (snmp:null null,null)
Please turn on the server, or fix its Configuration Properties.

There is network connectivity, and I can do an snmpwalk to the server.

What is going wrong here? Do I need to include snmp settings (snmpIp, snmpCommunity) in my plugin or use the shared configuration properties?
How can I test it from the command line with the correct snmpIp?

Regards, Dieter


<plugin>
<platform name="Fortimail">

<config include="snmp"/>

<plugin type="measurement"
class="org.hyperic.hq.product.SNMPMeasurementPlugin"/>

<property name="template" value="${snmp.template}:${alias}"/>

<metric name="Availability"
template="${snmp.template},Avail=true:sysUpTime"
indicator="true"/>

<metric name="Uptime"
alias="sysUpTime"
category="UTILIZATION"
units="jiffys"
defaultOn="true"
collectionType="static"/>

<metric name="CPU Utilization"
alias="fmlSysCpuUsage.0"
category="UTILIZATION"
units="percent"
defaultOn="true"
collectionType="static"/>

<metric name="Deferred Mail Queue"
alias="fmlMailOptionsDeferQueue.0"
category="UTILIZATION"
units="percent"
defaultOn="true"
collectionType="static"/>

<metric name="Log Disk Usage"
alias="fmlSysLogDiskUsage.0"
category="UTILIZATION"
units="percent"
defaultOn="true"
collectionType="static"/>

<metric name="Mail Disk Usage"
alias="fmlSysMailDiskUsage.0"
category="UTILIZATION"
units="percent"
defaultOn="true"
collectionType="static"/>

<metric name="Memory Usage"
alias="fmlSysMemUsage.0"
category="UTILIZATION"
units="percent"
defaultOn="true"
collectionType="static"/>
</platform>
</plugin>
Reply
0 Kudos
13 Replies
excowboy
Virtuoso
Virtuoso

Hi,

you can test it from the commandline and you have to include the snmp settings for your environment.

You should run that command locally or from a box where you can do an snmpwalk successfully

java -jar ./bundles/agent-4.5.1/pdk/lib/hq-product.jar -Dplugins.include=fortimail -m metric -a -Dlog=debug -Dplatform.ip=<IPADDRESS> -Dplatform.name=<FQDN> -Dplatform.fqdn=<FQDN> -DsnmpIp=<IPADDRESS> -DsnmpVersion=v2c -DsnmpCommunity=<COMMUNITY>
Please let me know how you get on.

Cheers,
Mirko
Dieter_C
Contributor
Contributor

Instead of hq-product.jar in used hq-pdk-4.5.1.2.jar
The output seems ok (see file output1.txt)
Reply
0 Kudos
excowboy
Virtuoso
Virtuoso

Hi Dieter,

sorry my bad. hq-product.jar is deprecated. Have your questions been answered ?
The output looks good indeed.

Cheers,
Mirko
Reply
0 Kudos
Dieter_C
Contributor
Contributor

Hi Mirko

Now I know how I can test the plugin, and the test looks good. But wen I try to use it in Hyperic I still get the error: Invalid configuration: Error contacting resource: Unable to connect to SNMP Agent (snmp:null null,null)
For screenshots see hyperic suppport (SUPPORT-10758)https://jira.hyperic.com/browse/SUPPORT-10758

Regards, Dieter
Reply
0 Kudos
Dieter_C
Contributor
Contributor

This is what I find in the agent.log at the time I configure the plugin. (see file : fortimail.agent.log)
Reply
0 Kudos
excowboy
Virtuoso
Virtuoso

Just to doublecheck, you have set up the Configurations Properties (SNMP version, etc ) of your plugin in the GUI ?

Mirko
Reply
0 Kudos
Dieter_C
Contributor
Contributor

yes I did, see https://jira.hyperic.com/secure/attachment/34975/screenshot-2.jpg
Is there something wrong with te settings?
Reply
0 Kudos
excowboy
Virtuoso
Virtuoso

Sorry, I can not access your screenshot. As I understand you have already logged a ticket with the support team. I am sure they will resolve your issue.

Cheers,
Mirko
Reply
0 Kudos
Dieter_C
Contributor
Contributor

I logged a ticket with support but this was the answer:

Thank you for contacting Hyperic Technical Support. I do understand your interest in this custom plugin, however, this is not something that is within the scope of support. That being said, I'd like to direct you to the forums where there are users that might be able to direct you.

The issue is now closed.
I understand that they aren't going to help me writing my plugin. But now my plugin works from the command line, but not in the GUI. Is it better to reopen this issue with support?

Regards Dieter
Reply
0 Kudos
excowboy
Virtuoso
Virtuoso

OK I see , you might want to attach the screenshot(s) to this thread.

Cheers,
Mirko
Reply
0 Kudos
Dieter_C
Contributor
Contributor

Here is the screenshot.
Reply
0 Kudos
excowboy
Virtuoso
Virtuoso

Thanks.

Have you deployed the same version of your plugin on your Agent and on the server ?
Have you made any modifications to the plugin, after you have created a resource based on it ?
Could you delete the resource from the inventory and create it again ?

If the steps above do not work, try the following. I would actually rather do it on a test system
Delete the plugin on filelevel on Agent and Server or/and rename the plugin filename and change the <platform name="Fortimail"> and deploy it on Agent and Server
Unfortunately you cannot delete plugins from the inventory list, so you have to rename it.
Try to create a resource based on the new plugin.

Cheers,
Mirko
Reply
0 Kudos
Dieter_C
Contributor
Contributor

The plugin works when I change the filename and the platform name.
Reply
0 Kudos