Script to tail/monitor and email upon activity...

Hello all,
First time poster, medium time user.
I'm looking to create a script that "watches" /var/log/authlog, and emails a user upon any failed or successful login, for 2 specific account. I've exhausted several options, including simply adding a script to /etc/profile for these accounts' logins, but that won't trap unsuccessful logins. Also, I've tried the following: http://search.cpan.org/~mgrabnar/File-Tail-0.99.3/Tail.pm --- but that won't fly in our environment (management decsion).
Can somebody please help with some ideas?
Thanks!
-Bob

I think your best bet is to write a routine that can parse the dates in the logfile that you're looking through so that you only look at entries after a specified point in time (or will look x mins back through the log), and so you don't double report on extant instances in the log.
The perl module Date::EzDate could be of use in the prevention of the reinvention of the wheel on the date parsing :)
pb

Similar Messages

  • Someone is using faebook to run java script to get data and email from me in windows 8

    someone is using faebook to run java script  to get  data  and  email  from  me in  windows  8

    Is this a developer question?
    Jeff Sanders (MSFT)
    @jsandersrocks - Windows Store Developer Solutions
    @WSDevSol
    Getting Started With Windows Azure Mobile Services development?
    Click here
    Getting Started With Windows Phone or Store app development?
    Click here
    My Team Blog: Windows Store & Phone Developer Solutions
    My Blog: Http Client Protocol Issues (and other fun stuff I support)

  • Creating script to take picture and email it

    I recently read an article about someone who created an automator script that would take a picture using a MacBook iSight camera and email it each time the MacBook awoke from sleep. Several laptops have been stolen from my workplace and I thought this would be a great way of figuring out the thief were my laptop ever stolen.
    When I looked at the script, I noticed that it opens up PhotoBooth and Mail so that the user in front of the computer would see that their picture was being taken and that an email message was sent.
    In the name of stealthness, I was hoping to duplicate this process in a unix script. I have a few pieces figured out, but I need some guidance on other issues.
    What I know:
    1. How to use sleepwatcher to call a unix script upon the MacBook waking.
    2. How to take a stealth image using the commandline command "camcapture".
    What I would like to know
    1. What unix command could I use to check to see if the MacBook has a viable internet connection?
    2. If there is a viable connection, send an email with the image taken to a particular email address and with a particular subjectline.
    3. If there is not a viable internet connection, save the email and check for a viable internet connection each 5 minutes (or so) and send the email as soon as an internet connection is achieved.
    Thank you in advance for any guidance you can offer.

    Hi Mahongue,
       I'm sorry for being absent for a while but in your case that seems to have been a good idea. I think you deserve the star more than I because you seemed to have worked it all out. Of course I couldn't tell you what server your e-mail account uses but it doesn't matter that much in the ping statement. If you can ping mail.yahoo.com, I'm sure that would indicate that you have an internet connection that would allow you to send mail to a yahoo account. I see your point about e-mail being the best solution in case you don't have a reliable server of your own. Of course you can get around the dynamic IP address the way I do, with DynDNS.org. They allow you to change your DNS listing programmatically and you do that at boot. Of course that wouldn't allow you to reliably scp to that machine unless it's always up.
       Your idea of testing the return value of ping command will work in principle. I tested it and ping returns an error if either the lookup fails or the ping times out. I've never used the syntax you did in the if clause. What shell are you using? In a Bourne-type shell, you shouldn't need the parentheses. You could use something like:
    if ping -c 1 mail.yahoo.com >/dev/null 2>&1; then
       <Invoke Network Usage>
    fi
    The redirection avoids cluttering the output of your script with the ping output.
    If you're interested, the CheckForNetwork function in the /etc/rc.common script is:
    # Determine if the network is up by looking for any non-loopback
    # internet network interfaces.
    CheckForNetwork()
       local test
       if [ -z "${NETWORKUP:=}" ]; then
       test=$(ifconfig -a inet 2>/dev/null | sed -n -e '/127.0.0.1/d' -e '/0.0.0.0/d' -e '/inet/p' | wc -l)
       if [ "${test}" -gt 0 ]; then
          NETWORKUP="-YES-"
       else
          NETWORKUP="-NO-"
       fi
       fi
    and usage is:
    CheckForNetwork
    if [ "${NETWORKUP}" = "-YES-" ]; then
       <Invoke Network Usage>
    fi
    If you copy-and-paste any of this code, be sure to replace the non-breaking spaces used for indention with real spaces.
       Thanks for the link to the mail_files script!! That is really impressive! Naturally I saved it. The link you posted is broken at the moment but it's probably one of those sites that throttle traffic by shutting it down for a while when it's "overused". Maybe you've made him popular. Anyway, I got a version of the same script elsewhere but mine says that the uuencoding is untested. Yours doesn't say that, does it? Have you tested that with your version?
       Dave's script still uses Perl to do base64 encoding. It should still be possible to do this in Perl and there are advantages to letting library code handle certain tasks. That way, if a protocol changes someone will likely upgrade the library for you. I think that on another thread you asked about how to add an attachment in the code that we were discussing on that other thread. However, I thought you said that you had Perl code to do that. I was just suggesting that you put the two together.
    Gary
    ~~~~
       The party adjourned to a hot tub, yes.
       Fully clothed, I might add.
             -- IBM employee, testifying in California State Supreme Court

  • Script to extract names and email addresses of all recipients of an email

    Hi,
    I have found some scripts which extract email addresses from the content of messages in Mail, but I am looking for something rather different, and wonder if such a script exists, or if someone can help me build one.  I would like to create a tab delimited text file of the first name, last name and email address of all recipients of a given message in Mail.  Most email addresses will be in the format John Doe <[email protected]>.
    Thanks,
    Nick

    Hi,
    nick_harambee wrote:
    I have one outstanding issue, which wasn't included in the original question.  Sometimes email addresses are included in the Name of the recipient, i.e. instead of 'John Doe', it reads 'John Doe ([email protected])'.  Could you script be adapted to delete any block of text (i.e. space delimited) that includes the @ symbol, so that 'John Doe ([email protected])' would return:
    John<tab>Doe<tab>[email protected]
    Use this handler:
    on splitName(t)
        if "@" is in t then -- to remove the address after the name
            set n to -3
        else
            set n to -2 -- normal name
        end if
        set tid to text item delimiters
        set text item delimiters to space
        set l to text items of t
        if (count l) = 1 then -- no space 
            set r to tab & t & tab -- last name only 
        else
            tell l to set r to "" & (items 1 thru n) & tab & (item (n + 1)) & tab
        end if
        set text item delimiters to tid
        return r
    end splitName

  • Monitoring and controlling wifi activity by device.

    Is there a relatively simple way to set up monitoring and controls per device on a Time Capsule-based wireless network?  For example, I might want to limit wifi access late at night by my son's iPhone or my daughters e-reader.  Or I might want to disallow internet access during certain periods for certain devices, while still allowing full access to the disk for backups via Time Machine.  I would also like to see a how much and when individual devices are using the network.  Is there an application out there for that sort of thing?

    There are some access controls for the TC available.
    Just open the airport utility, manual setup, airport, access control, and used timed access.
    But that is all that is available.
    To get download usage etc is well beyond what the TC can manage.. you will need a wireless router with 3rd party firmware, gargoyle. It will do exactly what you want. That is the only firmware or even software on the market that puts the control into a relatively cheap router.
    http://www.gargoyle-router.com/download.php
    You can get a TP-Link router for about $70 but the Netgear WNDR3700 at around $120 is a much better router for the job. This has far superior controls cf the apple routers.

  • CCMS Configuration - Central Monitoring and Email Alerts with Solution Mgr

    I am trying to configure my CCMS alerts on my satellite systems to be linked into the Solution manager system (acting as the CEN monitoring node). If I have already setup my RZ20 alerts, is there a way I can just link these into Solution Manager.
    Thanking you for your suggestions

    Try setting up the monitoring RFC connections in SMSY. Once those are setup, you can pull the CCMS data in and view within tran SOLUTION+MANAGER.
    If you need more detail, just update this message.
    Thanks,
    J. Haynes

  • How do i get rid of an old apple id from an iphone upon activation IOS 7

    This phone was sold to me by a friend and it had and account upon activation, my freind doesn't know the information how do I get rid of the account so I can use the phone?? Please I need to know I lost my other phone and I am trying to use this one.

    The "friend" will have to log in to his or her Apple ID and disable Find my iPhone. Or unlink by logging in to iCloud using the correct Apple ID and password and unlinking the phone. See: http://support.apple.com/kb/HT5661 for what your friend has to do before you can use the phone.
    I am truly amazed that a friend would sell you a phone without wiping out its contents, which must contain a lot of sensitive personal information. And to wipe it clean the friend would have had to disable Find my iPhone.
    Activation Lock is Apple's antitheft feature, that prevents a stolen iPhone from ever being used again. See: http://support.apple.com/kb/HT5818 for how it works.

  • How to set alert threshold and email alerts?

    Hi!
    I have configured Solution manager 3.2 to monitor
    our R/3 systems.
    I want to be able to set the threshold for  tablespace
    usage and be able to send an email if the usage
    of the tablespace is 80% full.
    Could anybody tell how to implement it?
    Thanks!

    Hi Christy:
    There are different approaches to configure alerts, if you are using Solution Manager; I think you can benefit if you choose SolMan and the Central System (CEN) to handle all the monitoring and email alerting.
    If this is the case, you will need to install the CCMS Agents on every satellite system in order to trigger remote alerts.
    Let me know what is your idea and I can follow with you with the required steps.
    Best Regards,
    Federico G. Babelis
    NetWeaver Certified Consultant
    GAZUM Technologies S.A.
    Consulting Services and Software Solutions
    http://www.gazum.com
    ...download FREE Marketplace Manager at: http://www.gazum.com/products

  • My apple id has been disabled and when i am trying to reset my apple id passwrd it is sending me mail to my registered email id and i no longer have access to that email id, totally confused what to do since my iphone 4s is stuck upon activation of i

    my apple id has been disabled and when i am trying to reset my apple id passwrd it is sending me mail to my registered email id and i no longer have access to that email id, totally confused what to do since my iphone 4s is stuck upon activation of icloud

    http://support.apple.com/en-us/HT201356

  • What are the best apps to monitor tests and emails on childs phone

    what are the best apps to monitor tests and emails on childs phone?

    You could simply log into your child's email with the password that the two of you agree upon, and monitor the emails manually.  As for the texts, you could purchase a separate device, and use the child's Apple ID to monitor the iMessages.  For SMS/MMS, no way to monitor it.  You'll have to use the app called 'Random Parental Inspections'.

  • Render and Email script

    Hello everybody. I have a question that I have thoroughly researched on the web with no results.
    I am trying to get the default After Effects "Render and Email" script to run properly. I have only been able to successfully send FROM one specific email address TO another (slightly less specific) email address. Most other email services I put in (icloud, gmail, etc) all give strange errors upon execution.
    For the SENDING email address, I'm currently using one I created that is a part of my web hosting account (this is the only account I am able to successfully send from). For RECEIVING, I've only successfully gotten my gmail address to work. All other receiving addresses don't always give me error, but also never show up. Either that, or I get very weird errors. The most common one I get is "Unaable to send mail. 533 5.7.1 AUTH command is not enabled."
    I haven't been able to find this error documented anywhere online. I'd like to be able to send emails to my icloud account, since it pushes email notifications to my phone in real time.
    Long ago someone by the name of Ko Maruyama supposedly explained all this in detail, but the writeup was posted on a .mac website (http://homepage.mac.com/komaruyama/Tutorials/AE/AE_javamail/AE_mail.html), which Apple officially discontinued/took down several years ago.
    Does anyone have any experience with this?

    For Mac, the path is of course slightly different. If you cannot delete the file, you should at least be able to edit it in Extend Script Toolkit or any text editor or run the script separately to change its config data. Works for me...
    Mylenium

  • How to reuse standard Activity subcomponents - Appointments, Tasks, Phone Calls and Emails within a custom work center?

    Requirement : We have a requirement to reuse the standard Activity subcomponents Appointments, Tasks, Phone Calls and Emails within a custom work centre. The requirement is to leverage and copy all sub functionalities Appointments, Tasks, Phone Calls and Emails available within the standard activity work center. This feature is available within Accounts, Opportunities, Leads etc. (Refer screenshot: Std_Act_Screen.jpg)
    We are unable to consume/embed the standard Activity (Work center) sub components Appointments, Tasks, Phone Calls and Emails within the custom work center. This is because of backend consistency check violation UI designer error message displayed. (Refer screenshot:Error while consuming standard activities.jpg)
    Ø  Open Question:
    a.      Is there a limitation to consume/embed the standard Activity (Work center) subcomponents Appointments, Tasks, Phone Calls and Emails within a custom work center?  We have noticed that this standard Activity Work center subcomponents Appointments, Tasks, Phone Calls and Emails has been repeatedly reused within the application in Account, Opportunity, Sales lead, Lead, Sales Quote Objects.
    b.      Is there an alternative way in which we can call [Through API etc..] the standard Activity Work center subcomponents Appointments, Tasks, Phone Calls and Emails?
    We need your guidance to overcome the error to enable the reuse of the standard Activity Work center sub-components Appointments, Tasks, Phone Calls and Emails within our custom work center or suggest a suitable workaround on how this can be achieved.
    Regards .. Dheeraj Saini

    Whenever you find out let me know. I wanted to assign a text tone to someone and now in iOS 7 i can't. Or I haven't figured this out yet.

  • How do I run an Apple Script only when the computer is awake at the specified time and NOT upon waking after the specified time?

    I've been using Steve Lambert's SelfControl to block myself from certain time-sucking internet sites for a certain period of time every day. I've automated the program launch using an AppleScript that runs based on an iCal alarm, but the problem is that if my computer has been asleep or shut off, the script will run as soon as I wake it up or start it up, and that can be very inconvenient if I'm intending to use my computer not during the hours when I intended to restrict access to such websites.
    So, is there any way to schedule an AppleScript to run *only* if the computer is running at the designated time and not upon waking/starting up after the alarm has passed if the computer was asleep/off?
    I started investigating launchd, as I understand this is the successor to cron/crontab in OS X Lion, but it appears that launchd has the same behavior I dislike in the iCal alarm approach--the script will run upon waking even if the time when it was supposed to run has already passed...unless there is a way to change this behavior?

    The obvious/easy solution would be to add some logic to the script to see what the time is.
    If you expect the script to run at, say, 1pm, but the script checks the time and sees that it's 5pm then you can assume the machine was asleep at the time and thefore you can bail out gracefully.
    if (hours of (get current date)) = 13 then
      -- it's sometime in the 1pm hour...
    end if
    You can fine-tune the check as much as you like

  • Hi I'm Mohammed abwane from Saudi Arabia. I purchased my me I phone  5 last march 2013. One week ago I try to restore this phone but when I arrive to activation point, this ask for apple Id and password. Unfortunately I forget the password and email I use

    Hi I’m Mohammed abwane from Saudi Arabia. I purchased my me I phone  5 last march 2013. One week ago I try to restore this phone but when I arrive to activation point, this ask for apple Id and password. Unfortunately I forget the password and email I used for opening my account.
    Then I send it to the suppler  where purchased  this phone  they told me  there is no way  to fix this unless I give  them the Id and password  .know I don’t know  where I can go  because in my Location nobody know how to fix this problem.
    At less I don’t know what I can do to fix this problem because I use this phone for my work and All my data and phone number in side this phone
    Notes :- I have  all the document    ( invoice and box  for this phone )which say that I phone for me .
    I hope to get any answer from  your good site other whys this phone will be useless for me   
    Thanks .
    <Email Edited By Host>

    If you can't remember your apple id or password then sadly that phone has been bricked, without that infomation te activation lock cannot be removed by apple or anyone else.

  • Script for check users password's expiry and email it to respective users

    Hi,
    I am a beginner in Solaris environment. Anyone have sample script to read password's expiry and email it to respective users ?
    Thanks in Advance.
    Sincerely,
    Daniel

    If you don't want to be constrained by keeping your videos super small so they can fit in an email, there are several solutions:
    1) Get a .mac account and use Web Gallery ($)
    2) Use Youtube and include a link to the video in your email (free)
    3) Use Google Video and include a link to the video in your email (free)
    4) Use VIMEO and include a link to the video in your email (free)
    There are several other video hosting services but you get the idea.

