iMC compliance checks and jython scripts (171 Views)
Reply
Occasional Visitor
FranckG
Posts: 3
Registered: ‎01-29-2013
Message 1 of 6 (171 Views)

iMC compliance checks and jython scripts

Hi,

is there any documentation about writing advanced compliance checks with custom jython scripts ?

 

The default policies already use jython scripts to make some specific check, like Vlan Tag.py or BPDU Filter.py.

I would like to write a custom script to check vlan configuration consistency on a given set of device interfaces.

 

Thanks.

Please use plain text.
Honored Contributor
Peter_Debruyne
Posts: 313
Registered: ‎03-21-2011
Message 2 of 6 (149 Views)

Re: iMC compliance checks and jython scripts

Hi,

 

I cannot help with a sample script, I can just refer you to this video for a basic compliance example:

http://www.youtube.com/watch?v=LdqPLa0dgHU

 

I would also recommend to post the request on http://www.netopscommunity.net/ , a dedicated IMC forum, where some guys have already developed custom scripts for backup/restore of Fortinet devices for instance,

 

Best regards,Peter

 

Please use plain text.
Honored Contributor
LindsayHill
Posts: 676
Registered: ‎11-16-2011
Message 3 of 6 (142 Views)

Re: iMC compliance checks and jython scripts

I thought I did have some examples somewhere, but I've been digging around, and can't find any specifics. Might have been something I saw last year at HP Discover. Quite agree that we need some good examples and API documentation here.

 

I tried reading some of the .py scripts, but they didn't help much!

CCIE 36708 | @northlandboy | lkhill.com
Please use plain text.
Occasional Visitor
FranckG
Posts: 3
Registered: ‎01-29-2013
Message 4 of 6 (139 Views)

Re: iMC compliance checks and jython scripts

Hi Peter,

thanks for the info.

I will look at both.

 

 

Best regards,

Franck

 

Please use plain text.
Occasional Visitor
FranckG
Posts: 3
Registered: ‎01-29-2013
Message 5 of 6 (136 Views)

Re: iMC compliance checks and jython scripts

[ Edited ]

 

Northlanboy,

 

As the choice to use a jython script is given when creating a rule, yes it should be documented.

 

I've also look at the given scripts before posting here. Some are "understandable", like those who just check the value of an SNMP oid (like TC notification count), however nothing to really write an "advanced" check.

 

Another way I'm investigating at the moment is using the eAPI to reach my initial goal. There is at least a documentation for it. However I really want to use the compliance center and not an external custom application/script to make the job.

 

Btw, thanks for your reply.

 

Best regards,

Franck

Please use plain text.
Honored Contributor
LindsayHill
Posts: 676
Registered: ‎11-16-2011
Message 6 of 6 (130 Views)

Re: iMC compliance checks and jython scripts

The eAPI is pretty cool, and sometimes it's the right answer, but I understand why you'd want to do it "inside" IMC itself.

 

Do let us know how you get on - if you do manage to work out how to do it, there's plenty of others would like to know!

CCIE 36708 | @northlandboy | lkhill.com
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation