Network-monitor-in-10-minutes-with-splunk

From Datateknik
(Difference between revisions)
Jump to: navigation, search
(Skapa skriptet)
(Skapa skriptet)
Line 15: Line 15:
 
    
 
    
 
  echo Pinging
 
  echo Pinging
  external hosts for testing, run in background
+
  #external hosts for testing, run in background
 
  # BYT IP-NUMMER NEDAN, ANNARS DÖDAR NI MIN SERVER !!!!
 
  # BYT IP-NUMMER NEDAN, ANNARS DÖDAR NI MIN SERVER !!!!
 
  ping 193.10.236.123 > /var/log/ping-targets/srv1-logs.txt &
 
  ping 193.10.236.123 > /var/log/ping-targets/srv1-logs.txt &
 
  ping 8.8.8.8 > /var/log/ping-targets/googledns-logs.txt &
 
  ping 8.8.8.8 > /var/log/ping-targets/googledns-logs.txt &
 
   
 
   
  echo Process List of PING process ID (PIDs)
+
  echo Process List of PING process ID     PIDs
 
  pgrep -l ping
 
  pgrep -l ping
 
    
 
    

Revision as of 14:29, 5 May 2017

  • SNÄLLA*

Logga in med vanliga skill-bokningslösenordet och fixa fel/lägg till det som saknas /Robert

Skapa kataloger

su -
mkdir /var/log/ping-targets
cd /var/log/ping-targets

Skapa skriptet

  • nano monitor.sh
#!/bin/bash

echo Killing Existing Pings
pkill ping
 
echo Pinging
#external hosts for testing, run in background
# BYT IP-NUMMER NEDAN, ANNARS DÖDAR NI MIN SERVER !!!!
ping 193.10.236.123 > /var/log/ping-targets/srv1-logs.txt &
ping 8.8.8.8 > /var/log/ping-targets/googledns-logs.txt &

echo Process List of PING process ID     PIDs
pgrep -l ping
 
ls -l
chmod +x monitor.sh
ls -l

asd

Personal tools
Namespaces

Variants
Actions
Navigation
Tools