09-09-2022 06:48 AM - edited 09-09-2022 06:49 AM
I have a problem with kicker invocation, ncs cant find the action, It says that doesn't exist. Even if I change the action-name with another I have the same problem. If I call the action directly from the cli I have no problem, all my actions works well, but the kicker cant find them for some reason
<INFO> 9-Sep-2022::13:16:28.317 37693c46734f ncs[1]: ncs progress usid=1835 tid=59488 datastore=running context=cli check data kickers
<ERR> 9-Sep-2022::13:16:28.318 37693c46734f ncs[1]: ncs Action, addmdu, does not exist
kickers data-kicker mdurequest
monitor /services/pon/actions/mdu-request
kick-node mgmt-ip-address
action-name addmdu
!
augment "/ncs:services/pon:pon/pon:actions" {
list mdu-request {
key "olt rack shelf slot port onuid";
uses input-onu;
leaf mgmt-ip-address {
mandatory true;
type inet:ip-address;
}
tailf:action addmdu {
tailf:actionpoint addmdu;
input {
uses kicker:action-input-params;
}
output {
leaf message {
type string;
}
}
}
}
}
actionpoints:
id=addmdu daemonId=1271 daemonName=ncs-dp-18324-pon-actions:config-mdu callbacks=action,init
admin@ncs(config)# services pon actions mdu-request CEYD-01Z 1 1 3 1 70 mgmt-ip-address 192.168.7.3
admin@ncs(config-mdu-request-CEYD-01Z/1/1/3/1/70)# commit | debug kicker 2022-09-09T13:46:20.064 kicker: mdurequest at /ncs:services/pon:pon/pon:actions/config-mdu:mdu-request[config-mdu:olt='CEYD-01Z'][config-mdu:rack='1'][config-mdu:shelf='1'][config-mdu:slot='3'][config-mdu:port='1'][config-mdu:onuid='70'] changed; invoking addmdu
Commit complete.
Solved! Go to Solution.
09-10-2022 01:24 AM
Hi
The action does not exist as you are invoking it from wrong location.
If you want it triggered for any change under mdu-request you could try something like this:
kickers data-kicker mdurequest
monitor /services/pon/actions/mdu-request
kick-node .
action-name addmdu
!
Or if you want it triggered only when mgmt-ip-address is change you could try something like this:
kickers data-kicker mdurequest
monitor /services/pon/actions/mdu-request/mgmt-ip-address
kick-node ../
action-name addmdu
!
br.
Kristoffer Larsen
09-09-2022 10:34 AM
It looks like the action is not registered with the Python/Java process. In Python code for the action you should have this:
class ActionClass(Action):
@Action.action
def cb_action(self, uinfo, name, kp, _input, output, trans):
self.log.debug(f"Entered cb_action {name}")
class Main(ncs.application.Application):
def setup(self
# The application class sets up logging for us. It is accessible
# through 'self.log' and is a ncs.log.Log instance.
self.log.info('Main RUNNING')
# When using actions, this is how we register them:
#
self.register_action('addmdu', ActionClass)
When you reload the package you should see in the log for your package that your action is registered.
<INFO> 08-Sep-2022::17:18:06.188 <name-of-the-package> ComponentThread:addmdu: - Main RUNNING
Yan
09-10-2022 01:24 AM
Hi
The action does not exist as you are invoking it from wrong location.
If you want it triggered for any change under mdu-request you could try something like this:
kickers data-kicker mdurequest
monitor /services/pon/actions/mdu-request
kick-node .
action-name addmdu
!
Or if you want it triggered only when mgmt-ip-address is change you could try something like this:
kickers data-kicker mdurequest
monitor /services/pon/actions/mdu-request/mgmt-ip-address
kick-node ../
action-name addmdu
!
br.
Kristoffer Larsen
09-19-2022 06:02 AM
That works, thank you!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide