I'm currently working on Configuration Change Templates for standard configurations on Cisco ASA's and though how great it would be to check the assigned poller (name, id, IP) of an node and use that to generate configuration. To make the template easier to run (i.e. don't have to check which poller a node has been assigned too).
However reading the NCM Admin guide I can't see anything that lists the poller, anyone got any more experience?
The code I'm using is the following (@LoggingInterface and @LoggingTarget are passed in as a script params):
string @LogServer if ( @LoggingTarget == 'Poller1 Internal') { @LogServer= '172.16.X.Y' } if ( @LoggingTarget == 'Poller1 External' ){ @LogServer='1.2.3.4' } foreach ( @interfaceItem in @LoggingInterface ) { CLI { logging host @interfaceItem.InterfaceName @LogServer } }
And I would like the following instead:
string @LogServer if ( @NCM.Nodes.EngineID == '1') { if ( @LoggingTarget == 'External') { @LogServer='1.2.3.4' } else { @LogServer= '172.16.X.Y' } } foreach ( @interfaceItem in @LoggingInterface ) { CLI { logging host @interfaceItem.InterfaceName @LogServer } }
This would allow the @LogServer variable to be generated and not set at script run time and thus allow the template to run against multiple systems on different pollers. It would be even better if it gave me the IP address of the poller.