CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Adding wmtp into logwatch

 



hedkandi
New User


Nov 25, 2011, 2:28 AM

Post #1 of 2 (329 views)
Adding wmtp into logwatch Can't Post

Hi all

Let me start off my informing that I am attempting to add wmtp log into logwatch monitoring. So far I have successfully added logwatch into my server and it sends to my email a html or text based report. Terrible as I am in Perl scripting (I have just begun to work on this these 2 weeks, since my new place are big on Nagios and Cacti)

Anyways I took the Perl script online and it runs fine as it is when I do this:


Code
 
my-mnag0:/etc/logwatch/scripts/services # ./my-report
my-mnag0:/etc/logwatch/scripts/services # ./my-report
Fri Dec 18 22:17:17 2009 Login LOGIN tty1
Fri Dec 18 22:17:17 2009 Login LOGIN tty2
Fri Dec 18 22:17:17 2009 Login LOGIN tty3

...output truncated


I had defined a config file in /etc/logwatch/scripts/services as instructed by README for logwatch:


Code
 
my-mnag0:/etc/logwatch/conf/services # more my-report.conf
Title = "wmtp logs"
Logfile = NONE
my-mnag0:/etc/logwatch/conf/services # pwd
/etc/logwatch/conf/services


And added a service file into my services directory:


Code
 
my-mnag0:/etc/logwatch/scripts/services # ls -lrt
total 4
-rwxrwxr-x 1 root root 588 Nov 25 19:49 my-report
my-mnag0:/etc/logwatch/scripts/services # pwd
/etc/logwatch/scripts/services
my-mnag0:/etc/logwatch/scripts/


This is the error message I receive when I run logwatch:


Code
 
--------------------- wmtp logs Begin ------------------------

String found where operator expected at /etc/logwatch/scripts/services/my-report line 1, at end of line
(Do you need to predeclare we?)
Warning: Use of "log" without parentheses is ambiguous at /etc/logwatch/scripts/services/my-report line 1.
syntax error at /etc/logwatch/scripts/services/my-report line 1, next token ???
Search pattern not terminated at /etc/logwatch/scripts/services/my-report line 1.

---------------------- wmtp logs End -------------------------


I am not sure what I should change, and I really hope you can help me out on this. I am at my wits end trying to fix this.

Thank you in advance

BTW, I love the font I am typing and the general layout here. For once, its not eye straining!


rovf
Veteran

Nov 25, 2011, 3:34 AM

Post #2 of 2 (324 views)
Re: [hedkandi] Adding wmtp into logwatch [In reply to] Can't Post


Quote
I am not sure what I should change


Well, since the error clearly says

/etc/logwatch/scripts/services/my-report line 1, at end of line

I would have a look at this place.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives