Start a Conversation

Unsolved

This post is more than 5 years old

D

4553

January 29th, 2008 05:00

escalation policy

Has anyone has done this
I want to include in our escalation policies a notification that lets me know when an alarm becomes cleared by email or SMS.

89 Posts

January 31st, 2008 07:00

you have to enter it in one go, so one single line
no carriage returns

if you are using UNIX just write and sh script and put the whole command if you are using windows do the same with a .bat or .cmd ...

just remember one single line ... the sm_service is just a command and the rest are parameters ...

can not attach a file otherwise i would do it

cheers

F.

79 Posts

January 31st, 2008 07:00

ada,

I have created a notification list using global admin manager and modified the mail-notify.conf file adding the notification list .my problem is the sm_service command you gave me is so long it cannot contain a single line when it gets somewhere it hangs .i wonder if i should emerge this in a shell script but this uses asl script which i am not familar with.
PLEASE HELP

54 Posts

January 31st, 2008 08:00

If you run it on unix, you can copy and past the following command:

sm_service install --force --unmanaged --startmode=manual \
'--name=MAIL-SERVICE' \
'--description=Mail adapter for device up_down Notifications' \
'/opt/nme/incharge7/SAM/smarts/bin/sm_notify' \
'--name=MAIL-SERVICE' \
'--output=MAIL-SERVICE' \
'--conf=/opt/nme/incharge7/SAM/smarts/local/conf/notifier/MAIL-SERVICE.conf' \
'mail'

This should work. Otherwise let me know. For windows, I can't help :-(

79 Posts

February 1st, 2008 01:00

ada,nando,

Thanks
I did this and did not get any error message

lrwxrwxrwx 1 root other 6 Aug 7 2006 sm_xcmd -> runcmd
lrwxrwxrwx 1 root other 6 Aug 7 2006 sm_xml -> runcmd
lrwxrwxrwx 1 root other 6 Aug 7 2006 smartsd -> runcmd
drwxr-xr-x 2 root other 1536 Mar 19 2007 system
root@ojt-smarts-pri # ./sm_service install --force --unmanaged --startmode=manual \
root@ojt-smarts-pri > '--name=mail-service.conf' \
root@ojt-smarts-pri > '--description=Mail adapter for device up_down Notifications' \
root@ojt-smarts-pri > '/opt/InCharge6/SAM/smarts/bin/sm_notify' \
root@ojt-smarts-pri > '--name=mail-service.conf' \
root@ojt-smarts-pri > '--output=mail-service.conf' \
root@ojt-smarts-pri > '--conf=/opt/incharge6/SAM/smarts/local/conf/notifier/mail-service.conf' \
root@ojt-smarts-pri > 'mail'

i hope we get a mail when a router that has gone down is cleared

89 Posts

February 1st, 2008 01:00

well, cross fingers!!!

you can also check if the adapter started properly or there are any erros
there should be a log file in your logs file directory!

and if you use the notification list and in order to test you can make the list less restrictive and send all the events

cheers

54 Posts

February 1st, 2008 02:00

No, you don't need to rename the file. You did the right thing. But the --conf option in the sm_service must point to the mail-service.conf file.
'--conf=/opt/incharge6/SAM/smarts/local/conf/notifier/mail-service.conf' \

--name is the name of the service and in the example mail-service is ok.

The name you specify will be shown if you run "sm_service show"
or to start/stop the adatper "sm_service start mail-service"
or "sm_service stop mail-service"

79 Posts

February 1st, 2008 02:00

thanks

i have a look at the sm_serviced.log
and this is the tail end of the file

[01-Feb-2008 10:25:41+117ms WAT] t@1
SMS-N-LOG_REMOVE-REMOVING service mail-service.conf

[01-Feb-2008 10:25:41+117ms WAT] t@1
SMS-N-LOG_ADD-ADDING service mail-service.conf

79 Posts

February 1st, 2008 02:00

Thanks
I would try this but i did use the mail-service.conf because i did copy the mail-notify.conf to mail-service.conf and then modified the file. DO you maen i should rename the file in that directory to mail-service
sm_service install --force --unmanaged --startmode=manual \
'--name=mail-service' \
'--description=Mail adapter for device up_down Notifications' \
'/opt/InCharge6/SAM/smarts/bin/sm_notify' \
'--name=mail-service' \
'--output=mail-service' \
'--conf=/opt/incharge6/SAM/smarts/local/conf/notifier/mail-service' \
'mail'

79 Posts

February 1st, 2008 02:00

this is the output

