automating nmap with crontab?

Hi, I've just installed nmap and I was wondering if I can set it up to scan my servers automatically and send me a report.
I tried entering straight into crontab with no luck.
Code:
#crontab -e
20 14 * * * /usr/bin/nmap -v mydomain.net | mail -s "nmap output" root
This didn't seem to work for me, at least no mail arrived.
So I thought maybe a script to call the nmap: runnmap.pl in /scripts:
Code:
#!/usr/bin/perl
 #script1 email nmap
 nmap -v mydomain.net | mail -s nmap root
and then call runnmap.pl from cron.

What do you think would be the best approach, and have I done something wrong ? TIA

 

 

 

 

Top