Email_alert

Hello Friends,
How to configure mail configuration in linux server 10g. Give me the steps or commands to execute.
Thanks.

SQL> DECLARE
2 vSender VARCHAR2(30) := '[email protected]';
3 vRecip VARCHAR2(30) := '[email protected]';
4 vSubj VARCHAR2(50) := 'Enter the subject here';
5 vMesg VARCHAR2(4000) := 'Enter the body';
6 vMType VARCHAR2(30) := 'text/plain; charset=us-ascii';
7 BEGIN
8 utl_mail.send
9 (vSender, vRecip, NULL, NULL, vSubj, vMesg, vMType,NULL);
10 END;
11 /
DECLARE
ERROR at line 1:
ORA-29278: SMTP transient error: 421 Service not available
ORA-06512: at "SYS.UTL_SMTP", line 21
ORA-06512: at "SYS.UTL_SMTP", line 97
ORA-06512: at "SYS.UTL_SMTP", line 139
ORA-06512: at "SYS.UTL_MAIL", line 405
ORA-06512: at "SYS.UTL_MAIL", line 594
ORA-06512: at line 8

Similar Messages

  • Sending an SMS or Mail to mobiles  through Oracle

    hi,
    We have created a proc through which we can send a mail to our MailId. but my requirement is we need to send this mail as an SMS to mobiles through oracle.
    Our code goes some thing like this:
    CREATE OR REPLACE PROCEDURE "EMAIL_ALERT" (v_From VARCHAR2,
    v_Recipient VARCHAR2,
                   v_Subject VARCHAR2,
    v_Mail_Host VARCHAR2,
    v_message VARCHAR2) AS
    v_Mail_Conn utl_smtp.Connection;
    crlf VARCHAR2(2) := CHR(13)||CHR(10);
    v_Recipient1 VARCHAR2(50):='[email protected]';
    v_Recipient2 VARCHAR2(50):='[email protected]';
    v_Recipient3 VARCHAR2(50):='[email protected]';
    BEGIN
    v_Mail_Conn := utl_smtp.Open_Connection(v_Mail_Host,25);
    utl_smtp.helo(v_Mail_Conn,v_Mail_Host);
    utl_smtp.Mail(v_Mail_Conn, v_From);
    utl_smtp.Rcpt(v_Mail_Conn, v_Recipient);
    utl_smtp.Rcpt(v_Mail_Conn, v_Recipient1);
    utl_smtp.Rcpt(v_Mail_Conn, v_Recipient2);
    utl_smtp.Rcpt(v_Mail_Conn, v_Recipient3);
    utl_smtp.DATA(v_Mail_Conn,
    'Date: ' || TO_CHAR(SYSDATE, 'Dy, DD Mon YYYY hh24:mi:ss') || crlf ||
    'From: ' || v_From || crlf ||
    'Cc:' ||v_Recipient1|| crlf ||
    'Cc:' ||v_Recipient2|| crlf ||
    'Cc:' ||v_Recipient3|| crlf ||
    'Subject: '|| v_Subject || crlf ||
    'To: ' || v_Recipient || crlf || crlf ||
    'Hi,'|| utl_tcp.crlf
    ||' '||CHR(13)||
    v_message|| utl_tcp.crlf
    ||' '||CHR(13)||
    'Thanks and Regards'|| utl_tcp.crlf||
    utl_tcp.crlf
    utl_smtp.Quit(v_mail_conn);
    EXCEPTION
    WHEN utl_smtp.Transient_Error OR utl_smtp.Permanent_Error THEN
    RAISE_APPLICATION_ERROR(-20000, 'Unable To Send Mail: '||SQLERRM);
    END Email_Alert;
    Assuming the mobile number to be 9197016944444 where 91 represent the country code . please advice.
    Regards
    Edited by: vine on Apr 16, 2010 5:24 AM

    vine wrote:
    EXCEPTION
    WHEN utl_smtp.Transient_Error OR utl_smtp.Permanent_Error THEN
    RAISE_APPLICATION_ERROR(-20000, 'Unable To Send Mail: '||SQLERRM);
    END Email_Alert;Ugly. What you are doing here is taking a meaningful exception and making it meaningless. The caller knows that the send mail fail. It is after all getting a raised exception in response.
    What is important for the caller is to evaluate the error. Determine a) what happened and then b) determine what to do about it.
    The what happened is determined from the exception error code. Only, you now went and changed the meaningful application error code to -20000.
    Do not make exceptions meaningless!
    >
    Assuming the mobile number to be 9197016944444 where 91 represent the country code . please advice.Advice exactly what? You cannot send a SMS via e-mail.
    What you can do is send a specially formatted e-mail (specific recipient/subject) to a mail server, where this mail server has special code/plug-ins/processes that can reformat the e-mail as a SMS and then forward it to a SMS gateway server that can pass it to the cellular provider's network for processing and delivery.
    Do you have such a mail server? Does it interface with a SMS Gateway (or similar) server?

  • Using linksys wag200g as an access point

    Hi, i just bought a smart TV and been wanting to set it up to stream videos from a media server. But since my wireless modem (DIR-615) is upstairs, the signal is quite weak and the video will skip sometimes during streaming; I happen to have an old WAG200G linksys modem and been wanting to use it as an access point. So now i have WAG200G, DIR615 and a router (HG850... is this a router?) So the DIR-615 is connected thru the router using the WAN port to LAN1 on the router and linksys is connrected to from LAN4 to LAN4 at the router. Linksys has a local ip of 192.168.0.5 and the modem has a local ip of 192.168.0.1; both of them has the same subnet mask (255.255.255.0) but when i connect my laptop to 'linksys' instead of 'home' wireless network, i dont have internet what am i doing wrong? Also does an access point creates 2 wireless network but both share the same internet? or it creates 1 shared wireless network with shared internet... networking is so confusing also if it helps, here's my backup cfg:
    WAG200G time_zone=GMT+0 2 time_daylight= restore_default=0 wan_ifname=nas0 wan_mode=pppoa wan_iptype=Dynamic wan_ipaddr= wan_netmask= wan_gateway= wan_mtu=1500 wan_fix_dns=0 wan_dns1= wan_dns2= wan_macaddr= wan_encap=0 pppoa_encap=1 wan_vpivci_detect=1 wan_vpi=8 wan_vci=35 wan_account= wan_domain= wan_dod=1 wan_qos=ubr wan_pcr= wan_scr= wan_cmtu=auto dsl_modulation=MMODE dhcp_dns0= dhcp_dns1= dhcp_dns2= dhcp_wins= lan_if=br0 lan_ipaddr=192.168.1.1 lan_netmask=255.255.255.0 lan_bipaddr=192.168.1.255 dhcp_server_enable=1 dhcp_server_ip= dhcp_start_ip=192.168.1.100 dhcp_end_ip=192.168.1.149 dhcp_reserved= dhcp_lease=0 http_username=admin http_password=admin http_timeout=5 rt_static_route= rt_rip_version=1 rt_rip_direction=0 rt_rip_recvflag=1 rt_rip_sendflag=1 ddns_enable=0 ddns_service_provider=dyndns ddns_user_name= ddns_password= ddns_host_name= tzo_user_name= tzo_password= tzo_host_name= ddns_use_wildcards=0 pppoe_username= pppoe_password= pppoe_idle=5 pppoe_service= pppoe_redial=30 pppoa_username= pppoa_password= pppoa_ipaddr= wifi_ssid=linksys wifi_region= wifi_channel=11 wifi_auth_type=3 wifi_psk_pwd= wifi_psk_lifetime=3600 wifi_key_len=0 wifi_def_key=1 wifi_key1= wifi_key2= wifi_key3= wifi_key4= wifi_access_control=0 wifi_access_type=1 wifi_access_list= wifi_if_on=1 wifi_broadcast_ssid=1 wifi_wep_on=0 wifi_dot11_mode=0 wifi_dot11_iso=0 wifi_rate=0 wifi_radius_port=1812 wifi_beacon_period=100 wifi_dtim_period=1 wifi_rts=2347 wifi_frag=2346 mail_enable=0 mail_logfull=0 mail_sendlog=2 mail_server= mail_recipient= mail_dos=1 mail_portscan=1 mail_block=1 mail_sh_day=0 mail_sh_hour=1 log_dos=1 log_block=1 log_login=1 log_gateway=1 log_type=0 log_remote_ip= fw_nat=1 fw_block=1 fw_access_policy= fw_block_service=dns:17:53-53ping:1:0-0http:6:80-80https:6:443-443ftp:6:21-21pop3:6:110-110imap:6:143-143smtp:6:25-25nntp:6:119-119telnet:6:23-23snmp:17:161-161tftp:17:69-69ike:17:500-500 fw_block_trust_enable=0 fw_block_trust= fw_services_def=Any(ALL):any:1-65535Any(TCP):tcp:1-65535Any(UDP):udp:1-65535AIM:tcp:5190-5190BGP:tcp:179-179BOOTP_CLIENT:udp:68-68BOOTP_SERVER:udp:67-67CU-SEEME:both:7648-24032DNS:both:53-53FINGER:tcp:79-79FTP:tcp:20-21H.323:tcp:1720-1720HTTP:tcp:80-80HTTPS:tcp:443-443IDENT:tcp:113-113IRC:both:6667-6667NEWS:tcp:144-144NFS:udp:2049-2049NNTP:tcp:119-119RCMD:tcp:512-512REAL-AUDIO:tcp:7070-7070REXEC:tcp:514-514RLOGIN:tcp:513-513RTELNET:tcp:107-107RTSP:both:554-554SFTP:tcp:115-115SMTP:tcp:25-25SNMP:both:161-161SNMP-TRAPS:both:162-162SQL-NET:tcp:1521-1521SSH:both:22-22STRMWORKS:udp:1558-1558TACACS:udp:49-49TELNET:tcp:23-23TFTP:udp:69-69VDOLIVE:tcp:7000-7000VPN-IPSEC:udp:500-500VPN-L2TP:udp:1701-1701VPN-PPTP:tcp:1723-1723 fw_services= fw_in_rules=s:1:0:HTTP:0:0:80:80s:2:0:FTP:0:0:21:21s:3:0:FTP-Data:0:0:20:20s:4:0:Telnet:0:0:23:23s:5:0MTP:0:0:25:25s:6:0:TFTP:0:1:69:69s:7:0:finger:0:0:79:79s:8:0:NTP:0:1:123:123s:9:0OP3:0:0:110:110s:10:0:NNTP:0:0:119:119s:11:0NMP:0:1:161:161s:12:0:CVS:0:0:2401:2401s:13:0MS:0:0:2701:2701s:14:0MS-rmctl:0:0:2702:2702 fw_out_rules= fw_dmz_enable=0 fw_dmz= fw_spi=1 fw_response_ping=0 fw_schedule=1111111:00:00-24:00 fw_time_zone=GMTb fw_remote=0 fw_remote_type= fw_remote_range_start= fw_remote_range_end= fw_remote_single= fw_remote_port=8080 ntp_custom=0 ntp_server= upnp_enable=1 upnp_adv_time=30 upnp_ttl=4 snmp_enable=0 snmp_read_community= snmp_set_community= snmp_sys_name= snmp_sys_contact= snmp_sys_location= snmp_trap_to= dhcpc_enable=1 ipsec_passthrough_enable=1 pppoe_passthrough_enable=1 pptp_passthrough_enable=1 l2tp_passthrough_enable=1 ping_size=60 ping_number=1 ping_interval=1000 ping_timeout=5000 fw_protection=1 fw_filter_proxy=0 fw_filter_cookies=0 fw_filter_java=0 fw_filter_activex=0 fw_block_wanrequest=1 log_enable=0 email_alert=0 dos_thresholds=20 smtp_mail_server= email_alert_addr= email_return_addr= qos_ds=disable qos_dslist=FTP:HHTTP:HTELNET:HSMTP:HPOP3:H0:L0:L0:L device_name=WAG200G lan_ifnames=br0 wlan0 language=1 igmp_proxy=1 wlan_mgr_enable=1 ipppoe_enable=0 timer_interval=3600 wifi_present=1 upnp_uuid_lan=8d401596-1dd2-11b2-a7d3-001ee59944a2 upnp_uuid_wancd=8d401597-1dd2-11b2-a7d3-001ee59944a2 upnp_uuid_wand=8d401596-1dd2-11b2-a7d4-001ee59944a2 upnp_uuid_igd=8d419c36-1dd2-11b2-a7d4-001ee59944a2 Û}\$

    woops that's an old cfg files, sry here's the new one:
    WAG200G time_zone=GMT+0 2 time_daylight=0 restore_default=0 wan_ifname=nas0 wan_mode=1483bridged wan_iptype=Fixed wan_ipaddr=192.168.0.5 wan_netmask=255.255.255.0 wan_gateway=192.168.0.5 wan_mtu=1500 wan_fix_dns=0 wan_dns1=192.168.0.5 wan_dns2= wan_macaddr= wan_encap=0 pppoa_encap=1 wan_vpivci_detect=1 wan_vpi=0 wan_vci=38 wan_account= wan_domain= wan_dod=0 wan_qos=ubr wan_pcr= wan_scr= wan_cmtu=auto dsl_modulation=MMODE dhcp_dns0= dhcp_dns1= dhcp_dns2= dhcp_wins= lan_if=br0 lan_ipaddr=192.168.0.5 lan_netmask=255.255.255.0 lan_bipaddr=192.168.0.255 dhcp_server_enable=0 dhcp_server_ip= dhcp_start_ip=192.168.0.100 dhcp_end_ip=192.168.0.149 dhcp_reserved= dhcp_lease=0 http_username=admin http_password=admin http_timeout=5 rt_static_route= rt_rip_version=1 rt_rip_direction=0 rt_rip_recvflag=1 rt_rip_sendflag=1 ddns_enable=0 ddns_service_provider=dyndns ddns_user_name= ddns_password= ddns_host_name= tzo_user_name= tzo_password= tzo_host_name= ddns_use_wildcards=0 pppoe_username= pppoe_password= pppoe_idle=5 pppoe_service= pppoe_redial=30 pppoa_username= pppoa_password= pppoa_ipaddr= wifi_ssid=linksys wifi_region= wifi_channel=11 wifi_auth_type=3 wifi_psk_pwd= wifi_psk_lifetime=3600 wifi_key_len=0 wifi_def_key=1 wifi_key1= wifi_key2= wifi_key3= wifi_key4= wifi_access_control=0 wifi_access_type=1 wifi_access_list= wifi_if_on=1 wifi_broadcast_ssid=1 wifi_wep_on=0 wifi_dot11_mode=0 wifi_dot11_iso=0 wifi_rate=0 wifi_radius_port=1812 wifi_beacon_period=100 wifi_dtim_period=1 wifi_rts=2347 wifi_frag=2346 mail_enable=0 mail_logfull=0 mail_sendlog=2 mail_server= mail_recipient= mail_dos=1 mail_portscan=1 mail_block=1 mail_sh_day=0 mail_sh_hour=1 log_dos=1 log_block=1 log_login=1 log_gateway=1 log_type=0 log_remote_ip= fw_nat=0 fw_block=1 fw_access_policy= fw_block_service=dns:17:53-53ping:1:0-0http:6:80-80https:6:443-443ftp:6:21-21pop3:6:110-110imap:6:143-143smtp:6:25-25nntp:6:119-119telnet:6:23-23snmp:17:161-161tftp:17:69-69ike:17:500-500 fw_block_trust_enable=0 fw_block_trust= fw_services_def=Any(ALL):any:1-65535Any(TCP):tcp:1-65535Any(UDP):udp:1-65535AIM:tcp:5190-5190BGP:tcp:179-179BOOTP_CLIENT:udp:68-68BOOTP_SERVER:udp:67-67CU-SEEME:both:7648-24032DNS:both:53-53FINGER:tcp:79-79FTP:tcp:20-21H.323:tcp:1720-1720HTTP:tcp:80-80HTTPS:tcp:443-443IDENT:tcp:113-113IRC:both:6667-6667NEWS:tcp:144-144NFS:udp:2049-2049NNTP:tcp:119-119RCMD:tcp:512-512REAL-AUDIO:tcp:7070-7070REXEC:tcp:514-514RLOGIN:tcp:513-513RTELNET:tcp:107-107RTSP:both:554-554SFTP:tcp:115-115SMTP:tcp:25-25SNMP:both:161-161SNMP-TRAPS:both:162-162SQL-NET:tcp:1521-1521SSH:both:22-22STRMWORKS:udp:1558-1558TACACS:udp:49-49TELNET:tcp:23-23TFTP:udp:69-69VDOLIVE:tcp:7000-7000VPN-IPSEC:udp:500-500VPN-L2TP:udp:1701-1701VPN-PPTP:tcp:1723-1723 fw_services= fw_in_rules=s:1:0:HTTP:0:0:80:80s:2:0:FTP:0:0:21:21s:3:0:FTP-Data:0:0:20:20s:4:0:Telnet:0:0:23:23s:5:0MTP:0:0:25:25s:6:0:TFTP:0:1:69:69s:7:0:finger:0:0:79:79s:8:0:NTP:0:1:123:123s:9:0OP3:0:0:110:110s:10:0:NNTP:0:0:119:119s:11:0NMP:0:1:161:161s:12:0:CVS:0:0:2401:2401s:13:0MS:0:0:2701:2701s:14:0MS-rmctl:0:0:2702:2702 fw_out_rules= fw_dmz_enable=0 fw_dmz= fw_spi=1 fw_response_ping=0 fw_schedule=1111111:00:00-24:00 fw_time_zone=GMTb fw_remote=0 fw_remote_type= fw_remote_range_start= fw_remote_range_end= fw_remote_single= fw_remote_port=8080 ntp_custom=0 ntp_server= upnp_enable=1 upnp_adv_time=30 upnp_ttl=4 snmp_enable=0 snmp_read_community= snmp_set_community= snmp_sys_name= snmp_sys_contact= snmp_sys_location= snmp_trap_to= dhcpc_enable=1 ipsec_passthrough_enable=1 pppoe_passthrough_enable=1 pptp_passthrough_enable=1 l2tp_passthrough_enable=1 ping_size=60 ping_number=1 ping_interval=1000 ping_timeout=5000 fw_protection=1 fw_filter_proxy=0 fw_filter_cookies=0 fw_filter_java=0 fw_filter_activex=0 fw_block_wanrequest=1 log_enable=0 email_alert=0 dos_thresholds=20 smtp_mail_server= email_alert_addr= email_return_addr= qos_ds=disable qos_dslist=FTP:HHTTP:HTELNET:HSMTP:HPOP3:H0:L0:L0:L device_name=WAG200G lan_ifnames=br0 wlan0 language=1 igmp_proxy=1 wlan_mgr_enable=1 ipppoe_enable=0 timer_interval=3600 wifi_present=1 upnp_uuid_lan=8ef91036-1dd2-11b2-8e20-001ee59944a2 upnp_uuid_wancd=8ef91037-1dd2-11b2-8e20-001ee59944a2 upnp_uuid_wand=8ef91036-1dd2-11b2-8e21-001ee59944a2 upnp_uuid_igd=8efa96d6-1dd2-11b2-8e21-001ee59944a2 °‡/7

  • [Solved] Automating btrfs scrub with systemd

    I have a single disk laptop (no RAID) and would like to have btrfs scrub run automatically on some interval and to be automatically emailed if any errors are found.  (My data is backed up online and I can attempt a manual fix.)  I'm trying to set this up with systemd and the btrfs tools.  Here's what I figure I need:
    A systemd service to run btrfs scrub on my entire filesystem.
    A systemd timer to schedule this job weekly.
    systemd services to pause and resume a running btrfs scrub when the machine suspends and wakes up.
    A script to run btrfs status when the previous service has finished, parse the output for the number of errors, and email me if the number is greater than 0.
    A systemd service to run that script when the scrub service has completed.
    What I have so far is below.  I'm sure there are problems with it all, and I'm especially uncertain about #5, since I don't know if the After attribute of one service waits until another has completed or just started.  If anyone could take a look and give me some pointers I'd appreciate it very much.  (The python script is a hack but I'm more concerned with the systemd at the moment, unless you see obvious problems or improvements you'd like to suggest.)
    Attempt at 1 and 2:
    /etc/systemd/system/btrfs_scrub.service
    [Unit]
    Description=Run btrfs scrub on filesystem
    [Service]
    Type=forking
    ExecStart=btrfs scrub start /home
    /etc/systemd/system/btrfs_scrub.timer
    [Unit]
    Description=Weekly btrfs scrub
    [Timer]
    OnCalendar=weekly
    Persistent=true
    [Install]
    WantedBy=timers.target
    Attempt at 3:
    /etc/systemd/system/btrfs_cancel.service
    [Unit]
    Description=Pause a running btrfs scrub on suspend
    Before=suspend.target
    [Service]
    Type=oneshot
    ExecStart=btrfs scrub cancel /home
    [Install]
    WantedBy=suspend.target
    /etc/systemd/system/btrfs_resume.service
    [Unit]
    Description=Resume a paused btrfs scrub after suspend
    After=suspend.target
    [Service]
    Type=oneshot
    ExecStart=btrfs scrub resume /home
    [Install]
    WantedBy=suspend.target
    Attempt at 4:
    /home/username/Code/Scripts/btrfs_results.py
    #Runs btrfs scrub and looks for an indication of errors found, upon
    #which an email is sent.
    import subprocess
    import smtplib
    from email.mime.text import MIMEText
    def email_alert():
    text = "btrfs scrub found errors"
    addr = 'myemail@address'
    username = 'myusername'
    password = 'mypassword'
    msg = MIMEText(text)
    msg['Subject'] = 'btrfs errors'
    msg['From'] = addr
    msg['To'] = addr
    server = smtplib.SMTP('smtp.gmail.com', '587')
    server.starttls()
    server.login(username,password)
    server.sendmail(addr, addr, msg.as_string())
    server.quit()
    print('email sent')
    def main():
    cmd = ['btrfs', 'scrub', 'status', '/home']
    output = subprocess.check_output(cmd)
    output_str = output.decode("utf-8")
    output_words = output_str.split(' ')
    for w in range(0, len(output_words)):
    if output_words[w].find('error') > -1:
    if int(output_words[w - 1]) > 0:
    email_alert()
    main()
    Attempt at 5:
    /etc/systemd/system/btrfs_results.service
    [Unit]
    Description=Parse output from btrfs scrub
    Requires=btrfs_scrub.service
    After=btrfs_scrub.service
    [Service]
    Type=oneshot
    ExecStart=/usr/bin/python /home/username/Code/Scripts/btrfs_results.py
    [Install]
    WantedBy=multi-user.target
    Last edited by 0112358 (2014-09-16 01:26:21)

    0112358 wrote:I have a single disk laptop (no RAID) and would like to have btrfs scrub run automatically on some interval and to be automatically emailed if any errors are found.  (My data is backed up online and I can attempt a manual fix.)  I'm trying to set this up with systemd and the btrfs tools.  Here's what I figure I need:
    0112358 wrote:
    A systemd service to run btrfs scrub on my entire filesystem.
    A systemd timer to schedule this job weekly.
    Should not be hard.
    0112358 wrote:systemd services to pause and resume a running btrfs scrub when the machine suspends and wakes up.
    This happens automatically with s2disk. Am I missing something?
    0112358 wrote:A script to run btrfs status when the previous service has finished, parse the output for the number of errors, and email me if the number is greater than 0.
    You might want to integrate that in the main btrfs scrub script, just after scrub is completed you will run this. Right?
    0112358 wrote:A systemd service to run that script when the scrub service has completed.
    0112358 wrote: What I have so far is below.  I'm sure there are problems with it all, and I'm especially uncertain about #5, since I don't know if the After attribute of one service waits until another has completed or just started.  If anyone could take a look and give me some pointers I'd appreciate it very much.  (The python script is a hack but I'm more concerned with the systemd at the moment, unless you see obvious problems or improvements you'd like to suggest.)
    0112358 wrote:
    Attempt at 1 and 2:
    /etc/systemd/system/btrfs_scrub.service
    [Unit]
    Description=Run btrfs scrub on filesystem
    [Service]
    Type=forking
    ExecStart=btrfs scrub start /home
    /etc/systemd/system/btrfs_scrub.timer
    [Unit]
    Description=Weekly btrfs scrub
    [Timer]
    OnCalendar=weekly
    Persistent=true
    [Install]
    WantedBy=timers.target
    Yes, why not wrap this in some sort of main bash (or python) script.
    0112358 wrote:
    Attempt at 3:
    /etc/systemd/system/btrfs_cancel.service
    [Unit]
    Description=Pause a running btrfs scrub on suspend
    Before=suspend.target
    [Service]
    Type=oneshot
    ExecStart=btrfs scrub cancel /home
    [Install]
    WantedBy=suspend.target
    /etc/systemd/system/btrfs_resume.service
    [Unit]
    Description=Resume a paused btrfs scrub after suspend
    After=suspend.target
    [Service]
    Type=oneshot
    ExecStart=btrfs scrub resume /home
    [Install]
    WantedBy=suspend.target
    Why not do nothing at all? Just let the fs continue after resume. Or is s2disk cancelling this process?
    0112358 wrote:
    Attempt at 4:
    /home/username/Code/Scripts/btrfs_results.py
    #Runs btrfs scrub and looks for an indication of errors found, upon
    #which an email is sent.
    import subprocess
    import smtplib
    from email.mime.text import MIMEText
    def email_alert():
    text = "btrfs scrub found errors"
    addr = 'myemail@address'
    username = 'myusername'
    password = 'mypassword'
    msg = MIMEText(text)
    msg['Subject'] = 'btrfs errors'
    msg['From'] = addr
    msg['To'] = addr
    server = smtplib.SMTP('smtp.gmail.com', '587')
    server.starttls()
    server.login(username,password)
    server.sendmail(addr, addr, msg.as_string())
    server.quit()
    print('email sent')
    def main():
    cmd = ['btrfs', 'scrub', 'status', '/home']
    output = subprocess.check_output(cmd)
    output_str = output.decode("utf-8")
    output_words = output_str.split(' ')
    for w in range(0, len(output_words)):
    if output_words[w].find('error') > -1:
    if int(output_words[w - 1]) > 0:
    email_alert()
    main()
    Ok
    0112358 wrote:
    Attempt at 5:
    /etc/systemd/system/btrfs_results.service
    [Unit]
    Description=Parse output from btrfs scrub
    Requires=btrfs_scrub.service
    After=btrfs_scrub.service
    [Service]
    Type=oneshot
    ExecStart=/usr/bin/python /home/username/Code/Scripts/btrfs_results.py
    [Install]
    WantedBy=multi-user.target
    Yeah, why not wrap 1,2,4 and 5 into one script/service. Why the fine granularity?

  • UTL_SMTP in 11g DB

    hi,
    I have a procedure for sending email from forms. The procedure is created in pl/sql.
    It is working in 9i. but due to the new security in 11g the procedure in not working.
    SEND_MAIL('sender email','recpientemail','header','message');
    I am getting error ORA-24247.
    I have checked in oracle site and found an article about this error code.
    http://www.oracle.com/technology/pub/articles/oracle-database-11g-top-features/11g-security.html
    i created the following :
    begin
    dbms_network_acl_admin.create_acl (
    acl => 'utlpkg.xml',
    description => 'Normal Access',
    principal => 'CONNECT',
    is_grant => TRUE,
    privilege => 'connect',
    start_date => null,
    end_date => null
    end;
    Begin
    dbms_network_acl_admin.add_privilege (
    acl => 'utlpkg.xml',
    principal => 'myuserid',
    is_grant => TRUE,
    privilege => 'connect',
    start_date => null,
    end_date => null);
    End;
    begin
    dbms_network_acl_admin.assign_acl (
    acl => 'utlpkg.xml',
    host => 'mail.eim.ae',
    lower_port => 22,
    upper_port => 55);
    end;
    but still not working and where is in the above code saying about UTL_SMTP.

    hi
    Install UTL_MAIL:
    # SQLPLUS SYS AS SYSDBA
    SQL> @$ORACLE_HOME/rdbms/admin/utlmail.sql
    SQL> @$ORACLE_HOME/rdbms/admin/prvtmail.plb
    You define the SMTP_OUT_SERVER parameter in the init.ora rdbms initialization file. However, if SMTP_OUT_SERVER is not defined, this invokes a default of DB_DOMAIN which is guaranteed to be defined to perform appropriately.
    Ensure that you are connected as SYS using the SYSDBA privilege, and then grant the following privileges to the Database Vault Owner account.
    For example:
    CONNECT SYS/AS SYSDBA
    Enter password: password
    GRANT CREATE PROCEDURE, DROP ANY PROCEDURE TO dbvowner;
    GRANT EXECUTE ON UTL_TCP TO dbvowner;
    GRANT EXECUTE ON UTL_SMTP TO dbvowner;
    GRANT EXECUTE ON UTL_MAIL TO dbvowner;
    GRANT EXECUTE ON DBMS_NETWORK_ACL_ADMIN TO dbvowner;
    The UTL_TCP, UTL_SMTP, UTL_MAIL, and DBMS_NETWORK_ACL_ADMIN PL/SQL packages are used by the e-mail security alert that you will create.
    Connect to SQL*Plus as the Oracle Database Owner (DV_OWNER) account.
    For example:
    CONNECT dbvowner
    Enter password: password
    Create the following procedure:
    CREATE OR REPLACE PROCEDURE email_alert AS
    msg varchar2(20000) := ‘Realm violation occurred for the ALTER TABLE Command Security Policy rule set. The time is: ‘;
    BEGIN
    msg := msg||to_char(SYSDATE, ‘Day DD MON, YYYY HH24:MI:SS’);
    UTL_MAIL.SEND (
    sender => ‘[email protected]’,
    recipients => ‘[email protected]’,
    subject => ‘Table modification attempted outside maintenance!’,
    message => msg);
    END email_alert;
    Replace [email protected] with your e-mail address, and [email protected] with the e-mail address of the person you want to receive the notificationsarah

Maybe you are looking for

  • Jabber For Windows - Available Status on Hibernation

    We're running Jabber for Windows 9.1.1 ansd see an issue which I think is casued by hiberantion. A laptop user will be at their pc and and Available, then on leaving their desk, they would typically just close their pc lid, hibernating the pc,  and l

  • SDE_ORAR1213_Adaptor.SDE_ORA_GLBalanceFact_Full

    Dears, when im trying run full load in finance analysts via dac, im getting error, Log file for your reference. DIRECTOR> VAR_27028 Use override value [DataWarehouse] for session parameter:[$DBConnection_OLAP]. DIRECTOR> VAR_27028 Use override value

  • Has anyone managed to upload an app since 1 Feb 2014?

    Hi all I am trying to upload an app to the istore but keep getting the error: *ERROR ITMS-9000: "This bundle is invalid. New apps and app updates submitted to the istore must be built with Xcode 5 and iOS 7 SDK" I have changed 4 values in the info.pl

  • How Can i get the URL of a page

    How Can i get the URL of a page . like in ASP the Request.QueryString() ... Thanks

  • Alternative to outlook

    My trial subscription to outlook has ended, but my iphone only seems able to sync with Outlook. Surely Apple have an alternative or can anyone suggest one? I can't bear to pay a fortune to Microsoft just for their Outlook calendar app. Or can my Mobi