2 Oct 2003 05:51
RE: Antwort: [opennms-discuss] Adding Categories/Views question [Viruschecked]
Hammond, Justin <Justin.Hammond <at> getronics.com>
2003-10-02 03:51:26 GMT
2003-10-02 03:51:26 GMT
> -----Original Message-----
> From: Sven-Oliver.Kraft <at> Sparkassen-Informatik.de
> [mailto:Sven-Oliver.Kraft <at> Sparkassen-Informatik.de]
> Sent: Wednesday, October 01, 2003 8:08 PM
> To: tedkaz <at> optonline.net; General OpenNMS Discussion
> Subject: Antwort: [opennms-discuss] Adding Categories/Views
> question [Viruschecked]
>
> Just a question for Tarus and other developers:
> Would OpenNNMS understand something like this: ipaddr IPLIKE
> file:/include-ip.file ????
> This could be a very nice feature, because for polling and/or
> snmp-collection I use some files, where my nodes are
> categorized. When I build categories it would be the easiest
> way to only use these files in the rule!
>
We use another feature here called customcategories.
You create a table in the database with the following fields:
CREATE TABLE "customcat" (
"ipaddr" character varying(16) NOT NULL,
"custcategory" character varying(16),
Constraint "pk_ipaddr" Primary Key ("ipaddr")
);
And then in your database-schema.xml add the following entry:
<table name="customCat">
<join column="ipAddr" table="ipInterface" table-column="ipAddr"/>
<column name="ipAddr" visable="false"/>
<column name="custCategory"/>
</table>
in categories.xml we create a new category:
<category>
<label><![CDATA[MyNewCat]]></label>
<comment>This category reflects Service Availability for
MyNewCat.</comment>
<normal>99</normal>
<warning>97</warning>
<rule><![CDATA[custCategory == 'MyNewCat']]></rule>
</category>
The <rule> statement is basically a SQL like syntax, where it grabs all
the ipAddr entries out of the customcat table that match MyNewCat.
Finally, in viewdisplay.xml we add a new category:
<category><![CDATA[MyNewCat]]></category>
And all that is left to do is populate the customcat table with enties.
a restart, and its done.
Of course, you could probably do it to any other table you want, say the
assets table for example. I played around for a while, and had it doing
selects on the SNMP location information for each device as well.
Hope that helps.
_______________________________________________
discuss mailing list (discuss <at> opennms.org)
To subscribe, unsubscribe, or change your list options, go to:
http://lists.opennms.org/mailman/listinfo/discuss
RSS Feed