Overclock.net › Forums › Specialty Builds › Servers › Ping Monitor Software?
New Posts  All Forums:Forum Nav:

Ping Monitor Software? - Page 2

post #11 of 14
Quote:
Originally Posted by tycoonbob View Post

In other words, what I have is very rough, but it gets the job done.
Thanks for this; I will look into in here soon. How do I initially start the script, if it runs automatically every 10 seconds? What would I need to do to call the script at system boot?

Are you running linux or windows? You start it manually like you would any other python script:
Code:
python up.py
Project Arch
(16 items)
 
BigByte
(8 items)
 
Macbook Pro
(8 items)
 
CPUMotherboardGraphicsRAM
Intel i7 5960x @ 4.8ghz Asus X99-E WS 2 x Nvidia Quadro K6000 Corsair Dominator Platinum 64gb 2666 
Hard DriveCoolingOSMonitor
2 x Samsung 850 Pro 512gb {RAID 0} Swiftech H320 w/ Noctua NF-F12 iPPC Arch Linux w/ OpenBox 2 x LG 31MU97 Cinema 4K 
KeyboardPowerCaseMouse
Vortex KBC Poker II PBT EVGA SuperNOVA 1000 G2 Corsair Obsidian 450D Zowie FK1 
Mouse PadAudioAudioOther
Steelseries QCK+ Beyerdynamic DT 770 Pro 80Ω Audioengine D1 Intel X540-T2 NIC 
CPUMotherboardRAMHard Drive
Intel Avoton C2750 Octa-Core ASRock C2750D4I Samsung 64gb ECC 1600mhz 8 x Samsung 850 Pro 1TB 
OSPowerCaseOther
FreeNAS SilverStone ST45SF-G 450w SilverStone DS380 Intel X540-T2 NIC 
CPUGraphicsGraphicsRAM
Intel i7-4960HQ Intel Iris 5200 Pro NVIDIA GT 750M 2gb 16gb (2x8gb) 1600mhz 
Hard DriveMonitorMouseMouse Pad
1tb PCIe SSD 15.4" {2880x1800} IPS SteelSeries Sensei [RAW] SteelSeries QcK Mini 
  hide details  
Reply
Project Arch
(16 items)
 
BigByte
(8 items)
 
Macbook Pro
(8 items)
 
CPUMotherboardGraphicsRAM
Intel i7 5960x @ 4.8ghz Asus X99-E WS 2 x Nvidia Quadro K6000 Corsair Dominator Platinum 64gb 2666 
Hard DriveCoolingOSMonitor
2 x Samsung 850 Pro 512gb {RAID 0} Swiftech H320 w/ Noctua NF-F12 iPPC Arch Linux w/ OpenBox 2 x LG 31MU97 Cinema 4K 
KeyboardPowerCaseMouse
Vortex KBC Poker II PBT EVGA SuperNOVA 1000 G2 Corsair Obsidian 450D Zowie FK1 
Mouse PadAudioAudioOther
Steelseries QCK+ Beyerdynamic DT 770 Pro 80Ω Audioengine D1 Intel X540-T2 NIC 
CPUMotherboardRAMHard Drive
Intel Avoton C2750 Octa-Core ASRock C2750D4I Samsung 64gb ECC 1600mhz 8 x Samsung 850 Pro 1TB 
OSPowerCaseOther
FreeNAS SilverStone ST45SF-G 450w SilverStone DS380 Intel X540-T2 NIC 
CPUGraphicsGraphicsRAM
Intel i7-4960HQ Intel Iris 5200 Pro NVIDIA GT 750M 2gb 16gb (2x8gb) 1600mhz 
Hard DriveMonitorMouseMouse Pad
1tb PCIe SSD 15.4" {2880x1800} IPS SteelSeries Sensei [RAW] SteelSeries QcK Mini 
  hide details  
Reply
post #12 of 14
Thread Starter 
Quote:
Originally Posted by DizZz View Post

Are you running linux or windows? You start it manually like you would any other python script:
Code:
python up.py

CentOS.

Starting it manually is fine, but I'd much prefer an automated method to start the script when the server starts up, in the event my VPS provider causes an outage, for example (rare, but it happens). Calling it from /etc/rc.local should work, yes?
Quote:
Originally Posted by SamKook View Post

All you need to do to avoid that is have a variable that you change the value of when you send the email and then change back when 3 pings are ok and add a check to it before sending the email.

Yeah, I figured it wasn't hard, but my bash-fu is weak.
post #13 of 14
Quote:
Originally Posted by tycoonbob View Post

Currently, It does 3 pings every 1 minute. If I'm not mistaken, it looks for 0/3 response before saying it's down, meaning if 1 packet was lost but 2 were successful, it would NOT fire off the email. Is that correct, using the logic in the last script I posted above? What I don't like about what I currently have is if my network is down, it's going to fire off that email once a minute, every minute until it's back up.

"ping -c 3" runs ping 3 times with 1 second interval and then exits.

