Community discussions

MikroTik App
 
andreako
just joined
Topic Author
Posts: 22
Joined: Tue Jul 20, 2010 7:19 pm

need help with ping and beep notification

Wed Sep 29, 2010 12:12 am

Hi everybody,

I need help to configure ping probe and beep notification.

I am monitoring some computers from one main pc (dude server) with ping probe and I want that if one pc goes down the server beeps until this pc is up.

I can configure it to beep but only for certain interval and then it stops even if the pc is still down.


Thanks in advance

Bye
 
andreako
just joined
Topic Author
Posts: 22
Joined: Tue Jul 20, 2010 7:19 pm

Re: need help with ping and beep notification

Wed Sep 29, 2010 5:44 pm

please help :( :( :(
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: need help with ping and beep notification

Wed Sep 29, 2010 7:45 pm

Use an external to run an application that plays a sound loop?
 
andreako
just joined
Topic Author
Posts: 22
Joined: Tue Jul 20, 2010 7:19 pm

Re: need help with ping and beep notification

Wed Sep 29, 2010 11:08 pm

First, thank you for the reply.

How can use an external to play a sound loop with Dude?

Do you mean an external software?


Can you give me some examples, please?

thanks
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: need help with ping and beep notification

Thu Sep 30, 2010 12:27 am

Solution 1 - not what your asked for...
Create 10 minute sound file that has a short beep every few seconds, add it to the dude, create a new notification of type sound, set the repeat interval to 10 minutes and repeat count to 100 times... It should beep for what about 16 hours?

Solution 2 - might not work...
This is totally off the cuff so you will need to find parts and develop the solution, this is just to get you moving. You can call an external program when a ping fails with a "notification" that will run another program "execute on server". The program that is ran as an external is an executable or a batch job (totally up to you and you will have to come up with which program/batch job your self).

If all the computers go down you will have x number of copies of your external sound loop. You will need a command line program that can play a sound and loop it.

As each computer comes back up you will want the 2nd notification to stop one of the copies of the sound loop. So you will need another program or batch job that stops one copy of the sound loop.

In the Dude, add a two new notifications:
Name: Dude Alarm
Type: execute on server
Command: soundloop.exe alarm.mp3

On the 'Advanced' Tab, check
up->down

The 2nd notification
Name: Dude stop Alarm
Type: execute on server
Command: batch file that stops soundloop.exe

On the 'Advanced' Tab, check
down->up
unstable->up

For each device double click on the ping service, on the Notifications tab, put a tick against Dude Alarm and Dude stop alarm.

I wonder what it would sound like if you have 100 copies of the sound loop playing :)
GL
Lebowski
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: need help with ping and beep notification

Thu Sep 30, 2010 12:27 am

Solution 1 - not what your asked for...
Create 10 minute sound file that has a short beep every few seconds, add it to the dude, create a new notification of type sound, set the repeat interval to 10 minutes and repeat count to 100 times... It should beep for what about 16 hours?

Solution 2 - might not work...
This is totally off the cuff so you will need to find parts and develop the solution, this is just to get you moving. You can call an external program when a ping fails with a "notification" that will run another program "execute on server". The program that is ran as an external is an executable or a batch job (totally up to you and you will have to come up with which program/batch job your self).

If all the computers go down you will have x number of copies of your external sound loop. You will need a command line program that can play a sound and loop it.

As each computer comes back up you will want the 2nd notification to stop one of the copies of the sound loop. So you will need another program or batch job that stops one copy of the sound loop.

In the Dude, add a two new notifications:
Name: Dude Alarm
Type: execute on server
Command: soundloop.exe alarm.mp3

On the 'Advanced' Tab, check
up->down
unstable->

The 2nd notification
Name: Dude stop Alarm
Type: execute on server
Command: batch file that stops soundloop.exe

On the 'Advanced' Tab, check
down->up
unstable->up

For each device double click on the ping service, on the Notifications tab, put a tick against Dude Alarm and Dude stop alarm.

I wonder what it would sound like if you have 100 copies of the sound loop playing :)
GL
Lebowski


EDIT added unstable->down Devices do not go from up to down, they go from unstable to down.
Last edited by lebowski on Thu Sep 30, 2010 4:50 pm, edited 1 time in total.
 
andreako
just joined
Topic Author
Posts: 22
Joined: Tue Jul 20, 2010 7:19 pm

Re: need help with ping and beep notification

Thu Sep 30, 2010 1:46 pm

I think that solution 1 is what I have tried.

So if one pc is down -> up the beep still runs until the count and the repeat times ends.

Maybe I will try the second solution.


Thanks
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: need help with ping and beep notification

Thu Sep 30, 2010 4:53 pm

For solution 1 the beep stops if the device comes back up.
For solution 2 you have to stop the beep programatically.
 
andreako
just joined
Topic Author
Posts: 22
Joined: Tue Jul 20, 2010 7:19 pm

Re: need help with ping and beep notification

Thu Sep 30, 2010 10:58 pm

I don't think so. It stops only when the repeat count reaches the selected value.

I thought that this could be done adjusting values inside the dude. I like this program and I don't want to use another soft to monitor my network

Thanks for your time lebowski

if you have another solution, please let me know.

Bye.
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: need help with ping and beep notification

Fri Oct 01, 2010 12:39 am

I just tried it but shouldn't the repeat count be reset to 0 if the device comes back up? I tested it and yep even after the device is up the Notification of the outage is repeated until it is done. That should not be too hard to fix but getting them to fix it...

Well solution 2 then... but modified to make it even better. By the way, how many computers are you tracking?

Mplayer is a windows program that will play sounds from the command line.
http://sourceforge.net/projects/mplayer ... 0MEncoder/
mplayer beep.wav -loop 0

Make different named copies of mplayer.exe, one for each computer you want to monitor.
You could also make a sound file for each computer, It could say computer x is down every 10 seconds.
cpu1snd.exe beep1.wav -loop 0
cpu2snd.exe beep2.wav -loop 0
cpu3snd.exe beep3.wav -loop 0
cpu4snd.exe beep4.wav -loop 0
...
By the way, how many computers are you tracking?

The program nircmd can kill processes by name from the command line.
http://www.nirsoft.net/utils/nircmd.html
nircmd killprocess cpu1snd.exe
nircmd killprocess cpu2snd.exe
nircmd killprocess cpu3snd.exe

Here is the first pair of probes.
Name: Dude Alarm1
Type: execute on server
Command: c:\alert\cpu1snd.exe beep1.wav -loop 0

On the 'Advanced' Tab, check
unstable->down

Name: Dude stop Alarm1
Type: execute on server
Command: c:\alert\nircmd killprocess cpu1snd.exe

On the 'Advanced' Tab, check
down->up
unstable->up

I would just toss all the files into a folder off the root of drive i.e. C:\alert as I show in the "Command:"
One pair of probes to start and stop the sound per computer, yuk but it will work.

:)
Lewbowski
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: need help with ping and beep notification