root@ojt-smarts-pri # ./sm_service install --force --unmanaged --startmode=manual \
root@ojt-smarts-pri > '--name=mail-service' \
root@ojt-smarts-pri > '--description=Mail adapter for device up_down Notifications' \
root@ojt-smarts-pri > '/opt/InCharge6/SAM/smarts/bin/sm_notify' \
root@ojt-smarts-pri > '--name=mail-service' \
root@ojt-smarts-pri > '--output=mail-service' \
root@ojt-smarts-pri > '--conf=/opt/incharge6/SAM/smarts/local/conf/notifier/mail-service' \
root@ojt-smarts-pri > 'mail'
root@ojt-smarts-pri # sm_service show
sm_service: not found
root@ojt-smarts-pri # ./sm_service show
RUNNING ic-sam-server
RUNNING ic-am-pm-server
RUNNING ic-business-dashboard
RUNNING ic-npm-bgp-server
RUNNING ic-mpls-server
RUNNING ic-icoi-server
RUNNING ic-trapd-receiver
RUNNING ic-trap-exploder
RUNNING ic-syslog-adapter
RUNNING ic-ehealth-adapter
RUNNING ic-isc-adapter
RUNNING ic-npm-ospf-server
NOT RUNNING mail-service.conf
NOT RUNNING mail-service

root@ojt-smarts-pri # ./sm_service start mail-service
root@ojt-smarts-pri # ./sm_service show
RUNNING ic-sam-server
RUNNING ic-am-pm-server
RUNNING ic-business-dashboard
RUNNING ic-npm-bgp-server
RUNNING ic-mpls-server
RUNNING ic-icoi-server
RUNNING ic-trapd-receiver
RUNNING ic-trap-exploder
RUNNING ic-syslog-adapter
RUNNING ic-ehealth-adapter
RUNNING ic-isc-adapter
RUNNING ic-npm-ospf-server
NOT RUNNING mail-service.conf
RUNNING mail-service

54 Posts

February 1st, 2008 02:00

Hi dele,

Let's hope that it will work. You can test it as nando descibed (change the notification list filter).

One comment to your sm_service command:
./sm_service install --force --unmanaged --startmode=manual \
'--name=mail-service.conf' \
=> coment '--name=mail-service' \ remove the ".conf"
=> it's the name of the service and it has nothing to do with the conf file.
'--description=Mail adapter for device up_down Notifications' \
'/opt/InCharge6/SAM/smarts/bin/sm_notify' \
'--name=mail-service.conf' \
=> coment '--name=mail-service' \ remove the ".conf"
=> it's the name of the service and it has nothing to do with the conf file.
'--output=mail-service.conf' \
=> coment '--output=mail-service' \ remove the ".conf"
=> it's the name of the logfile and it has nothing to do with the conf file.
=> as nando said you will find the logfile in the logdirectory in the example the logfile would be called mail-service.log
'--conf=/opt/incharge6/SAM/smarts/local/conf/notifier/mail-service.conf' \
'mail'

if you start the service with "sm_service start mail-service"
You can check the logfile. You should get the following output:
InCharge Server has connected.

If you are interested to manage the mail-service by the system itself you can do that. That means if the mail-service dies you will get a notification on SAM. The notification would be
DisblayName: SAM->mail-service
EventName: Disconnected

Let me know if you need help.

54 Posts

February 1st, 2008 02:00

:-) looks good now. What is written in /local/logs/mail-service.log file?

To remove the service mail-service.conf you can run "./sm_service remove mail-service.conf".

79 Posts

February 1st, 2008 03:00

output of that command

root@ojt-smarts-pri # ./sm_service show --cmdline mail-service
sm_service install --force --unmanaged --startmode=manual \
'--name=mail-service' \
'--description=Mail adapter for device up_down Notifications' \
'/opt/InCharge6/SAM/smarts/bin/sm_notify' \
'--name=mail-service' \
'--output=mail-service' \
'--conf=/opt/incharge6/SAM/smarts/local/conf/notifier/mail-service' \
'mail'

79 Posts

February 1st, 2008 03:00

it is looking good

root@ojt-smarts-pri # more mail-service.log
InCharge Server INCHARGE-SA has connected.

after renaming mail-service.conf to mail-service and then starting sm_service command again and then sm_service start mail-service.
Let us keep our fingers cross so see if there is any mail about a device is cleared.

I might slightly play around with the notification lists that i created and inserted into the mail-service file

54 Posts

February 1st, 2008 03:00

conf=/opt/incharge6/SAM/smarts/local/conf/notifier/mail-service

Yes this line must be change to

conf=/opt/incharge6/SAM/smarts/local/conf/notifier/mail-service.conf

79 Posts

February 1st, 2008 03:00

it looks there is a problem as the mail-service.log file looks like this

root@ojt-smarts-pri # more mail-service.log
[01-Feb-2008 11:44:18+081ms WAT] t@1 sm_notify
GNA-W-EBADCONF-Invalid configuration directory or file specification
CI-ESPEC-While attempting to locate file with primary
"/opt/InCharge6/SAM/smarts/local/conf/notifier/:/opt/InCharge6/SAM/smarts/
conf/notifier/:/opt/dev/foo/foo/6.5/latest/smarts/local/conf/notifier/:/op
t/dev/foo/foo/6.5/latest/smarts/conf/notifier/", default "", and related
"/opt/incharge6/SAM/smarts/local/conf/notifier/mail-service"
-ENOENT-No such file or directory
No Events found!

Top