nagios的文件是nagios.c是main函数所在的文件
#ifdef EMBEDDEDPERL int main(int argc, char **argv, char **env){ #else int main(int argc, char **argv){ #endif
EMBEDDEDPERL用来标识是否将内置的perl支持进行编译
接下来为一些局部变量的定义
int result; int error=FALSE; char *buffer=NULL; int display_license=FALSE; int display_help=FALSE; int c=0; struct tm *tm; time_t now; char datestring[256];
使用getopt_long函数来获取传入的参数,用来设置一些标志
接下来就是根据这些标志位来打印一些信息,并且将传入的config文件由相对路径处理为绝对路径
最后的do while循环是整个程序的主体