0

I have debian squeeze installed on my box. I have BIRD daemon to route traffic of particular IP. We add IP to bird-route.conf automatically from ruby script if traffic spikes up to specific range. I would like to know the possible ways to send notification of added IP to remove from bird-route.conf after certain period, for example say If script adds the IP in bird-route.conf file at 12.00AM so notification script should notify me after 48 hours to remove it. How can I achieve this ? shell, perl or ruby any of the scripting would work.

7
  • Ubuntu user here, not sure what is preinstalled on squeeze: notify-osd, zenity? Python version? – Jacob Vlijm Mar 25 '16 at 8:56
  • Also: I assume planned notifications should survive a possible restart? – Jacob Vlijm Mar 25 '16 at 9:21
  • @Jacob Vlijm : Nothing is preinstalled, except python 2.7.3 and can't we survive without restart ? – Rahul Mar 25 '16 at 9:38
  • 2
    One idea would be to have your "add" ruby script fire off an at job to call a removal script of the same IP – Jeff Schaller Mar 25 '16 at 21:40
  • 1
    and if at isn't installed, just run the removal or notification script after a sleep 2d (or sleep 172800 if your version of sleep doesn't understand the d suffix for days). – cas Mar 25 '16 at 22:53
0

One mechanism for "delayed action" in Unix is at. Some system administrators may disable its usage, but if it's available, it can help you solve your problem.

  1. Your "add" script can add the IP, then fire off an at job that calls a "remove" script with the same IP as a parameter.

  2. Once the at job runs, it should check the target configuration to see if the given IP is still there (I'm not sure if your situation allows for the same IP to be "added" twice).

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.