├── AUTHORS ├── COPYING ├── ChangeLog ├── INSTALL ├── Makefile.am ├── Makefile.in ├── NEWS ├── README ├── aclocal.m4 ├── compile ├── config.guess ├── config.h.in ├── config.sub ├── configure ├── configure.ac ├── depcomp ├── install-sh ├── libtool ├── ltmain.sh ├── m4 ├── libtool.m4 ├── ltoptions.m4 ├── ltsugar.m4 ├── ltversion.m4 ├── lt~obsolete.m4 └── m4-ax_compare_version.m4 ├── missing ├── scripts ├── Makefile.am ├── Makefile.in ├── common_function.in ├── hpeilo_zabbix_api.py.in ├── hpeilo_zabbix_config.in └── zabbix_hpeilo_cfg_generator.in ├── src ├── credit_save │ ├── Makefile.am │ ├── Makefile.in │ └── credit_save.c ├── hpeilo_engine │ ├── Makefile.am │ ├── Makefile.in │ ├── hpilo_engine.c │ └── hpilo_snmp.c ├── ilo_credit │ ├── Makefile.am │ ├── Makefile.in │ ├── base64.c │ └── ilo-credit-store.cpp └── include │ ├── base64.h │ ├── cJSON.h │ ├── credit_save.h │ ├── hpilo_common.h │ ├── hpilo_engine.h │ ├── hpilo_snmp.h │ └── ilo-credit-store.h └── template ├── Makefile.am ├── Makefile.in └── zabbix_export_templates.xml /AUTHORS: -------------------------------------------------------------------------------- 1 | MAINTAINERS 2 | 3 | Linux_SWdeliverables Linux_SWdeliverables@groups.ext.hpe.com 4 | 5 | PATCHES 6 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | 1.0 initial version. 2 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | Installation Instructions 2 | ************************* 3 | 4 | Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, 5 | Inc. 6 | 7 | Copying and distribution of this file, with or without modification, 8 | are permitted in any medium without royalty provided the copyright 9 | notice and this notice are preserved. This file is offered as-is, 10 | without warranty of any kind. 11 | 12 | Basic Installation 13 | ================== 14 | 15 | Briefly, the shell command `./configure && make && make install' 16 | should configure, build, and install this package. The following 17 | more-detailed instructions are generic; see the `README' file for 18 | instructions specific to this package. Some packages provide this 19 | `INSTALL' file but do not implement all of the features documented 20 | below. The lack of an optional feature in a given package is not 21 | necessarily a bug. More recommendations for GNU packages can be found 22 | in *note Makefile Conventions: (standards)Makefile Conventions. 23 | 24 | The `configure' shell script attempts to guess correct values for 25 | various system-dependent variables used during compilation. It uses 26 | those values to create a `Makefile' in each directory of the package. 27 | It may also create one or more `.h' files containing system-dependent 28 | definitions. Finally, it creates a shell script `config.status' that 29 | you can run in the future to recreate the current configuration, and a 30 | file `config.log' containing compiler output (useful mainly for 31 | debugging `configure'). 32 | 33 | It can also use an optional file (typically called `config.cache' 34 | and enabled with `--cache-file=config.cache' or simply `-C') that saves 35 | the results of its tests to speed up reconfiguring. Caching is 36 | disabled by default to prevent problems with accidental use of stale 37 | cache files. 38 | 39 | If you need to do unusual things to compile the package, please try 40 | to figure out how `configure' could check whether to do them, and mail 41 | diffs or instructions to the address given in the `README' so they can 42 | be considered for the next release. If you are using the cache, and at 43 | some point `config.cache' contains results you don't want to keep, you 44 | may remove or edit it. 45 | 46 | The file `configure.ac' (or `configure.in') is used to create 47 | `configure' by a program called `autoconf'. You need `configure.ac' if 48 | you want to change it or regenerate `configure' using a newer version 49 | of `autoconf'. 50 | 51 | The simplest way to compile this package is: 52 | 53 | 1. `cd' to the directory containing the package's source code and type 54 | `./configure' to configure the package for your system. 55 | 56 | Running `configure' might take a while. While running, it prints 57 | some messages telling which features it is checking for. 58 | 59 | 2. Type `make' to compile the package. 60 | 61 | 3. Optionally, type `make check' to run any self-tests that come with 62 | the package, generally using the just-built uninstalled binaries. 63 | 64 | 4. Type `make install' to install the programs and any data files and 65 | documentation. When installing into a prefix owned by root, it is 66 | recommended that the package be configured and built as a regular 67 | user, and only the `make install' phase executed with root 68 | privileges. 69 | 70 | 5. Optionally, type `make installcheck' to repeat any self-tests, but 71 | this time using the binaries in their final installed location. 72 | This target does not install anything. Running this target as a 73 | regular user, particularly if the prior `make install' required 74 | root privileges, verifies that the installation completed 75 | correctly. 76 | 77 | 6. You can remove the program binaries and object files from the 78 | source code directory by typing `make clean'. To also remove the 79 | files that `configure' created (so you can compile the package for 80 | a different kind of computer), type `make distclean'. There is 81 | also a `make maintainer-clean' target, but that is intended mainly 82 | for the package's developers. If you use it, you may have to get 83 | all sorts of other programs in order to regenerate files that came 84 | with the distribution. 85 | 86 | 7. Often, you can also type `make uninstall' to remove the installed 87 | files again. In practice, not all packages have tested that 88 | uninstallation works correctly, even though it is required by the 89 | GNU Coding Standards. 90 | 91 | 8. Some packages, particularly those that use Automake, provide `make 92 | distcheck', which can by used by developers to test that all other 93 | targets like `make install' and `make uninstall' work correctly. 94 | This target is generally not run by end users. 95 | 96 | Compilers and Options 97 | ===================== 98 | 99 | Some systems require unusual options for compilation or linking that 100 | the `configure' script does not know about. Run `./configure --help' 101 | for details on some of the pertinent environment variables. 102 | 103 | You can give `configure' initial values for configuration parameters 104 | by setting variables in the command line or in the environment. Here 105 | is an example: 106 | 107 | ./configure CC=c99 CFLAGS=-g LIBS=-lposix 108 | 109 | *Note Defining Variables::, for more details. 110 | 111 | Compiling For Multiple Architectures 112 | ==================================== 113 | 114 | You can compile the package for more than one kind of computer at the 115 | same time, by placing the object files for each architecture in their 116 | own directory. To do this, you can use GNU `make'. `cd' to the 117 | directory where you want the object files and executables to go and run 118 | the `configure' script. `configure' automatically checks for the 119 | source code in the directory that `configure' is in and in `..'. This 120 | is known as a "VPATH" build. 121 | 122 | With a non-GNU `make', it is safer to compile the package for one 123 | architecture at a time in the source code directory. After you have 124 | installed the package for one architecture, use `make distclean' before 125 | reconfiguring for another architecture. 126 | 127 | On MacOS X 10.5 and later systems, you can create libraries and 128 | executables that work on multiple system types--known as "fat" or 129 | "universal" binaries--by specifying multiple `-arch' options to the 130 | compiler but only a single `-arch' option to the preprocessor. Like 131 | this: 132 | 133 | ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ 134 | CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ 135 | CPP="gcc -E" CXXCPP="g++ -E" 136 | 137 | This is not guaranteed to produce working output in all cases, you 138 | may have to build one architecture at a time and combine the results 139 | using the `lipo' tool if you have problems. 140 | 141 | Installation Names 142 | ================== 143 | 144 | By default, `make install' installs the package's commands under 145 | `/usr/local/bin', include files under `/usr/local/include', etc. You 146 | can specify an installation prefix other than `/usr/local' by giving 147 | `configure' the option `--prefix=PREFIX', where PREFIX must be an 148 | absolute file name. 149 | 150 | You can specify separate installation prefixes for 151 | architecture-specific files and architecture-independent files. If you 152 | pass the option `--exec-prefix=PREFIX' to `configure', the package uses 153 | PREFIX as the prefix for installing programs and libraries. 154 | Documentation and other data files still use the regular prefix. 155 | 156 | In addition, if you use an unusual directory layout you can give 157 | options like `--bindir=DIR' to specify different values for particular 158 | kinds of files. Run `configure --help' for a list of the directories 159 | you can set and what kinds of files go in them. In general, the 160 | default for these options is expressed in terms of `${prefix}', so that 161 | specifying just `--prefix' will affect all of the other directory 162 | specifications that were not explicitly provided. 163 | 164 | The most portable way to affect installation locations is to pass the 165 | correct locations to `configure'; however, many packages provide one or 166 | both of the following shortcuts of passing variable assignments to the 167 | `make install' command line to change installation locations without 168 | having to reconfigure or recompile. 169 | 170 | The first method involves providing an override variable for each 171 | affected directory. For example, `make install 172 | prefix=/alternate/directory' will choose an alternate location for all 173 | directory configuration variables that were expressed in terms of 174 | `${prefix}'. Any directories that were specified during `configure', 175 | but not in terms of `${prefix}', must each be overridden at install 176 | time for the entire installation to be relocated. The approach of 177 | makefile variable overrides for each directory variable is required by 178 | the GNU Coding Standards, and ideally causes no recompilation. 179 | However, some platforms have known limitations with the semantics of 180 | shared libraries that end up requiring recompilation when using this 181 | method, particularly noticeable in packages that use GNU Libtool. 182 | 183 | The second method involves providing the `DESTDIR' variable. For 184 | example, `make install DESTDIR=/alternate/directory' will prepend 185 | `/alternate/directory' before all installation names. The approach of 186 | `DESTDIR' overrides is not required by the GNU Coding Standards, and 187 | does not work on platforms that have drive letters. On the other hand, 188 | it does better at avoiding recompilation issues, and works well even 189 | when some directory options were not specified in terms of `${prefix}' 190 | at `configure' time. 191 | 192 | Optional Features 193 | ================= 194 | 195 | If the package supports it, you can cause programs to be installed 196 | with an extra prefix or suffix on their names by giving `configure' the 197 | option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. 198 | 199 | Some packages pay attention to `--enable-FEATURE' options to 200 | `configure', where FEATURE indicates an optional part of the package. 201 | They may also pay attention to `--with-PACKAGE' options, where PACKAGE 202 | is something like `gnu-as' or `x' (for the X Window System). The 203 | `README' should mention any `--enable-' and `--with-' options that the 204 | package recognizes. 205 | 206 | For packages that use the X Window System, `configure' can usually 207 | find the X include and library files automatically, but if it doesn't, 208 | you can use the `configure' options `--x-includes=DIR' and 209 | `--x-libraries=DIR' to specify their locations. 210 | 211 | Some packages offer the ability to configure how verbose the 212 | execution of `make' will be. For these packages, running `./configure 213 | --enable-silent-rules' sets the default to minimal output, which can be 214 | overridden with `make V=1'; while running `./configure 215 | --disable-silent-rules' sets the default to verbose, which can be 216 | overridden with `make V=0'. 217 | 218 | Particular systems 219 | ================== 220 | 221 | On HP-UX, the default C compiler is not ANSI C compatible. If GNU 222 | CC is not installed, it is recommended to use the following options in 223 | order to use an ANSI C compiler: 224 | 225 | ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" 226 | 227 | and if that doesn't work, install pre-built binaries of GCC for HP-UX. 228 | 229 | HP-UX `make' updates targets which have the same time stamps as 230 | their prerequisites, which makes it generally unusable when shipped 231 | generated files such as `configure' are involved. Use GNU `make' 232 | instead. 233 | 234 | On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot 235 | parse its `' header file. The option `-nodtk' can be used as 236 | a workaround. If GNU CC is not installed, it is therefore recommended 237 | to try 238 | 239 | ./configure CC="cc" 240 | 241 | and if that doesn't work, try 242 | 243 | ./configure CC="cc -nodtk" 244 | 245 | On Solaris, don't put `/usr/ucb' early in your `PATH'. This 246 | directory contains several dysfunctional programs; working variants of 247 | these programs are available in `/usr/bin'. So, if you need `/usr/ucb' 248 | in your `PATH', put it _after_ `/usr/bin'. 249 | 250 | On Haiku, software installed for all users goes in `/boot/common', 251 | not `/usr/local'. It is recommended to use the following options: 252 | 253 | ./configure --prefix=/boot/common 254 | 255 | Specifying the System Type 256 | ========================== 257 | 258 | There may be some features `configure' cannot figure out 259 | automatically, but needs to determine by the type of machine the package 260 | will run on. Usually, assuming the package is built to be run on the 261 | _same_ architectures, `configure' can figure that out, but if it prints 262 | a message saying it cannot guess the machine type, give it the 263 | `--build=TYPE' option. TYPE can either be a short name for the system 264 | type, such as `sun4', or a canonical name which has the form: 265 | 266 | CPU-COMPANY-SYSTEM 267 | 268 | where SYSTEM can have one of these forms: 269 | 270 | OS 271 | KERNEL-OS 272 | 273 | See the file `config.sub' for the possible values of each field. If 274 | `config.sub' isn't included in this package, then this package doesn't 275 | need to know the machine type. 276 | 277 | If you are _building_ compiler tools for cross-compiling, you should 278 | use the option `--target=TYPE' to select the type of system they will 279 | produce code for. 280 | 281 | If you want to _use_ a cross compiler, that generates code for a 282 | platform different from the build platform, you should specify the 283 | "host" platform (i.e., that on which the generated programs will 284 | eventually be run) with `--host=TYPE'. 285 | 286 | Sharing Defaults 287 | ================ 288 | 289 | If you want to set default values for `configure' scripts to share, 290 | you can create a site shell script called `config.site' that gives 291 | default values for variables like `CC', `cache_file', and `prefix'. 292 | `configure' looks for `PREFIX/share/config.site' if it exists, then 293 | `PREFIX/etc/config.site' if it exists. Or, you can set the 294 | `CONFIG_SITE' environment variable to the location of the site script. 295 | A warning: not all `configure' scripts look for a site script. 296 | 297 | Defining Variables 298 | ================== 299 | 300 | Variables not defined in a site shell script can be set in the 301 | environment passed to `configure'. However, some packages may run 302 | configure again during the build, and the customized values of these 303 | variables may be lost. In order to avoid this problem, you should set 304 | them in the `configure' command line, using `VAR=value'. For example: 305 | 306 | ./configure CC=/usr/local2/bin/gcc 307 | 308 | causes the specified `gcc' to be used as the C compiler (unless it is 309 | overridden in the site shell script). 310 | 311 | Unfortunately, this technique does not work for `CONFIG_SHELL' due to 312 | an Autoconf limitation. Until the limitation is lifted, you can use 313 | this workaround: 314 | 315 | CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash 316 | 317 | `configure' Invocation 318 | ====================== 319 | 320 | `configure' recognizes the following options to control how it 321 | operates. 322 | 323 | `--help' 324 | `-h' 325 | Print a summary of all of the options to `configure', and exit. 326 | 327 | `--help=short' 328 | `--help=recursive' 329 | Print a summary of the options unique to this package's 330 | `configure', and exit. The `short' variant lists options used 331 | only in the top level, while the `recursive' variant lists options 332 | also present in any nested packages. 333 | 334 | `--version' 335 | `-V' 336 | Print the version of Autoconf used to generate the `configure' 337 | script, and exit. 338 | 339 | `--cache-file=FILE' 340 | Enable the cache: use and save the results of the tests in FILE, 341 | traditionally `config.cache'. FILE defaults to `/dev/null' to 342 | disable caching. 343 | 344 | `--config-cache' 345 | `-C' 346 | Alias for `--cache-file=config.cache'. 347 | 348 | `--quiet' 349 | `--silent' 350 | `-q' 351 | Do not print messages saying which checks are being made. To 352 | suppress all normal output, redirect it to `/dev/null' (any error 353 | messages will still be shown). 354 | 355 | `--srcdir=DIR' 356 | Look for the package's source code in directory DIR. Usually 357 | `configure' can determine that directory automatically. 358 | 359 | `--prefix=DIR' 360 | Use DIR as the installation prefix. *note Installation Names:: 361 | for more details, including other options available for fine-tuning 362 | the installation locations. 363 | 364 | `--no-create' 365 | `-n' 366 | Run the configure checks, but stop before creating any output 367 | files. 368 | 369 | `configure' also accepts some other, not widely useful, options. Run 370 | `configure --help' for more details. 371 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | CXXFLAGS = -O3 2 | 3 | SUBDIRS = scripts template src/ilo_credit src/credit_save src/hpeilo_engine 4 | 5 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- 1 | Zabbix plugin for HP iLO Agentless Management 2 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | Zabbix plug-in for iLO Agentless Management 2 | ------------------------------------------ 3 | Zabbix plug-in for iLO Agentless Management aims to automatically manage 4 | HPE ProLiant servers within the data center. With the help of the plug-in, 5 | the administator does not need to add the ilo host manually. 6 | The plug-in automatically add the HPE ProLiant servers which is 7 | discovered within the data center. 8 | 9 | Requirements: 10 | ------------- 11 | - Net-snmp 12 | - snmptrapd 13 | - HPE ProLiant Server 14 | - python >= 2.3 and python-argparse or python >= 2.7 15 | 16 | Features: 17 | ------------- 18 | 1) Discover and monitor HPE ProLiant servers within data center automatically. There are two alternatives to discover HPE ProLiant servers. 19 | 20 | 1.1) Active discovery: The active discovery scans all available servers 21 | in the network of the monitoring server. This 22 | approach can discovery all up and running servers 23 | with the data center. This feature is supported 24 | started version 1.1.0. Note that this feature 25 | is a time-consuming process if your data center 26 | has lots of hosts/IP addresses to be discovered. 27 | 28 | 1.2) Passive discovery: The passive discovery discovers HPE ProLiant 29 | servers once receiving the cold start traps 30 | generated by those servers. The traps are 31 | generated when those servers get booted 32 | successfully, so this approach cannot discover 33 | the up and running servers within the data 34 | center. 35 | 36 | 2) Provide the high-level server status. 37 | 38 | 3) Display the server status in real-time if the status is changed. 39 | 40 | 4) Categorize the preferred servers into the same host group. 41 | 42 | -------------------------------------------------------------------------------- /compile: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Wrapper for compilers which do not understand '-c -o'. 3 | 4 | scriptversion=2012-10-14.11; # UTC 5 | 6 | # Copyright (C) 1999-2013 Free Software Foundation, Inc. 7 | # Written by Tom Tromey . 8 | # 9 | # This program is free software; you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation; either version 2, or (at your option) 12 | # any later version. 13 | # 14 | # This program is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with this program. If not, see . 21 | 22 | # As a special exception to the GNU General Public License, if you 23 | # distribute this file as part of a program that contains a 24 | # configuration script generated by Autoconf, you may include it under 25 | # the same distribution terms that you use for the rest of that program. 26 | 27 | # This file is maintained in Automake, please report 28 | # bugs to or send patches to 29 | # . 30 | 31 | nl=' 32 | ' 33 | 34 | # We need space, tab and new line, in precisely that order. Quoting is 35 | # there to prevent tools from complaining about whitespace usage. 36 | IFS=" "" $nl" 37 | 38 | file_conv= 39 | 40 | # func_file_conv build_file lazy 41 | # Convert a $build file to $host form and store it in $file 42 | # Currently only supports Windows hosts. If the determined conversion 43 | # type is listed in (the comma separated) LAZY, no conversion will 44 | # take place. 45 | func_file_conv () 46 | { 47 | file=$1 48 | case $file in 49 | / | /[!/]*) # absolute file, and not a UNC file 50 | if test -z "$file_conv"; then 51 | # lazily determine how to convert abs files 52 | case `uname -s` in 53 | MINGW*) 54 | file_conv=mingw 55 | ;; 56 | CYGWIN*) 57 | file_conv=cygwin 58 | ;; 59 | *) 60 | file_conv=wine 61 | ;; 62 | esac 63 | fi 64 | case $file_conv/,$2, in 65 | *,$file_conv,*) 66 | ;; 67 | mingw/*) 68 | file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` 69 | ;; 70 | cygwin/*) 71 | file=`cygpath -m "$file" || echo "$file"` 72 | ;; 73 | wine/*) 74 | file=`winepath -w "$file" || echo "$file"` 75 | ;; 76 | esac 77 | ;; 78 | esac 79 | } 80 | 81 | # func_cl_dashL linkdir 82 | # Make cl look for libraries in LINKDIR 83 | func_cl_dashL () 84 | { 85 | func_file_conv "$1" 86 | if test -z "$lib_path"; then 87 | lib_path=$file 88 | else 89 | lib_path="$lib_path;$file" 90 | fi 91 | linker_opts="$linker_opts -LIBPATH:$file" 92 | } 93 | 94 | # func_cl_dashl library 95 | # Do a library search-path lookup for cl 96 | func_cl_dashl () 97 | { 98 | lib=$1 99 | found=no 100 | save_IFS=$IFS 101 | IFS=';' 102 | for dir in $lib_path $LIB 103 | do 104 | IFS=$save_IFS 105 | if $shared && test -f "$dir/$lib.dll.lib"; then 106 | found=yes 107 | lib=$dir/$lib.dll.lib 108 | break 109 | fi 110 | if test -f "$dir/$lib.lib"; then 111 | found=yes 112 | lib=$dir/$lib.lib 113 | break 114 | fi 115 | if test -f "$dir/lib$lib.a"; then 116 | found=yes 117 | lib=$dir/lib$lib.a 118 | break 119 | fi 120 | done 121 | IFS=$save_IFS 122 | 123 | if test "$found" != yes; then 124 | lib=$lib.lib 125 | fi 126 | } 127 | 128 | # func_cl_wrapper cl arg... 129 | # Adjust compile command to suit cl 130 | func_cl_wrapper () 131 | { 132 | # Assume a capable shell 133 | lib_path= 134 | shared=: 135 | linker_opts= 136 | for arg 137 | do 138 | if test -n "$eat"; then 139 | eat= 140 | else 141 | case $1 in 142 | -o) 143 | # configure might choose to run compile as 'compile cc -o foo foo.c'. 144 | eat=1 145 | case $2 in 146 | *.o | *.[oO][bB][jJ]) 147 | func_file_conv "$2" 148 | set x "$@" -Fo"$file" 149 | shift 150 | ;; 151 | *) 152 | func_file_conv "$2" 153 | set x "$@" -Fe"$file" 154 | shift 155 | ;; 156 | esac 157 | ;; 158 | -I) 159 | eat=1 160 | func_file_conv "$2" mingw 161 | set x "$@" -I"$file" 162 | shift 163 | ;; 164 | -I*) 165 | func_file_conv "${1#-I}" mingw 166 | set x "$@" -I"$file" 167 | shift 168 | ;; 169 | -l) 170 | eat=1 171 | func_cl_dashl "$2" 172 | set x "$@" "$lib" 173 | shift 174 | ;; 175 | -l*) 176 | func_cl_dashl "${1#-l}" 177 | set x "$@" "$lib" 178 | shift 179 | ;; 180 | -L) 181 | eat=1 182 | func_cl_dashL "$2" 183 | ;; 184 | -L*) 185 | func_cl_dashL "${1#-L}" 186 | ;; 187 | -static) 188 | shared=false 189 | ;; 190 | -Wl,*) 191 | arg=${1#-Wl,} 192 | save_ifs="$IFS"; IFS=',' 193 | for flag in $arg; do 194 | IFS="$save_ifs" 195 | linker_opts="$linker_opts $flag" 196 | done 197 | IFS="$save_ifs" 198 | ;; 199 | -Xlinker) 200 | eat=1 201 | linker_opts="$linker_opts $2" 202 | ;; 203 | -*) 204 | set x "$@" "$1" 205 | shift 206 | ;; 207 | *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) 208 | func_file_conv "$1" 209 | set x "$@" -Tp"$file" 210 | shift 211 | ;; 212 | *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) 213 | func_file_conv "$1" mingw 214 | set x "$@" "$file" 215 | shift 216 | ;; 217 | *) 218 | set x "$@" "$1" 219 | shift 220 | ;; 221 | esac 222 | fi 223 | shift 224 | done 225 | if test -n "$linker_opts"; then 226 | linker_opts="-link$linker_opts" 227 | fi 228 | exec "$@" $linker_opts 229 | exit 1 230 | } 231 | 232 | eat= 233 | 234 | case $1 in 235 | '') 236 | echo "$0: No command. Try '$0 --help' for more information." 1>&2 237 | exit 1; 238 | ;; 239 | -h | --h*) 240 | cat <<\EOF 241 | Usage: compile [--help] [--version] PROGRAM [ARGS] 242 | 243 | Wrapper for compilers which do not understand '-c -o'. 244 | Remove '-o dest.o' from ARGS, run PROGRAM with the remaining 245 | arguments, and rename the output as expected. 246 | 247 | If you are trying to build a whole package this is not the 248 | right script to run: please start by reading the file 'INSTALL'. 249 | 250 | Report bugs to . 251 | EOF 252 | exit $? 253 | ;; 254 | -v | --v*) 255 | echo "compile $scriptversion" 256 | exit $? 257 | ;; 258 | cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) 259 | func_cl_wrapper "$@" # Doesn't return... 260 | ;; 261 | esac 262 | 263 | ofile= 264 | cfile= 265 | 266 | for arg 267 | do 268 | if test -n "$eat"; then 269 | eat= 270 | else 271 | case $1 in 272 | -o) 273 | # configure might choose to run compile as 'compile cc -o foo foo.c'. 274 | # So we strip '-o arg' only if arg is an object. 275 | eat=1 276 | case $2 in 277 | *.o | *.obj) 278 | ofile=$2 279 | ;; 280 | *) 281 | set x "$@" -o "$2" 282 | shift 283 | ;; 284 | esac 285 | ;; 286 | *.c) 287 | cfile=$1 288 | set x "$@" "$1" 289 | shift 290 | ;; 291 | *) 292 | set x "$@" "$1" 293 | shift 294 | ;; 295 | esac 296 | fi 297 | shift 298 | done 299 | 300 | if test -z "$ofile" || test -z "$cfile"; then 301 | # If no '-o' option was seen then we might have been invoked from a 302 | # pattern rule where we don't need one. That is ok -- this is a 303 | # normal compilation that the losing compiler can handle. If no 304 | # '.c' file was seen then we are probably linking. That is also 305 | # ok. 306 | exec "$@" 307 | fi 308 | 309 | # Name of file we expect compiler to create. 310 | cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` 311 | 312 | # Create the lock directory. 313 | # Note: use '[/\\:.-]' here to ensure that we don't use the same name 314 | # that we are using for the .o file. Also, base the name on the expected 315 | # object file name, since that is what matters with a parallel build. 316 | lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d 317 | while true; do 318 | if mkdir "$lockdir" >/dev/null 2>&1; then 319 | break 320 | fi 321 | sleep 1 322 | done 323 | # FIXME: race condition here if user kills between mkdir and trap. 324 | trap "rmdir '$lockdir'; exit 1" 1 2 15 325 | 326 | # Run the compile. 327 | "$@" 328 | ret=$? 329 | 330 | if test -f "$cofile"; then 331 | test "$cofile" = "$ofile" || mv "$cofile" "$ofile" 332 | elif test -f "${cofile}bj"; then 333 | test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" 334 | fi 335 | 336 | rmdir "$lockdir" 337 | exit $ret 338 | 339 | # Local Variables: 340 | # mode: shell-script 341 | # sh-indentation: 2 342 | # eval: (add-hook 'write-file-hooks 'time-stamp) 343 | # time-stamp-start: "scriptversion=" 344 | # time-stamp-format: "%:y-%02m-%02d.%02H" 345 | # time-stamp-time-zone: "UTC" 346 | # time-stamp-end: "; # UTC" 347 | # End: 348 | -------------------------------------------------------------------------------- /config.h.in: -------------------------------------------------------------------------------- 1 | /* config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* Define to 1 if you have the header file. */ 4 | #undef HAVE_DLFCN_H 5 | 6 | /* Define to 1 if you have the header file. */ 7 | #undef HAVE_INTTYPES_H 8 | 9 | /* Define to 1 if your system has a GNU libc compatible `malloc' function, and 10 | to 0 otherwise. */ 11 | #undef HAVE_MALLOC 12 | 13 | /* Define to 1 if you have the header file. */ 14 | #undef HAVE_MEMORY_H 15 | 16 | /* Define to 1 if you have the `memset' function. */ 17 | #undef HAVE_MEMSET 18 | 19 | /* Define to 1 if you have the header file. */ 20 | #undef HAVE_STDINT_H 21 | 22 | /* Define to 1 if you have the header file. */ 23 | #undef HAVE_STDLIB_H 24 | 25 | /* Define to 1 if you have the `strdup' function. */ 26 | #undef HAVE_STRDUP 27 | 28 | /* Define to 1 if you have the header file. */ 29 | #undef HAVE_STRINGS_H 30 | 31 | /* Define to 1 if you have the header file. */ 32 | #undef HAVE_STRING_H 33 | 34 | /* Define to 1 if you have the `strstr' function. */ 35 | #undef HAVE_STRSTR 36 | 37 | /* Define to 1 if you have the header file. */ 38 | #undef HAVE_SYS_STAT_H 39 | 40 | /* Define to 1 if you have the header file. */ 41 | #undef HAVE_SYS_TYPES_H 42 | 43 | /* Define to 1 if you have the header file. */ 44 | #undef HAVE_UNISTD_H 45 | 46 | /* Define to the sub-directory in which libtool stores uninstalled libraries. 47 | */ 48 | #undef LT_OBJDIR 49 | 50 | /* Name of package */ 51 | #undef PACKAGE 52 | 53 | /* Define to the address where bug reports for this package should be sent. */ 54 | #undef PACKAGE_BUGREPORT 55 | 56 | /* Define to the full name of this package. */ 57 | #undef PACKAGE_NAME 58 | 59 | /* Define to the full name and version of this package. */ 60 | #undef PACKAGE_STRING 61 | 62 | /* Define to the one symbol short name of this package. */ 63 | #undef PACKAGE_TARNAME 64 | 65 | /* Define to the home page for this package. */ 66 | #undef PACKAGE_URL 67 | 68 | /* Define to the version of this package. */ 69 | #undef PACKAGE_VERSION 70 | 71 | /* Define to 1 if you have the ANSI C header files. */ 72 | #undef STDC_HEADERS 73 | 74 | /* Version number of package */ 75 | #undef VERSION 76 | 77 | /* Define to rpl_malloc if the replacement function should be used. */ 78 | #undef malloc 79 | 80 | /* Define to `unsigned int' if does not define. */ 81 | #undef size_t 82 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | # -*- Autoconf -*- 2 | # Process this file with autoconf to produce a configure script. 3 | 4 | AC_PREREQ([2.69]) 5 | AC_INIT(zabbix-plugins-hpeilo, 1.0, yyu@hpe.com) 6 | AC_CONFIG_SRCDIR([src/hpeilo_engine/hpilo_engine.c]) 7 | AC_CONFIG_HEADERS([config.h]) 8 | AM_INIT_AUTOMAKE() 9 | AC_CONFIG_MACRO_DIR([m4]) 10 | 11 | m4_include([m4/m4-ax_compare_version.m4]) 12 | 13 | AC_PREFIX_DEFAULT(/usr/lib) 14 | 15 | # Checks for programs. 16 | AC_PROG_CC 17 | AC_PROG_CXX 18 | AC_PROG_LIBTOOL 19 | 20 | LT_INIT 21 | 22 | # Checks for libraries. 23 | AC_CHECK_LIB(netsnmp, snmp_sess_init, [LIBS="$LIBS -lnetsnmp"], [AC_MSG_ERROR(Please install net-snmp-devel(on rhel/sles) or libsnmp-dev(on ubuntu).)]) 24 | 25 | # Checks for header files. 26 | AC_CHECK_HEADERS([stdlib.h string.h unistd.h]) 27 | AC_CHECK_HEADERS([tdb.h],[],[AC_MSG_ERROR(Please install libtdb-devel(on rhel/sles) or libtdb-dev(on ubuntu).)],[]) 28 | 29 | # Check the nmap utility 30 | NMAP_MIN_VERSION=5.20 31 | AC_SUBST(NMAP_MIN_VERSION) 32 | 33 | AC_PATH_PROG(NMAP_PATH, nmap, no) 34 | 35 | AM_CONDITIONAL([COMPILING_ON_64], [test "x`getconf LONG_BIT`"="x64"]) 36 | AM_CONDITIONAL([COMPILING_ON_DEBIAN], [test -f "/etc/debian_version"]) 37 | 38 | if test "x$NMAP_PATH" = "xno"; then 39 | AC_MSG_ERROR(Cannot find nmap.) 40 | else 41 | AC_MSG_CHECKING(for namp version >= $NMAP_MIN_VERSION) 42 | NMAP_VERSION=`$NMAP_PATH --version | grep version | cut -d ' ' -f3` 43 | AX_COMPARE_VERSION([$NMAP_VERSION], [ge], [$NMAP_MIN_VERSION], 44 | AC_MSG_RESULT(yes), 45 | AC_MSG_ERROR(your namp version is '$NMAP_VERSION'. Must be >= $NMAP_MIN_VERSION)) 46 | fi 47 | 48 | # Checks for typedefs, structures, and compiler characteristics. 49 | AC_TYPE_SIZE_T 50 | 51 | # Checks for library functions. 52 | AC_FUNC_MALLOC 53 | AC_CHECK_FUNCS([memset strdup strstr]) 54 | AC_CONFIG_FILES([ 55 | Makefile 56 | scripts/Makefile 57 | template/Makefile 58 | src/ilo_credit/Makefile 59 | src/credit_save/Makefile 60 | src/hpeilo_engine/Makefile 61 | scripts/common_function 62 | scripts/hpeilo_zabbix_api.py 63 | scripts/hpeilo_zabbix_config 64 | scripts/zabbix_hpeilo_cfg_generator 65 | ]) 66 | 67 | AC_OUTPUT 68 | 69 | -------------------------------------------------------------------------------- /install-sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # install - install a program, script, or datafile 3 | 4 | scriptversion=2011-11-20.07; # UTC 5 | 6 | # This originates from X11R5 (mit/util/scripts/install.sh), which was 7 | # later released in X11R6 (xc/config/util/install.sh) with the 8 | # following copyright and license. 9 | # 10 | # Copyright (C) 1994 X Consortium 11 | # 12 | # Permission is hereby granted, free of charge, to any person obtaining a copy 13 | # of this software and associated documentation files (the "Software"), to 14 | # deal in the Software without restriction, including without limitation the 15 | # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 16 | # sell copies of the Software, and to permit persons to whom the Software is 17 | # furnished to do so, subject to the following conditions: 18 | # 19 | # The above copyright notice and this permission notice shall be included in 20 | # all copies or substantial portions of the Software. 21 | # 22 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 25 | # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 26 | # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- 27 | # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name of the X Consortium shall not 30 | # be used in advertising or otherwise to promote the sale, use or other deal- 31 | # ings in this Software without prior written authorization from the X Consor- 32 | # tium. 33 | # 34 | # 35 | # FSF changes to this file are in the public domain. 36 | # 37 | # Calling this script install-sh is preferred over install.sh, to prevent 38 | # 'make' implicit rules from creating a file called install from it 39 | # when there is no Makefile. 40 | # 41 | # This script is compatible with the BSD install script, but was written 42 | # from scratch. 43 | 44 | nl=' 45 | ' 46 | IFS=" "" $nl" 47 | 48 | # set DOITPROG to echo to test this script 49 | 50 | # Don't use :- since 4.3BSD and earlier shells don't like it. 51 | doit=${DOITPROG-} 52 | if test -z "$doit"; then 53 | doit_exec=exec 54 | else 55 | doit_exec=$doit 56 | fi 57 | 58 | # Put in absolute file names if you don't have them in your path; 59 | # or use environment vars. 60 | 61 | chgrpprog=${CHGRPPROG-chgrp} 62 | chmodprog=${CHMODPROG-chmod} 63 | chownprog=${CHOWNPROG-chown} 64 | cmpprog=${CMPPROG-cmp} 65 | cpprog=${CPPROG-cp} 66 | mkdirprog=${MKDIRPROG-mkdir} 67 | mvprog=${MVPROG-mv} 68 | rmprog=${RMPROG-rm} 69 | stripprog=${STRIPPROG-strip} 70 | 71 | posix_glob='?' 72 | initialize_posix_glob=' 73 | test "$posix_glob" != "?" || { 74 | if (set -f) 2>/dev/null; then 75 | posix_glob= 76 | else 77 | posix_glob=: 78 | fi 79 | } 80 | ' 81 | 82 | posix_mkdir= 83 | 84 | # Desired mode of installed file. 85 | mode=0755 86 | 87 | chgrpcmd= 88 | chmodcmd=$chmodprog 89 | chowncmd= 90 | mvcmd=$mvprog 91 | rmcmd="$rmprog -f" 92 | stripcmd= 93 | 94 | src= 95 | dst= 96 | dir_arg= 97 | dst_arg= 98 | 99 | copy_on_change=false 100 | no_target_directory= 101 | 102 | usage="\ 103 | Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE 104 | or: $0 [OPTION]... SRCFILES... DIRECTORY 105 | or: $0 [OPTION]... -t DIRECTORY SRCFILES... 106 | or: $0 [OPTION]... -d DIRECTORIES... 107 | 108 | In the 1st form, copy SRCFILE to DSTFILE. 109 | In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. 110 | In the 4th, create DIRECTORIES. 111 | 112 | Options: 113 | --help display this help and exit. 114 | --version display version info and exit. 115 | 116 | -c (ignored) 117 | -C install only if different (preserve the last data modification time) 118 | -d create directories instead of installing files. 119 | -g GROUP $chgrpprog installed files to GROUP. 120 | -m MODE $chmodprog installed files to MODE. 121 | -o USER $chownprog installed files to USER. 122 | -s $stripprog installed files. 123 | -t DIRECTORY install into DIRECTORY. 124 | -T report an error if DSTFILE is a directory. 125 | 126 | Environment variables override the default commands: 127 | CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG 128 | RMPROG STRIPPROG 129 | " 130 | 131 | while test $# -ne 0; do 132 | case $1 in 133 | -c) ;; 134 | 135 | -C) copy_on_change=true;; 136 | 137 | -d) dir_arg=true;; 138 | 139 | -g) chgrpcmd="$chgrpprog $2" 140 | shift;; 141 | 142 | --help) echo "$usage"; exit $?;; 143 | 144 | -m) mode=$2 145 | case $mode in 146 | *' '* | *' '* | *' 147 | '* | *'*'* | *'?'* | *'['*) 148 | echo "$0: invalid mode: $mode" >&2 149 | exit 1;; 150 | esac 151 | shift;; 152 | 153 | -o) chowncmd="$chownprog $2" 154 | shift;; 155 | 156 | -s) stripcmd=$stripprog;; 157 | 158 | -t) dst_arg=$2 159 | # Protect names problematic for 'test' and other utilities. 160 | case $dst_arg in 161 | -* | [=\(\)!]) dst_arg=./$dst_arg;; 162 | esac 163 | shift;; 164 | 165 | -T) no_target_directory=true;; 166 | 167 | --version) echo "$0 $scriptversion"; exit $?;; 168 | 169 | --) shift 170 | break;; 171 | 172 | -*) echo "$0: invalid option: $1" >&2 173 | exit 1;; 174 | 175 | *) break;; 176 | esac 177 | shift 178 | done 179 | 180 | if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then 181 | # When -d is used, all remaining arguments are directories to create. 182 | # When -t is used, the destination is already specified. 183 | # Otherwise, the last argument is the destination. Remove it from $@. 184 | for arg 185 | do 186 | if test -n "$dst_arg"; then 187 | # $@ is not empty: it contains at least $arg. 188 | set fnord "$@" "$dst_arg" 189 | shift # fnord 190 | fi 191 | shift # arg 192 | dst_arg=$arg 193 | # Protect names problematic for 'test' and other utilities. 194 | case $dst_arg in 195 | -* | [=\(\)!]) dst_arg=./$dst_arg;; 196 | esac 197 | done 198 | fi 199 | 200 | if test $# -eq 0; then 201 | if test -z "$dir_arg"; then 202 | echo "$0: no input file specified." >&2 203 | exit 1 204 | fi 205 | # It's OK to call 'install-sh -d' without argument. 206 | # This can happen when creating conditional directories. 207 | exit 0 208 | fi 209 | 210 | if test -z "$dir_arg"; then 211 | do_exit='(exit $ret); exit $ret' 212 | trap "ret=129; $do_exit" 1 213 | trap "ret=130; $do_exit" 2 214 | trap "ret=141; $do_exit" 13 215 | trap "ret=143; $do_exit" 15 216 | 217 | # Set umask so as not to create temps with too-generous modes. 218 | # However, 'strip' requires both read and write access to temps. 219 | case $mode in 220 | # Optimize common cases. 221 | *644) cp_umask=133;; 222 | *755) cp_umask=22;; 223 | 224 | *[0-7]) 225 | if test -z "$stripcmd"; then 226 | u_plus_rw= 227 | else 228 | u_plus_rw='% 200' 229 | fi 230 | cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; 231 | *) 232 | if test -z "$stripcmd"; then 233 | u_plus_rw= 234 | else 235 | u_plus_rw=,u+rw 236 | fi 237 | cp_umask=$mode$u_plus_rw;; 238 | esac 239 | fi 240 | 241 | for src 242 | do 243 | # Protect names problematic for 'test' and other utilities. 244 | case $src in 245 | -* | [=\(\)!]) src=./$src;; 246 | esac 247 | 248 | if test -n "$dir_arg"; then 249 | dst=$src 250 | dstdir=$dst 251 | test -d "$dstdir" 252 | dstdir_status=$? 253 | else 254 | 255 | # Waiting for this to be detected by the "$cpprog $src $dsttmp" command 256 | # might cause directories to be created, which would be especially bad 257 | # if $src (and thus $dsttmp) contains '*'. 258 | if test ! -f "$src" && test ! -d "$src"; then 259 | echo "$0: $src does not exist." >&2 260 | exit 1 261 | fi 262 | 263 | if test -z "$dst_arg"; then 264 | echo "$0: no destination specified." >&2 265 | exit 1 266 | fi 267 | dst=$dst_arg 268 | 269 | # If destination is a directory, append the input filename; won't work 270 | # if double slashes aren't ignored. 271 | if test -d "$dst"; then 272 | if test -n "$no_target_directory"; then 273 | echo "$0: $dst_arg: Is a directory" >&2 274 | exit 1 275 | fi 276 | dstdir=$dst 277 | dst=$dstdir/`basename "$src"` 278 | dstdir_status=0 279 | else 280 | # Prefer dirname, but fall back on a substitute if dirname fails. 281 | dstdir=` 282 | (dirname "$dst") 2>/dev/null || 283 | expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ 284 | X"$dst" : 'X\(//\)[^/]' \| \ 285 | X"$dst" : 'X\(//\)$' \| \ 286 | X"$dst" : 'X\(/\)' \| . 2>/dev/null || 287 | echo X"$dst" | 288 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ 289 | s//\1/ 290 | q 291 | } 292 | /^X\(\/\/\)[^/].*/{ 293 | s//\1/ 294 | q 295 | } 296 | /^X\(\/\/\)$/{ 297 | s//\1/ 298 | q 299 | } 300 | /^X\(\/\).*/{ 301 | s//\1/ 302 | q 303 | } 304 | s/.*/./; q' 305 | ` 306 | 307 | test -d "$dstdir" 308 | dstdir_status=$? 309 | fi 310 | fi 311 | 312 | obsolete_mkdir_used=false 313 | 314 | if test $dstdir_status != 0; then 315 | case $posix_mkdir in 316 | '') 317 | # Create intermediate dirs using mode 755 as modified by the umask. 318 | # This is like FreeBSD 'install' as of 1997-10-28. 319 | umask=`umask` 320 | case $stripcmd.$umask in 321 | # Optimize common cases. 322 | *[2367][2367]) mkdir_umask=$umask;; 323 | .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; 324 | 325 | *[0-7]) 326 | mkdir_umask=`expr $umask + 22 \ 327 | - $umask % 100 % 40 + $umask % 20 \ 328 | - $umask % 10 % 4 + $umask % 2 329 | `;; 330 | *) mkdir_umask=$umask,go-w;; 331 | esac 332 | 333 | # With -d, create the new directory with the user-specified mode. 334 | # Otherwise, rely on $mkdir_umask. 335 | if test -n "$dir_arg"; then 336 | mkdir_mode=-m$mode 337 | else 338 | mkdir_mode= 339 | fi 340 | 341 | posix_mkdir=false 342 | case $umask in 343 | *[123567][0-7][0-7]) 344 | # POSIX mkdir -p sets u+wx bits regardless of umask, which 345 | # is incompatible with FreeBSD 'install' when (umask & 300) != 0. 346 | ;; 347 | *) 348 | tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ 349 | trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 350 | 351 | if (umask $mkdir_umask && 352 | exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 353 | then 354 | if test -z "$dir_arg" || { 355 | # Check for POSIX incompatibilities with -m. 356 | # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or 357 | # other-writable bit of parent directory when it shouldn't. 358 | # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. 359 | ls_ld_tmpdir=`ls -ld "$tmpdir"` 360 | case $ls_ld_tmpdir in 361 | d????-?r-*) different_mode=700;; 362 | d????-?--*) different_mode=755;; 363 | *) false;; 364 | esac && 365 | $mkdirprog -m$different_mode -p -- "$tmpdir" && { 366 | ls_ld_tmpdir_1=`ls -ld "$tmpdir"` 367 | test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" 368 | } 369 | } 370 | then posix_mkdir=: 371 | fi 372 | rmdir "$tmpdir/d" "$tmpdir" 373 | else 374 | # Remove any dirs left behind by ancient mkdir implementations. 375 | rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null 376 | fi 377 | trap '' 0;; 378 | esac;; 379 | esac 380 | 381 | if 382 | $posix_mkdir && ( 383 | umask $mkdir_umask && 384 | $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" 385 | ) 386 | then : 387 | else 388 | 389 | # The umask is ridiculous, or mkdir does not conform to POSIX, 390 | # or it failed possibly due to a race condition. Create the 391 | # directory the slow way, step by step, checking for races as we go. 392 | 393 | case $dstdir in 394 | /*) prefix='/';; 395 | [-=\(\)!]*) prefix='./';; 396 | *) prefix='';; 397 | esac 398 | 399 | eval "$initialize_posix_glob" 400 | 401 | oIFS=$IFS 402 | IFS=/ 403 | $posix_glob set -f 404 | set fnord $dstdir 405 | shift 406 | $posix_glob set +f 407 | IFS=$oIFS 408 | 409 | prefixes= 410 | 411 | for d 412 | do 413 | test X"$d" = X && continue 414 | 415 | prefix=$prefix$d 416 | if test -d "$prefix"; then 417 | prefixes= 418 | else 419 | if $posix_mkdir; then 420 | (umask=$mkdir_umask && 421 | $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break 422 | # Don't fail if two instances are running concurrently. 423 | test -d "$prefix" || exit 1 424 | else 425 | case $prefix in 426 | *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; 427 | *) qprefix=$prefix;; 428 | esac 429 | prefixes="$prefixes '$qprefix'" 430 | fi 431 | fi 432 | prefix=$prefix/ 433 | done 434 | 435 | if test -n "$prefixes"; then 436 | # Don't fail if two instances are running concurrently. 437 | (umask $mkdir_umask && 438 | eval "\$doit_exec \$mkdirprog $prefixes") || 439 | test -d "$dstdir" || exit 1 440 | obsolete_mkdir_used=true 441 | fi 442 | fi 443 | fi 444 | 445 | if test -n "$dir_arg"; then 446 | { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && 447 | { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && 448 | { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || 449 | test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 450 | else 451 | 452 | # Make a couple of temp file names in the proper directory. 453 | dsttmp=$dstdir/_inst.$$_ 454 | rmtmp=$dstdir/_rm.$$_ 455 | 456 | # Trap to clean up those temp files at exit. 457 | trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 458 | 459 | # Copy the file name to the temp name. 460 | (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && 461 | 462 | # and set any options; do chmod last to preserve setuid bits. 463 | # 464 | # If any of these fail, we abort the whole thing. If we want to 465 | # ignore errors from any of these, just make sure not to ignore 466 | # errors from the above "$doit $cpprog $src $dsttmp" command. 467 | # 468 | { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && 469 | { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && 470 | { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && 471 | { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && 472 | 473 | # If -C, don't bother to copy if it wouldn't change the file. 474 | if $copy_on_change && 475 | old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && 476 | new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && 477 | 478 | eval "$initialize_posix_glob" && 479 | $posix_glob set -f && 480 | set X $old && old=:$2:$4:$5:$6 && 481 | set X $new && new=:$2:$4:$5:$6 && 482 | $posix_glob set +f && 483 | 484 | test "$old" = "$new" && 485 | $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 486 | then 487 | rm -f "$dsttmp" 488 | else 489 | # Rename the file to the real destination. 490 | $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || 491 | 492 | # The rename failed, perhaps because mv can't rename something else 493 | # to itself, or perhaps because mv is so ancient that it does not 494 | # support -f. 495 | { 496 | # Now remove or move aside any old file at destination location. 497 | # We try this two ways since rm can't unlink itself on some 498 | # systems and the destination file might be busy for other 499 | # reasons. In this case, the final cleanup might fail but the new 500 | # file should still install successfully. 501 | { 502 | test ! -f "$dst" || 503 | $doit $rmcmd -f "$dst" 2>/dev/null || 504 | { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && 505 | { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } 506 | } || 507 | { echo "$0: cannot unlink or rename $dst" >&2 508 | (exit 1); exit 1 509 | } 510 | } && 511 | 512 | # Now rename the file to the real destination. 513 | $doit $mvcmd "$dsttmp" "$dst" 514 | } 515 | fi || exit 1 516 | 517 | trap '' 0 518 | fi 519 | done 520 | 521 | # Local variables: 522 | # eval: (add-hook 'write-file-hooks 'time-stamp) 523 | # time-stamp-start: "scriptversion=" 524 | # time-stamp-format: "%:y-%02m-%02d.%02H" 525 | # time-stamp-time-zone: "UTC" 526 | # time-stamp-end: "; # UTC" 527 | # End: 528 | -------------------------------------------------------------------------------- /m4/ltoptions.m4: -------------------------------------------------------------------------------- 1 | # Helper functions for option handling. -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, 4 | # Inc. 5 | # Written by Gary V. Vaughan, 2004 6 | # 7 | # This file is free software; the Free Software Foundation gives 8 | # unlimited permission to copy and/or distribute it, with or without 9 | # modifications, as long as this notice is preserved. 10 | 11 | # serial 7 ltoptions.m4 12 | 13 | # This is to help aclocal find these macros, as it can't see m4_define. 14 | AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) 15 | 16 | 17 | # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) 18 | # ------------------------------------------ 19 | m4_define([_LT_MANGLE_OPTION], 20 | [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) 21 | 22 | 23 | # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) 24 | # --------------------------------------- 25 | # Set option OPTION-NAME for macro MACRO-NAME, and if there is a 26 | # matching handler defined, dispatch to it. Other OPTION-NAMEs are 27 | # saved as a flag. 28 | m4_define([_LT_SET_OPTION], 29 | [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl 30 | m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), 31 | _LT_MANGLE_DEFUN([$1], [$2]), 32 | [m4_warning([Unknown $1 option `$2'])])[]dnl 33 | ]) 34 | 35 | 36 | # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) 37 | # ------------------------------------------------------------ 38 | # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 39 | m4_define([_LT_IF_OPTION], 40 | [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) 41 | 42 | 43 | # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) 44 | # ------------------------------------------------------- 45 | # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME 46 | # are set. 47 | m4_define([_LT_UNLESS_OPTIONS], 48 | [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), 49 | [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), 50 | [m4_define([$0_found])])])[]dnl 51 | m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 52 | ])[]dnl 53 | ]) 54 | 55 | 56 | # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) 57 | # ---------------------------------------- 58 | # OPTION-LIST is a space-separated list of Libtool options associated 59 | # with MACRO-NAME. If any OPTION has a matching handler declared with 60 | # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about 61 | # the unknown option and exit. 62 | m4_defun([_LT_SET_OPTIONS], 63 | [# Set options 64 | m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), 65 | [_LT_SET_OPTION([$1], _LT_Option)]) 66 | 67 | m4_if([$1],[LT_INIT],[ 68 | dnl 69 | dnl Simply set some default values (i.e off) if boolean options were not 70 | dnl specified: 71 | _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no 72 | ]) 73 | _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no 74 | ]) 75 | dnl 76 | dnl If no reference was made to various pairs of opposing options, then 77 | dnl we run the default mode handler for the pair. For example, if neither 78 | dnl `shared' nor `disable-shared' was passed, we enable building of shared 79 | dnl archives by default: 80 | _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) 81 | _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) 82 | _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) 83 | _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], 84 | [_LT_ENABLE_FAST_INSTALL]) 85 | ]) 86 | ])# _LT_SET_OPTIONS 87 | 88 | 89 | ## --------------------------------- ## 90 | ## Macros to handle LT_INIT options. ## 91 | ## --------------------------------- ## 92 | 93 | # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) 94 | # ----------------------------------------- 95 | m4_define([_LT_MANGLE_DEFUN], 96 | [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) 97 | 98 | 99 | # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) 100 | # ----------------------------------------------- 101 | m4_define([LT_OPTION_DEFINE], 102 | [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl 103 | ])# LT_OPTION_DEFINE 104 | 105 | 106 | # dlopen 107 | # ------ 108 | LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes 109 | ]) 110 | 111 | AU_DEFUN([AC_LIBTOOL_DLOPEN], 112 | [_LT_SET_OPTION([LT_INIT], [dlopen]) 113 | AC_DIAGNOSE([obsolete], 114 | [$0: Remove this warning and the call to _LT_SET_OPTION when you 115 | put the `dlopen' option into LT_INIT's first parameter.]) 116 | ]) 117 | 118 | dnl aclocal-1.4 backwards compatibility: 119 | dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) 120 | 121 | 122 | # win32-dll 123 | # --------- 124 | # Declare package support for building win32 dll's. 125 | LT_OPTION_DEFINE([LT_INIT], [win32-dll], 126 | [enable_win32_dll=yes 127 | 128 | case $host in 129 | *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) 130 | AC_CHECK_TOOL(AS, as, false) 131 | AC_CHECK_TOOL(DLLTOOL, dlltool, false) 132 | AC_CHECK_TOOL(OBJDUMP, objdump, false) 133 | ;; 134 | esac 135 | 136 | test -z "$AS" && AS=as 137 | _LT_DECL([], [AS], [1], [Assembler program])dnl 138 | 139 | test -z "$DLLTOOL" && DLLTOOL=dlltool 140 | _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl 141 | 142 | test -z "$OBJDUMP" && OBJDUMP=objdump 143 | _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl 144 | ])# win32-dll 145 | 146 | AU_DEFUN([AC_LIBTOOL_WIN32_DLL], 147 | [AC_REQUIRE([AC_CANONICAL_HOST])dnl 148 | _LT_SET_OPTION([LT_INIT], [win32-dll]) 149 | AC_DIAGNOSE([obsolete], 150 | [$0: Remove this warning and the call to _LT_SET_OPTION when you 151 | put the `win32-dll' option into LT_INIT's first parameter.]) 152 | ]) 153 | 154 | dnl aclocal-1.4 backwards compatibility: 155 | dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) 156 | 157 | 158 | # _LT_ENABLE_SHARED([DEFAULT]) 159 | # ---------------------------- 160 | # implement the --enable-shared flag, and supports the `shared' and 161 | # `disable-shared' LT_INIT options. 162 | # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. 163 | m4_define([_LT_ENABLE_SHARED], 164 | [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl 165 | AC_ARG_ENABLE([shared], 166 | [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], 167 | [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], 168 | [p=${PACKAGE-default} 169 | case $enableval in 170 | yes) enable_shared=yes ;; 171 | no) enable_shared=no ;; 172 | *) 173 | enable_shared=no 174 | # Look at the argument we got. We use all the common list separators. 175 | lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," 176 | for pkg in $enableval; do 177 | IFS="$lt_save_ifs" 178 | if test "X$pkg" = "X$p"; then 179 | enable_shared=yes 180 | fi 181 | done 182 | IFS="$lt_save_ifs" 183 | ;; 184 | esac], 185 | [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) 186 | 187 | _LT_DECL([build_libtool_libs], [enable_shared], [0], 188 | [Whether or not to build shared libraries]) 189 | ])# _LT_ENABLE_SHARED 190 | 191 | LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) 192 | LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) 193 | 194 | # Old names: 195 | AC_DEFUN([AC_ENABLE_SHARED], 196 | [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) 197 | ]) 198 | 199 | AC_DEFUN([AC_DISABLE_SHARED], 200 | [_LT_SET_OPTION([LT_INIT], [disable-shared]) 201 | ]) 202 | 203 | AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) 204 | AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) 205 | 206 | dnl aclocal-1.4 backwards compatibility: 207 | dnl AC_DEFUN([AM_ENABLE_SHARED], []) 208 | dnl AC_DEFUN([AM_DISABLE_SHARED], []) 209 | 210 | 211 | 212 | # _LT_ENABLE_STATIC([DEFAULT]) 213 | # ---------------------------- 214 | # implement the --enable-static flag, and support the `static' and 215 | # `disable-static' LT_INIT options. 216 | # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. 217 | m4_define([_LT_ENABLE_STATIC], 218 | [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl 219 | AC_ARG_ENABLE([static], 220 | [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], 221 | [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], 222 | [p=${PACKAGE-default} 223 | case $enableval in 224 | yes) enable_static=yes ;; 225 | no) enable_static=no ;; 226 | *) 227 | enable_static=no 228 | # Look at the argument we got. We use all the common list separators. 229 | lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," 230 | for pkg in $enableval; do 231 | IFS="$lt_save_ifs" 232 | if test "X$pkg" = "X$p"; then 233 | enable_static=yes 234 | fi 235 | done 236 | IFS="$lt_save_ifs" 237 | ;; 238 | esac], 239 | [enable_static=]_LT_ENABLE_STATIC_DEFAULT) 240 | 241 | _LT_DECL([build_old_libs], [enable_static], [0], 242 | [Whether or not to build static libraries]) 243 | ])# _LT_ENABLE_STATIC 244 | 245 | LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) 246 | LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) 247 | 248 | # Old names: 249 | AC_DEFUN([AC_ENABLE_STATIC], 250 | [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) 251 | ]) 252 | 253 | AC_DEFUN([AC_DISABLE_STATIC], 254 | [_LT_SET_OPTION([LT_INIT], [disable-static]) 255 | ]) 256 | 257 | AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) 258 | AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) 259 | 260 | dnl aclocal-1.4 backwards compatibility: 261 | dnl AC_DEFUN([AM_ENABLE_STATIC], []) 262 | dnl AC_DEFUN([AM_DISABLE_STATIC], []) 263 | 264 | 265 | 266 | # _LT_ENABLE_FAST_INSTALL([DEFAULT]) 267 | # ---------------------------------- 268 | # implement the --enable-fast-install flag, and support the `fast-install' 269 | # and `disable-fast-install' LT_INIT options. 270 | # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. 271 | m4_define([_LT_ENABLE_FAST_INSTALL], 272 | [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl 273 | AC_ARG_ENABLE([fast-install], 274 | [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], 275 | [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], 276 | [p=${PACKAGE-default} 277 | case $enableval in 278 | yes) enable_fast_install=yes ;; 279 | no) enable_fast_install=no ;; 280 | *) 281 | enable_fast_install=no 282 | # Look at the argument we got. We use all the common list separators. 283 | lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," 284 | for pkg in $enableval; do 285 | IFS="$lt_save_ifs" 286 | if test "X$pkg" = "X$p"; then 287 | enable_fast_install=yes 288 | fi 289 | done 290 | IFS="$lt_save_ifs" 291 | ;; 292 | esac], 293 | [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) 294 | 295 | _LT_DECL([fast_install], [enable_fast_install], [0], 296 | [Whether or not to optimize for fast installation])dnl 297 | ])# _LT_ENABLE_FAST_INSTALL 298 | 299 | LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) 300 | LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) 301 | 302 | # Old names: 303 | AU_DEFUN([AC_ENABLE_FAST_INSTALL], 304 | [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) 305 | AC_DIAGNOSE([obsolete], 306 | [$0: Remove this warning and the call to _LT_SET_OPTION when you put 307 | the `fast-install' option into LT_INIT's first parameter.]) 308 | ]) 309 | 310 | AU_DEFUN([AC_DISABLE_FAST_INSTALL], 311 | [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) 312 | AC_DIAGNOSE([obsolete], 313 | [$0: Remove this warning and the call to _LT_SET_OPTION when you put 314 | the `disable-fast-install' option into LT_INIT's first parameter.]) 315 | ]) 316 | 317 | dnl aclocal-1.4 backwards compatibility: 318 | dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) 319 | dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) 320 | 321 | 322 | # _LT_WITH_PIC([MODE]) 323 | # -------------------- 324 | # implement the --with-pic flag, and support the `pic-only' and `no-pic' 325 | # LT_INIT options. 326 | # MODE is either `yes' or `no'. If omitted, it defaults to `both'. 327 | m4_define([_LT_WITH_PIC], 328 | [AC_ARG_WITH([pic], 329 | [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], 330 | [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], 331 | [lt_p=${PACKAGE-default} 332 | case $withval in 333 | yes|no) pic_mode=$withval ;; 334 | *) 335 | pic_mode=default 336 | # Look at the argument we got. We use all the common list separators. 337 | lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," 338 | for lt_pkg in $withval; do 339 | IFS="$lt_save_ifs" 340 | if test "X$lt_pkg" = "X$lt_p"; then 341 | pic_mode=yes 342 | fi 343 | done 344 | IFS="$lt_save_ifs" 345 | ;; 346 | esac], 347 | [pic_mode=default]) 348 | 349 | test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) 350 | 351 | _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl 352 | ])# _LT_WITH_PIC 353 | 354 | LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) 355 | LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) 356 | 357 | # Old name: 358 | AU_DEFUN([AC_LIBTOOL_PICMODE], 359 | [_LT_SET_OPTION([LT_INIT], [pic-only]) 360 | AC_DIAGNOSE([obsolete], 361 | [$0: Remove this warning and the call to _LT_SET_OPTION when you 362 | put the `pic-only' option into LT_INIT's first parameter.]) 363 | ]) 364 | 365 | dnl aclocal-1.4 backwards compatibility: 366 | dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) 367 | 368 | ## ----------------- ## 369 | ## LTDL_INIT Options ## 370 | ## ----------------- ## 371 | 372 | m4_define([_LTDL_MODE], []) 373 | LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], 374 | [m4_define([_LTDL_MODE], [nonrecursive])]) 375 | LT_OPTION_DEFINE([LTDL_INIT], [recursive], 376 | [m4_define([_LTDL_MODE], [recursive])]) 377 | LT_OPTION_DEFINE([LTDL_INIT], [subproject], 378 | [m4_define([_LTDL_MODE], [subproject])]) 379 | 380 | m4_define([_LTDL_TYPE], []) 381 | LT_OPTION_DEFINE([LTDL_INIT], [installable], 382 | [m4_define([_LTDL_TYPE], [installable])]) 383 | LT_OPTION_DEFINE([LTDL_INIT], [convenience], 384 | [m4_define([_LTDL_TYPE], [convenience])]) 385 | -------------------------------------------------------------------------------- /m4/ltsugar.m4: -------------------------------------------------------------------------------- 1 | # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- 2 | # 3 | # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. 4 | # Written by Gary V. Vaughan, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # serial 6 ltsugar.m4 11 | 12 | # This is to help aclocal find these macros, as it can't see m4_define. 13 | AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) 14 | 15 | 16 | # lt_join(SEP, ARG1, [ARG2...]) 17 | # ----------------------------- 18 | # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their 19 | # associated separator. 20 | # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier 21 | # versions in m4sugar had bugs. 22 | m4_define([lt_join], 23 | [m4_if([$#], [1], [], 24 | [$#], [2], [[$2]], 25 | [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) 26 | m4_define([_lt_join], 27 | [m4_if([$#$2], [2], [], 28 | [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) 29 | 30 | 31 | # lt_car(LIST) 32 | # lt_cdr(LIST) 33 | # ------------ 34 | # Manipulate m4 lists. 35 | # These macros are necessary as long as will still need to support 36 | # Autoconf-2.59 which quotes differently. 37 | m4_define([lt_car], [[$1]]) 38 | m4_define([lt_cdr], 39 | [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], 40 | [$#], 1, [], 41 | [m4_dquote(m4_shift($@))])]) 42 | m4_define([lt_unquote], $1) 43 | 44 | 45 | # lt_append(MACRO-NAME, STRING, [SEPARATOR]) 46 | # ------------------------------------------ 47 | # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. 48 | # Note that neither SEPARATOR nor STRING are expanded; they are appended 49 | # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). 50 | # No SEPARATOR is output if MACRO-NAME was previously undefined (different 51 | # than defined and empty). 52 | # 53 | # This macro is needed until we can rely on Autoconf 2.62, since earlier 54 | # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. 55 | m4_define([lt_append], 56 | [m4_define([$1], 57 | m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) 58 | 59 | 60 | 61 | # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) 62 | # ---------------------------------------------------------- 63 | # Produce a SEP delimited list of all paired combinations of elements of 64 | # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list 65 | # has the form PREFIXmINFIXSUFFIXn. 66 | # Needed until we can rely on m4_combine added in Autoconf 2.62. 67 | m4_define([lt_combine], 68 | [m4_if(m4_eval([$# > 3]), [1], 69 | [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl 70 | [[m4_foreach([_Lt_prefix], [$2], 71 | [m4_foreach([_Lt_suffix], 72 | ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, 73 | [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) 74 | 75 | 76 | # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) 77 | # ----------------------------------------------------------------------- 78 | # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited 79 | # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. 80 | m4_define([lt_if_append_uniq], 81 | [m4_ifdef([$1], 82 | [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], 83 | [lt_append([$1], [$2], [$3])$4], 84 | [$5])], 85 | [lt_append([$1], [$2], [$3])$4])]) 86 | 87 | 88 | # lt_dict_add(DICT, KEY, VALUE) 89 | # ----------------------------- 90 | m4_define([lt_dict_add], 91 | [m4_define([$1($2)], [$3])]) 92 | 93 | 94 | # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) 95 | # -------------------------------------------- 96 | m4_define([lt_dict_add_subkey], 97 | [m4_define([$1($2:$3)], [$4])]) 98 | 99 | 100 | # lt_dict_fetch(DICT, KEY, [SUBKEY]) 101 | # ---------------------------------- 102 | m4_define([lt_dict_fetch], 103 | [m4_ifval([$3], 104 | m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), 105 | m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) 106 | 107 | 108 | # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) 109 | # ----------------------------------------------------------------- 110 | m4_define([lt_if_dict_fetch], 111 | [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], 112 | [$5], 113 | [$6])]) 114 | 115 | 116 | # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) 117 | # -------------------------------------------------------------- 118 | m4_define([lt_dict_filter], 119 | [m4_if([$5], [], [], 120 | [lt_join(m4_quote(m4_default([$4], [[, ]])), 121 | lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), 122 | [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl 123 | ]) 124 | -------------------------------------------------------------------------------- /m4/ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004 Free Software Foundation, Inc. 4 | # Written by Scott James Remnant, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # @configure_input@ 11 | 12 | # serial 3337 ltversion.m4 13 | # This file is part of GNU Libtool 14 | 15 | m4_define([LT_PACKAGE_VERSION], [2.4.2]) 16 | m4_define([LT_PACKAGE_REVISION], [1.3337]) 17 | 18 | AC_DEFUN([LTVERSION_VERSION], 19 | [macro_version='2.4.2' 20 | macro_revision='1.3337' 21 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 22 | _LT_DECL(, macro_revision, 0) 23 | ]) 24 | -------------------------------------------------------------------------------- /m4/lt~obsolete.m4: -------------------------------------------------------------------------------- 1 | # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- 2 | # 3 | # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. 4 | # Written by Scott James Remnant, 2004. 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # serial 5 lt~obsolete.m4 11 | 12 | # These exist entirely to fool aclocal when bootstrapping libtool. 13 | # 14 | # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) 15 | # which have later been changed to m4_define as they aren't part of the 16 | # exported API, or moved to Autoconf or Automake where they belong. 17 | # 18 | # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN 19 | # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us 20 | # using a macro with the same name in our local m4/libtool.m4 it'll 21 | # pull the old libtool.m4 in (it doesn't see our shiny new m4_define 22 | # and doesn't know about Autoconf macros at all.) 23 | # 24 | # So we provide this file, which has a silly filename so it's always 25 | # included after everything else. This provides aclocal with the 26 | # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything 27 | # because those macros already exist, or will be overwritten later. 28 | # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 29 | # 30 | # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. 31 | # Yes, that means every name once taken will need to remain here until 32 | # we give up compatibility with versions before 1.7, at which point 33 | # we need to keep only those names which we still refer to. 34 | 35 | # This is to help aclocal find these macros, as it can't see m4_define. 36 | AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) 37 | 38 | m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) 39 | m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) 40 | m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) 41 | m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) 42 | m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) 43 | m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) 44 | m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) 45 | m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) 46 | m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) 47 | m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) 48 | m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) 49 | m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) 50 | m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) 51 | m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) 52 | m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) 53 | m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) 54 | m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) 55 | m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) 56 | m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) 57 | m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) 58 | m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) 59 | m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) 60 | m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) 61 | m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) 62 | m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) 63 | m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) 64 | m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) 65 | m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) 66 | m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) 67 | m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) 68 | m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) 69 | m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) 70 | m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) 71 | m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) 72 | m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) 73 | m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) 74 | m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) 75 | m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) 76 | m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) 77 | m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) 78 | m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) 79 | m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) 80 | m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) 81 | m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) 82 | m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) 83 | m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) 84 | m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) 85 | m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) 86 | m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) 87 | m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) 88 | m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) 89 | m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) 90 | m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) 91 | m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) 92 | m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) 93 | m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) 94 | m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) 95 | m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) 96 | m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) 97 | m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) 98 | m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) 99 | -------------------------------------------------------------------------------- /m4/m4-ax_compare_version.m4: -------------------------------------------------------------------------------- 1 | # =========================================================================== 2 | # http://www.gnu.org/software/autoconf-archive/ax_compare_version.html 3 | # =========================================================================== 4 | # 5 | # SYNOPSIS 6 | # 7 | # AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) 8 | # 9 | # DESCRIPTION 10 | # 11 | # This macro compares two version strings. Due to the various number of 12 | # minor-version numbers that can exist, and the fact that string 13 | # comparisons are not compatible with numeric comparisons, this is not 14 | # necessarily trivial to do in a autoconf script. This macro makes doing 15 | # these comparisons easy. 16 | # 17 | # The six basic comparisons are available, as well as checking equality 18 | # limited to a certain number of minor-version levels. 19 | # 20 | # The operator OP determines what type of comparison to do, and can be one 21 | # of: 22 | # 23 | # eq - equal (test A == B) 24 | # ne - not equal (test A != B) 25 | # le - less than or equal (test A <= B) 26 | # ge - greater than or equal (test A >= B) 27 | # lt - less than (test A < B) 28 | # gt - greater than (test A > B) 29 | # 30 | # Additionally, the eq and ne operator can have a number after it to limit 31 | # the test to that number of minor versions. 32 | # 33 | # eq0 - equal up to the length of the shorter version 34 | # ne0 - not equal up to the length of the shorter version 35 | # eqN - equal up to N sub-version levels 36 | # neN - not equal up to N sub-version levels 37 | # 38 | # When the condition is true, shell commands ACTION-IF-TRUE are run, 39 | # otherwise shell commands ACTION-IF-FALSE are run. The environment 40 | # variable 'ax_compare_version' is always set to either 'true' or 'false' 41 | # as well. 42 | # 43 | # Examples: 44 | # 45 | # AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8]) 46 | # AX_COMPARE_VERSION([3.15],[lt],[3.15.8]) 47 | # 48 | # would both be true. 49 | # 50 | # AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8]) 51 | # AX_COMPARE_VERSION([3.15],[gt],[3.15.8]) 52 | # 53 | # would both be false. 54 | # 55 | # AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8]) 56 | # 57 | # would be true because it is only comparing two minor versions. 58 | # 59 | # AX_COMPARE_VERSION([3.15.7],[eq0],[3.15]) 60 | # 61 | # would be true because it is only comparing the lesser number of minor 62 | # versions of the two values. 63 | # 64 | # Note: The characters that separate the version numbers do not matter. An 65 | # empty string is the same as version 0. OP is evaluated by autoconf, not 66 | # configure, so must be a string, not a variable. 67 | # 68 | # The author would like to acknowledge Guido Draheim whose advice about 69 | # the m4_case and m4_ifvaln functions make this macro only include the 70 | # portions necessary to perform the specific comparison specified by the 71 | # OP argument in the final configure script. 72 | # 73 | # LICENSE 74 | # 75 | # Copyright (c) 2008 Tim Toolan 76 | # 77 | # Copying and distribution of this file, with or without modification, are 78 | # permitted in any medium without royalty provided the copyright notice 79 | # and this notice are preserved. This file is offered as-is, without any 80 | # warranty. 81 | 82 | #serial 11 83 | 84 | dnl ######################################################################### 85 | AC_DEFUN([AX_COMPARE_VERSION], [ 86 | AC_REQUIRE([AC_PROG_AWK]) 87 | 88 | # Used to indicate true or false condition 89 | ax_compare_version=false 90 | 91 | # Convert the two version strings to be compared into a format that 92 | # allows a simple string comparison. The end result is that a version 93 | # string of the form 1.12.5-r617 will be converted to the form 94 | # 0001001200050617. In other words, each number is zero padded to four 95 | # digits, and non digits are removed. 96 | AS_VAR_PUSHDEF([A],[ax_compare_version_A]) 97 | A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ 98 | -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ 99 | -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ 100 | -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ 101 | -e 's/[[^0-9]]//g'` 102 | 103 | AS_VAR_PUSHDEF([B],[ax_compare_version_B]) 104 | B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ 105 | -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ 106 | -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ 107 | -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ 108 | -e 's/[[^0-9]]//g'` 109 | 110 | dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary 111 | dnl # then the first line is used to determine if the condition is true. 112 | dnl # The sed right after the echo is to remove any indented white space. 113 | m4_case(m4_tolower($2), 114 | [lt],[ 115 | ax_compare_version=`echo "x$A 116 | x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"` 117 | ], 118 | [gt],[ 119 | ax_compare_version=`echo "x$A 120 | x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"` 121 | ], 122 | [le],[ 123 | ax_compare_version=`echo "x$A 124 | x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"` 125 | ], 126 | [ge],[ 127 | ax_compare_version=`echo "x$A 128 | x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"` 129 | ],[ 130 | dnl Split the operator from the subversion count if present. 131 | m4_bmatch(m4_substr($2,2), 132 | [0],[ 133 | # A count of zero means use the length of the shorter version. 134 | # Determine the number of characters in A and B. 135 | ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'` 136 | ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'` 137 | 138 | # Set A to no more than B's length and B to no more than A's length. 139 | A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"` 140 | B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"` 141 | ], 142 | [[0-9]+],[ 143 | # A count greater than zero means use only that many subversions 144 | A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` 145 | B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` 146 | ], 147 | [.+],[ 148 | AC_WARNING( 149 | [illegal OP numeric parameter: $2]) 150 | ],[]) 151 | 152 | # Pad zeros at end of numbers to make same length. 153 | ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`" 154 | B="$B`echo $A | sed 's/./0/g'`" 155 | A="$ax_compare_version_tmp_A" 156 | 157 | # Check for equality or inequality as necessary. 158 | m4_case(m4_tolower(m4_substr($2,0,2)), 159 | [eq],[ 160 | test "x$A" = "x$B" && ax_compare_version=true 161 | ], 162 | [ne],[ 163 | test "x$A" != "x$B" && ax_compare_version=true 164 | ],[ 165 | AC_WARNING([illegal OP parameter: $2]) 166 | ]) 167 | ]) 168 | 169 | AS_VAR_POPDEF([A])dnl 170 | AS_VAR_POPDEF([B])dnl 171 | 172 | dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE. 173 | if test "$ax_compare_version" = "true" ; then 174 | m4_ifvaln([$4],[$4],[:])dnl 175 | m4_ifvaln([$5],[else $5])dnl 176 | fi 177 | ]) dnl AX_COMPARE_VERSION 178 | 179 | -------------------------------------------------------------------------------- /missing: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Common stub for a few missing GNU programs while installing. 3 | 4 | scriptversion=2012-01-06.13; # UTC 5 | 6 | # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 7 | # 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. 8 | # Originally by Fran,cois Pinard , 1996. 9 | 10 | # This program is free software; you can redistribute it and/or modify 11 | # it under the terms of the GNU General Public License as published by 12 | # the Free Software Foundation; either version 2, or (at your option) 13 | # any later version. 14 | 15 | # This program is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | # GNU General Public License for more details. 19 | 20 | # You should have received a copy of the GNU General Public License 21 | # along with this program. If not, see . 22 | 23 | # As a special exception to the GNU General Public License, if you 24 | # distribute this file as part of a program that contains a 25 | # configuration script generated by Autoconf, you may include it under 26 | # the same distribution terms that you use for the rest of that program. 27 | 28 | if test $# -eq 0; then 29 | echo 1>&2 "Try \`$0 --help' for more information" 30 | exit 1 31 | fi 32 | 33 | run=: 34 | sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' 35 | sed_minuso='s/.* -o \([^ ]*\).*/\1/p' 36 | 37 | # In the cases where this matters, `missing' is being run in the 38 | # srcdir already. 39 | if test -f configure.ac; then 40 | configure_ac=configure.ac 41 | else 42 | configure_ac=configure.in 43 | fi 44 | 45 | msg="missing on your system" 46 | 47 | case $1 in 48 | --run) 49 | # Try to run requested program, and just exit if it succeeds. 50 | run= 51 | shift 52 | "$@" && exit 0 53 | # Exit code 63 means version mismatch. This often happens 54 | # when the user try to use an ancient version of a tool on 55 | # a file that requires a minimum version. In this case we 56 | # we should proceed has if the program had been absent, or 57 | # if --run hadn't been passed. 58 | if test $? = 63; then 59 | run=: 60 | msg="probably too old" 61 | fi 62 | ;; 63 | 64 | -h|--h|--he|--hel|--help) 65 | echo "\ 66 | $0 [OPTION]... PROGRAM [ARGUMENT]... 67 | 68 | Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an 69 | error status if there is no known handling for PROGRAM. 70 | 71 | Options: 72 | -h, --help display this help and exit 73 | -v, --version output version information and exit 74 | --run try to run the given command, and emulate it if it fails 75 | 76 | Supported PROGRAM values: 77 | aclocal touch file \`aclocal.m4' 78 | autoconf touch file \`configure' 79 | autoheader touch file \`config.h.in' 80 | autom4te touch the output file, or create a stub one 81 | automake touch all \`Makefile.in' files 82 | bison create \`y.tab.[ch]', if possible, from existing .[ch] 83 | flex create \`lex.yy.c', if possible, from existing .c 84 | help2man touch the output file 85 | lex create \`lex.yy.c', if possible, from existing .c 86 | makeinfo touch the output file 87 | yacc create \`y.tab.[ch]', if possible, from existing .[ch] 88 | 89 | Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and 90 | \`g' are ignored when checking the name. 91 | 92 | Send bug reports to ." 93 | exit $? 94 | ;; 95 | 96 | -v|--v|--ve|--ver|--vers|--versi|--versio|--version) 97 | echo "missing $scriptversion (GNU Automake)" 98 | exit $? 99 | ;; 100 | 101 | -*) 102 | echo 1>&2 "$0: Unknown \`$1' option" 103 | echo 1>&2 "Try \`$0 --help' for more information" 104 | exit 1 105 | ;; 106 | 107 | esac 108 | 109 | # normalize program name to check for. 110 | program=`echo "$1" | sed ' 111 | s/^gnu-//; t 112 | s/^gnu//; t 113 | s/^g//; t'` 114 | 115 | # Now exit if we have it, but it failed. Also exit now if we 116 | # don't have it and --version was passed (most likely to detect 117 | # the program). This is about non-GNU programs, so use $1 not 118 | # $program. 119 | case $1 in 120 | lex*|yacc*) 121 | # Not GNU programs, they don't have --version. 122 | ;; 123 | 124 | *) 125 | if test -z "$run" && ($1 --version) > /dev/null 2>&1; then 126 | # We have it, but it failed. 127 | exit 1 128 | elif test "x$2" = "x--version" || test "x$2" = "x--help"; then 129 | # Could not run --version or --help. This is probably someone 130 | # running `$TOOL --version' or `$TOOL --help' to check whether 131 | # $TOOL exists and not knowing $TOOL uses missing. 132 | exit 1 133 | fi 134 | ;; 135 | esac 136 | 137 | # If it does not exist, or fails to run (possibly an outdated version), 138 | # try to emulate it. 139 | case $program in 140 | aclocal*) 141 | echo 1>&2 "\ 142 | WARNING: \`$1' is $msg. You should only need it if 143 | you modified \`acinclude.m4' or \`${configure_ac}'. You might want 144 | to install the \`Automake' and \`Perl' packages. Grab them from 145 | any GNU archive site." 146 | touch aclocal.m4 147 | ;; 148 | 149 | autoconf*) 150 | echo 1>&2 "\ 151 | WARNING: \`$1' is $msg. You should only need it if 152 | you modified \`${configure_ac}'. You might want to install the 153 | \`Autoconf' and \`GNU m4' packages. Grab them from any GNU 154 | archive site." 155 | touch configure 156 | ;; 157 | 158 | autoheader*) 159 | echo 1>&2 "\ 160 | WARNING: \`$1' is $msg. You should only need it if 161 | you modified \`acconfig.h' or \`${configure_ac}'. You might want 162 | to install the \`Autoconf' and \`GNU m4' packages. Grab them 163 | from any GNU archive site." 164 | files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` 165 | test -z "$files" && files="config.h" 166 | touch_files= 167 | for f in $files; do 168 | case $f in 169 | *:*) touch_files="$touch_files "`echo "$f" | 170 | sed -e 's/^[^:]*://' -e 's/:.*//'`;; 171 | *) touch_files="$touch_files $f.in";; 172 | esac 173 | done 174 | touch $touch_files 175 | ;; 176 | 177 | automake*) 178 | echo 1>&2 "\ 179 | WARNING: \`$1' is $msg. You should only need it if 180 | you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. 181 | You might want to install the \`Automake' and \`Perl' packages. 182 | Grab them from any GNU archive site." 183 | find . -type f -name Makefile.am -print | 184 | sed 's/\.am$/.in/' | 185 | while read f; do touch "$f"; done 186 | ;; 187 | 188 | autom4te*) 189 | echo 1>&2 "\ 190 | WARNING: \`$1' is needed, but is $msg. 191 | You might have modified some files without having the 192 | proper tools for further handling them. 193 | You can get \`$1' as part of \`Autoconf' from any GNU 194 | archive site." 195 | 196 | file=`echo "$*" | sed -n "$sed_output"` 197 | test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 198 | if test -f "$file"; then 199 | touch $file 200 | else 201 | test -z "$file" || exec >$file 202 | echo "#! /bin/sh" 203 | echo "# Created by GNU Automake missing as a replacement of" 204 | echo "# $ $@" 205 | echo "exit 0" 206 | chmod +x $file 207 | exit 1 208 | fi 209 | ;; 210 | 211 | bison*|yacc*) 212 | echo 1>&2 "\ 213 | WARNING: \`$1' $msg. You should only need it if 214 | you modified a \`.y' file. You may need the \`Bison' package 215 | in order for those modifications to take effect. You can get 216 | \`Bison' from any GNU archive site." 217 | rm -f y.tab.c y.tab.h 218 | if test $# -ne 1; then 219 | eval LASTARG=\${$#} 220 | case $LASTARG in 221 | *.y) 222 | SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` 223 | if test -f "$SRCFILE"; then 224 | cp "$SRCFILE" y.tab.c 225 | fi 226 | SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` 227 | if test -f "$SRCFILE"; then 228 | cp "$SRCFILE" y.tab.h 229 | fi 230 | ;; 231 | esac 232 | fi 233 | if test ! -f y.tab.h; then 234 | echo >y.tab.h 235 | fi 236 | if test ! -f y.tab.c; then 237 | echo 'main() { return 0; }' >y.tab.c 238 | fi 239 | ;; 240 | 241 | lex*|flex*) 242 | echo 1>&2 "\ 243 | WARNING: \`$1' is $msg. You should only need it if 244 | you modified a \`.l' file. You may need the \`Flex' package 245 | in order for those modifications to take effect. You can get 246 | \`Flex' from any GNU archive site." 247 | rm -f lex.yy.c 248 | if test $# -ne 1; then 249 | eval LASTARG=\${$#} 250 | case $LASTARG in 251 | *.l) 252 | SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` 253 | if test -f "$SRCFILE"; then 254 | cp "$SRCFILE" lex.yy.c 255 | fi 256 | ;; 257 | esac 258 | fi 259 | if test ! -f lex.yy.c; then 260 | echo 'main() { return 0; }' >lex.yy.c 261 | fi 262 | ;; 263 | 264 | help2man*) 265 | echo 1>&2 "\ 266 | WARNING: \`$1' is $msg. You should only need it if 267 | you modified a dependency of a manual page. You may need the 268 | \`Help2man' package in order for those modifications to take 269 | effect. You can get \`Help2man' from any GNU archive site." 270 | 271 | file=`echo "$*" | sed -n "$sed_output"` 272 | test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 273 | if test -f "$file"; then 274 | touch $file 275 | else 276 | test -z "$file" || exec >$file 277 | echo ".ab help2man is required to generate this page" 278 | exit $? 279 | fi 280 | ;; 281 | 282 | makeinfo*) 283 | echo 1>&2 "\ 284 | WARNING: \`$1' is $msg. You should only need it if 285 | you modified a \`.texi' or \`.texinfo' file, or any other file 286 | indirectly affecting the aspect of the manual. The spurious 287 | call might also be the consequence of using a buggy \`make' (AIX, 288 | DU, IRIX). You might want to install the \`Texinfo' package or 289 | the \`GNU make' package. Grab either from any GNU archive site." 290 | # The file to touch is that specified with -o ... 291 | file=`echo "$*" | sed -n "$sed_output"` 292 | test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 293 | if test -z "$file"; then 294 | # ... or it is the one specified with @setfilename ... 295 | infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` 296 | file=`sed -n ' 297 | /^@setfilename/{ 298 | s/.* \([^ ]*\) *$/\1/ 299 | p 300 | q 301 | }' $infile` 302 | # ... or it is derived from the source name (dir/f.texi becomes f.info) 303 | test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info 304 | fi 305 | # If the file does not exist, the user really needs makeinfo; 306 | # let's fail without touching anything. 307 | test -f $file || exit 1 308 | touch $file 309 | ;; 310 | 311 | *) 312 | echo 1>&2 "\ 313 | WARNING: \`$1' is needed, and is $msg. 314 | You might have modified some files without having the 315 | proper tools for further handling them. Check the \`README' file, 316 | it often tells you about the needed prerequisites for installing 317 | this package. You may also peek at any GNU archive site, in case 318 | some other package would contain this missing \`$1' program." 319 | exit 1 320 | ;; 321 | esac 322 | 323 | exit 0 324 | 325 | # Local variables: 326 | # eval: (add-hook 'write-file-hooks 'time-stamp) 327 | # time-stamp-start: "scriptversion=" 328 | # time-stamp-format: "%:y-%02m-%02d.%02H" 329 | # time-stamp-time-zone: "UTC" 330 | # time-stamp-end: "; # UTC" 331 | # End: 332 | -------------------------------------------------------------------------------- /scripts/Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS=foreign 2 | 3 | zabbixdir=${prefix}/zabbix 4 | 5 | zabbix_SCRIPTS=common_function hpeilo_zabbix_api.py hpeilo_zabbix_config zabbix_hpeilo_cfg_generator 6 | 7 | uninstall: 8 | cd $(zabbixdir); \ 9 | rm -f hpeilo_zabbix_api.log common_function hpeilo_zabbix_api.py hpeilo_zabbix_config zabbix_hpeilo_cfg_generator 10 | -------------------------------------------------------------------------------- /scripts/Makefile.in: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.11.6 from Makefile.am. 2 | # @configure_input@ 3 | 4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 5 | # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software 6 | # Foundation, Inc. 7 | # This Makefile.in is free software; the Free Software Foundation 8 | # gives unlimited permission to copy and/or distribute it, 9 | # with or without modifications, as long as this notice is preserved. 10 | 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 13 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 14 | # PARTICULAR PURPOSE. 15 | 16 | @SET_MAKE@ 17 | 18 | VPATH = @srcdir@ 19 | am__make_dryrun = \ 20 | { \ 21 | am__dry=no; \ 22 | case $$MAKEFLAGS in \ 23 | *\\[\ \ ]*) \ 24 | echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ 25 | | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ 26 | *) \ 27 | for am__flg in $$MAKEFLAGS; do \ 28 | case $$am__flg in \ 29 | *=*|--*) ;; \ 30 | *n*) am__dry=yes; break;; \ 31 | esac; \ 32 | done;; \ 33 | esac; \ 34 | test $$am__dry = yes; \ 35 | } 36 | pkgdatadir = $(datadir)/@PACKAGE@ 37 | pkgincludedir = $(includedir)/@PACKAGE@ 38 | pkglibdir = $(libdir)/@PACKAGE@ 39 | pkglibexecdir = $(libexecdir)/@PACKAGE@ 40 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 41 | install_sh_DATA = $(install_sh) -c -m 644 42 | install_sh_PROGRAM = $(install_sh) -c 43 | install_sh_SCRIPT = $(install_sh) -c 44 | INSTALL_HEADER = $(INSTALL_DATA) 45 | transform = $(program_transform_name) 46 | NORMAL_INSTALL = : 47 | PRE_INSTALL = : 48 | POST_INSTALL = : 49 | NORMAL_UNINSTALL = : 50 | PRE_UNINSTALL = : 51 | POST_UNINSTALL = : 52 | build_triplet = @build@ 53 | host_triplet = @host@ 54 | subdir = scripts 55 | DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ 56 | $(srcdir)/common_function.in $(srcdir)/hpeilo_zabbix_api.py.in \ 57 | $(srcdir)/hpeilo_zabbix_config.in \ 58 | $(srcdir)/zabbix_hpeilo_cfg_generator.in 59 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 60 | am__aclocal_m4_deps = $(top_srcdir)/m4/m4-ax_compare_version.m4 \ 61 | $(top_srcdir)/configure.ac 62 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 63 | $(ACLOCAL_M4) 64 | mkinstalldirs = $(install_sh) -d 65 | CONFIG_HEADER = $(top_builddir)/config.h 66 | CONFIG_CLEAN_FILES = common_function hpeilo_zabbix_api.py \ 67 | hpeilo_zabbix_config zabbix_hpeilo_cfg_generator 68 | CONFIG_CLEAN_VPATH_FILES = 69 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; 70 | am__vpath_adj = case $$p in \ 71 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ 72 | *) f=$$p;; \ 73 | esac; 74 | am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; 75 | am__install_max = 40 76 | am__nobase_strip_setup = \ 77 | srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` 78 | am__nobase_strip = \ 79 | for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" 80 | am__nobase_list = $(am__nobase_strip_setup); \ 81 | for p in $$list; do echo "$$p $$p"; done | \ 82 | sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ 83 | $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ 84 | if (++n[$$2] == $(am__install_max)) \ 85 | { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ 86 | END { for (dir in files) print dir, files[dir] }' 87 | am__base_list = \ 88 | sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ 89 | sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' 90 | am__uninstall_files_from_dir = { \ 91 | test -z "$$files" \ 92 | || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ 93 | || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ 94 | $(am__cd) "$$dir" && rm -f $$files; }; \ 95 | } 96 | am__installdirs = "$(DESTDIR)$(zabbixdir)" 97 | SCRIPTS = $(zabbix_SCRIPTS) 98 | SOURCES = 99 | DIST_SOURCES = 100 | am__can_run_installinfo = \ 101 | case $$AM_UPDATE_INFO_DIR in \ 102 | n|no|NO) false;; \ 103 | *) (install-info --version) >/dev/null 2>&1;; \ 104 | esac 105 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 106 | ACLOCAL = @ACLOCAL@ 107 | AMTAR = @AMTAR@ 108 | AR = @AR@ 109 | AUTOCONF = @AUTOCONF@ 110 | AUTOHEADER = @AUTOHEADER@ 111 | AUTOMAKE = @AUTOMAKE@ 112 | AWK = @AWK@ 113 | CC = @CC@ 114 | CCDEPMODE = @CCDEPMODE@ 115 | CFLAGS = @CFLAGS@ 116 | CPP = @CPP@ 117 | CPPFLAGS = @CPPFLAGS@ 118 | CXX = @CXX@ 119 | CXXCPP = @CXXCPP@ 120 | CXXDEPMODE = @CXXDEPMODE@ 121 | CXXFLAGS = @CXXFLAGS@ 122 | CYGPATH_W = @CYGPATH_W@ 123 | DEFS = @DEFS@ 124 | DEPDIR = @DEPDIR@ 125 | DLLTOOL = @DLLTOOL@ 126 | DSYMUTIL = @DSYMUTIL@ 127 | DUMPBIN = @DUMPBIN@ 128 | ECHO_C = @ECHO_C@ 129 | ECHO_N = @ECHO_N@ 130 | ECHO_T = @ECHO_T@ 131 | EGREP = @EGREP@ 132 | EXEEXT = @EXEEXT@ 133 | FGREP = @FGREP@ 134 | GREP = @GREP@ 135 | INSTALL = @INSTALL@ 136 | INSTALL_DATA = @INSTALL_DATA@ 137 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 138 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ 139 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ 140 | LD = @LD@ 141 | LDFLAGS = @LDFLAGS@ 142 | LIBOBJS = @LIBOBJS@ 143 | LIBS = @LIBS@ 144 | LIBTOOL = @LIBTOOL@ 145 | LIPO = @LIPO@ 146 | LN_S = @LN_S@ 147 | LTLIBOBJS = @LTLIBOBJS@ 148 | MAKEINFO = @MAKEINFO@ 149 | MANIFEST_TOOL = @MANIFEST_TOOL@ 150 | MKDIR_P = @MKDIR_P@ 151 | NM = @NM@ 152 | NMAP_MIN_VERSION = @NMAP_MIN_VERSION@ 153 | NMAP_PATH = @NMAP_PATH@ 154 | NMEDIT = @NMEDIT@ 155 | OBJDUMP = @OBJDUMP@ 156 | OBJEXT = @OBJEXT@ 157 | OTOOL = @OTOOL@ 158 | OTOOL64 = @OTOOL64@ 159 | PACKAGE = @PACKAGE@ 160 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 161 | PACKAGE_NAME = @PACKAGE_NAME@ 162 | PACKAGE_STRING = @PACKAGE_STRING@ 163 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ 164 | PACKAGE_URL = @PACKAGE_URL@ 165 | PACKAGE_VERSION = @PACKAGE_VERSION@ 166 | PATH_SEPARATOR = @PATH_SEPARATOR@ 167 | RANLIB = @RANLIB@ 168 | SED = @SED@ 169 | SET_MAKE = @SET_MAKE@ 170 | SHELL = @SHELL@ 171 | STRIP = @STRIP@ 172 | VERSION = @VERSION@ 173 | abs_builddir = @abs_builddir@ 174 | abs_srcdir = @abs_srcdir@ 175 | abs_top_builddir = @abs_top_builddir@ 176 | abs_top_srcdir = @abs_top_srcdir@ 177 | ac_ct_AR = @ac_ct_AR@ 178 | ac_ct_CC = @ac_ct_CC@ 179 | ac_ct_CXX = @ac_ct_CXX@ 180 | ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 181 | am__include = @am__include@ 182 | am__leading_dot = @am__leading_dot@ 183 | am__quote = @am__quote@ 184 | am__tar = @am__tar@ 185 | am__untar = @am__untar@ 186 | bindir = @bindir@ 187 | build = @build@ 188 | build_alias = @build_alias@ 189 | build_cpu = @build_cpu@ 190 | build_os = @build_os@ 191 | build_vendor = @build_vendor@ 192 | builddir = @builddir@ 193 | datadir = @datadir@ 194 | datarootdir = @datarootdir@ 195 | docdir = @docdir@ 196 | dvidir = @dvidir@ 197 | exec_prefix = @exec_prefix@ 198 | host = @host@ 199 | host_alias = @host_alias@ 200 | host_cpu = @host_cpu@ 201 | host_os = @host_os@ 202 | host_vendor = @host_vendor@ 203 | htmldir = @htmldir@ 204 | includedir = @includedir@ 205 | infodir = @infodir@ 206 | install_sh = @install_sh@ 207 | libdir = @libdir@ 208 | libexecdir = @libexecdir@ 209 | localedir = @localedir@ 210 | localstatedir = @localstatedir@ 211 | mandir = @mandir@ 212 | mkdir_p = @mkdir_p@ 213 | oldincludedir = @oldincludedir@ 214 | pdfdir = @pdfdir@ 215 | prefix = @prefix@ 216 | program_transform_name = @program_transform_name@ 217 | psdir = @psdir@ 218 | sbindir = @sbindir@ 219 | sharedstatedir = @sharedstatedir@ 220 | srcdir = @srcdir@ 221 | sysconfdir = @sysconfdir@ 222 | target_alias = @target_alias@ 223 | top_build_prefix = @top_build_prefix@ 224 | top_builddir = @top_builddir@ 225 | top_srcdir = @top_srcdir@ 226 | AUTOMAKE_OPTIONS = foreign 227 | zabbixdir = ${prefix}/zabbix 228 | zabbix_SCRIPTS = common_function hpeilo_zabbix_api.py hpeilo_zabbix_config zabbix_hpeilo_cfg_generator 229 | all: all-am 230 | 231 | .SUFFIXES: 232 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) 233 | @for dep in $?; do \ 234 | case '$(am__configure_deps)' in \ 235 | *$$dep*) \ 236 | ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ 237 | && { if test -f $@; then exit 0; else break; fi; }; \ 238 | exit 1;; \ 239 | esac; \ 240 | done; \ 241 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scripts/Makefile'; \ 242 | $(am__cd) $(top_srcdir) && \ 243 | $(AUTOMAKE) --foreign scripts/Makefile 244 | .PRECIOUS: Makefile 245 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 246 | @case '$?' in \ 247 | *config.status*) \ 248 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ 249 | *) \ 250 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ 251 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 252 | esac; 253 | 254 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 255 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 256 | 257 | $(top_srcdir)/configure: $(am__configure_deps) 258 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 259 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) 260 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 261 | $(am__aclocal_m4_deps): 262 | common_function: $(top_builddir)/config.status $(srcdir)/common_function.in 263 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ 264 | hpeilo_zabbix_api.py: $(top_builddir)/config.status $(srcdir)/hpeilo_zabbix_api.py.in 265 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ 266 | hpeilo_zabbix_config: $(top_builddir)/config.status $(srcdir)/hpeilo_zabbix_config.in 267 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ 268 | zabbix_hpeilo_cfg_generator: $(top_builddir)/config.status $(srcdir)/zabbix_hpeilo_cfg_generator.in 269 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ 270 | install-zabbixSCRIPTS: $(zabbix_SCRIPTS) 271 | @$(NORMAL_INSTALL) 272 | @list='$(zabbix_SCRIPTS)'; test -n "$(zabbixdir)" || list=; \ 273 | if test -n "$$list"; then \ 274 | echo " $(MKDIR_P) '$(DESTDIR)$(zabbixdir)'"; \ 275 | $(MKDIR_P) "$(DESTDIR)$(zabbixdir)" || exit 1; \ 276 | fi; \ 277 | for p in $$list; do \ 278 | if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ 279 | if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ 280 | done | \ 281 | sed -e 'p;s,.*/,,;n' \ 282 | -e 'h;s|.*|.|' \ 283 | -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ 284 | $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ 285 | { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ 286 | if ($$2 == $$4) { files[d] = files[d] " " $$1; \ 287 | if (++n[d] == $(am__install_max)) { \ 288 | print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ 289 | else { print "f", d "/" $$4, $$1 } } \ 290 | END { for (d in files) print "f", d, files[d] }' | \ 291 | while read type dir files; do \ 292 | if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ 293 | test -z "$$files" || { \ 294 | echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(zabbixdir)$$dir'"; \ 295 | $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(zabbixdir)$$dir" || exit $$?; \ 296 | } \ 297 | ; done 298 | 299 | uninstall-zabbixSCRIPTS: 300 | @$(NORMAL_UNINSTALL) 301 | @list='$(zabbix_SCRIPTS)'; test -n "$(zabbixdir)" || exit 0; \ 302 | files=`for p in $$list; do echo "$$p"; done | \ 303 | sed -e 's,.*/,,;$(transform)'`; \ 304 | dir='$(DESTDIR)$(zabbixdir)'; $(am__uninstall_files_from_dir) 305 | 306 | mostlyclean-libtool: 307 | -rm -f *.lo 308 | 309 | clean-libtool: 310 | -rm -rf .libs _libs 311 | tags: TAGS 312 | TAGS: 313 | 314 | ctags: CTAGS 315 | CTAGS: 316 | 317 | 318 | distdir: $(DISTFILES) 319 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 320 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 321 | list='$(DISTFILES)'; \ 322 | dist_files=`for file in $$list; do echo $$file; done | \ 323 | sed -e "s|^$$srcdirstrip/||;t" \ 324 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ 325 | case $$dist_files in \ 326 | */*) $(MKDIR_P) `echo "$$dist_files" | \ 327 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ 328 | sort -u` ;; \ 329 | esac; \ 330 | for file in $$dist_files; do \ 331 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 332 | if test -d $$d/$$file; then \ 333 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 334 | if test -d "$(distdir)/$$file"; then \ 335 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 336 | fi; \ 337 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 338 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ 339 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 340 | fi; \ 341 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ 342 | else \ 343 | test -f "$(distdir)/$$file" \ 344 | || cp -p $$d/$$file "$(distdir)/$$file" \ 345 | || exit 1; \ 346 | fi; \ 347 | done 348 | check-am: all-am 349 | check: check-am 350 | all-am: Makefile $(SCRIPTS) 351 | installdirs: 352 | for dir in "$(DESTDIR)$(zabbixdir)"; do \ 353 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ 354 | done 355 | install: install-am 356 | install-exec: install-exec-am 357 | install-data: install-data-am 358 | 359 | install-am: all-am 360 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 361 | 362 | installcheck: installcheck-am 363 | install-strip: 364 | if test -z '$(STRIP)'; then \ 365 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 366 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 367 | install; \ 368 | else \ 369 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 370 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 371 | "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ 372 | fi 373 | mostlyclean-generic: 374 | 375 | clean-generic: 376 | 377 | distclean-generic: 378 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 379 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 380 | 381 | maintainer-clean-generic: 382 | @echo "This command is intended for maintainers to use" 383 | @echo "it deletes files that may require special tools to rebuild." 384 | clean: clean-am 385 | 386 | clean-am: clean-generic clean-libtool mostlyclean-am 387 | 388 | distclean: distclean-am 389 | -rm -f Makefile 390 | distclean-am: clean-am distclean-generic 391 | 392 | dvi: dvi-am 393 | 394 | dvi-am: 395 | 396 | html: html-am 397 | 398 | html-am: 399 | 400 | info: info-am 401 | 402 | info-am: 403 | 404 | install-data-am: install-zabbixSCRIPTS 405 | 406 | install-dvi: install-dvi-am 407 | 408 | install-dvi-am: 409 | 410 | install-exec-am: 411 | 412 | install-html: install-html-am 413 | 414 | install-html-am: 415 | 416 | install-info: install-info-am 417 | 418 | install-info-am: 419 | 420 | install-man: 421 | 422 | install-pdf: install-pdf-am 423 | 424 | install-pdf-am: 425 | 426 | install-ps: install-ps-am 427 | 428 | install-ps-am: 429 | 430 | installcheck-am: 431 | 432 | maintainer-clean: maintainer-clean-am 433 | -rm -f Makefile 434 | maintainer-clean-am: distclean-am maintainer-clean-generic 435 | 436 | mostlyclean: mostlyclean-am 437 | 438 | mostlyclean-am: mostlyclean-generic mostlyclean-libtool 439 | 440 | pdf: pdf-am 441 | 442 | pdf-am: 443 | 444 | ps: ps-am 445 | 446 | ps-am: 447 | 448 | uninstall-am: uninstall-zabbixSCRIPTS 449 | 450 | .MAKE: install-am install-strip 451 | 452 | .PHONY: all all-am check check-am clean clean-generic clean-libtool \ 453 | distclean distclean-generic distclean-libtool distdir dvi \ 454 | dvi-am html html-am info info-am install install-am \ 455 | install-data install-data-am install-dvi install-dvi-am \ 456 | install-exec install-exec-am install-html install-html-am \ 457 | install-info install-info-am install-man install-pdf \ 458 | install-pdf-am install-ps install-ps-am install-strip \ 459 | install-zabbixSCRIPTS installcheck installcheck-am installdirs \ 460 | maintainer-clean maintainer-clean-generic mostlyclean \ 461 | mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ 462 | uninstall uninstall-am uninstall-zabbixSCRIPTS 463 | 464 | 465 | uninstall: 466 | cd $(zabbixdir); \ 467 | rm -f hpeilo_zabbix_api.log common_function hpeilo_zabbix_api.py hpeilo_zabbix_config zabbix_hpeilo_cfg_generator 468 | 469 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 470 | # Otherwise a system limit (for SysV at least) may be exceeded. 471 | .NOEXPORT: 472 | -------------------------------------------------------------------------------- /scripts/common_function.in: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # (C) Copyright [2016] Hewlett Packard Enterprise Development Company, L.P. 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of version 2 of the GNU General Public License as 7 | # published by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | # 13 | # See the GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to: 17 | # Free Software Foundation, Inc. 18 | # 51 Franklin Street, Fifth Floor 19 | # Boston, MA 02110-1301, USA. 20 | 21 | # $1: file name 22 | # $2: search pattern 23 | function search_string() { 24 | local str= 25 | 26 | if [ -f $1 ]; then 27 | str=`grep "$2" $1` 28 | fi 29 | 30 | echo -e "$str" 31 | } 32 | 33 | # argument 1 ($1): The data to be logged 34 | function write_log() { 35 | if [ "$VerboseMode" = "1" ] 36 | then 37 | [ $mode -eq $PassiveDisc ] && echo -e "[`date "+%b %d %T"`] $1" >> $HpiloLogFile || echo -e "$1" 38 | fi 39 | } 40 | -------------------------------------------------------------------------------- /src/credit_save/Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS=foreign 2 | AM_LIBTOOLFLAGS=--silent 3 | zabbixdir=$(prefix)/zabbix 4 | 5 | AM_LDFLAGS = -L$(top_srcdir)/src/ilo_credit/.libs/ -lm -lilocrst -ldl -lcrypto 6 | AM_CPPFLAGS = -I$(top_srcdir)/src/include 7 | 8 | AM_CFLAGS = 9 | 10 | zabbix_PROGRAMS = credit_save 11 | 12 | credit_save_SOURCES = credit_save.c 13 | 14 | -------------------------------------------------------------------------------- /src/credit_save/Makefile.in: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.11.6 from Makefile.am. 2 | # @configure_input@ 3 | 4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 5 | # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software 6 | # Foundation, Inc. 7 | # This Makefile.in is free software; the Free Software Foundation 8 | # gives unlimited permission to copy and/or distribute it, 9 | # with or without modifications, as long as this notice is preserved. 10 | 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 13 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 14 | # PARTICULAR PURPOSE. 15 | 16 | @SET_MAKE@ 17 | 18 | VPATH = @srcdir@ 19 | am__make_dryrun = \ 20 | { \ 21 | am__dry=no; \ 22 | case $$MAKEFLAGS in \ 23 | *\\[\ \ ]*) \ 24 | echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ 25 | | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ 26 | *) \ 27 | for am__flg in $$MAKEFLAGS; do \ 28 | case $$am__flg in \ 29 | *=*|--*) ;; \ 30 | *n*) am__dry=yes; break;; \ 31 | esac; \ 32 | done;; \ 33 | esac; \ 34 | test $$am__dry = yes; \ 35 | } 36 | pkgdatadir = $(datadir)/@PACKAGE@ 37 | pkgincludedir = $(includedir)/@PACKAGE@ 38 | pkglibdir = $(libdir)/@PACKAGE@ 39 | pkglibexecdir = $(libexecdir)/@PACKAGE@ 40 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 41 | install_sh_DATA = $(install_sh) -c -m 644 42 | install_sh_PROGRAM = $(install_sh) -c 43 | install_sh_SCRIPT = $(install_sh) -c 44 | INSTALL_HEADER = $(INSTALL_DATA) 45 | transform = $(program_transform_name) 46 | NORMAL_INSTALL = : 47 | PRE_INSTALL = : 48 | POST_INSTALL = : 49 | NORMAL_UNINSTALL = : 50 | PRE_UNINSTALL = : 51 | POST_UNINSTALL = : 52 | build_triplet = @build@ 53 | host_triplet = @host@ 54 | zabbix_PROGRAMS = credit_save$(EXEEXT) 55 | subdir = src/credit_save 56 | DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in 57 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 58 | am__aclocal_m4_deps = $(top_srcdir)/m4/m4-ax_compare_version.m4 \ 59 | $(top_srcdir)/configure.ac 60 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 61 | $(ACLOCAL_M4) 62 | mkinstalldirs = $(install_sh) -d 63 | CONFIG_HEADER = $(top_builddir)/config.h 64 | CONFIG_CLEAN_FILES = 65 | CONFIG_CLEAN_VPATH_FILES = 66 | am__installdirs = "$(DESTDIR)$(zabbixdir)" 67 | PROGRAMS = $(zabbix_PROGRAMS) 68 | am_credit_save_OBJECTS = credit_save.$(OBJEXT) 69 | credit_save_OBJECTS = $(am_credit_save_OBJECTS) 70 | credit_save_LDADD = $(LDADD) 71 | DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) 72 | depcomp = $(SHELL) $(top_srcdir)/depcomp 73 | am__depfiles_maybe = depfiles 74 | am__mv = mv -f 75 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ 76 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) 77 | LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ 78 | --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ 79 | $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) 80 | CCLD = $(CC) 81 | LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ 82 | --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ 83 | $(LDFLAGS) -o $@ 84 | SOURCES = $(credit_save_SOURCES) 85 | DIST_SOURCES = $(credit_save_SOURCES) 86 | am__can_run_installinfo = \ 87 | case $$AM_UPDATE_INFO_DIR in \ 88 | n|no|NO) false;; \ 89 | *) (install-info --version) >/dev/null 2>&1;; \ 90 | esac 91 | ETAGS = etags 92 | CTAGS = ctags 93 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 94 | ACLOCAL = @ACLOCAL@ 95 | AMTAR = @AMTAR@ 96 | AR = @AR@ 97 | AUTOCONF = @AUTOCONF@ 98 | AUTOHEADER = @AUTOHEADER@ 99 | AUTOMAKE = @AUTOMAKE@ 100 | AWK = @AWK@ 101 | CC = @CC@ 102 | CCDEPMODE = @CCDEPMODE@ 103 | CFLAGS = @CFLAGS@ 104 | CPP = @CPP@ 105 | CPPFLAGS = @CPPFLAGS@ 106 | CXX = @CXX@ 107 | CXXCPP = @CXXCPP@ 108 | CXXDEPMODE = @CXXDEPMODE@ 109 | CXXFLAGS = @CXXFLAGS@ 110 | CYGPATH_W = @CYGPATH_W@ 111 | DEFS = @DEFS@ 112 | DEPDIR = @DEPDIR@ 113 | DLLTOOL = @DLLTOOL@ 114 | DSYMUTIL = @DSYMUTIL@ 115 | DUMPBIN = @DUMPBIN@ 116 | ECHO_C = @ECHO_C@ 117 | ECHO_N = @ECHO_N@ 118 | ECHO_T = @ECHO_T@ 119 | EGREP = @EGREP@ 120 | EXEEXT = @EXEEXT@ 121 | FGREP = @FGREP@ 122 | GREP = @GREP@ 123 | INSTALL = @INSTALL@ 124 | INSTALL_DATA = @INSTALL_DATA@ 125 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 126 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ 127 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ 128 | LD = @LD@ 129 | LDFLAGS = @LDFLAGS@ 130 | LIBOBJS = @LIBOBJS@ 131 | LIBS = @LIBS@ 132 | LIBTOOL = @LIBTOOL@ 133 | LIPO = @LIPO@ 134 | LN_S = @LN_S@ 135 | LTLIBOBJS = @LTLIBOBJS@ 136 | MAKEINFO = @MAKEINFO@ 137 | MANIFEST_TOOL = @MANIFEST_TOOL@ 138 | MKDIR_P = @MKDIR_P@ 139 | NM = @NM@ 140 | NMAP_MIN_VERSION = @NMAP_MIN_VERSION@ 141 | NMAP_PATH = @NMAP_PATH@ 142 | NMEDIT = @NMEDIT@ 143 | OBJDUMP = @OBJDUMP@ 144 | OBJEXT = @OBJEXT@ 145 | OTOOL = @OTOOL@ 146 | OTOOL64 = @OTOOL64@ 147 | PACKAGE = @PACKAGE@ 148 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 149 | PACKAGE_NAME = @PACKAGE_NAME@ 150 | PACKAGE_STRING = @PACKAGE_STRING@ 151 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ 152 | PACKAGE_URL = @PACKAGE_URL@ 153 | PACKAGE_VERSION = @PACKAGE_VERSION@ 154 | PATH_SEPARATOR = @PATH_SEPARATOR@ 155 | RANLIB = @RANLIB@ 156 | SED = @SED@ 157 | SET_MAKE = @SET_MAKE@ 158 | SHELL = @SHELL@ 159 | STRIP = @STRIP@ 160 | VERSION = @VERSION@ 161 | abs_builddir = @abs_builddir@ 162 | abs_srcdir = @abs_srcdir@ 163 | abs_top_builddir = @abs_top_builddir@ 164 | abs_top_srcdir = @abs_top_srcdir@ 165 | ac_ct_AR = @ac_ct_AR@ 166 | ac_ct_CC = @ac_ct_CC@ 167 | ac_ct_CXX = @ac_ct_CXX@ 168 | ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 169 | am__include = @am__include@ 170 | am__leading_dot = @am__leading_dot@ 171 | am__quote = @am__quote@ 172 | am__tar = @am__tar@ 173 | am__untar = @am__untar@ 174 | bindir = @bindir@ 175 | build = @build@ 176 | build_alias = @build_alias@ 177 | build_cpu = @build_cpu@ 178 | build_os = @build_os@ 179 | build_vendor = @build_vendor@ 180 | builddir = @builddir@ 181 | datadir = @datadir@ 182 | datarootdir = @datarootdir@ 183 | docdir = @docdir@ 184 | dvidir = @dvidir@ 185 | exec_prefix = @exec_prefix@ 186 | host = @host@ 187 | host_alias = @host_alias@ 188 | host_cpu = @host_cpu@ 189 | host_os = @host_os@ 190 | host_vendor = @host_vendor@ 191 | htmldir = @htmldir@ 192 | includedir = @includedir@ 193 | infodir = @infodir@ 194 | install_sh = @install_sh@ 195 | libdir = @libdir@ 196 | libexecdir = @libexecdir@ 197 | localedir = @localedir@ 198 | localstatedir = @localstatedir@ 199 | mandir = @mandir@ 200 | mkdir_p = @mkdir_p@ 201 | oldincludedir = @oldincludedir@ 202 | pdfdir = @pdfdir@ 203 | prefix = @prefix@ 204 | program_transform_name = @program_transform_name@ 205 | psdir = @psdir@ 206 | sbindir = @sbindir@ 207 | sharedstatedir = @sharedstatedir@ 208 | srcdir = @srcdir@ 209 | sysconfdir = @sysconfdir@ 210 | target_alias = @target_alias@ 211 | top_build_prefix = @top_build_prefix@ 212 | top_builddir = @top_builddir@ 213 | top_srcdir = @top_srcdir@ 214 | AUTOMAKE_OPTIONS = foreign 215 | AM_LIBTOOLFLAGS = --silent 216 | zabbixdir = $(prefix)/zabbix 217 | AM_LDFLAGS = -L$(top_srcdir)/src/ilo_credit/.libs/ -lm -lilocrst -ldl -lcrypto 218 | AM_CPPFLAGS = -I$(top_srcdir)/src/include 219 | AM_CFLAGS = 220 | credit_save_SOURCES = credit_save.c 221 | all: all-am 222 | 223 | .SUFFIXES: 224 | .SUFFIXES: .c .lo .o .obj 225 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) 226 | @for dep in $?; do \ 227 | case '$(am__configure_deps)' in \ 228 | *$$dep*) \ 229 | ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ 230 | && { if test -f $@; then exit 0; else break; fi; }; \ 231 | exit 1;; \ 232 | esac; \ 233 | done; \ 234 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/credit_save/Makefile'; \ 235 | $(am__cd) $(top_srcdir) && \ 236 | $(AUTOMAKE) --foreign src/credit_save/Makefile 237 | .PRECIOUS: Makefile 238 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 239 | @case '$?' in \ 240 | *config.status*) \ 241 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ 242 | *) \ 243 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ 244 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 245 | esac; 246 | 247 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 248 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 249 | 250 | $(top_srcdir)/configure: $(am__configure_deps) 251 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 252 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) 253 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 254 | $(am__aclocal_m4_deps): 255 | install-zabbixPROGRAMS: $(zabbix_PROGRAMS) 256 | @$(NORMAL_INSTALL) 257 | @list='$(zabbix_PROGRAMS)'; test -n "$(zabbixdir)" || list=; \ 258 | if test -n "$$list"; then \ 259 | echo " $(MKDIR_P) '$(DESTDIR)$(zabbixdir)'"; \ 260 | $(MKDIR_P) "$(DESTDIR)$(zabbixdir)" || exit 1; \ 261 | fi; \ 262 | for p in $$list; do echo "$$p $$p"; done | \ 263 | sed 's/$(EXEEXT)$$//' | \ 264 | while read p p1; do if test -f $$p || test -f $$p1; \ 265 | then echo "$$p"; echo "$$p"; else :; fi; \ 266 | done | \ 267 | sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ 268 | -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ 269 | sed 'N;N;N;s,\n, ,g' | \ 270 | $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ 271 | { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ 272 | if ($$2 == $$4) files[d] = files[d] " " $$1; \ 273 | else { print "f", $$3 "/" $$4, $$1; } } \ 274 | END { for (d in files) print "f", d, files[d] }' | \ 275 | while read type dir files; do \ 276 | if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ 277 | test -z "$$files" || { \ 278 | echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(zabbixdir)$$dir'"; \ 279 | $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(zabbixdir)$$dir" || exit $$?; \ 280 | } \ 281 | ; done 282 | 283 | uninstall-zabbixPROGRAMS: 284 | @$(NORMAL_UNINSTALL) 285 | @list='$(zabbix_PROGRAMS)'; test -n "$(zabbixdir)" || list=; \ 286 | files=`for p in $$list; do echo "$$p"; done | \ 287 | sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ 288 | -e 's/$$/$(EXEEXT)/' `; \ 289 | test -n "$$list" || exit 0; \ 290 | echo " ( cd '$(DESTDIR)$(zabbixdir)' && rm -f" $$files ")"; \ 291 | cd "$(DESTDIR)$(zabbixdir)" && rm -f $$files 292 | 293 | clean-zabbixPROGRAMS: 294 | @list='$(zabbix_PROGRAMS)'; test -n "$$list" || exit 0; \ 295 | echo " rm -f" $$list; \ 296 | rm -f $$list || exit $$?; \ 297 | test -n "$(EXEEXT)" || exit 0; \ 298 | list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ 299 | echo " rm -f" $$list; \ 300 | rm -f $$list 301 | credit_save$(EXEEXT): $(credit_save_OBJECTS) $(credit_save_DEPENDENCIES) $(EXTRA_credit_save_DEPENDENCIES) 302 | @rm -f credit_save$(EXEEXT) 303 | $(LINK) $(credit_save_OBJECTS) $(credit_save_LDADD) $(LIBS) 304 | 305 | mostlyclean-compile: 306 | -rm -f *.$(OBJEXT) 307 | 308 | distclean-compile: 309 | -rm -f *.tab.c 310 | 311 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/credit_save.Po@am__quote@ 312 | 313 | .c.o: 314 | @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< 315 | @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 316 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 317 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 318 | @am__fastdepCC_FALSE@ $(COMPILE) -c $< 319 | 320 | .c.obj: 321 | @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` 322 | @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 323 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 324 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 325 | @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` 326 | 327 | .c.lo: 328 | @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< 329 | @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo 330 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ 331 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 332 | @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< 333 | 334 | mostlyclean-libtool: 335 | -rm -f *.lo 336 | 337 | clean-libtool: 338 | -rm -rf .libs _libs 339 | 340 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) 341 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 342 | unique=`for i in $$list; do \ 343 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 344 | done | \ 345 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 346 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 347 | mkid -fID $$unique 348 | tags: TAGS 349 | 350 | TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ 351 | $(TAGS_FILES) $(LISP) 352 | set x; \ 353 | here=`pwd`; \ 354 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 355 | unique=`for i in $$list; do \ 356 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 357 | done | \ 358 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 359 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 360 | shift; \ 361 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ 362 | test -n "$$unique" || unique=$$empty_fix; \ 363 | if test $$# -gt 0; then \ 364 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 365 | "$$@" $$unique; \ 366 | else \ 367 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 368 | $$unique; \ 369 | fi; \ 370 | fi 371 | ctags: CTAGS 372 | CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ 373 | $(TAGS_FILES) $(LISP) 374 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 375 | unique=`for i in $$list; do \ 376 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 377 | done | \ 378 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 379 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 380 | test -z "$(CTAGS_ARGS)$$unique" \ 381 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ 382 | $$unique 383 | 384 | GTAGS: 385 | here=`$(am__cd) $(top_builddir) && pwd` \ 386 | && $(am__cd) $(top_srcdir) \ 387 | && gtags -i $(GTAGS_ARGS) "$$here" 388 | 389 | distclean-tags: 390 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 391 | 392 | distdir: $(DISTFILES) 393 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 394 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 395 | list='$(DISTFILES)'; \ 396 | dist_files=`for file in $$list; do echo $$file; done | \ 397 | sed -e "s|^$$srcdirstrip/||;t" \ 398 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ 399 | case $$dist_files in \ 400 | */*) $(MKDIR_P) `echo "$$dist_files" | \ 401 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ 402 | sort -u` ;; \ 403 | esac; \ 404 | for file in $$dist_files; do \ 405 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 406 | if test -d $$d/$$file; then \ 407 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 408 | if test -d "$(distdir)/$$file"; then \ 409 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 410 | fi; \ 411 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 412 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ 413 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 414 | fi; \ 415 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ 416 | else \ 417 | test -f "$(distdir)/$$file" \ 418 | || cp -p $$d/$$file "$(distdir)/$$file" \ 419 | || exit 1; \ 420 | fi; \ 421 | done 422 | check-am: all-am 423 | check: check-am 424 | all-am: Makefile $(PROGRAMS) 425 | installdirs: 426 | for dir in "$(DESTDIR)$(zabbixdir)"; do \ 427 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ 428 | done 429 | install: install-am 430 | install-exec: install-exec-am 431 | install-data: install-data-am 432 | uninstall: uninstall-am 433 | 434 | install-am: all-am 435 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 436 | 437 | installcheck: installcheck-am 438 | install-strip: 439 | if test -z '$(STRIP)'; then \ 440 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 441 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 442 | install; \ 443 | else \ 444 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 445 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 446 | "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ 447 | fi 448 | mostlyclean-generic: 449 | 450 | clean-generic: 451 | 452 | distclean-generic: 453 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 454 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 455 | 456 | maintainer-clean-generic: 457 | @echo "This command is intended for maintainers to use" 458 | @echo "it deletes files that may require special tools to rebuild." 459 | clean: clean-am 460 | 461 | clean-am: clean-generic clean-libtool clean-zabbixPROGRAMS \ 462 | mostlyclean-am 463 | 464 | distclean: distclean-am 465 | -rm -rf ./$(DEPDIR) 466 | -rm -f Makefile 467 | distclean-am: clean-am distclean-compile distclean-generic \ 468 | distclean-tags 469 | 470 | dvi: dvi-am 471 | 472 | dvi-am: 473 | 474 | html: html-am 475 | 476 | html-am: 477 | 478 | info: info-am 479 | 480 | info-am: 481 | 482 | install-data-am: install-zabbixPROGRAMS 483 | 484 | install-dvi: install-dvi-am 485 | 486 | install-dvi-am: 487 | 488 | install-exec-am: 489 | 490 | install-html: install-html-am 491 | 492 | install-html-am: 493 | 494 | install-info: install-info-am 495 | 496 | install-info-am: 497 | 498 | install-man: 499 | 500 | install-pdf: install-pdf-am 501 | 502 | install-pdf-am: 503 | 504 | install-ps: install-ps-am 505 | 506 | install-ps-am: 507 | 508 | installcheck-am: 509 | 510 | maintainer-clean: maintainer-clean-am 511 | -rm -rf ./$(DEPDIR) 512 | -rm -f Makefile 513 | maintainer-clean-am: distclean-am maintainer-clean-generic 514 | 515 | mostlyclean: mostlyclean-am 516 | 517 | mostlyclean-am: mostlyclean-compile mostlyclean-generic \ 518 | mostlyclean-libtool 519 | 520 | pdf: pdf-am 521 | 522 | pdf-am: 523 | 524 | ps: ps-am 525 | 526 | ps-am: 527 | 528 | uninstall-am: uninstall-zabbixPROGRAMS 529 | 530 | .MAKE: install-am install-strip 531 | 532 | .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ 533 | clean-libtool clean-zabbixPROGRAMS ctags distclean \ 534 | distclean-compile distclean-generic distclean-libtool \ 535 | distclean-tags distdir dvi dvi-am html html-am info info-am \ 536 | install install-am install-data install-data-am install-dvi \ 537 | install-dvi-am install-exec install-exec-am install-html \ 538 | install-html-am install-info install-info-am install-man \ 539 | install-pdf install-pdf-am install-ps install-ps-am \ 540 | install-strip install-zabbixPROGRAMS installcheck \ 541 | installcheck-am installdirs maintainer-clean \ 542 | maintainer-clean-generic mostlyclean mostlyclean-compile \ 543 | mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ 544 | tags uninstall uninstall-am uninstall-zabbixPROGRAMS 545 | 546 | 547 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 548 | # Otherwise a system limit (for SysV at least) may be exceeded. 549 | .NOEXPORT: 550 | -------------------------------------------------------------------------------- /src/credit_save/credit_save.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /*(C) Copyright [2016] Hewlett Packard Enterprise Development Company, L.P.*/ 3 | 4 | #define CURL_STATICLIB 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include "ilo-credit-store.h" 11 | #include "credit_save.h" 12 | #include "base64.h" 13 | 14 | /* The official name of this program (e.g., no 'g' prefix). */ 15 | #define PROGRAM_NAME "credit_save" 16 | #define PROGRAM_VERSION "1.0" 17 | #define MAX_RETRY_TIMES 3 18 | 19 | #define ECHOFLAGS (ECHO | ECHOE | ECHOK | ECHONL) 20 | 21 | // If option=0, set display mode close 22 | int set_disp_mode(int fd,int option) 23 | { 24 | int err; 25 | struct termios term; 26 | if(tcgetattr(fd,&term)==-1){ 27 | perror("Cannot get the attribution of the terminal"); 28 | return 1; 29 | } 30 | if(option) 31 | term.c_lflag|=ECHOFLAGS; 32 | else 33 | term.c_lflag &=~ECHOFLAGS; 34 | err=tcsetattr(fd,TCSAFLUSH,&term); 35 | if(err==-1 && err==EINTR){ 36 | perror("Cannot set the attribution of the terminal"); 37 | return 1; 38 | } 39 | return 0; 40 | } 41 | 42 | int getpasswd(char* passwd, int size) 43 | { 44 | int c; 45 | int n = 0; 46 | if (!passwd) 47 | return 1; 48 | 49 | do{ 50 | c=getchar(); 51 | if (c != '\n'|c!='\r'){ 52 | passwd[n++] = c; 53 | } 54 | }while(c != '\n' && c !='\r' && n < (size - 1)); 55 | passwd[n] = '\0'; 56 | return n; 57 | } 58 | 59 | static void 60 | print_version (void) 61 | { 62 | printf("%s version - %s\n", PROGRAM_NAME, PROGRAM_VERSION); 63 | return ; 64 | } 65 | 66 | /* Print the usage information 67 | 68 | static void 69 | usage (void) 70 | { 71 | struct option *opt_ptr = NULL; 72 | 73 | printf("Usage: %s ", PROGRAM_NAME); 74 | 75 | for (opt_ptr=long_options;opt_ptr->name != NULL;opt_ptr++) 76 | { 77 | if (opt_ptr->has_arg == no_argument) 78 | printf("[-%c] ", opt_ptr->val); 79 | else if (opt_ptr->has_arg == required_argument) 80 | printf("-%c <%s> ", opt_ptr->val, opt_ptr->name); 81 | } 82 | 83 | printf("\n"); 84 | 85 | return ; 86 | } 87 | 88 | static void 89 | print_help (void) 90 | { 91 | int i, j; 92 | 93 | usage(); 94 | 95 | printf("\n"); 96 | 97 | for (i=0;i> $$zabbixserver_conf; \ 27 | modify_conf=1; \ 28 | fi; \ 29 | if test "x$$ESDir" != "x" && test "$$ESDir" != "$(externalscriptszabbixdir)" && test "$$ESDir" != "$(externalscriptszabbixdir)/" ; then \ 30 | rm -f "$$ESDir"/hpeilo_snmp_engine; \ 31 | ln -s $(externalscriptszabbixdir)/hpeilo_snmp_engine "$$ESDir"/hpeilo_snmp_engine; \ 32 | fi; \ 33 | if test "x`grep "^Timeout=" $$zabbixserver_conf`" = "x" ; then \ 34 | echo "Timeout=20" >> $$zabbixserver_conf; \ 35 | modify_conf=1; \ 36 | else \ 37 | timeout=`grep "^Timeout=" $$zabbixserver_conf| awk -F= '{print $$2}'`; \ 38 | if test $$timeout -lt 20 ; then \ 39 | sed -i 's/^Timeout=.*/Timeout=20/g' $$zabbixserver_conf; \ 40 | modify_conf=1; \ 41 | fi; \ 42 | fi; \ 43 | if test $$modify_conf -eq "1" ; then \ 44 | echo "warning: "$$zabbixserver_conf" saved as "$$zabbixserver_conf".pluginsave"; \ 45 | echo "Restart zabbix-server"; \ 46 | service zabbix-server restart; \ 47 | else \ 48 | rm -f $$zabbixserver_conf.pluginsave; \ 49 | fi; \ 50 | fi; 51 | uninstall-hook: 52 | if test -f "/etc/zabbix/zabbix_server.conf" ; then \ 53 | zabbixserver_conf=/etc/zabbix/zabbix_server.conf; \ 54 | else \ 55 | if test -f "/etc/zabbix/zabbix-server.conf" ; then \ 56 | zabbixserver_conf=/etc/zabbix/zabbix-server.conf; \ 57 | fi; \ 58 | fi; \ 59 | if test -f "$$zabbixserver_conf".pluginsave ; then \ 60 | rm -f $$zabbixserver_conf; \ 61 | mv $$zabbixserver_conf.pluginsave $$zabbixserver_conf; \ 62 | fi; 63 | -------------------------------------------------------------------------------- /src/hpeilo_engine/hpilo_snmp.c: -------------------------------------------------------------------------------- 1 | /* hpilo_snmp -- The base code for Linux to communicate with the SNMP 2 | agent of the iLO via the SNMP APIs. 3 | (C) Copyright [2015] Hewlett Packard Enterprise Development Company, L.P. 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of version 2 of the GNU General Public License as 7 | published by the Free Software Foundation. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to: 17 | Free Software Foundation, Inc. 18 | 51 Franklin Street, Fifth Floor 19 | Boston, MA 02110-1301, USA. */ 20 | 21 | #include "hpilo_snmp.h" 22 | extern struct inst_list *list; 23 | /* Return TRUE if the 'str' contains the hexadecimal character. */ 24 | 25 | static int 26 | is_hex_str (char *str, int value_len) 27 | { 28 | int i; 29 | int hex_format = FALSE; 30 | 31 | for (i = 0; i < value_len; i++) 32 | { 33 | if (!isprint(str[i]) && !isspace(str[i])) 34 | { 35 | hex_format = TRUE; 36 | break; 37 | } 38 | } 39 | 40 | return hex_format; 41 | } 42 | 43 | /* Print the string in the hexadecimal format. */ 44 | 45 | static void 46 | print_hex_str (char *str, int value_len) 47 | { 48 | int i; 49 | 50 | for (i = 0; i < value_len; i++) 51 | printf("%02X ", (unsigned char) str[i]); 52 | 53 | printf("\n"); 54 | } 55 | 56 | /* Copy the string in the hexadecimal format. */ 57 | 58 | static void 59 | copy_hex_str (char *str, int value_len, char *hex_buf, int len) 60 | { 61 | int i, hex_len = len/3; 62 | 63 | for (i = 0; i < value_len && i < hex_len; i++) 64 | { 65 | sprintf(hex_buf,"%02X ", (unsigned char) str[i]); 66 | hex_buf = hex_buf + 3; 67 | } 68 | } 69 | 70 | /* Retrieve the variable list from the netsnmp component. Next, the retrieved 71 | list will be placed in ilo_oid_list in order to process each valid OID. */ 72 | 73 | static int 74 | get_netsnmp_var (struct ilo_oid_list *dest, netsnmp_variable_list *src) 75 | { 76 | int ret = NAGIOS_ILO_SUCCESS_STATUS; 77 | 78 | switch (src->type) 79 | { 80 | case ASN_INTEGER: 81 | dest->integer = *src->val.integer; 82 | break; 83 | case ASN_OCTET_STR: 84 | 85 | /* Make sure the length is identical */ 86 | if (src->val_len != dest->value_len) 87 | dest->value_len = src->val_len; 88 | 89 | dest->string = (char *) malloc(dest->value_len + 1); 90 | 91 | if (dest->string == NULL) 92 | ret = NAGIOS_ILO_FAIL_STATUS; 93 | 94 | memcpy(dest->string, src->val.string, dest->value_len); 95 | dest->string[dest->value_len] = '\0'; 96 | 97 | break; 98 | case ASN_COUNTER: 99 | dest->integer = (int) &src->val.counter64; 100 | 101 | break; 102 | case ASN_GAUGE: 103 | dest->integer = (int) &src->val.counter64; 104 | 105 | break; 106 | case ASN_IPADDRESS: 107 | asprintf(&dest->string, "%d.%d.%d.%d", src->val.string[0], 108 | src->val.string[1], 109 | src->val.string[2], 110 | src->val.string[3]); 111 | 112 | break; 113 | default: 114 | ret = NAGIOS_ILO_FAIL_STATUS; 115 | } 116 | 117 | return ret; 118 | } 119 | 120 | /* Copy the oid information from oid_src to oid_dest. */ 121 | 122 | static void 123 | oid_copy (oid *oid_dest, size_t *dest_len, oid *oid_src, size_t src_len) 124 | { 125 | int i; 126 | 127 | for (i = 0; i < src_len; i++) { 128 | oid_dest[i] = oid_src[i]; 129 | } 130 | 131 | *dest_len = src_len; 132 | } 133 | 134 | /* Allocate an OID list and copy the data of netsnmp variable list to 135 | the allocated OID list. */ 136 | 137 | static struct ilo_oid_list * 138 | alloc_oid_list (netsnmp_variable_list *var_src, char **error_ptr) 139 | { 140 | struct ilo_oid_list *oid_list = NULL; 141 | 142 | oid_list = (struct ilo_oid_list *) malloc(sizeof(*oid_list)); 143 | 144 | if (oid_list != NULL) 145 | { 146 | memset(oid_list, 0, sizeof(struct ilo_oid_list)); 147 | 148 | oid_list->type = var_src->type; 149 | oid_list->value_len = var_src->val_len; 150 | oid_list->index = var_src->index; 151 | 152 | if(get_netsnmp_var(oid_list, var_src) != NAGIOS_ILO_SUCCESS_STATUS) 153 | { 154 | ILO_ERR_DEBUG(error_ptr, "Unknown type '%d'\n", var_src->type); 155 | return NULL; 156 | } 157 | 158 | oid_list->name = (oid *) malloc(MAX_OID_LEN); 159 | 160 | if (oid_list->name == NULL) 161 | { 162 | ILO_ERR_DEBUG(error_ptr, "malloc failed for the 'name' " 163 | "member of the oid list\n"); 164 | return NULL; 165 | } 166 | 167 | oid_copy(oid_list->name, &oid_list->name_len, var_src->name, 168 | var_src->name_length); 169 | oid_list->next = NULL; 170 | } 171 | else 172 | { 173 | ILO_ERR_DEBUG(error_ptr, "malloc failed for entry of the oid list\n"); 174 | } 175 | 176 | return oid_list; 177 | } 178 | 179 | /* Add an OID list to the tail of the head. */ 180 | 181 | static void 182 | oid_list_add (struct ilo_oid_list **head, struct ilo_oid_list *oid_list) 183 | { 184 | struct ilo_oid_list *tmp; 185 | 186 | if (*head == NULL) 187 | { 188 | /* No entry is in the head, so the oid_list is the head. */ 189 | *head = oid_list; 190 | } 191 | else 192 | { 193 | /* Add the oid_list to the tail of the head. */ 194 | tmp = *head; 195 | 196 | while (tmp->next != NULL) 197 | tmp = tmp->next; 198 | 199 | tmp->next = oid_list; 200 | } 201 | 202 | return ; 203 | } 204 | 205 | /* Print the value of each OID. */ 206 | 207 | static void 208 | print_oid (struct ilo_oid_list *oid_list) 209 | { 210 | int oid_num = 0; 211 | 212 | while (oid_list != NULL) 213 | { 214 | switch (oid_list->type) 215 | { 216 | case ASN_INTEGER: 217 | printf("%d\n", oid_list->integer); 218 | break; 219 | case ASN_OCTET_STR: 220 | 221 | if (is_hex_str(oid_list->string, oid_list->value_len) == TRUE) 222 | print_hex_str(oid_list->string, oid_list->value_len); 223 | else 224 | printf("%s\n", oid_list->string); 225 | 226 | break; 227 | case ASN_IPADDRESS: 228 | printf("%s\n", oid_list->string); 229 | break; 230 | default: 231 | printf("[%s] no such type: %d\n", __func__, oid_list->type); 232 | } 233 | oid_list = oid_list->next; 234 | } 235 | } 236 | 237 | /* Initialize the options data structure. */ 238 | 239 | static void 240 | init_options (struct ilo_snmp_options *options) 241 | { 242 | options->host = NULL; 243 | options->community = NULL; 244 | 245 | options->port = NAGIOS_ILO_SNMP_PORT; 246 | options->version = SNMP_VERSION_2c; 247 | options->timeout = NAGIOS_ILO_SNMP_TIMEOUT; 248 | options->retries = NAGIOS_ILO_SNMP_RETRIES; 249 | options->oid_idx = 0; 250 | 251 | return ; 252 | } 253 | 254 | /* Free the allocated the elements of the OID list. */ 255 | void 256 | free_oid_list (struct ilo_oid_list *oid_list) 257 | { 258 | struct ilo_oid_list *prev; 259 | 260 | while (oid_list) 261 | { 262 | prev = oid_list; 263 | 264 | free(oid_list->name); 265 | free(oid_list->string); 266 | 267 | oid_list = oid_list->next; 268 | 269 | free(prev); 270 | } 271 | 272 | return ; 273 | } 274 | 275 | /* Initialize struct ilo_snmp_priv the data structure. */ 276 | 277 | void 278 | init_priv_data (struct ilo_snmp_priv *priv_ptr) 279 | { 280 | 281 | priv_ptr->session = NULL; 282 | priv_ptr->err_str = NULL; 283 | 284 | priv_ptr->oid_list = NULL; 285 | 286 | init_options(&priv_ptr->options); 287 | 288 | return ; 289 | } 290 | 291 | /* Establish a SNMP session with the SNMP agent of HP iLO by invoking 292 | a SNMP API. */ 293 | 294 | int init_ilo_snmp_session(struct ilo_snmp_priv * priv_ptr) 295 | { 296 | int ret = NAGIOS_ILO_SUCCESS_STATUS; 297 | netsnmp_session session; 298 | 299 | init_snmp("Nagios_hpilo_snmp"); 300 | 301 | snmp_sess_init(&session); 302 | session.peername = strdup(priv_ptr->options.host); 303 | session.community = strdup(priv_ptr->options.community); 304 | session.community_len = strlen((char *) session.community); 305 | session.version = priv_ptr->options.version; 306 | session.timeout = priv_ptr->options.timeout; 307 | session.retries = priv_ptr->options.retries; 308 | 309 | priv_ptr->session = snmp_open(&session); 310 | 311 | if (priv_ptr->session == NULL) 312 | { 313 | snmp_error(&session, &session.s_errno, &session.s_snmp_errno, 314 | &priv_ptr->err_str); 315 | ret = NAGIOS_ILO_FAIL_STATUS; 316 | } 317 | 318 | return ret; 319 | } 320 | 321 | /* Get the netsnmp variable list by establishing a SNMP session with the 322 | SNMP agent of HP iLO. Once the list is retrieved, the list will be copied 323 | to the ilo_oid_list. Note that the netsnmp variable list will not be 324 | available after this function returns. That's why we need to copy the 325 | variable list to the private data structure (ilo_oid_list). */ 326 | 327 | int 328 | get_ilo_oid_list (struct snmp_session *session, oid *target_oid, 329 | size_t target_oid_len, char **error_ptr) 330 | { 331 | int status; 332 | int running = TRUE; 333 | oid cur_oid[MAX_OID_LEN]; 334 | size_t cur_oid_len; 335 | 336 | struct snmp_pdu *pdu_ptr, *response_ptr; 337 | netsnmp_variable_list *var_list,*var_list_prev=NULL; 338 | struct ilo_oid_list *oid_list; 339 | 340 | struct ilo_snmp_priv *priv_ptr = container_of(error_ptr, 341 | struct ilo_snmp_priv, err_str); 342 | 343 | if (priv_ptr == NULL) 344 | { 345 | ILO_ERR_DEBUG(error_ptr, "priv_ptr is NULL!\n"); 346 | return NAGIOS_ILO_FAIL_STATUS; 347 | } 348 | 349 | oid_copy(cur_oid, &cur_oid_len, target_oid, target_oid_len); 350 | 351 | while (running) 352 | { 353 | pdu_ptr = snmp_pdu_create(SNMP_MSG_GETBULK); 354 | 355 | /* Max-repetitions: Tell get-bulk to attemp up to 'errindex' 356 | get-next operations to get the remaining objects. */ 357 | pdu_ptr->errindex = SNMP_GETBULK_ERRINDEX; 358 | 359 | /* Non-repeater. */ 360 | pdu_ptr->errstat = 0; 361 | 362 | snmp_add_null_var(pdu_ptr, cur_oid, cur_oid_len); 363 | 364 | status = snmp_synch_response(session, pdu_ptr, &response_ptr); 365 | 366 | if (status == STAT_SUCCESS && response_ptr->errstat == SNMP_ERR_NOERROR) 367 | { 368 | 369 | var_list = var_list_prev =response_ptr->variables; 370 | 371 | /* Add each element of the netsnmp variable list to 372 | struct ilo_oid_list. */ 373 | while (var_list) 374 | { 375 | if (netsnmp_oid_is_subtree(target_oid, 376 | target_oid_len, 377 | var_list->name, 378 | var_list->name_length) != 0) 379 | { 380 | running = FALSE; 381 | break; 382 | } 383 | 384 | oid_list = alloc_oid_list(var_list, error_ptr); 385 | 386 | if (oid_list == NULL) 387 | { 388 | ILO_ERR_DEBUG(error_ptr, "oid_list is NULL!\n"); 389 | return NAGIOS_ILO_FAIL_STATUS; 390 | } 391 | 392 | oid_list_add(&priv_ptr->oid_list, oid_list); 393 | var_list_prev = var_list; 394 | var_list = var_list->next_variable; 395 | } 396 | var_list=var_list_prev; 397 | 398 | if ((var_list->type == SNMP_ENDOFMIBVIEW) || 399 | (var_list->type == SNMP_NOSUCHOBJECT) || 400 | (var_list->type == SNMP_NOSUCHINSTANCE)) 401 | { 402 | running = FALSE; 403 | } 404 | else 405 | { 406 | oid_copy(cur_oid, &cur_oid_len, var_list->name,var_list->name_length); 407 | } 408 | } 409 | else 410 | { /* Cannot get the response */ 411 | if (status == STAT_SUCCESS) 412 | { 413 | ILO_ERR_DEBUG(error_ptr, "Cannot get the response: %s\n", 414 | snmp_errstring(response_ptr->errstat)); 415 | } 416 | else 417 | { 418 | snmp_error(session, &session->s_errno, &session->s_snmp_errno, 419 | error_ptr); 420 | } 421 | 422 | return NAGIOS_ILO_FAIL_STATUS; 423 | 424 | } 425 | 426 | if (response_ptr) 427 | snmp_free_pdu(response_ptr); 428 | 429 | } 430 | 431 | return NAGIOS_ILO_SUCCESS_STATUS; 432 | } 433 | 434 | /* Free the allocated private data structure (struct ilo_snmp_priv *). */ 435 | 436 | void 437 | free_priv_data (struct ilo_snmp_priv * priv_ptr) 438 | { 439 | 440 | free_oid_list(priv_ptr->oid_list); 441 | 442 | priv_ptr->oid_list = NULL; 443 | 444 | if (priv_ptr->err_str) 445 | free(priv_ptr->err_str); 446 | 447 | return ; 448 | } 449 | 450 | 451 | /* Get the service detailed information. */ 452 | service_details_print_oid_info (struct ilo_oid_list **oid_list_ptr, int *oid) { 453 | struct ilo_oid_list *oid_list = *oid_list_ptr; 454 | struct inst *instance,*tmp = NULL; 455 | char **table_ele; 456 | int tbl_ele, inst_id, inst_last = -1; 457 | int count = 0, newinst = 0, inst_store[512] = {0}; 458 | char i, str_len = 0; 459 | char buf[1024] = {0}, *oid_str, *json_c = NULL, pBuf[128] = {0}; 460 | 461 | switch (*oid) { 462 | case 1: 463 | table_ele = &ps_tbl_ele; 464 | break; 465 | case 2: 466 | table_ele = &fan_tbl_ele; 467 | break; 468 | case 3: 469 | table_ele = &temp_tbl_ele; 470 | break; 471 | case 4: 472 | table_ele = &st_tbl_ele; 473 | break; 474 | case 5: 475 | table_ele = &mem_tbl_ele; 476 | break; 477 | case 6: 478 | table_ele = &pro_tbl_ele; 479 | break; 480 | case 7: 481 | table_ele = &net_tbl_ele; 482 | break; 483 | default: 484 | break; 485 | } 486 | 487 | while (oid_list != NULL ) { 488 | switch (*oid) { 489 | case 4: 490 | inst_id = oid_list->name[oid_list->name_len-4]; 491 | tbl_ele = oid_list->name[oid_list->name_len-2]; 492 | break; 493 | case 5: 494 | case 6: 495 | case 7: 496 | inst_id = oid_list->name[oid_list->name_len-1]; 497 | tbl_ele = oid_list->name[oid_list->name_len-2]; 498 | break; 499 | default: 500 | inst_id = oid_list->name[oid_list->name_len-1]; 501 | tbl_ele = oid_list->name[oid_list->name_len-3]; 502 | break; 503 | } 504 | /* Create instance */ 505 | if ( inst_last < inst_id ) { 506 | instance = (struct inst *) malloc(sizeof (struct inst *)); 507 | 508 | /* Create object for each instance */ 509 | /* Store each inst_id in inst_store[] and record the last inst_id for inst_last */ 510 | if (instance != NULL) 511 | { 512 | inst_store[list->inst_count] = inst_id; 513 | list->inst_count++; 514 | inst_last = inst_id; 515 | instance->json_doc = (char *) malloc(sizeof(char)*1024); 516 | sprintf(buf, "\"%d\": \{", inst_id); 517 | strncpy(instance->json_doc,buf,strlen(buf)); 518 | instance->bytes_cons = strlen(buf); 519 | instance->next=NULL; 520 | newinst=1; 521 | 522 | if(list->obj == NULL) 523 | { 524 | list->obj = instance; 525 | } else 526 | { 527 | tmp = list->obj; 528 | while(tmp->next != NULL) 529 | tmp = tmp->next; 530 | tmp->next = instance; 531 | } 532 | } 533 | } 534 | /* Add object into each instance*/ 535 | else 536 | { 537 | newinst = 0; 538 | tmp = list->obj; 539 | count = 0; 540 | /* Match instance by inst_id*/ 541 | while(inst_store[count] != inst_id) 542 | { 543 | tmp = tmp->next; 544 | count++; 545 | } 546 | instance = tmp; 547 | tmp = NULL; 548 | } 549 | /* Store each instances OID information in respective objects */ 550 | if (instance != NULL && instance->json_doc != NULL){ 551 | switch (oid_list->type) 552 | { 553 | case ASN_INTEGER: 554 | sprintf(buf, "\"%s\":%d",table_ele[tbl_ele-1],oid_list->integer); 555 | break; 556 | case ASN_OCTET_STR: 557 | if (is_hex_str(oid_list->string, oid_list->value_len) == TRUE) { 558 | copy_hex_str(oid_list->string, oid_list->value_len, pBuf, 128); 559 | sprintf(buf, "\"%s\":\"%s\"", table_ele[tbl_ele-1], pBuf); 560 | } 561 | else { 562 | oid_str = oid_list->string; 563 | if ( *oid_str == ' ') 564 | { 565 | sprintf (oid_str, "%s", ""); 566 | sprintf(buf, "\"%s\":\"%s\"", table_ele[tbl_ele-1], oid_str); 567 | } 568 | else { 569 | sprintf(buf, "\"%s\":\"%s\"", table_ele[tbl_ele-1], oid_list->string); 570 | } 571 | } 572 | break; 573 | case ASN_IPADDRESS: 574 | sprintf(buf, "\"%s\":\"%s\"", table_ele[tbl_ele-1], oid_list->string); 575 | break; 576 | case ASN_COUNTER: 577 | sprintf(buf, "\"%s\":%d",table_ele[tbl_ele-1],oid_list->integer); 578 | break; 579 | case ASN_GAUGE: 580 | sprintf(buf, "\"%s\":%d",table_ele[tbl_ele-1],oid_list->integer); 581 | break; 582 | default: 583 | sprintf(buf, "\"%d\":\"%s\"",tbl_ele,"null"); 584 | break; 585 | } 586 | if(!newinst) 587 | { 588 | json_c = &(instance->json_doc[instance->bytes_cons]); 589 | strcpy(json_c,","); 590 | instance->bytes_cons++; 591 | } 592 | json_c = &(instance->json_doc[instance->bytes_cons]); 593 | strncpy(json_c,buf,strlen(buf)); 594 | instance->bytes_cons = instance->bytes_cons+strlen(buf); 595 | } 596 | 597 | instance = tmp = NULL; 598 | memset(buf,0,sizeof(buf)); 599 | oid_list = oid_list->next; 600 | } 601 | tmp = list->obj; 602 | while(tmp != NULL){ 603 | json_c = &(tmp->json_doc[tmp->bytes_cons]); 604 | strcpy(json_c,"}"); 605 | tmp->bytes_cons++; 606 | tmp = tmp->next; 607 | } 608 | } 609 | 610 | int 611 | print_oid_info (int status, struct ilo_oid_list **oid_list_ptr) 612 | { 613 | 614 | //if (status != NAGIOS_CRITICAL) 615 | if (status != NAGIOS_ILO_FAIL_STATUS) 616 | { 617 | print_oid(*oid_list_ptr); 618 | } 619 | else 620 | { 621 | struct ilo_snmp_priv * priv_ptr = NULL; 622 | 623 | priv_ptr = container_of(oid_list_ptr, struct ilo_snmp_priv, oid_list); 624 | 625 | if (priv_ptr != NULL) 626 | if (priv_ptr->err_str) 627 | { 628 | if(strcmp(priv_ptr->err_str,"Timeout") == 0) 629 | { 630 | status = NAGIOS_UNKNOWN; 631 | printf("%s - Probable Cause might be SNMP Community string is incorrect or not configured.\n", priv_ptr->err_str); 632 | } 633 | else 634 | { 635 | printf("%s\n", priv_ptr->err_str); 636 | } 637 | } 638 | } 639 | 640 | return status; 641 | } 642 | -------------------------------------------------------------------------------- /src/ilo_credit/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = -I$(top_srcdir)/src/include 2 | AM_LIBTOOLFLAGS=--silent 3 | zabbixdir = ${prefix}/zabbix 4 | 5 | lib_LTLIBRARIES = libilocrst.la 6 | 7 | libilocrst_la_SOURCES = base64.c ilo-credit-store.cpp 8 | 9 | libilocrst_la_LDFLAGS = -shared -fPIC -ltdb -lssl -lcrypto 10 | 11 | AUTOMAKE_OPTIONS = foreign 12 | 13 | if COMPILING_ON_64 14 | lib_path = /usr/lib64 15 | else 16 | lib_path = /usr/lib 17 | endif 18 | 19 | if COMPILING_ON_DEBIAN 20 | LIBPATH = /usr/lib/x86_64-linux-gnu 21 | else 22 | LIBPATH = ${lib_path} 23 | endif 24 | 25 | install: 26 | install -m 755 .libs/libilocrst.so.0.0.0 $(LIBPATH); \ 27 | ln -sf $(LIBPATH)/libilocrst.so.0.0.0 $(LIBPATH)/libilocrst.so.0; \ 28 | install -m 755 .libs/libilocrst.so $(zabbixdir)/libilocrst.so 29 | 30 | clean: clean-am 31 | unlink $(LIBPATH)/libilocrst.so.0; \ 32 | rm -f $(LIBPATH)/libilocrst.so.0.0.0 33 | 34 | uninstall: 35 | rm -f $(zabbixdir)/libilocrst.so; \ 36 | rm -f /etc/zabbix/.zabbix_credential.tdb 37 | -------------------------------------------------------------------------------- /src/ilo_credit/base64.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /*(C) Copyright [2016] Hewlett Packard Enterprise Development Company, L.P.*/ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include "base64.h" 12 | 13 | 14 | int base64_encode(const unsigned char* buffer, size_t length, char** b64text) { //Encodes a binary safe base 64 string 15 | BIO *bio, *b64; 16 | BUF_MEM *bufferPtr; 17 | 18 | b64 = BIO_new(BIO_f_base64()); 19 | bio = BIO_new(BIO_s_mem()); 20 | bio = BIO_push(b64, bio); 21 | 22 | BIO_set_flags(bio, BIO_FLAGS_BASE64_NO_NL); //Ignore newlines - write everything in one line 23 | if (buffer) 24 | BIO_write(bio, buffer, length); 25 | else 26 | return 1;//error 27 | BIO_flush(bio); 28 | BIO_get_mem_ptr(bio, &bufferPtr); 29 | BIO_set_close(bio, BIO_NOCLOSE); 30 | BIO_free_all(bio); 31 | BIO_free_all(b64); 32 | 33 | if (b64text) 34 | *b64text=(*bufferPtr).data; 35 | else 36 | return 1;//error 37 | 38 | return (0); //success 39 | } 40 | 41 | size_t calcDecodeLength(const char* b64input) { //Calculates the length of a decoded string 42 | size_t len = strlen(b64input), 43 | padding = 0; 44 | 45 | if (b64input[len-1] == '=' && b64input[len-2] == '=') //last two chars are = 46 | padding = 2; 47 | else if (b64input[len-1] == '=') //last char is = 48 | padding = 1; 49 | 50 | return (len*3)/4 - padding; 51 | } 52 | 53 | 54 | int base64_decode(char* b64message, char** buffer) { //Decodes a base64 encoded string 55 | BIO *bio, *b64; 56 | int decodeLen = calcDecodeLength(b64message), 57 | len = 0; 58 | *buffer = (char*)malloc(1024); 59 | FILE* stream = fmemopen(b64message, strlen(b64message), "r"); 60 | 61 | b64 = BIO_new(BIO_f_base64()); 62 | bio = BIO_new_fp(stream, BIO_NOCLOSE); 63 | bio = BIO_push(b64, bio); 64 | BIO_set_flags(bio, BIO_FLAGS_BASE64_NO_NL); //Do not use newlines to flush buffer 65 | len = BIO_read(bio, *buffer, 1024); 66 | //Can test here if len == decodeLen - if not, then return an error 67 | (*buffer)[len] = '\0'; 68 | 69 | BIO_free_all(bio); 70 | fclose(stream); 71 | 72 | return 0; //success 73 | } 74 | -------------------------------------------------------------------------------- /src/ilo_credit/ilo-credit-store.cpp: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /*(C) Copyright [2016] Hewlett Packard Enterprise Development Company, L.P.*/ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #include "base64.h" 19 | #include "ilo-credit-store.h" 20 | 21 | #define PROGRAM_NAME "ilo-credit-store" 22 | #define PROGRAM_VERSION 1.0 23 | #define TDBDIR "/etc/zabbix" 24 | #define TDBFILE "/etc/zabbix/.zabbix_credential.tdb" 25 | 26 | using namespace std; 27 | 28 | TDB_CONTEXT *_tdb; // Handle on tdb protected by lock 29 | 30 | int storeString(const string &key, const string &value) 31 | { 32 | TDB_DATA k, v; 33 | 34 | k.dptr = (unsigned char *)key.c_str(); 35 | k.dsize = key.length(); 36 | 37 | v.dptr = (unsigned char *)value.c_str(); 38 | v.dsize = value.length(); 39 | 40 | int result = tdb_store(_tdb, k, v, TDB_REPLACE); 41 | 42 | return result; 43 | } 44 | 45 | string fetchString(const string &key) 46 | { 47 | TDB_DATA k; 48 | 49 | k.dptr = (unsigned char *)key.c_str(); 50 | k.dsize = key.length(); 51 | 52 | TDB_DATA v; 53 | 54 | v = tdb_fetch(_tdb, k); 55 | 56 | if (v.dptr == NULL) 57 | return string(); 58 | 59 | string result((char *)v.dptr, v.dsize); 60 | 61 | free(v.dptr); 62 | 63 | return result; 64 | } 65 | 66 | bool remove(const string &key) 67 | { 68 | TDB_DATA k; 69 | 70 | k.dptr = (unsigned char *)key.c_str(); 71 | k.dsize = key.length(); 72 | 73 | bool result = (tdb_delete(_tdb, k) == 0); 74 | 75 | return result; 76 | } 77 | 78 | bool exists(const string &key) 79 | { 80 | TDB_DATA k; 81 | 82 | k.dptr = (unsigned char *)key.c_str(); 83 | k.dsize = key.length(); 84 | 85 | bool result = tdb_exists(_tdb, k); 86 | 87 | return result; 88 | } 89 | 90 | extern "C" 91 | char * 92 | get_cred(char * host) 93 | { 94 | const char * encode_credential; 95 | string key, value; 96 | size_t test; 97 | int option_instruction = OPTION_NOP; 98 | 99 | if (host) 100 | key=host; 101 | else 102 | return NULL; 103 | 104 | _tdb = tdb_open_ex(TDBFILE, 0, 0, O_RDWR, 0600, NULL, NULL); 105 | 106 | if (!_tdb) { 107 | cout<<"Could not open "<>cred_data.user; 237 | } 238 | 239 | printf("Enter password:"); 240 | cin>>cred_data.passwd; 241 | 242 | if((_textf = fopen(file.c_str(), "r+" )) == NULL) 243 | _tdb = tdb_open_ex(file.c_str(), 244 | 0, // hash_size 245 | 0, // tdb_flags 246 | O_CREAT|O_RDWR, // open_flags 247 | 0600, // mode 248 | NULL, // log_fn 249 | NULL); // hash_fn 250 | else 251 | _tdb = tdb_open_ex(file.c_str(), 0, 0, O_RDWR, 0600, NULL, NULL); 252 | 253 | if (!_tdb) { 254 | cout<<"Could not create "< 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | int base64_encode(const unsigned char*, size_t, char**); 26 | int base64_decode(char*, char**); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | -------------------------------------------------------------------------------- /src/include/cJSON.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009 Dave Gamble 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | 23 | #ifndef cJSON__h 24 | #define cJSON__h 25 | 26 | #ifdef __cplusplus 27 | extern "C" 28 | { 29 | #endif 30 | 31 | /* cJSON Types: */ 32 | #define cJSON_False 0 33 | #define cJSON_True 1 34 | #define cJSON_NULL 2 35 | #define cJSON_Number 3 36 | #define cJSON_String 4 37 | #define cJSON_Array 5 38 | #define cJSON_Object 6 39 | 40 | #define cJSON_IsReference 256 41 | #define cJSON_StringIsConst 512 42 | 43 | /* The cJSON structure: */ 44 | typedef struct cJSON { 45 | struct cJSON *next,*prev; /* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */ 46 | struct cJSON *child; /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */ 47 | 48 | int type; /* The type of the item, as above. */ 49 | 50 | char *valuestring; /* The item's string, if type==cJSON_String */ 51 | int valueint; /* The item's number, if type==cJSON_Number */ 52 | double valuedouble; /* The item's number, if type==cJSON_Number */ 53 | 54 | char *string; /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */ 55 | } cJSON; 56 | 57 | typedef struct cJSON_Hooks { 58 | void *(*malloc_fn)(size_t sz); 59 | void (*free_fn)(void *ptr); 60 | } cJSON_Hooks; 61 | 62 | /* Supply malloc, realloc and free functions to cJSON */ 63 | extern void cJSON_InitHooks(cJSON_Hooks* hooks); 64 | 65 | 66 | /* Supply a block of JSON, and this returns a cJSON object you can interrogate. Call cJSON_Delete when finished. */ 67 | extern cJSON *cJSON_Parse(const char *value); 68 | /* Render a cJSON entity to text for transfer/storage. Free the char* when finished. */ 69 | extern char *cJSON_Print(cJSON *item); 70 | /* Render a cJSON entity to text for transfer/storage without any formatting. Free the char* when finished. */ 71 | extern char *cJSON_PrintUnformatted(cJSON *item); 72 | /* Render a cJSON entity to text using a buffered strategy. prebuffer is a guess at the final size. guessing well reduces reallocation. fmt=0 gives unformatted, =1 gives formatted */ 73 | extern char *cJSON_PrintBuffered(cJSON *item,int prebuffer,int fmt); 74 | /* Delete a cJSON entity and all subentities. */ 75 | extern void cJSON_Delete(cJSON *c); 76 | 77 | /* Returns the number of items in an array (or object). */ 78 | extern int cJSON_GetArraySize(cJSON *array); 79 | /* Retrieve item number "item" from array "array". Returns NULL if unsuccessful. */ 80 | extern cJSON *cJSON_GetArrayItem(cJSON *array,int item); 81 | /* Get item "string" from object. Case insensitive. */ 82 | extern cJSON *cJSON_GetObjectItem(cJSON *object,const char *string); 83 | 84 | /* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds. */ 85 | extern const char *cJSON_GetErrorPtr(void); 86 | 87 | /* These calls create a cJSON item of the appropriate type. */ 88 | extern cJSON *cJSON_CreateNull(void); 89 | extern cJSON *cJSON_CreateTrue(void); 90 | extern cJSON *cJSON_CreateFalse(void); 91 | extern cJSON *cJSON_CreateBool(int b); 92 | extern cJSON *cJSON_CreateNumber(double num); 93 | extern cJSON *cJSON_CreateString(const char *string); 94 | extern cJSON *cJSON_CreateArray(void); 95 | extern cJSON *cJSON_CreateObject(void); 96 | 97 | /* These utilities create an Array of count items. */ 98 | extern cJSON *cJSON_CreateIntArray(const int *numbers,int count); 99 | extern cJSON *cJSON_CreateFloatArray(const float *numbers,int count); 100 | extern cJSON *cJSON_CreateDoubleArray(const double *numbers,int count); 101 | extern cJSON *cJSON_CreateStringArray(const char **strings,int count); 102 | 103 | /* Append item to the specified array/object. */ 104 | extern void cJSON_AddItemToArray(cJSON *array, cJSON *item); 105 | extern void cJSON_AddItemToObject(cJSON *object,const char *string,cJSON *item); 106 | extern void cJSON_AddItemToObjectCS(cJSON *object,const char *string,cJSON *item); /* Use this when string is definitely const (i.e. a literal, or as good as), and will definitely survive the cJSON object */ 107 | /* Append reference to item to the specified array/object. Use this when you want to add an existing cJSON to a new cJSON, but don't want to corrupt your existing cJSON. */ 108 | extern void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item); 109 | extern void cJSON_AddItemReferenceToObject(cJSON *object,const char *string,cJSON *item); 110 | 111 | /* Remove/Detatch items from Arrays/Objects. */ 112 | extern cJSON *cJSON_DetachItemFromArray(cJSON *array,int which); 113 | extern void cJSON_DeleteItemFromArray(cJSON *array,int which); 114 | extern cJSON *cJSON_DetachItemFromObject(cJSON *object,const char *string); 115 | extern void cJSON_DeleteItemFromObject(cJSON *object,const char *string); 116 | 117 | /* Update array items. */ 118 | extern void cJSON_InsertItemInArray(cJSON *array,int which,cJSON *newitem); /* Shifts pre-existing items to the right. */ 119 | extern void cJSON_ReplaceItemInArray(cJSON *array,int which,cJSON *newitem); 120 | extern void cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem); 121 | 122 | /* Duplicate a cJSON item */ 123 | extern cJSON *cJSON_Duplicate(cJSON *item,int recurse); 124 | /* Duplicate will create a new, identical cJSON item to the one you pass, in new memory that will 125 | need to be released. With recurse!=0, it will duplicate any children connected to the item. 126 | The item->next and ->prev pointers are always zero on return from Duplicate. */ 127 | 128 | /* ParseWithOpts allows you to require (and check) that the JSON is null terminated, and to retrieve the pointer to the final byte parsed. */ 129 | extern cJSON *cJSON_ParseWithOpts(const char *value,const char **return_parse_end,int require_null_terminated); 130 | 131 | extern void cJSON_Minify(char *json); 132 | 133 | /* Macros for creating things quickly. */ 134 | #define cJSON_AddNullToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateNull()) 135 | #define cJSON_AddTrueToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateTrue()) 136 | #define cJSON_AddFalseToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateFalse()) 137 | #define cJSON_AddBoolToObject(object,name,b) cJSON_AddItemToObject(object, name, cJSON_CreateBool(b)) 138 | #define cJSON_AddNumberToObject(object,name,n) cJSON_AddItemToObject(object, name, cJSON_CreateNumber(n)) 139 | #define cJSON_AddStringToObject(object,name,s) cJSON_AddItemToObject(object, name, cJSON_CreateString(s)) 140 | 141 | /* When assigning an integer value, it needs to be propagated to valuedouble too. */ 142 | #define cJSON_SetIntValue(object,val) ((object)?(object)->valueint=(object)->valuedouble=(val):(val)) 143 | #define cJSON_SetNumberValue(object,val) ((object)?(object)->valueint=(object)->valuedouble=(val):(val)) 144 | 145 | #ifdef __cplusplus 146 | } 147 | #endif 148 | 149 | #endif 150 | -------------------------------------------------------------------------------- /src/include/credit_save.h: -------------------------------------------------------------------------------- 1 | /* credit_setting.h -- types and prototypes used by iLO engine 2 | (C) Copyright [2016] Hewlett Packard Enterprise Development Company, L.P. 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of version 2 of the GNU General Public License as 6 | published by the Free Software Foundation. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 11 | 12 | See the GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to: 16 | Free Software Foundation, Inc. 17 | 51 Franklin Street, Fifth Floor 18 | Boston, MA 02110-1301, USA. */ 19 | 20 | #ifndef CREDIT_SETTING_H 21 | #define CREDIT_SETTING_H 22 | 23 | #include "hpilo_common.h" 24 | 25 | /* Macro definition */ 26 | #define USAGE "-H [-V] [-h]" 27 | 28 | /* Available options for this plugin. */ 29 | #define SHORT_OPTIONS "hVH:" 30 | 31 | /* The required the number of arguments for this plugin. */ 32 | #define ILO_REQUIRE_ARGC 1 33 | 34 | /* Strings for help menu. */ 35 | static char help_string[][128] = 36 | {"-H, --hostip=ip_address\n\tHP iLO IP address or \"default\" for all servers", 37 | "-V, --version\n\tprint the version number", 38 | "-h, --help\n\tprint this help menu" 39 | }; 40 | 41 | /* options for arguments. */ 42 | static struct option long_options[] = 43 | { 44 | {"hostname", required_argument, 0, 'H'}, 45 | {"version", no_argument, 0, 'V'}, 46 | {"help", no_argument, 0, 'h'}, 47 | {0, 0, 0, 0} 48 | }; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/include/hpilo_common.h: -------------------------------------------------------------------------------- 1 | /* hpilo_common.h -- types and prototypes used by iLO plug-in 2 | (C) Copyright [2016] Hewlett Packard Enterprise Development Company, L.P. 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of version 2 of the GNU General Public License as 6 | published by the Free Software Foundation. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 11 | 12 | See the GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to: 16 | Free Software Foundation, Inc. 17 | 51 Franklin Street, Fifth Floor 18 | Boston, MA 02110-1301, USA. */ 19 | 20 | #ifndef NAGIOS_HPILO_COMMON_H 21 | #define NAGIOS_HPILO_COMMON_H 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | #define TRUE 1 32 | #define FALSE 0 33 | 34 | /* Internal status. */ 35 | #define NAGIOS_ILO_SUCCESS_STATUS 0 36 | #define NAGIOS_ILO_FAIL_STATUS -1 37 | 38 | /* Cast a member of a structure out to the containing structure. */ 39 | #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) 40 | #define container_of(ptr, type, member) ({ \ 41 | const typeof( ((type *)0)->member ) *__mptr = (ptr); \ 42 | (type *)( (char *)__mptr - offsetof(type,member) );}) 43 | 44 | 45 | #define NUM_ELEMENTS(array) \ 46 | (sizeof(array) / sizeof(typeof(array[0]))) 47 | 48 | /* Return status defined by Nagios. */ 49 | enum Nagios_status 50 | { 51 | NAGIOS_OK, 52 | NAGIOS_WARNING, 53 | NAGIOS_CRITICAL, 54 | NAGIOS_UNKNOWN 55 | }; 56 | 57 | /* Error Debug Macro. */ 58 | #define ILO_ERR_DEBUG(ppError, fmt, args...) \ 59 | if (*ppError == NULL) { \ 60 | asprintf(ppError, "[Error]: " fmt, ## args); \ 61 | } else { \ 62 | char buf[strlen(*ppError) + 1]; \ 63 | sprintf(buf, "%s", *ppError); \ 64 | free(*ppError); \ 65 | asprintf(ppError, "%s[Error]: " fmt, buf, ##args); \ 66 | } 67 | 68 | /* Data structure to store services detailed OID inforamtion retrieved from a specific OID. */ 69 | /* Data structure to create object for each instance */ 70 | struct inst { 71 | char *json_doc; /* 1024 bytes allocation */ 72 | int bytes_cons; /*track the pos in json_doc after updating each element */ 73 | struct inst *next; 74 | }; 75 | 76 | /* Data structure to create instances */ 77 | struct inst_list { 78 | int inst_count; /*number of instances*/ 79 | struct inst *obj; /*Instance List*/ 80 | }*glist; 81 | 82 | /* Data structure to store OID information retrieved from a specific OID. */ 83 | struct ilo_oid_list 84 | { 85 | /* The OID name. */ 86 | oid *name; 87 | 88 | /* Length of a specific OID. */ 89 | size_t name_len; 90 | 91 | /* Length of the content for an OID. */ 92 | size_t value_len; 93 | 94 | int index; 95 | 96 | /* Type of a specific OID. */ 97 | u_char type; 98 | 99 | /* The content of the specific OID if it is a string OID. */ 100 | char *string; 101 | 102 | /* The content of a integer OID. */ 103 | int integer; 104 | 105 | /* Pointer to the next entry. */ 106 | struct ilo_oid_list *next; 107 | }; 108 | 109 | /* Data structure to store options via the argument list of the command 110 | line. */ 111 | struct ilo_snmp_options 112 | { 113 | /* Pointer to host name (IP address). */ 114 | char *host; 115 | 116 | /* Pointer to communuity. */ 117 | char *community; 118 | 119 | /* Port number of the SNMP agent. */ 120 | int port; 121 | 122 | /* SNMP version. */ 123 | int version; 124 | 125 | /* SNMP timeout (microsecond). */ 126 | int timeout; 127 | 128 | /* SNMP retries. */ 129 | int retries; 130 | 131 | /* Index to the iLO OID table. */ 132 | int oid_idx; 133 | }; 134 | 135 | /* Private data for this plugin. */ 136 | struct ilo_snmp_priv 137 | { 138 | /* Options information. */ 139 | struct ilo_snmp_options options; 140 | 141 | /* Pointer to a SNMP session. */ 142 | netsnmp_session *session; 143 | 144 | /* Pointer to an error string. */ 145 | char *err_str; 146 | 147 | /* Pointer to an OID list. */ 148 | struct ilo_oid_list *oid_list, *oid_list_info; 149 | 150 | 151 | }; 152 | 153 | #endif 154 | -------------------------------------------------------------------------------- /src/include/hpilo_engine.h: -------------------------------------------------------------------------------- 1 | /* hpilo_engine.h -- types and prototypes used by iLO engine 2 | (C) Copyright [2015] Hewlett Packard Enterprise Development Company, L.P. 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of version 2 of the GNU General Public License as 6 | published by the Free Software Foundation. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 11 | 12 | See the GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to: 16 | Free Software Foundation, Inc. 17 | 51 Franklin Street, Fifth Floor 18 | Boston, MA 02110-1301, USA. */ 19 | 20 | #ifndef NAGIOS_HPILO_ENGINE_H 21 | #define NAGIOS_HPILO_ENGINE_H 22 | 23 | #include "hpilo_common.h" 24 | 25 | /* Macro definition */ 26 | #define USAGE "-H -C -o [-h] [-V] [-J]" 27 | 28 | /* Available options for this plugin. */ 29 | #define SHORT_OPTIONS "hJVC:H:o:" 30 | 31 | /* The required the number of arguments for this plugin. */ 32 | #define NAGIOS_ILO_REQUIRE_ARGC 3 33 | 34 | #define IDX_OUT_OF_RANGE(idx, array) ((idx < 0 || idx >= NUM_ELEMENTS(array)) ? TRUE : FALSE) 35 | 36 | #define ILO_OID_NAME_LEN 24 37 | 38 | #define MAX_OID_INFO_ENTRIES 2 39 | 40 | /* Health group OID. 41 | For example: Fans, power supplies and so on. */ 42 | #define HLTH_GROUP_OID 0 43 | 44 | /* Health component OID info 45 | For example: Fan 1, Fan 2.....Fan n 46 | Sensor 1, Sensor 2.....Sensor n. */ 47 | #define HLTH_COMP_OID 1 48 | 49 | /* Strings for help menu. */ 50 | static char help_string[][128] = 51 | {"-H, --hostname=ip_address\n\tHost name or IP address to connect with", 52 | "-C, --community=SNMP_COMMINUTY\n\tSNMP comminuty string. " 53 | "For example: -C public or --community=public", 54 | "-o, --oid=oid_index\n\tOID index", 55 | "-J, --json\nprint the oid data in json format", 56 | "-V, --version\n\tprint the version number", 57 | "-h, --help\n\tprint this help menu" 58 | }; 59 | 60 | /* options for arguments. */ 61 | static struct option long_options[] = 62 | { 63 | {"hostname", required_argument, 0, 'H'}, 64 | {"community", required_argument, 0, 'C'}, 65 | {"oid", required_argument, 0, 'o'}, 66 | {"version", no_argument, 0, 'V'}, 67 | {"json", no_argument, 0, 'J'}, 68 | {"help", no_argument, 0, 'h'}, 69 | {0, 0, 0, 0} 70 | }; 71 | 72 | 73 | /* iLO health status. */ 74 | enum 75 | { 76 | ILO_HLTH_STATUS_NA, 77 | ILO_HLTH_STATUS_OTHER, 78 | ILO_HLTH_STATUS_OK, 79 | ILO_HLTH_STATUS_DEGRADED, 80 | ILO_HLTH_STATUS_FAILED, 81 | }; 82 | 83 | /* iLO Redundant status. */ 84 | enum 85 | { 86 | ILO_RED_STATUS_OTHER = 1, 87 | ILO_RED_STATUS_NOT_RED, 88 | ILO_RED_STATUS_RED, 89 | }; 90 | 91 | /* A variety of OID types. */ 92 | enum 93 | { 94 | /* The array index of the system overall condition. */ 95 | ILO_SYS_OVERALL_COND, 96 | 97 | ILO_HLTH_TYPE, 98 | 99 | ILO_HLTH_STR_TYPE, 100 | 101 | ILO_REDUNDANT_TYPE, 102 | 103 | /* The array index of NIC condition (232.18.1.3:cpqNicMibCondition). */ 104 | ILO_NIC_MIB_COND = 14, 105 | }; 106 | 107 | /* Option operation. */ 108 | enum 109 | { 110 | NAGIOS_OPTION_NOP, 111 | NAGIOS_OPTION_PRINT_VERSION, 112 | NAGIOS_OPTION_PRINT_HELP 113 | }; 114 | 115 | /* This data structure is used to store the different type associated with the 116 | different get_status_str_fn_ptr function. */ 117 | struct ilo_get_status_str_entry 118 | { 119 | /* The type of different component. */ 120 | int type; 121 | 122 | /* Function pointer. */ 123 | enum Nagios_status (*get_status_str_fn_ptr) (struct ilo_oid_list **, void *); 124 | }; 125 | 126 | /* Generic OID info. */ 127 | struct generic_oid_info 128 | { 129 | /* OID Name. */ 130 | char oid_name[ILO_OID_NAME_LEN]; 131 | 132 | /* OID Number. */ 133 | oid oid[MAX_OID_LEN]; 134 | 135 | /* OID Length. */ 136 | int oid_len; 137 | }; 138 | 139 | 140 | /* The data structure for iLO OID. */ 141 | struct ilo_oid_info 142 | { 143 | struct generic_oid_info oid_pool[MAX_OID_INFO_ENTRIES]; 144 | 145 | /* Function Pointer. */ 146 | enum Nagios_status (*parse_status_fn_ptr)(void **, int *); 147 | 148 | /* Type of status. */ 149 | int type; 150 | }; 151 | 152 | /* Callback functions. */ 153 | static enum Nagios_status parse_status(void **, int *); 154 | static enum Nagios_status parse_status_array(void **, int *); 155 | static enum Nagios_status health_status_array(void **, int *); 156 | static enum Nagios_status get_hlth_status_str(struct ilo_oid_list **, void *); 157 | static enum Nagios_status get_redundant_status_str(struct ilo_oid_list **,void *); 158 | static enum Nagios_status get_oid_str(struct ilo_oid_list **,void *); 159 | 160 | #endif 161 | -------------------------------------------------------------------------------- /src/include/hpilo_snmp.h: -------------------------------------------------------------------------------- 1 | /* hpilo_snmp.h -- types and prototypes used by iLO plug-in 2 | (C) Copyright [2015] Hewlett Packard Enterprise Development Company, L.P. 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of version 2 of the GNU General Public License as 6 | published by the Free Software Foundation. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 11 | 12 | See the GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to: 16 | Free Software Foundation, Inc. 17 | 51 Franklin Street, Fifth Floor 18 | Boston, MA 02110-1301, USA. */ 19 | 20 | #ifndef NAGIOS_HPILO_SNMP_H 21 | #define NAGIOS_HPILO_SNMP_H 22 | 23 | #include "hpilo_common.h" 24 | 25 | /* Default SNMP port number of HP iLO. */ 26 | #define NAGIOS_ILO_SNMP_PORT 161 27 | 28 | /* 3-second timeout. */ 29 | #define NAGIOS_ILO_SNMP_TIMEOUT (3 * 1000000) 30 | #define NAGIOS_ILO_SNMP_RETRIES 3 31 | 32 | 33 | #define SNMP_GETBULK_ERRINDEX 10 34 | 35 | /* Power Supply Table name tags for detailed information */ 36 | char *ps_tbl_ele[18] = {"Chassis", "Bay","Present","Condition",\ 37 | "Status","MainVoltage", "CapacityUsed",\ 38 | "CapacityMaximum", "Redundant","Model",\ 39 | "SerialNumber","AutoRev","HotPlug","FirmwareRev",\ 40 | "HwLocation","SparePartNum","RedundantPartner","ErrorCondition" \ 41 | }; 42 | 43 | /* Fan Table name tags for detailed information */ 44 | char *fan_tbl_ele[12] = { "FanChassis","FanIndex","FanLocale","FanPresent","FanType","FanSpeed",\ 45 | "FanRedundant","FanRedundantPartner","FanCondition","FanHotPlug",\ 46 | "FanHwLocation","FanCurrentSpeed"\ 47 | }; 48 | 49 | /* Temperature Table name tags for detailed information */ 50 | char *temp_tbl_ele[8] = { "TmpChas","TmpInd","TmpLocale","TmpCelsius",\ 51 | "TmpThres","TmpCond","TmpThresType","TmpHwLocation"\ 52 | }; 53 | 54 | /* Storage Table name tags for detailed information */ 55 | char *st_tbl_ele[43] = { "st_Ind","st_Model","st_FWRev","st_StndIntr","st_Slot","st_Cond",\ 56 | "st_Prod_Rev","st_PartnerSlot","st_Cur_Role","st_BoardStat","st_PartnerBoardStat",\ 57 | "st_BoardCond","st_PartnerBoardCond","st_DriveOwnership","st_SerlNum",\ 58 | "st_RedundancyType","st_RedundancyError","st_AccessModuleStat","st_DaughterBoardType",\ 59 | "st_HwLoc","st_NumOfBuses","st_BlinkTime","st_RebuildPriority","st_ExpandPriority",\ 60 | "st_NumOfInt_Ports","st_NumOfExt_Ports","st_DriveWriteCacheStat","st_PartnerSerNum",\ 61 | "st_OptionRomRev","st_HbaFWRev","st_HBAModeOptionRomRev","st_Cur_Temp","st_LastLockupCode",\ 62 | "st_EncryptionStat","st_ASICEncptSelfTestStat","st_EncryptCspNvramStat","st_EncryptRTCSramStat",\ 63 | "st_EncryptCntlrPwdStat","st_EncryptBypassModeStat","NA","NA","NA","NA"\ 64 | }; 65 | 66 | /* Memory Table name tags for detailed information */ 67 | char *mem_tbl_ele[] = { "Mem2BoardInd","Mem2BoardSlotNum","Mem2BoardCpuNum","Mem2BoardRiserNum","Mem2BoardOnlineStat",\ 68 | "Mem2BoardErrorStat","Mem2BoardLocked","Mem2BoardNumSock","Mem2BoardOsMemSize","Mem2BoardTotalMemSize",\ 69 | "Mem2BoardCond","Mem2BoardHotPlug","Mem2BoardOper_Freq","Mem2BoardOper_Volt"\ 70 | }; 71 | 72 | /* Processor Table name tags for detailed information */ 73 | char *pro_tbl_ele[] = { "CpuUnitInd","CpuSlot","CpuName","CpuSpeed","CpuStep","CpuStat","CpuExtSpeed","CpuDesigner","CpuSocketNum",\ 74 | "CpuThreshPassed","CpuHwLocation","CpuCellTablePtr","CpuPowerpodStat","CpuArchRev","CpuCore","CPUSerialNum",\ 75 | "CPUPartNum","CPUSerialNumMfgr","CPUPartNumMfgr","CPUCoreInd","CPUMaxSpeed","CPUCoreThreadIndex",\ 76 | "CPUChipGenerationName","CPUMultiThreadStat","CPUCoreMaxThreads","CpuLowPowerStat","CpuPrimary","CpuCoreStepText",\ 77 | "CpuCurrentPerf","CpuMinPerfStat","CpuMaxPerfStat"\ 78 | }; 79 | 80 | /* Network Table name tags for detailed information */ 81 | char *net_tbl_ele[] = { "NIPAInd","NIPAIfNum","NIPARole","NIPAMACAddr","NIPASlot","NIPAIoAddr","NIPAIrq","NIPADma","NIPAMemAddr",\ 82 | "NIPAPort","NIPADuplexState","NIPACond","NIPAState","NIPAStatus","NIPAStatsVal","NIPAGoodTrans",\ 83 | "NIPAGoodRec","NIPABadTrans","NIPABadRec","NIPAAlignErr","NIPAFCSErr","NIPASinColFrames",\ 84 | "NIPAMulColFrames","NIPADefTrans","NIPALateCol","NIPAExceCol","NIPAIntMacTrantErr","NIPACarSenseErr","NIPAFraTooLongs",\ 85 | "NIPAIntMacRecErr","NIPAHwLoc","NIPAPartNo","NIPASpeed","NIPAConfSpeedDup","NIPAAggrGID","NIPASpeedMbps",\ 86 | "NIPAInOct","NIPAOutOct","NIPANam","NIPAIoBayNo","NIPAFWVer","NIPAVirtPortNo"\ 87 | }; 88 | /* SNMP version defintion. */ 89 | enum 90 | { 91 | SNMP_V1 = 1, 92 | SNMP_V2C, 93 | SNMP_V3_NOPRIV, 94 | SNMP_V3_PRIV 95 | }; 96 | 97 | #endif 98 | -------------------------------------------------------------------------------- /src/include/ilo-credit-store.h: -------------------------------------------------------------------------------- 1 | /* ilo-credit-store.h -- types and prototypes used by iLO plug-in 2 | (C) Copyright [2015] Hewlett Packard Enterprise Development Company, L.P. 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of version 2 of the GNU General Public License as 6 | published by the Free Software Foundation. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 11 | 12 | See the GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to: 16 | Free Software Foundation, Inc. 17 | 51 Franklin Street, Fifth Floor 18 | Boston, MA 02110-1301, USA. */ 19 | 20 | #ifndef _ILOCREDITSO_H 21 | #define _ILOCREDITSO_H 22 | 23 | #include 24 | #define OPTION_NOP 0 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | int set_cred(char * host, char * user, char * passwd); 30 | char *get_cred(char * host); 31 | int exist_cred(char * host); 32 | typedef int set_cred_t(char *, char *, char *); 33 | typedef char *get_cred_t(char *); 34 | typedef int exist_cred_t(char *); 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /template/Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS=foreign 2 | 3 | zabbixdir=${prefix}/zabbix 4 | 5 | zabbix_DATA=zabbix_export_templates.xml 6 | 7 | -------------------------------------------------------------------------------- /template/Makefile.in: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.11.6 from Makefile.am. 2 | # @configure_input@ 3 | 4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 5 | # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software 6 | # Foundation, Inc. 7 | # This Makefile.in is free software; the Free Software Foundation 8 | # gives unlimited permission to copy and/or distribute it, 9 | # with or without modifications, as long as this notice is preserved. 10 | 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 13 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 14 | # PARTICULAR PURPOSE. 15 | 16 | @SET_MAKE@ 17 | 18 | VPATH = @srcdir@ 19 | am__make_dryrun = \ 20 | { \ 21 | am__dry=no; \ 22 | case $$MAKEFLAGS in \ 23 | *\\[\ \ ]*) \ 24 | echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ 25 | | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ 26 | *) \ 27 | for am__flg in $$MAKEFLAGS; do \ 28 | case $$am__flg in \ 29 | *=*|--*) ;; \ 30 | *n*) am__dry=yes; break;; \ 31 | esac; \ 32 | done;; \ 33 | esac; \ 34 | test $$am__dry = yes; \ 35 | } 36 | pkgdatadir = $(datadir)/@PACKAGE@ 37 | pkgincludedir = $(includedir)/@PACKAGE@ 38 | pkglibdir = $(libdir)/@PACKAGE@ 39 | pkglibexecdir = $(libexecdir)/@PACKAGE@ 40 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 41 | install_sh_DATA = $(install_sh) -c -m 644 42 | install_sh_PROGRAM = $(install_sh) -c 43 | install_sh_SCRIPT = $(install_sh) -c 44 | INSTALL_HEADER = $(INSTALL_DATA) 45 | transform = $(program_transform_name) 46 | NORMAL_INSTALL = : 47 | PRE_INSTALL = : 48 | POST_INSTALL = : 49 | NORMAL_UNINSTALL = : 50 | PRE_UNINSTALL = : 51 | POST_UNINSTALL = : 52 | build_triplet = @build@ 53 | host_triplet = @host@ 54 | subdir = template 55 | DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in 56 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 57 | am__aclocal_m4_deps = $(top_srcdir)/m4/m4-ax_compare_version.m4 \ 58 | $(top_srcdir)/configure.ac 59 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 60 | $(ACLOCAL_M4) 61 | mkinstalldirs = $(install_sh) -d 62 | CONFIG_HEADER = $(top_builddir)/config.h 63 | CONFIG_CLEAN_FILES = 64 | CONFIG_CLEAN_VPATH_FILES = 65 | SOURCES = 66 | DIST_SOURCES = 67 | am__can_run_installinfo = \ 68 | case $$AM_UPDATE_INFO_DIR in \ 69 | n|no|NO) false;; \ 70 | *) (install-info --version) >/dev/null 2>&1;; \ 71 | esac 72 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; 73 | am__vpath_adj = case $$p in \ 74 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ 75 | *) f=$$p;; \ 76 | esac; 77 | am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; 78 | am__install_max = 40 79 | am__nobase_strip_setup = \ 80 | srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` 81 | am__nobase_strip = \ 82 | for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" 83 | am__nobase_list = $(am__nobase_strip_setup); \ 84 | for p in $$list; do echo "$$p $$p"; done | \ 85 | sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ 86 | $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ 87 | if (++n[$$2] == $(am__install_max)) \ 88 | { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ 89 | END { for (dir in files) print dir, files[dir] }' 90 | am__base_list = \ 91 | sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ 92 | sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' 93 | am__uninstall_files_from_dir = { \ 94 | test -z "$$files" \ 95 | || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ 96 | || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ 97 | $(am__cd) "$$dir" && rm -f $$files; }; \ 98 | } 99 | am__installdirs = "$(DESTDIR)$(zabbixdir)" 100 | DATA = $(zabbix_DATA) 101 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 102 | ACLOCAL = @ACLOCAL@ 103 | AMTAR = @AMTAR@ 104 | AR = @AR@ 105 | AUTOCONF = @AUTOCONF@ 106 | AUTOHEADER = @AUTOHEADER@ 107 | AUTOMAKE = @AUTOMAKE@ 108 | AWK = @AWK@ 109 | CC = @CC@ 110 | CCDEPMODE = @CCDEPMODE@ 111 | CFLAGS = @CFLAGS@ 112 | CPP = @CPP@ 113 | CPPFLAGS = @CPPFLAGS@ 114 | CXX = @CXX@ 115 | CXXCPP = @CXXCPP@ 116 | CXXDEPMODE = @CXXDEPMODE@ 117 | CXXFLAGS = @CXXFLAGS@ 118 | CYGPATH_W = @CYGPATH_W@ 119 | DEFS = @DEFS@ 120 | DEPDIR = @DEPDIR@ 121 | DLLTOOL = @DLLTOOL@ 122 | DSYMUTIL = @DSYMUTIL@ 123 | DUMPBIN = @DUMPBIN@ 124 | ECHO_C = @ECHO_C@ 125 | ECHO_N = @ECHO_N@ 126 | ECHO_T = @ECHO_T@ 127 | EGREP = @EGREP@ 128 | EXEEXT = @EXEEXT@ 129 | FGREP = @FGREP@ 130 | GREP = @GREP@ 131 | INSTALL = @INSTALL@ 132 | INSTALL_DATA = @INSTALL_DATA@ 133 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 134 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ 135 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ 136 | LD = @LD@ 137 | LDFLAGS = @LDFLAGS@ 138 | LIBOBJS = @LIBOBJS@ 139 | LIBS = @LIBS@ 140 | LIBTOOL = @LIBTOOL@ 141 | LIPO = @LIPO@ 142 | LN_S = @LN_S@ 143 | LTLIBOBJS = @LTLIBOBJS@ 144 | MAKEINFO = @MAKEINFO@ 145 | MANIFEST_TOOL = @MANIFEST_TOOL@ 146 | MKDIR_P = @MKDIR_P@ 147 | NM = @NM@ 148 | NMAP_MIN_VERSION = @NMAP_MIN_VERSION@ 149 | NMAP_PATH = @NMAP_PATH@ 150 | NMEDIT = @NMEDIT@ 151 | OBJDUMP = @OBJDUMP@ 152 | OBJEXT = @OBJEXT@ 153 | OTOOL = @OTOOL@ 154 | OTOOL64 = @OTOOL64@ 155 | PACKAGE = @PACKAGE@ 156 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 157 | PACKAGE_NAME = @PACKAGE_NAME@ 158 | PACKAGE_STRING = @PACKAGE_STRING@ 159 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ 160 | PACKAGE_URL = @PACKAGE_URL@ 161 | PACKAGE_VERSION = @PACKAGE_VERSION@ 162 | PATH_SEPARATOR = @PATH_SEPARATOR@ 163 | RANLIB = @RANLIB@ 164 | SED = @SED@ 165 | SET_MAKE = @SET_MAKE@ 166 | SHELL = @SHELL@ 167 | STRIP = @STRIP@ 168 | VERSION = @VERSION@ 169 | abs_builddir = @abs_builddir@ 170 | abs_srcdir = @abs_srcdir@ 171 | abs_top_builddir = @abs_top_builddir@ 172 | abs_top_srcdir = @abs_top_srcdir@ 173 | ac_ct_AR = @ac_ct_AR@ 174 | ac_ct_CC = @ac_ct_CC@ 175 | ac_ct_CXX = @ac_ct_CXX@ 176 | ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 177 | am__include = @am__include@ 178 | am__leading_dot = @am__leading_dot@ 179 | am__quote = @am__quote@ 180 | am__tar = @am__tar@ 181 | am__untar = @am__untar@ 182 | bindir = @bindir@ 183 | build = @build@ 184 | build_alias = @build_alias@ 185 | build_cpu = @build_cpu@ 186 | build_os = @build_os@ 187 | build_vendor = @build_vendor@ 188 | builddir = @builddir@ 189 | datadir = @datadir@ 190 | datarootdir = @datarootdir@ 191 | docdir = @docdir@ 192 | dvidir = @dvidir@ 193 | exec_prefix = @exec_prefix@ 194 | host = @host@ 195 | host_alias = @host_alias@ 196 | host_cpu = @host_cpu@ 197 | host_os = @host_os@ 198 | host_vendor = @host_vendor@ 199 | htmldir = @htmldir@ 200 | includedir = @includedir@ 201 | infodir = @infodir@ 202 | install_sh = @install_sh@ 203 | libdir = @libdir@ 204 | libexecdir = @libexecdir@ 205 | localedir = @localedir@ 206 | localstatedir = @localstatedir@ 207 | mandir = @mandir@ 208 | mkdir_p = @mkdir_p@ 209 | oldincludedir = @oldincludedir@ 210 | pdfdir = @pdfdir@ 211 | prefix = @prefix@ 212 | program_transform_name = @program_transform_name@ 213 | psdir = @psdir@ 214 | sbindir = @sbindir@ 215 | sharedstatedir = @sharedstatedir@ 216 | srcdir = @srcdir@ 217 | sysconfdir = @sysconfdir@ 218 | target_alias = @target_alias@ 219 | top_build_prefix = @top_build_prefix@ 220 | top_builddir = @top_builddir@ 221 | top_srcdir = @top_srcdir@ 222 | AUTOMAKE_OPTIONS = foreign 223 | zabbixdir = ${prefix}/zabbix 224 | zabbix_DATA = zabbix_export_templates.xml 225 | all: all-am 226 | 227 | .SUFFIXES: 228 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) 229 | @for dep in $?; do \ 230 | case '$(am__configure_deps)' in \ 231 | *$$dep*) \ 232 | ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ 233 | && { if test -f $@; then exit 0; else break; fi; }; \ 234 | exit 1;; \ 235 | esac; \ 236 | done; \ 237 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign template/Makefile'; \ 238 | $(am__cd) $(top_srcdir) && \ 239 | $(AUTOMAKE) --foreign template/Makefile 240 | .PRECIOUS: Makefile 241 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 242 | @case '$?' in \ 243 | *config.status*) \ 244 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ 245 | *) \ 246 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ 247 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 248 | esac; 249 | 250 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 251 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 252 | 253 | $(top_srcdir)/configure: $(am__configure_deps) 254 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 255 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) 256 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 257 | $(am__aclocal_m4_deps): 258 | 259 | mostlyclean-libtool: 260 | -rm -f *.lo 261 | 262 | clean-libtool: 263 | -rm -rf .libs _libs 264 | install-zabbixDATA: $(zabbix_DATA) 265 | @$(NORMAL_INSTALL) 266 | @list='$(zabbix_DATA)'; test -n "$(zabbixdir)" || list=; \ 267 | if test -n "$$list"; then \ 268 | echo " $(MKDIR_P) '$(DESTDIR)$(zabbixdir)'"; \ 269 | $(MKDIR_P) "$(DESTDIR)$(zabbixdir)" || exit 1; \ 270 | fi; \ 271 | for p in $$list; do \ 272 | if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ 273 | echo "$$d$$p"; \ 274 | done | $(am__base_list) | \ 275 | while read files; do \ 276 | echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(zabbixdir)'"; \ 277 | $(INSTALL_DATA) $$files "$(DESTDIR)$(zabbixdir)" || exit $$?; \ 278 | done 279 | 280 | uninstall-zabbixDATA: 281 | @$(NORMAL_UNINSTALL) 282 | @list='$(zabbix_DATA)'; test -n "$(zabbixdir)" || list=; \ 283 | files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ 284 | dir='$(DESTDIR)$(zabbixdir)'; $(am__uninstall_files_from_dir) 285 | tags: TAGS 286 | TAGS: 287 | 288 | ctags: CTAGS 289 | CTAGS: 290 | 291 | 292 | distdir: $(DISTFILES) 293 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 294 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 295 | list='$(DISTFILES)'; \ 296 | dist_files=`for file in $$list; do echo $$file; done | \ 297 | sed -e "s|^$$srcdirstrip/||;t" \ 298 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ 299 | case $$dist_files in \ 300 | */*) $(MKDIR_P) `echo "$$dist_files" | \ 301 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ 302 | sort -u` ;; \ 303 | esac; \ 304 | for file in $$dist_files; do \ 305 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 306 | if test -d $$d/$$file; then \ 307 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 308 | if test -d "$(distdir)/$$file"; then \ 309 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 310 | fi; \ 311 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 312 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ 313 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 314 | fi; \ 315 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ 316 | else \ 317 | test -f "$(distdir)/$$file" \ 318 | || cp -p $$d/$$file "$(distdir)/$$file" \ 319 | || exit 1; \ 320 | fi; \ 321 | done 322 | check-am: all-am 323 | check: check-am 324 | all-am: Makefile $(DATA) 325 | installdirs: 326 | for dir in "$(DESTDIR)$(zabbixdir)"; do \ 327 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ 328 | done 329 | install: install-am 330 | install-exec: install-exec-am 331 | install-data: install-data-am 332 | uninstall: uninstall-am 333 | 334 | install-am: all-am 335 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 336 | 337 | installcheck: installcheck-am 338 | install-strip: 339 | if test -z '$(STRIP)'; then \ 340 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 341 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 342 | install; \ 343 | else \ 344 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 345 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 346 | "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ 347 | fi 348 | mostlyclean-generic: 349 | 350 | clean-generic: 351 | 352 | distclean-generic: 353 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 354 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 355 | 356 | maintainer-clean-generic: 357 | @echo "This command is intended for maintainers to use" 358 | @echo "it deletes files that may require special tools to rebuild." 359 | clean: clean-am 360 | 361 | clean-am: clean-generic clean-libtool mostlyclean-am 362 | 363 | distclean: distclean-am 364 | -rm -f Makefile 365 | distclean-am: clean-am distclean-generic 366 | 367 | dvi: dvi-am 368 | 369 | dvi-am: 370 | 371 | html: html-am 372 | 373 | html-am: 374 | 375 | info: info-am 376 | 377 | info-am: 378 | 379 | install-data-am: install-zabbixDATA 380 | 381 | install-dvi: install-dvi-am 382 | 383 | install-dvi-am: 384 | 385 | install-exec-am: 386 | 387 | install-html: install-html-am 388 | 389 | install-html-am: 390 | 391 | install-info: install-info-am 392 | 393 | install-info-am: 394 | 395 | install-man: 396 | 397 | install-pdf: install-pdf-am 398 | 399 | install-pdf-am: 400 | 401 | install-ps: install-ps-am 402 | 403 | install-ps-am: 404 | 405 | installcheck-am: 406 | 407 | maintainer-clean: maintainer-clean-am 408 | -rm -f Makefile 409 | maintainer-clean-am: distclean-am maintainer-clean-generic 410 | 411 | mostlyclean: mostlyclean-am 412 | 413 | mostlyclean-am: mostlyclean-generic mostlyclean-libtool 414 | 415 | pdf: pdf-am 416 | 417 | pdf-am: 418 | 419 | ps: ps-am 420 | 421 | ps-am: 422 | 423 | uninstall-am: uninstall-zabbixDATA 424 | 425 | .MAKE: install-am install-strip 426 | 427 | .PHONY: all all-am check check-am clean clean-generic clean-libtool \ 428 | distclean distclean-generic distclean-libtool distdir dvi \ 429 | dvi-am html html-am info info-am install install-am \ 430 | install-data install-data-am install-dvi install-dvi-am \ 431 | install-exec install-exec-am install-html install-html-am \ 432 | install-info install-info-am install-man install-pdf \ 433 | install-pdf-am install-ps install-ps-am install-strip \ 434 | install-zabbixDATA installcheck installcheck-am installdirs \ 435 | maintainer-clean maintainer-clean-generic mostlyclean \ 436 | mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ 437 | uninstall uninstall-am uninstall-zabbixDATA 438 | 439 | 440 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 441 | # Otherwise a system limit (for SysV at least) may be exceeded. 442 | .NOEXPORT: 443 | -------------------------------------------------------------------------------- /template/zabbix_export_templates.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 2.0 4 | 2016-02-26T23:48:12Z 5 | 6 | 7 | public 8 | 9 | 10 | 11 | 387 | 388 | 389 | --------------------------------------------------------------------------------