Join the community today
Register Now

Sysadmin Pushover setup

Discussion in 'System Administration' started by dooma, Oct 22, 2016.

  1. dooma

    dooma Member

    226
    22
    18
    Oct 15, 2016
    Cairo
    Ratings:
    +27
    Local Time:
    9:51 AM
    Hello,

    I'm asking about installing pushover to get notifications on my iphone. Which app should I choose from here, and how can that be insatlled with centminmod ?

    Thanks
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,196
    6,789
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,144
    Local Time:
    5:51 PM
    Nginx 1.13.x
    MariaDB 5.5
    no apps needed, log into pushover.net and find your pushover @pomail.net email. Use that for email notifications where applicable.
     
  3. dooma

    dooma Member

    226
    22
    18
    Oct 15, 2016
    Cairo
    Ratings:
    +27
    Local Time:
    9:51 AM
    Where can that email added and how can I connect it with my server ?

    Thanks alot
     
  4. Matt

    Matt Moderator Staff Member

    691
    319
    63
    May 25, 2014
    Sheffield, UK
    Ratings:
    +444
    Local Time:
    8:51 AM
    1.7.1
    MariaDB 10
    Add the address to any systems which send a notification out (such as the root forwarder in centos), and then all mails received at the address will be pushed to your device.
     
    • Informative Informative x 1
  5. eva2000

    eva2000 Administrator Staff Member

    30,196
    6,789
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,144
    Local Time:
    5:51 PM
    Nginx 1.13.x
    MariaDB 5.5
    maybe the root forwarder might be too verbose/frequent for pushover ?

    i use pushover.net email for stuff like
    so whereever you have software or scripts you install that allow email notifications, you can choose to use pushover email instead or email
     
  6. dooma

    dooma Member

    226
    22
    18
    Oct 15, 2016
    Cairo
    Ratings:
    +27
    Local Time:
    9:51 AM
    Hi,

    I already installed it successfully and I got an update yesterday at my iphone notifications with some blocked IPs. But while installing the cron, I didn't understand this point " For CentOS 7, using sed replacements to enable yum-cron settings. This sets daily updates for full yum upgrades and hourly to security only updates."

    Thanks
     
  7. eva2000

    eva2000 Administrator Staff Member

    30,196
    6,789
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,144
    Local Time:
    5:51 PM
    Nginx 1.13.x
    MariaDB 5.5
    you edit the 1st variable for EMAIL=yourpushoveremailaddress and then type in ssh all these below commands commands or copy and paste
    Code (Text):
     
    EMAIL=your@email.com
    sed -i "s|^email_to = root|email_to = ${EMAIL}|" /etc/yum/yum-cron.conf
    sed -i 's|^update_messages = no|update_messages = yes|' /etc/yum/yum-cron.conf
    sed -i 's|^download_updates = no|download_updates = yes|' /etc/yum/yum-cron.conf
    sed -i 's|^apply_updates = no|apply_updates = yes|' /etc/yum/yum-cron.conf
    sed -i 's|^emit_via = stdio|emit_via = email|' /etc/yum/yum-cron.conf
    sed -i "s|^email_to = root|email_to = ${EMAIL}|" /etc/yum/yum-cron-hourly.conf
    sed -i 's|^update_cmd = default|update_cmd = security|' /etc/yum/yum-cron-hourly.conf
    sed -i 's|^update_messages = no|update_messages = yes|' /etc/yum/yum-cron-hourly.conf
    sed -i 's|^download_updates = no|download_updates = yes|' /etc/yum/yum-cron-hourly.conf
    sed -i 's|^apply_updates = no|apply_updates = yes|' /etc/yum/yum-cron-hourly.conf
    sed -i 's|^emit_via = stdio|emit_via = email|' /etc/yum/yum-cron-hourly.conf
    egrep '^email_to|^update_messages|^download_updates|^apply_updates|^emit_via' /etc/yum/yum-cron.conf
    egrep '^email_to|^update_cmd|^update_messages|^download_updates|^apply_updates|^emit_via' /etc/yum/yum-cron-hourly.conf
    service yum-cron restart
    

    sed replacement is just matching one set of text and replacing with other

    so this would replace first instance of text beginning with ABC (^ begins with) with XYZ in /path/to/filename.conf
    Code (Text):
    sed -i 's|^ABC|XYZ|' /path/to/filename.conf


    You could manually edit /etc/yum/yum-cron.conf and /etc/yum/yum-cron-hourly.conf instead of sed edits if you want

    i.e.
    Code (Text):
    sed -i 's|^update_messages = no|update_messages = yes|' /etc/yum/yum-cron.conf

    replace

    update_messages = no

    with

    update_messages = yes
     
    • Informative Informative x 1
  8. dooma

    dooma Member

    226
    22
    18
    Oct 15, 2016
    Cairo
    Ratings:
    +27
    Local Time:
    9:51 AM
    It's done, I got many blocked IPs notifications at my mobile and only 1 update notification. Is that normal?, do you suggest any other security ?
     
  9. eva2000

    eva2000 Administrator Staff Member

    30,196
    6,789
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,144
    Local Time:
    5:51 PM
    Nginx 1.13.x
    MariaDB 5.5
    Yeah that's why i suggest not to use push email notification for root forwarder or csf /etc/csf/csf.conf configured email to/from alerts and use regular email for that and leave push notifications for stuff like maldet, yum-cron etc
     
  10. dooma

    dooma Member

    226
    22
    18
    Oct 15, 2016
    Cairo
    Ratings:
    +27
    Local Time:
    9:51 AM
    should I leave filename.conf or rename it ?, which one do you recommend sed replacements or manually edit /etc/yum/yum-cron.conf ? or can I do both ?

    How can I install Matt script ? here ?

    Thanks a lot :)
     
  11. eva2000

    eva2000 Administrator Staff Member

    30,196
    6,789
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,144
    Local Time:
    5:51 PM
    Nginx 1.13.x
    MariaDB 5.5
    No no filename.conf is just an example of how sed works

    you edit the 1st variable below for EMAIL=yourpushoveremailaddress and then type in ssh all these below commands commands or copy and paste
    Code (Text):
    EMAIL=your@email.com
    sed -i "s|^email_to = root|email_to = ${EMAIL}|" /etc/yum/yum-cron.conf
    sed -i 's|^update_messages = no|update_messages = yes|' /etc/yum/yum-cron.conf
    sed -i 's|^download_updates = no|download_updates = yes|' /etc/yum/yum-cron.conf
    sed -i 's|^apply_updates = no|apply_updates = yes|' /etc/yum/yum-cron.conf
    sed -i 's|^emit_via = stdio|emit_via = email|' /etc/yum/yum-cron.conf
    sed -i "s|^email_to = root|email_to = ${EMAIL}|" /etc/yum/yum-cron-hourly.conf
    sed -i 's|^update_cmd = default|update_cmd = security|' /etc/yum/yum-cron-hourly.conf
    sed -i 's|^update_messages = no|update_messages = yes|' /etc/yum/yum-cron-hourly.conf
    sed -i 's|^download_updates = no|download_updates = yes|' /etc/yum/yum-cron-hourly.conf
    sed -i 's|^apply_updates = no|apply_updates = yes|' /etc/yum/yum-cron-hourly.conf
    sed -i 's|^emit_via = stdio|emit_via = email|' /etc/yum/yum-cron-hourly.conf
    egrep '^email_to|^update_messages|^download_updates|^apply_updates|^emit_via' /etc/yum/yum-cron.conf
    egrep '^email_to|^update_cmd|^update_messages|^download_updates|^apply_updates|^emit_via' /etc/yum/yum-cron-hourly.conf
    service yum-cron restart
    


    might want to ask in that thread Pushover | Centmin Mod Community
     
  12. dooma

    dooma Member

    226
    22
    18
    Oct 15, 2016
    Cairo
    Ratings:
    +27
    Local Time:
    9:51 AM
    I installed pushover and I added my pushover email on my server but I'm not getting any yum-cron updates notifications ?!
     
  13. eva2000

    eva2000 Administrator Staff Member

    30,196
    6,789
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,144
    Local Time:
    5:51 PM
    Nginx 1.13.x
    MariaDB 5.5
    have you tested if pushover email works itself ? has there been any yum updates to notify for ?
     
  14. dooma

    dooma Member

    226
    22
    18
    Oct 15, 2016
    Cairo
    Ratings:
    +27
    Local Time:
    9:51 AM
    yes, it's working.
    how can I check that ?
     
  15. eva2000

    eva2000 Administrator Staff Member

    30,196
    6,789
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,144
    Local Time:
    5:51 PM
    Nginx 1.13.x
    MariaDB 5.5
    Code (Text):
    yum list updates
     
  16. dooma

    dooma Member

    226
    22
    18
    Oct 15, 2016
    Cairo
    Ratings:
    +27
    Local Time:
    9:51 AM
    output is !
    Code (Text):
    yum list updates
    Loaded plugins: fastestmirror, priorities
    Loading mirror speeds from cached hostfile
     * base: mirror.cc.columbia.edu
     * epel: mirror.math.princeton.edu
     * extras: linux.cc.lehigh.edu
     * rpmforge: mirror.us.leaseweb.net
     * updates: mirror.clarkson.edu
    224 packages excluded due to repository priority protections
    
     
  17. eva2000

    eva2000 Administrator Staff Member

    30,196
    6,789
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,144
    Local Time:
    5:51 PM
    Nginx 1.13.x
    MariaDB 5.5
    Yeah no updates available