Join the community today
Register Now

Sysadmin Pushover setup

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

  1. dooma

    dooma Active Member

    326
    34
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +49
    Local Time:
    10:58 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

    54,860
    12,239
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,810
    Local Time:
    6:58 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    no apps needed, log into pushover.net and find your pushover @pomail.net email. Use that for email notifications where applicable.
     
  3. dooma

    dooma Active Member

    326
    34
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +49
    Local Time:
    10:58 AM
    Where can that email added and how can I connect it with my server ?

    Thanks alot
     
  4. Matt

    Matt Well-Known Member

    932
    415
    63
    May 25, 2014
    Rotherham, UK
    Ratings:
    +671
    Local Time:
    8:58 AM
    1.5.15
    MariaDB 10.2
    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.
     
  5. eva2000

    eva2000 Administrator Staff Member

    54,860
    12,239
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,810
    Local Time:
    6:58 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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 Active Member

    326
    34
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +49
    Local Time:
    10:58 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

    54,860
    12,239
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,810
    Local Time:
    6:58 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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
     
  8. dooma

    dooma Active Member

    326
    34
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +49
    Local Time:
    10:58 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

    54,860
    12,239
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,810
    Local Time:
    6:58 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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 Active Member

    326
    34
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +49
    Local Time:
    10:58 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

    54,860
    12,239
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,810
    Local Time:
    6:58 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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 Active Member

    326
    34
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +49
    Local Time:
    10:58 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

    54,860
    12,239
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,810
    Local Time:
    6:58 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    have you tested if pushover email works itself ? has there been any yum updates to notify for ?
     
  14. dooma

    dooma Active Member

    326
    34
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +49
    Local Time:
    10:58 AM
    yes, it's working.
    how can I check that ?
     
  15. eva2000

    eva2000 Administrator Staff Member

    54,860
    12,239
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,810
    Local Time:
    6:58 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Code (Text):
    yum list updates
     
  16. dooma

    dooma Active Member

    326
    34
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +49
    Local Time:
    10:58 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

    54,860
    12,239
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,810
    Local Time:
    6:58 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Yeah no updates available