Munin Plugin File write permission

Hi,
I have a script which is called when a munin alert arises. That file reads data from a config file sends out a mail and logs to a file.

If i run the script directly from bash it works without any issues. But when it is called by munin I get a Permission denied error. I have included a part of the munin-limit log below.

Please help me out with this. I am i n urgent need of a solution.

I have tried every directory including /home/usr, /tmp, /var/log/ but i get the same error for any directory I try out.

Thanks a lot

2011/09/30 15:55:07 [INFO] Process 24325 is dead, stealing lock, removing file 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 722. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 725. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 740. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 754. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 759. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $text in length at /usr/share/perl5/Munin/Master/LimitsOld.pm line 774. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $res[3] in join or string at /usr/share/perl5/Munin/Master/LimitsOld.pm line 777. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 722. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 725. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 740. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 754. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 759. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $text in length at /usr/share/perl5/Munin/Master/LimitsOld.pm line 774. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $res[15] in join or string at /usr/share/perl5/Munin/Master/LimitsOld.pm line 777. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 722. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 725. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 740. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 754. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 759. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $text in length at /usr/share/perl5/Munin/Master/LimitsOld.pm line 774. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $res[3] in join or string at /usr/share/perl5/Munin/Master/LimitsOld.pm line 777. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 722. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 725. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 740. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 754. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 759. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $text in length at /usr/share/perl5/Munin/Master/LimitsOld.pm line 774. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $res[1] in join or string at /usr/share/perl5/Munin/Master/LimitsOld.pm line 777. 2011/09/30 15:55:07 Baz? 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 722. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 725. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 740. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 754. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 759. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $text in length at /usr/share/perl5/Munin/Master/LimitsOld.pm line 774. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $res[3] in join or string at /usr/share/perl5/Munin/Master/LimitsOld.pm line 777. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 722. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 725. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 740. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 754. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 759. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $text in length at /usr/share/perl5/Munin/Master/LimitsOld.pm line 774. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $res[15] in join or string at /usr/share/perl5/Munin/Master/LimitsOld.pm line 777. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 722. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 725. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 740. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 754. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 759. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $text in length at /usr/share/perl5/Munin/Master/LimitsOld.pm line 774. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $res[3] in join or string at /usr/share/perl5/Munin/Master/LimitsOld.pm line 777. **2011/09/30 15:55:07 Command "prashanth" stderr: /tmp/scripts/sendNotification:46:in `initialize': Permission denied - /tmp/scripts/time (Errno::EACCES)** 2011/09/30 15:55:07 Command "prashanth" stderr: from /tmp/scripts/sendNotification:46:in `new' 2011/09/30 15:55:07 Command "prashanth" stderr: from /tmp/scripts/sendNotification:46:in `check_intreval' 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 722. 2011/09/30 15:55:07 Command "prashanth" stderr: from /tmp/scripts/sendNotification:55:in `sendmail' 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 725. 2011/09/30 15:55:07 Command "prashanth" stderr: from /tmp/scripts/sendNotification:75 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 740. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 754. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 759. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $text in length at /usr/share/perl5/Munin/Master/LimitsOld.pm line 774. 2011/09/30 15:55:07 [PERL WARNING] Use of uninitialized value $res[1] in join or string at /usr/share/perl5/Munin/Master/LimitsOld.pm line 777. 2011/09/30 15:55:07 Baz? 2011/09/30 15:55:07 [INFO] munin-limits finished (0.06 sec) **2011/09/30 15:55:07 Command "prashanth" stderr: /tmp/scripts/sendNotification:46:in `initialize': Permission denied - /tmp/scripts/time (Errno::EACCES)** 2011/09/30 15:55:07 Command "prashanth" stderr: from /tmp/scripts/sendNotification:46:in `new' 2011/09/30 15:55:07 Command "prashanth" stderr: from /tmp/scripts/sendNotification:46:in `check_intreval' 2011/09/30 15:55:07 Command "prashanth" stderr: from /tmp/scripts/sendNotification:55:in `sendmail' 2011/09/30 15:55:07 Command "prashanth" stderr: from /tmp/scripts/sendNotification:75