File: EXAMPLES

package info (click to toggle)
pbnj 2.04-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 640 kB
  • ctags: 309
  • sloc: perl: 4,838; xml: 748; sh: 109; makefile: 37
file content (40 lines) | stat: -rw-r--r-- 941 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
SINGLE SCAN

Scan Localhost
    
    sudo ./scanpbnj 127.0.0.1

Mail latest changes in csv format to user bill

    sudo ./outputpbnj -q latestinfo -t csv |mail -s "PBNJ Latest Info" bill

AUTOMATED SCANS WITH CRONJOBS

Copy the following into your /etc/crontab

    # scan of 10 net every 2 hours and email the latest changes to root
    16 */2 * * * root /root/bin/scan

    # monthly report of class c and email to root
    59 1 1 * * root /root/bin/monthly-report

Scan Every 2 Hours: 

/root/bin/scan contains the following:

#!/bin/sh
scanpbnj 192.168.10.\*
outputpbnj -q latestinfo -t csv | mail -s "PBNJ LatestInfo `date`" root

Monthly Report: 

/root/bin/monthly-report contains the following:

#!/bin/sh
MONTHYEAR=`date +%B-%Y`
cd /root/
mkdir report-$MONTHYEAR
cd report-$MONTHYEAR
scanpbnj 192.168.10.\*
outputpbnj -q monthlyreport -t csv | mail -s "PBNJ Month Report `date
+%B+%r`" root