ConfD User Community

Notifications on CLI Terminal


#1

Hi, I am trying to implement Notifications in Confd.

Our requirement is that when a alarm or event is triggered from application, we must be able to display it in the open CLI terminal.

We need to implement them using JAVA API’s.

I tried to enable Notification from Confd.conf and tried using the below example sample. I don’t get any error any where but there is no messages printed on the CLI terminal.

Socket ctrlSocket = new Socket(“10.200.202.222”, 4565);
Dp dp = new Dp(“hosts_daemon”, ctrlSocket);
DpNotifStream stream = dp.createNotifStream(“NETCONF”);
mynotif myn = new mynotif();
ConfXMLParam[] vals =
new ConfXMLParam[]{
new ConfXMLParamStart(myn.hash(), mynotif.myn_my_notif),
new ConfXMLParamValue(myn.hash(), mynotif.myn_arg1,
new ConfBuf(“Hello”)),
new ConfXMLParamStop(myn.hash(), mynotif.myn_my_notif)
};
stream.send(ConfDatetime.getConfDatetime(), vals);

Can you help me how to display a notification/alarms/events on the fly on the CLI terminal from backend application.


#2

The API you are using is for sending notifications to e.g. NETCONF cliens. You may want to look at methods Maapi.userMessage, Maapi.sysMessage, Maapi.prioMessage - some of those might do what you need.


#3

Thanks, Maapi.pioMessage is exactly what i was searching for.