Maybe you are looking for

  • Unable to install iTunes 10.5.1

    I had iTunes installed on Windows 7 ultimate & when I updated to 10.5.1 it disappeared. When I tried to reinstall it says I don't have administrative priviledge's.I am the only user on my computer. What do I do?

  • Trouble saving files as jpg or eps in CS3

    I recently moved from OSX 10.4 to OSX 10.6 (new computer) and seem to have lost the ability to save photoshop files (CS3)  in eps or jpg format. I can "save to web", which will save small jpgs, but once was able to save jpgs of any size in the "save

  • Sequence of the classes called in a standard BADI

    Hi guys,    I have a problem on the sequence of the classes called in a standard BADI occuring in different system.    In the DEV system, the sequence called is A, B, C (Just to illustrate). But, in the QA and PROD system, the sequence called is B, C

  • Extract function for xmltype replaces ~ (tilde) with ']]]'

    Hi, In 10.2.0.4 when extracting fragment using xpath and extract function is replacing ~ with ]]]. strange thing is, it happens with only one ~ though there are many ~ in the xml. Has anyone faced similar issue with extract() function ? Thanks, vivek

  • Problem opening live web page (url) from within keynote

    hi. i encountered this problem during a recent presentation. i have a standard two-monitor set-up, on my laptop viewing notes etc and presenting on the attached monitor. the transitions between my slides are all set onClick. so, when i encounter a hy