Page view counter

Scheduler questions

Last post 06-18-2004 7:58 AM by BigWebmaster. 17 replies.

Sort Posts:

  • Scheduler questions

    06-07-2004, 4:36 AM
    • Loading...
    • vmasanas
    • Joined on 09-17-2003, 2:48 AM
    • Banyoles, Girona (Spain)
    • Posts 1,550
    • Points 7,685
    On the Edit Schedule page we have a number of options to define a scheduled task. After reading the Scheduler.doc I have a few questions about that:

    1- Run on Event. Why Application_Start is the only supported event? How about Session_start or other interesting events?

    2- Object dependencies. How should we specify the object name. Does this resolve for {databaseOwner},{objectQualifier}? When it says "other objects" what does this refer to?

    (I reported an issue on the Scheduler as I find a missing "Cancel" or "Return" on all pages. Currently there's no way to cancel or go back.)

  • Re: Scheduler questions

    06-08-2004, 7:54 AM
    • Loading...
    • vmasanas
    • Joined on 09-17-2003, 2:48 AM
    • Banyoles, Girona (Spain)
    • Posts 1,550
    • Points 7,685
    3- On the predefined items scheduled we have

    DotNetNuke.Logging.PurgeLogBuffer, DOTNETNUKE.XMLLOGGINGPROVIDER
    DotNetNuke.Logging.SendLogNotifications, DOTNETNUKE.XMLLOGGINGPROVIDER

    What does this last one do?

    4- Is the predefined frequency for each item the recommended/best setting or just an example?
  • Re: Scheduler questions

    06-08-2004, 9:19 AM
    • Loading...
    • BigWebmaster
    • Joined on 09-17-2002, 8:07 AM
    • Connecticut, USA
    • Posts 1,170
    • Points 5,850
    I should have included a description for each of the tasks...that'd be a nice enhancement. I'll add that on.

    1. I started with APPLICATION_START and APPLICATION_END. In the end, I removed APPLICATION_END because it was unreliable due to the worker thread in IIS. I didn't add the other events (SESSION_START, etc.) yet because I am concerned about performance if we start adding things to SESSION_START or any of the other events that are hit very often. If there is a need out there for the other events, I can add them in there...but there absolutely will be at least a small performance hit, even if no events are scheduled for that event. I'll play this one by ear...let's see if there is a need for it before I add it.

    2. Object Dependencies - I started by using just the table name. If you are specifying a table, don't include {databaseowner} or {objectqualifier}...just the table name. It is not referential to anything. You could type "blue banana" in there...if it finds another task with "blue banana" for an object dependency, they won't run at the same time.

    3. SendLogNotifications - the logging provider includes the ability to be notified once a certain threshold has been met for a particular event type/portal. The logs are checked regularly to see if there are any logs that have exceeded their notification threshold, in which case an email will be sent out.

    4. The predefined frequency is what is recommended, however it's up to you really. UsersOnline should be updated very frequently. Log Notifications should be checked very frequently...(i.e. what if it is a breach of security notification, wouldn't you want to know ASAP?)...etc...you can use common sense.

    Dan
    DotNetNuke Core Architect

  • Re: Scheduler questions

    06-08-2004, 9:39 AM
    • Loading...
    • DocHoliday
    • Joined on 10-29-2003, 6:02 AM
    • Germany
    • Posts 472
    • Points 2,360
    Dan,

    how do I configure the SendLogNotification?

    Example:
    Event: login failure
    Threshold: 7 x in 30 minutes

    I can't fugure it out when I look at the "Edit Schedule" page (available tasks: *SendLogNotifications*

    Cheers,

    DocHoliday
    MCSA/MCSE on W2K3, artless DNN operator
  • Re: Scheduler questions

    06-08-2004, 10:32 AM
    • Loading...
    • vmasanas
    • Joined on 09-17-2003, 2:48 AM
    • Banyoles, Girona (Spain)
    • Posts 1,550
    • Points 7,685
    Thanks Dan, just what I needed!

    On #1 I'm not really asking for any one, just trying to figure what/why was done. For the Session_Start I can imagine it makes sense to plug, for example, the usersonline. It's when a new users connect to the site, so a good place to start tracing it.
    Imagine a piece of code you want to execute on each new user, that's the right place.

    (I don't really know how Usersonline internals work, but I just figured an easy example, which maybe is not perfectly correct)
  • Re: Scheduler questions

    06-08-2004, 10:59 AM
    • Loading...
    • bobster234
    • Joined on 02-27-2003, 5:00 AM
    • Posts 1,039
    • Points 5,195
    Doc,

    Note sure if this helps but I think it is under log viewer ... then click the pencil icon Edit log configurations ... then click one of the edit links...
    Visit www.dnnnotes.com - index of DNN threads - hand picked quality threads.

    TextLayout Module - create multiple column layouts easily
  • Re: Scheduler questions

    06-08-2004, 11:18 AM
    • Loading...
    • DocHoliday
    • Joined on 10-29-2003, 6:02 AM
    • Germany
    • Posts 472
    • Points 2,360
    Rob,

    oh yeah, barked up the wrong tree.

    Follow-Up questions: in this context (Edit Log Setttings) do I

    (1) click on * (Log type) and configure this one to reach my goal

    (2) or do I "Add Log Configuration", configure the settings, but...which "file name"?
    Is it again "Log.xml.resources"?

    Cheers,

    DocHoliday
    MCSA/MCSE on W2K3, artless DNN operator
  • Re: Scheduler questions

    06-08-2004, 2:05 PM
    • Loading...
    • BigWebmaster
    • Joined on 09-17-2002, 8:07 AM
    • Connecticut, USA
    • Posts 1,170
    • Points 5,850
    Doc,

    For the login failure notification, you'll want to add a new config entry...select the proper event type for login failure, set up the rest of the settings and that's it.

    The "*" log type means "everything"...a bad place to put log notifications...you could get bombed with emails if you're not careful! But, it's possible for those who want to do that.

    Dan
    DotNetNuke Core Architect

  • Re: Scheduler questions

    06-16-2004, 4:16 AM
    • Loading...
    • DocHoliday
    • Joined on 10-29-2003, 6:02 AM
    • Germany
    • Posts 472
    • Points 2,360
    Hi,

    here is what i did:

    1. login as host
    2. point to ADMIN, LOG VIEWER
    3. EDIT LOG CONFIGURATIONS
    4. ADD LOG CONFIGURATIONS,

    Edit Log Settings
    ----------------------------------------------------
    Logging Settings
    ----------------------------------------------------
    ** Logging Enabled: [X] (checked)
    ** Log Type: Login Failure
    ** Portal: ALL
    ** Keep Most Recent: ALL
    ** FileName: Log.xml.resources
    ----------------------------------------------------
    Email Notification Settings
    ----------------------------------------------------
    ** Email Notification Enabled. [X] (checked)
    ** Occurance Threshold: 3 Occurances in 3 Minutes
    ** Mail From Address: myemailaddress@mydomain.com
    ** Mail To Address: myemailaddress@mydomain.com

    then clicked "save".

    5. Context, EDIT LOG SETTINGS, clicked EDIT Login failure, verified all settings, saved again
    6. logged out
    7. tried to login multiple times with false username/passwords
    8. logged in as host
    9. point to admin, Log Viewer
    10. Log Viewer shows Login failures
    11. Again EDIT LOG CONFIGURATIONS
    12. EDIT Login Failure
    13. All settings but the "Occurance Threshold" are correct.
    ** instead of 3 Occurances in 3 Minutes I find 3 Occurances in 1 Seconds.

    Under \Portals\_default\Logs

    I find a file called "PendingLogNotifications.xml.resources"
    with the several entries, but

    I do not receive notifications emails (other portal mail is working).

    Is it because the "Occurance Threshold" continuously changes back to "1 Seconds" ?

    Cheers,

    DocHoliday



    MCSA/MCSE on W2K3, artless DNN operator
  • Re: Scheduler questions

    06-16-2004, 6:41 AM
    • Loading...
    • BigWebmaster
    • Joined on 09-17-2002, 8:07 AM
    • Connecticut, USA
    • Posts 1,170
    • Points 5,850
    I followed your directions exactly...here's what I found:

    1. The notification does get sent properly on my system and on a remote system I test with at a hosting facility. I need to look further into why your particular notification isn't being sent.
    2. You did find a bug in /Admin/Logging/EditLogTypes.ascx.vb around line 157 and line 159:

    ddlThresholdNotificationTimeType.Items.FindByValue
    should be
    ddlThresholdNotificationTimeType.Items.FindByText

    That will solve the problem with the seconds/minutes. Good catch, thank you! I already fixed this in our source control, so it will be in the next release.

    But I do not know why your email is not sending...I can't reproduce it. I'll keep looking to see if I can get it to break. In the meantime, let me know if you figure it out.

    Dan
    DotNetNuke Core Architect

  • Re: Scheduler questions

    06-16-2004, 7:57 AM
    • Loading...
    • DocHoliday
    • Joined on 10-29-2003, 6:02 AM
    • Germany
    • Posts 472
    • Points 2,360
    Dan,

    thanks for your swift response.

    I tried the same thing on my production site. With the same results as described above. I don't get an email. On both sites (the test site is a copy on the same webserver) I have tested, sending mails (like New User Registration) works (My DNN sends mail via a SMTP gateway (same subnet) specified in host settings).

    One suggestion: please add a "cancel" button in "Edit Log Settings". Thanks !

    Cheers,

    DocHoliday
    MCSA/MCSE on W2K3, artless DNN operator
  • Re: Scheduler questions

    06-16-2004, 8:33 AM
    • Loading...
    • BigWebmaster
    • Joined on 09-17-2002, 8:07 AM
    • Connecticut, USA
    • Posts 1,170
    • Points 5,850
    Can you send me your log configuration file so I can test it out on my system? It's this file: /portals/_default/logs/logconfig/LogConfig.xml.resources

    Send it to dan (at) dancaron.com


    DotNetNuke Core Architect

  • Re: Scheduler questions

    06-17-2004, 3:02 AM
    • Loading...
    • DocHoliday
    • Joined on 10-29-2003, 6:02 AM
    • Germany
    • Posts 472
    • Points 2,360
    It works !

    I added a "SMTP Username" and a "SMTP Password" in host settings. Now I receive notification mails.

    But now the ball is back to you: Why does the log notification need a valid SMTP user account as opposed to the other mail activity (e.g. new user registration), which has been working without any problems so far?

    Is there a different SendMail string?

    Cheers

    DocHoliday
    MCSA/MCSE on W2K3, artless DNN operator
  • Re: Scheduler questions

    06-17-2004, 8:51 AM
    • Loading...
    • BigWebmaster
    • Joined on 09-17-2002, 8:07 AM
    • Connecticut, USA
    • Posts 1,170
    • Points 5,850
    Great! Yeah, now this is bizarre. I remember copying & pasting the SendNotification() call (or whatever it is) from HostSettings.ascx.vb...so syntactically it should be the same.

    The only thing that is different is that the SendLogNotification() method gets run on another thread, meaning it doesn't have Portal Context. My guess is that it has something to do with this. Perhaps it cannot access the HostSettings or something, though it seems impossible since HostSettings is a global variable in Global.asax.vb that is populated in APPLICATION_START. I'll take a look at it.

    We're getting there...thanks for helping to diagnose this.

    Dan
    DotNetNuke Core Architect

  • Re: Scheduler questions

    06-17-2004, 6:14 PM
    • Loading...
    • BigWebmaster
    • Joined on 09-17-2002, 8:07 AM
    • Connecticut, USA
    • Posts 1,170
    • Points 5,850
    Ok, here's a followup. I didn't realize that when you use the SendMail() method (instead of the older SendNotification() method) you must specify the SMTP server, username & password, from HostSettings. The older SendNotification() did this for you. This will be fixed in the next release.

    Around line 580 in /Providers/LoggingProviders/XMLLoggingProvider.vb,

    -----------------------------------
    replace this:
    -----------------------------------
    errSendNotif = SendMail(objLogTypeInfo.MailFromAddress, objLogTypeInfo.MailToAddress, "", "", Mail.MailPriority.High, "Log Notification", Mail.MailFormat.Text, Text.Encoding.Default, xmlOut.OuterXml, "", "", "", "")

    -----------------------------------
    with this:
    -----------------------------------
    Dim strSMTPServer As String
    ' SMTP server
    If Global.HostSettings("SMTPServer").ToString <> "" Then
    strSMTPServer = Global.HostSettings("SMTPServer").ToString
    End If
    Dim strSMTPUsername As String = ""
    If Convert.ToString(Global.HostSettings("SMTPUsername")) <> "" Then
    strSMTPUsername = Convert.ToString(Global.HostSettings("SMTPUsername"))
    End If
    Dim strSMTPPassword As String = ""
    If Convert.ToString(Global.HostSettings("SMTPPassword")) <> "" Then
    strSMTPPassword = Convert.ToString(Global.HostSettings("SMTPPassword"))
    End If
    errSendNotif = SendMail(objLogTypeInfo.MailFromAddress, objLogTypeInfo.MailToAddress, "", "", Mail.MailPriority.High, "Log Notification", Mail.MailFormat.Text, Text.Encoding.Default, xmlOut.OuterXml, "", strSMTPServer, strSMTPUsername, strSMTPPassword)

    ---------------------------

    Let me know if this doesn't solve your problem.

    Dan
    DotNetNuke Core Architect

Page 1 of 2 (18 items) 1 2 Next >