Nagios plugin unable to open external log file for reading
Posted: Wed Mar 20, 2013 4:38 am
Hi i have a plugin written in c that will parse a .log<server log> file and determine the page hit count
_xLogFileName = "loging.log";
_xFile = fopen ( _xLogFileName, "r" );
if ( _xFile != NULL )
{
// process file
}else
{
printf("error\n");
return 3;
}
now i placed the a.out file in /usr/lib/nagios/plugin folder and placed the "loging.log" file in the same folder- for both chmod 777 done. now i can run the plugin from command line but when i integrate the same with nagios then it is giving unknown status and printing the "error" from else part-- can anyone plese help
_xLogFileName = "loging.log";
_xFile = fopen ( _xLogFileName, "r" );
if ( _xFile != NULL )
{
// process file
}else
{
printf("error\n");
return 3;
}
now i placed the a.out file in /usr/lib/nagios/plugin folder and placed the "loging.log" file in the same folder- for both chmod 777 done. now i can run the plugin from command line but when i integrate the same with nagios then it is giving unknown status and printing the "error" from else part-- can anyone plese help