Fri Oct 01, 2010 1:28 am

I built two notifications, I had to put the commands into batch jobs and put the commands in quotes. The batch jobs for ding and unding are simple.

contents of ding.bat
c:\alert\mplayer.exe c:\alert\ding.wav -loop 0
contents of unding.bat
c:\alert\nircmd.exe killprocess mplayer.exe
alert.png
It works.
You do not have the required permissions to view the files attached to this post.
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26968
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia
Contact:

Re: need help with ping and beep notification

Fri Oct 01, 2010 12:44 pm

heh, genius :)

would like to see you (and gsandul) at a MUM some time!
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: need help with ping and beep notification

Sat Oct 02, 2010 6:47 pm

Thanks Normis, That would be great fun.
 
andreako
just joined
Topic Author
Posts: 22
Joined: Tue Jul 20, 2010 7:19 pm

Re: need help with ping and beep notification

Sun Oct 03, 2010 2:31 pm

Thanks lebowski it works great. You are a genius.

I hope that mikrotik dude staff will improve this kind of notification in the future version.

I like all mikrotik products.

Bye
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: need help with ping and beep notification

Mon Oct 04, 2010 5:16 pm

That is great Andreako, so did you make an executable and sound for each computer?

Don't forget to give positive karma when you have been helped...

Thanks,
Lebowski
 
andreako
just joined
Topic Author
Posts: 22
Joined: Tue Jul 20, 2010 7:19 pm

Re: need help with ping and beep notification

Mon Oct 04, 2010 9:46 pm

Yes I have made batch files for each pc but sometimes it beeps and sometimes not.

I am waiting improvements from mikrotik dude staff. I dont know what to do.

I have installed dude server on windows 7 and sometimes it craches sometimes show a connection error. ("Connenction error because the target machine actively refused it") I have permitted dude to pass throught the firewall.

I hope that mikrotik will fix bugs and improve beep notifications.

Thanks Lebowski