Want more timely Centmin Mod News Updates?
Become a Member

Sysadmin Pushover

Discussion in 'System Administration' started by Matt, May 30, 2014.

  1. pamamolf

    pamamolf Premium Member Premium Member

    3,807
    369
    83
    May 31, 2014
    Ratings:
    +711
    Local Time:
    11:04 AM
    Nginx-1.17.x
    MariaDB 10.3.x
    Ok i did it but what option i must select on pushover?

    Script?

    [​IMG]

    Thanks :)
     
  2. pamamolf

    pamamolf Premium Member Premium Member

    3,807
    369
    83
    May 31, 2014
    Ratings:
    +711
    Local Time:
    11:04 AM
    Nginx-1.17.x
    MariaDB 10.3.x
    Come on as you did it already Matt and George you know what i must select here :)
     
  3. eva2000

    eva2000 Administrator Staff Member

    44,424
    10,144
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,693
    Local Time:
    6:04 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Only just saw your post now ;)

    I used website because I am using the same pushover API application I have setup for the forums (future premium user feature ;) )

    You can use script I suppose
     
  4. pamamolf

    pamamolf Premium Member Premium Member

    3,807
    369
    83
    May 31, 2014
    Ratings:
    +711
    Local Time:
    11:04 AM
    Nginx-1.17.x
    MariaDB 10.3.x
    Do you think that code will work on Ubuntu also?
     
  5. eva2000

    eva2000 Administrator Staff Member

    44,424
    10,144
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,693
    Local Time:
    6:04 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    should although paths to service and php-fpm files would be different to CentOS
     
  6. Matt

    Matt Moderator Staff Member

    858
    387
    63
    May 25, 2014
    Rotherham, UK
    Ratings:
    +603
    Local Time:
    9:04 AM
    1.5.15
    MariaDB 10.2
    Only just seen these replies.

    Running the script each minute will case basically zero over head, as it's a small for loop going a ps, 2 greps and a wc.

    As for setting up the Type in Pushover, mine is set up as a website, because it's working on my forum, but the bash script still works through it.
     
  7. eva2000

    eva2000 Administrator Staff Member

    44,424
    10,144
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,693
    Local Time:
    6:04 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Yeah there's a 7,500 free message limit per API application https://pushover.net/faq#overview-limits so you could technically have a separate API application for each task i.e. one for forums, and each individual bash script. Or is there a limit to how many API applications you can create ? Don't see any mention in their FAQ ?
     
  8. pamamolf

    pamamolf Premium Member Premium Member

    3,807
    369
    83
    May 31, 2014
    Ratings:
    +711
    Local Time:
    11:04 AM
    Nginx-1.17.x
    MariaDB 10.3.x
    In a few weeks you will not need to buy the iOA /Android app as it will be free and you will need to buy a license from the site ....

    At least for me that i do not use any credit card that is much better as i can use Paypal :)
     
  9. eva2000

    eva2000 Administrator Staff Member

    44,424
    10,144
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,693
    Local Time:
    6:04 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    where did you get that info from ?
     
  10. pamamolf

    pamamolf Premium Member Premium Member

    3,807
    369
    83
    May 31, 2014
    Ratings:
    +711
    Local Time:
    11:04 AM
    Nginx-1.17.x
    MariaDB 10.3.x
    This is a reply on my mail to them as i want to try this service but i was not able to buy it from itunes (no credit card) and the gift cards in my country starting from about 20$ and as i never buy from itunes i don't want to use it for 5$ :)

    So i will wait on July to test it and buy a license using Paypal :)
     
  11. eva2000

    eva2000 Administrator Staff Member

    44,424
    10,144
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,693
    Local Time:
    6:04 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Ah I see.. no wonder couldn't find any info from their site :)
     
  12. pamamolf

    pamamolf Premium Member Premium Member

    3,807
    369
    83
    May 31, 2014
    Ratings:
    +711
    Local Time:
    11:04 AM
    Nginx-1.17.x
    MariaDB 10.3.x
    It will be great if that script can convert it to just email if they are down :)
     
  13. dooma

    dooma Active Member

    303
    31
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +44
    Local Time:
    10:04 AM
    How can I install Matt script on my server ?, I didn't understand

    Thanks :)
     
  14. eva2000

    eva2000 Administrator Staff Member

    44,424
    10,144
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,693
    Local Time:
    6:04 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    put the bash script code into a file ending in .sh extension i.e. i usually put my scripts in custom created directory at /root/tools

    so /root/tools/pushover-script.sh and then make script executable
    Code (Text):
    chmod +x /root/tools/pushover-script.sh
    

    then using crontab -e launch nano linux text editor and add a cronjob for the script

    nano which you can read up more about nano here and here. For vim text editor read here and here.

    Also there's numerous online how to use guides for nano and vim you can search for via google :)
     
  15. dooma

    dooma Active Member

    303
    31
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +44
    Local Time:
    10:04 AM
    Hello,
    Thanks for your answer.

    so 1- I will put my process list at this file /root/scripts/process_list.txt
    2-Create the bash script as you said.

    what should I put at the crontab -e :) ?

    where can I put my pushover email ?

    Thanks a lot
     
  16. eva2000

    eva2000 Administrator Staff Member

    44,424
    10,144
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,693
    Local Time:
    6:04 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
  17. dooma

    dooma Active Member

    303
    31
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +44
    Local Time:
    10:04 AM
    Thanks a lot, should I create an application/plugin at my pushover.com account ?

    Thanks :)
     
  18. eva2000

    eva2000 Administrator Staff Member

    44,424
    10,144
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,693
    Local Time:
    6:04 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    yup
     
  19. dooma

    dooma Active Member

    303
    31
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +44
    Local Time:
    10:04 AM
    Hi @eva2000 , I'm trying to create the process list using vi and nano editors but server refused to save this file, how can I solve that please ?. I have created the script .sh first. May that issue ?

    Thanks
     
  20. eva2000

    eva2000 Administrator Staff Member

    44,424
    10,144
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,693
    Local Time:
    6:04 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    what error does it report ? depending where you save the file/script, would need to be root user