This is my output:
Code: Select all
[root@localhost libexec]# gcc check_http.c -o check_http2
check_http.c:40:20: error: common.h: No such file or directory
check_http.c:41:22: error: netutils.h: No such file or directory
check_http.c:42:19: error: utils.h: No such file or directory
check_http.c:43:20: error: base64.h: No such file or directory
check_http.c:70: error: ‘FALSE’ undeclared here (not in a function)
check_http.c:81: error: ‘MAX_INPUT_BUFFER’ undeclared here (not in a function)
check_http.c:107: error: ‘NULL’ undeclared here (not in a function)
check_http.c:109: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
check_http.c:115: error: ‘STATE_OK’ undeclared here (not in a function)
check_http.c: In function ‘main’:
check_http.c:151: error: ‘STATE_UNKNOWN’ undeclared (first use in this function)
check_http.c:151: error: (Each undeclared identifier is reported only once
check_http.c:151: error: for each function it appears in.)
check_http.c:153: error: ‘LC_ALL’ undeclared (first use in this function)
check_http.c:154: error: ‘PACKAGE’ undeclared (first use in this function)
check_http.c:154: error: ‘LOCALEDIR’ undeclared (first use in this function)
check_http.c:158: warning: incompatible implicit declaration of built-in function ‘strdup’
check_http.c:159: warning: incompatible implicit declaration of built-in function ‘strlen’
check_http.c:161: error: ‘NP_VERSION’ undeclared (first use in this function)
check_http.c:161: error: ‘VERSION’ undeclared (first use in this function)
check_http.c:164: warning: assignment makes pointer from integer without a cast
check_http.c:166: error: ‘ERROR’ undeclared (first use in this function)
check_http.c:169: error: ‘TRUE’ undeclared (first use in this function)
check_http.c:170: warning: incompatible implicit declaration of built-in function ‘printf’
check_http.c:175: error: ‘SIGALRM’ undeclared (first use in this function)
check_http.c:175: error: ‘socket_timeout_alarm_handler’ undeclared (first use in this function)
check_http.c:176: error: ‘socket_timeout’ undeclared (first use in this function)
check_http.c: In function ‘test_file’:
check_http.c:187: error: ‘R_OK’ undeclared (first use in this function)
check_http.c: In function ‘process_arguments’:
check_http.c:201: error: ‘CHAR_MAX’ undeclared (first use in this function)
check_http.c:206: error: array type has incomplete element type
check_http.c:207: error: ‘STD_LONG_OPTS’ undeclared (first use in this function)
check_http.c:208: error: ‘no_argument’ undeclared (first use in this function)
check_http.c:210: error: ‘optional_argument’ undeclared (first use in this function)
check_http.c:212: error: ‘required_argument’ undeclared (first use in this function)
check_http.c:244: error: ‘ERROR’ undeclared (first use in this function)
check_http.c:248: warning: incompatible implicit declaration of built-in function ‘strcpy’
check_http.c:261: error: ‘EOF’ undeclared (first use in this function)
check_http.c:270: warning: incompatible implicit declaration of built-in function ‘exit’
check_http.c:273: error: ‘NP_VERSION’ undeclared (first use in this function)
check_http.c:277: error: ‘socket_timeout’ undeclared (first use in this function)
check_http.c:277: error: ‘optarg’ undeclared (first use in this function)
check_http.c:290: warning: incompatible implicit declaration of built-in function ‘malloc’
check_http.c:292: warning: incompatible implicit declaration of built-in function ‘realloc’
check_http.c:297: error: ‘TRUE’ undeclared (first use in this function)
check_http.c:359: error: ‘STATE_DEPENDENT’ undeclared (first use in this function)
check_http.c:365: error: ‘STATE_UNKNOWN’ undeclared (first use in this function)
check_http.c:369: error: ‘STATE_WARNING’ undeclared (first use in this function)
check_http.c:371: error: ‘STATE_CRITICAL’ undeclared (first use in this function)
check_http.c:374: warning: incompatible implicit declaration of built-in function ‘printf’
check_http.c:374: warning: passing argument 1 of ‘printf’ makes pointer from integer without a cast
check_http.c:374: note: expected ‘const char *’ but argument is of type ‘int’
check_http.c:378: warning: incompatible implicit declaration of built-in function ‘strdup’
check_http.c:380: warning: incompatible implicit declaration of built-in function ‘strstr’
check_http.c:382: warning: incompatible implicit declaration of built-in function ‘strchr’
check_http.c:391: warning: incompatible implicit declaration of built-in function ‘strlen’
check_http.c:402: warning: incompatible implicit declaration of built-in function ‘strncpy’
check_http.c:417: warning: incompatible implicit declaration of built-in function ‘free’
check_http.c:447: warning: passing argument 1 of ‘printf’ makes pointer from integer without a cast
check_http.c:447: note: expected ‘const char *’ but argument is of type ‘int’
check_http.c:455: error: ‘address_family’ undeclared (first use in this function)
check_http.c:455: error: ‘AF_INET’ undeclared (first use in this function)
check_http.c:505: warning: incompatible implicit declaration of built-in function ‘fprintf’
check_http.c:505: error: ‘stderr’ undeclared (first use in this function)
check_http.c:516: error: ‘optind’ undeclared (first use in this function)
check_http.c:519: warning: incompatible implicit declaration of built-in function ‘strdup’
check_http.c:531: error: ‘thlds’ undeclared (first use in this function)
check_http.c: In function ‘parse_time_string’:
check_http.c:568: error: storage size of ‘tm’ isn’t known
check_http.c:570: warning: incompatible implicit declaration of built-in function ‘memset’
check_http.c:645: error: ‘stdout’ undeclared (first use in this function)
check_http.c:646: warning: incompatible implicit declaration of built-in function ‘printf’
check_http.c: In function ‘expected_statuscode’:
check_http.c:663: warning: incompatible implicit declaration of built-in function ‘strdup’
check_http.c:664: error: ‘STATE_UNKNOWN’ undeclared (first use in this function)
check_http.c:666: warning: assignment makes pointer from integer without a cast
check_http.c:667: warning: incompatible implicit declaration of built-in function ‘strstr’
check_http.c:672: warning: incompatible implicit declaration of built-in function ‘free’
check_http.c: In function ‘check_document_dates’:
check_http.c:707: warning: incompatible implicit declaration of built-in function ‘malloc’
check_http.c:720: warning: incompatible implicit declaration of built-in function ‘strncpy’
check_http.c:723: warning: incompatible implicit declaration of built-in function ‘free’
check_http.c:726: warning: incompatible implicit declaration of built-in function ‘free’
check_http.c:730: warning: incompatible implicit declaration of built-in function ‘free’
check_http.c:737: error: ‘STATE_UNKNOWN’ undeclared (first use in this function)
check_http.c:740: error: ‘STATE_CRITICAL’ undeclared (first use in this function)
check_http.c:764: warning: incompatible implicit declaration of built-in function ‘free’
check_http.c: In function ‘get_content_length’:
check_http.c:799: warning: incompatible implicit declaration of built-in function ‘malloc’
check_http.c:812: warning: incompatible implicit declaration of built-in function ‘strncpy’
check_http.c:815: warning: incompatible implicit declaration of built-in function ‘free’
check_http.c:817: warning: incompatible implicit declaration of built-in function ‘free’
check_http.c: In function ‘prepend_slash’:
check_http.c:831: warning: incompatible implicit declaration of built-in function ‘malloc’
check_http.c:831: warning: incompatible implicit declaration of built-in function ‘strlen’
check_http.c:832: error: ‘STATE_UNKNOWN’ undeclared (first use in this function)
check_http.c:834: warning: incompatible implicit declaration of built-in function ‘strcpy’
check_http.c:835: warning: incompatible implicit declaration of built-in function ‘free’
check_http.c: In function ‘check_http’:
check_http.c:873: error: ‘STATE_CRITICAL’ undeclared (first use in this function)
check_http.c:906: error: ‘TRUE’ undeclared (first use in this function)
check_http.c:929: warning: incompatible implicit declaration of built-in function ‘strlen’
check_http.c:956: warning: incompatible implicit declaration of built-in function ‘printf’
check_http.c:963: warning: incompatible implicit declaration of built-in function ‘strdup’
check_http.c:972: warning: incompatible implicit declaration of built-in function ‘free’
check_http.c:984: error: ‘errno’ undeclared (first use in this function)
check_http.c:984: error: ‘ECONNRESET’ undeclared (first use in this function)
check_http.c:1030: warning: incompatible implicit declaration of built-in function ‘strcspn’
check_http.c:1032: warning: incompatible implicit declaration of built-in function ‘strspn’
check_http.c:1081: warning: incompatible implicit declaration of built-in function ‘strchr’
check_http.c:1100: error: ‘STATE_WARNING’ undeclared (first use in this function)
check_http.c:1105: error: ‘STATE_DEPENDENT’ undeclared (first use in this function)
check_http.c:1127: warning: incompatible implicit declaration of built-in function ‘strstr’
check_http.c:1128: warning: incompatible implicit declaration of built-in function ‘strncpy’
check_http.c:1130: warning: incompatible implicit declaration of built-in function ‘bcopy’
check_http.c:1139: warning: incompatible implicit declaration of built-in function ‘strstr’
check_http.c:1140: warning: incompatible implicit declaration of built-in function ‘strncpy’
check_http.c:1142: warning: incompatible implicit declaration of built-in function ‘bcopy’
check_http.c:1215: error: ‘thlds’ undeclared (first use in this function)
check_http.c:1219: error: ‘STATE_UNKNOWN’ undeclared (first use in this function)
check_http.c: In function ‘redir’:
check_http.c:1245: warning: incompatible implicit declaration of built-in function ‘malloc’
check_http.c:1247: error: ‘STATE_UNKNOWN’ undeclared (first use in this function)
check_http.c:1249: warning: incompatible implicit declaration of built-in function ‘strcspn’
check_http.c:1254: warning: incompatible implicit declaration of built-in function ‘sscanf’
check_http.c:1257: warning: incompatible implicit declaration of built-in function ‘strspn’
check_http.c:1258: warning: incompatible implicit declaration of built-in function ‘strlen’
check_http.c:1266: warning: incompatible implicit declaration of built-in function ‘strspn’
check_http.c:1280: warning: incompatible implicit declaration of built-in function ‘realloc’
check_http.c:1299: warning: incompatible implicit declaration of built-in function ‘strcpy’
check_http.c:1305: warning: incompatible implicit declaration of built-in function ‘strcpy’
check_http.c:1314: warning: incompatible implicit declaration of built-in function ‘strrchr’
check_http.c:1319: warning: incompatible implicit declaration of built-in function ‘strcpy’
check_http.c:1334: error: ‘STATE_WARNING’ undeclared (first use in this function)
check_http.c:1346: warning: incompatible implicit declaration of built-in function ‘strcpy’
check_http.c:1348: warning: incompatible implicit declaration of built-in function ‘free’
check_http.c:1349: warning: incompatible implicit declaration of built-in function ‘strdup’
check_http.c:1369: warning: incompatible implicit declaration of built-in function ‘printf’
check_http.c:1370: warning: passing argument 1 of ‘printf’ makes pointer from integer without a cast
check_http.c:1370: note: expected ‘const char *’ but argument is of type ‘int’
check_http.c: In function ‘server_type_check’:
check_http.c:1382: error: ‘TRUE’ undeclared (first use in this function)
check_http.c: In function ‘perfd_time’:
check_http.c:1397: error: ‘thlds’ undeclared (first use in this function)
check_http.c:1397: error: ‘TRUE’ undeclared (first use in this function)
check_http.c: In function ‘perfd_size’:
check_http.c:1430: error: ‘TRUE’ undeclared (first use in this function)
check_http.c: In function ‘print_help’:
check_http.c:1438: error: ‘NP_VERSION’ undeclared (first use in this function)
check_http.c:1440: warning: incompatible implicit declaration of built-in function ‘printf’
check_http.c:1441: error: ‘COPYRIGHT’ undeclared (first use in this function)
check_http.c:1452: warning: passing argument 1 of ‘printf’ makes pointer from integer without a cast
check_http.c:1452: note: expected ‘const char *’ but argument is of type ‘int’
check_http.c:1456: error: ‘UT_HELP_VRSN’ undeclared (first use in this function)
check_http.c:1457: error: ‘UT_EXTRA_OPTS’ undeclared (first use in this function)
check_http.c:1468: error: ‘UT_IPv46’ undeclared (first use in this function)
check_http.c:1538: error: ‘UT_WARN_CRIT’ undeclared (first use in this function)
check_http.c:1540: error: ‘UT_CONN_TIMEOUT’ undeclared (first use in this function)
check_http.c:1540: error: ‘DEFAULT_SOCKET_TIMEOUT’ undeclared (first use in this function)
check_http.c:1542: error: ‘UT_VERBOSE’ undeclared (first use in this function)
check_http.c:1584: error: ‘UT_SUPPORT’ undeclared (first use in this function)
check_http.c: In function ‘print_usage’:
check_http.c:1593: warning: incompatible implicit declaration of built-in function ‘printf’
https://raw.githubusercontent.com/nagio ... eck_http.c
and copy/pasted it directly into my CentOS host via Putty.