You want to loop the call of ping and checking return codes
Once again...
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 920 [4.28GHz, HT] Asus P6T + Broadcom NetXtreme II VisionTek HD5850 [900/1200] + Galaxy GT240 2x4GB G.Skill Ripjaw X [1632 MHz] 
Hard DriveOSMonitorKeyboard
Intel X25-M 160GB + 3xRAID0 500GB 7200.12 Window 7 Pro 64 Acer H243H + Samsung 226BW XARMOR-U9BL  
PowerCaseMouseMouse Pad
Antec Truepower New 750W Li Lian PC-V2100 [10x120mm fans] Logitech G9 X-Trac Pro 
  hide details  
Reply
Once again...
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 920 [4.28GHz, HT] Asus P6T + Broadcom NetXtreme II VisionTek HD5850 [900/1200] + Galaxy GT240 2x4GB G.Skill Ripjaw X [1632 MHz] 
Hard DriveOSMonitorKeyboard
Intel X25-M 160GB + 3xRAID0 500GB 7200.12 Window 7 Pro 64 Acer H243H + Samsung 226BW XARMOR-U9BL  
PowerCaseMouseMouse Pad
Antec Truepower New 750W Li Lian PC-V2100 [10x120mm fans] Logitech G9 X-Trac Pro 
  hide details  
Reply
post #14 of 14
Quote:
Originally Posted by tycoonbob View Post

CentOS.

Starting it manually is fine, but I'd much prefer an automated method to start the script when the server starts up, in the event my VPS provider causes an outage, for example (rare, but it happens). Calling it from /etc/rc.local should work, yes?

Yes that is what I would do. If you just want the process to start and that's it, putting the command below, into the /etc/rc.local will make it run on boot. Make sure you set the permissions for the script and rc.local to 755.
Code:
sudo python up.py &
Project Arch
(16 items)
 
BigByte
(8 items)
 
Macbook Pro
(8 items)
 
CPUMotherboardGraphicsRAM
Intel i7 5960x @ 4.8ghz Asus X99-E WS 2 x Nvidia Quadro K6000 Corsair Dominator Platinum 64gb 2666 
Hard DriveCoolingOSMonitor
2 x Samsung 850 Pro 512gb {RAID 0} Swiftech H320 w/ Noctua NF-F12 iPPC Arch Linux w/ OpenBox 2 x LG 31MU97 Cinema 4K 
KeyboardPowerCaseMouse
Vortex KBC Poker II PBT EVGA SuperNOVA 1000 G2 Corsair Obsidian 450D Zowie FK1 
Mouse PadAudioAudioOther
Steelseries QCK+ Beyerdynamic DT 770 Pro 80Ω Audioengine D1 Intel X540-T2 NIC 
CPUMotherboardRAMHard Drive
Intel Avoton C2750 Octa-Core ASRock C2750D4I Samsung 64gb ECC 1600mhz 8 x Samsung 850 Pro 1TB 
OSPowerCaseOther
FreeNAS SilverStone ST45SF-G 450w SilverStone DS380 Intel X540-T2 NIC 
CPUGraphicsGraphicsRAM
Intel i7-4960HQ Intel Iris 5200 Pro NVIDIA GT 750M 2gb 16gb (2x8gb) 1600mhz 
Hard DriveMonitorMouseMouse Pad
1tb PCIe SSD 15.4" {2880x1800} IPS SteelSeries Sensei [RAW] SteelSeries QcK Mini 
  hide details  
Reply
Project Arch
(16 items)
 
BigByte
(8 items)
 
Macbook Pro
(8 items)
 
CPUMotherboardGraphicsRAM
Intel i7 5960x @ 4.8ghz Asus X99-E WS 2 x Nvidia Quadro K6000 Corsair Dominator Platinum 64gb 2666 
Hard DriveCoolingOSMonitor
2 x Samsung 850 Pro 512gb {RAID 0} Swiftech H320 w/ Noctua NF-F12 iPPC Arch Linux w/ OpenBox 2 x LG 31MU97 Cinema 4K 
KeyboardPowerCaseMouse
Vortex KBC Poker II PBT EVGA SuperNOVA 1000 G2 Corsair Obsidian 450D Zowie FK1 
Mouse PadAudioAudioOther
Steelseries QCK+ Beyerdynamic DT 770 Pro 80Ω Audioengine D1 Intel X540-T2 NIC 
CPUMotherboardRAMHard Drive
Intel Avoton C2750 Octa-Core ASRock C2750D4I Samsung 64gb ECC 1600mhz 8 x Samsung 850 Pro 1TB 
OSPowerCaseOther
FreeNAS SilverStone ST45SF-G 450w SilverStone DS380 Intel X540-T2 NIC 
CPUGraphicsGraphicsRAM
Intel i7-4960HQ Intel Iris 5200 Pro NVIDIA GT 750M 2gb 16gb (2x8gb) 1600mhz 
Hard DriveMonitorMouseMouse Pad
1tb PCIe SSD 15.4" {2880x1800} IPS SteelSeries Sensei [RAW] SteelSeries QcK Mini 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Servers
Overclock.net › Forums › Specialty Builds › Servers › Ping Monitor Software?