pax_global_header00006660000000000000000000000064122546604070014520gustar00rootroot0000000000000052 comment=bdc32e6839a310d10e6c527bcd05051300ae2166 nagvis-1.7.10+dfsg1/000077500000000000000000000000001225466040700140755ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/.f12000077500000000000000000000013671225466040700145000ustar00rootroot00000000000000#!/bin/bash [ -z $SITE ] && SITE=event which sudo >/dev/null 2>&1 && SUDO=sudo || SUDO= BASE=$(pwd) # # Install to /usr/local/nagvis # $SUDO ./install.sh -a y -q -r -F -c y \ -W /nagvis -n /usr/local/nagios \ -i mklivestatus -p /usr/local/nagvis \ -u www-data -g www-data \ -w /etc/apache2/conf.d \ -l unix:/omd/sites/muc/tmp/run/live $SUDO rm -f /etc/apache2/conf.d/nagvis.conf.* # # Install to omd site local/ # $SUDO su - $SITE -c "[ ! -d /omd/sites/$SITE/nvsrc ] && mkdir /omd/sites/$SITE/nvsrc || rm -rf /omd/sites/$SITE/nvsrc; \ cd $BASE ; \ rsync --filter='- .git' --filter='- .*.swp' -a ./ /omd/sites/$SITE/nvsrc/ ; \ cd /omd/sites/$SITE/nvsrc/ ; \ yes y | ./omd_install.sh" exit 0 nagvis-1.7.10+dfsg1/.gitignore000066400000000000000000000022321225466040700160640ustar00rootroot00000000000000# Exclude misc files *.bak *.swp *~ *.tar.gz .metadata uifx/.settings uifx/.actionScriptProperties uifx/.flexProperties uifx/.project uifx/bin uifx/bin-release install.log mache # Exclude main configuration file etc/nagvis.ini.php # Exclude all maps except the demo maps etc/maps/*.cfg !etc/maps/demo*.cfg # Exclude all maps except the default automap etc/automaps/*.cfg !etc/automaps/__automap.cfg !etc/automaps/demo*.cfg # Exclude all background images except the default share/nagvis/images/maps/*.png !share/nagvis/images/maps/demo_background.png !share/nagvis/images/maps/nagvis-demo.png !share/nagvis/images/maps/geomap-thumb.png # Exclude all shapes except the default share/nagvis/images/shapes/*.png share/nagvis/images/shapes/*.jpg share/nagvis/images/shapes/*.gif !share/nagvis/images/shapes/demo*.png # Exclude all header/hover/context templates except the default share/nagvis/templates/*/*.html share/nagvis/templates/*/*.css !share/nagvis/templates/*/tmpl.default.html !share/nagvis/templates/*/tmpl.default.css # Exclude all gadgets except the default share/nagvis/gadgets/*.php !share/nagvis/gadgets/std_speedometer.php # Exclude all var contents var/* nagvis-1.7.10+dfsg1/ChangeLog000066400000000000000000001011211225466040700156430ustar00rootroot000000000000001.7.10 Frontend: * Weathermap lines now deal with bit/byte values provided by Check_MKs interface checks * FIX: Fixed "TypeError: oLabel is null" on at least geomaps * FIX: Fixed shape image displaying when using external URLS * FIX: Hiding "Edit Map" link for "on demand" automaps * FIX: Fixed "modify view" dialog for "on demand" automaps * FIX: Fixed wrong viewport html header (Thanks to Carl Helmertz ) Automap: * Labels have now a white background to improve the text readability * Labels should not overlap on automaps with many hosts anymore * Slightly layout improvement of automaps in undirected mode * FIX: Rendering lines on zoomed automaps correctly * FIX: Fixed positions of labels on zoomed automaps 1.7.9 Core: * Livestatus: Fixed handling of hosts/services without custom variables * Added option to perform privilege switch to a user with less permissions for viewing maps in the context of this user * FIX: Fixed state weight definition parsing * FIX: Fixed demo automap (missing programStart method in demo backend) Frontend: * FIX: Not adding textboxes to "to be updated list" anymore; This might have lead to objects not being reloaded on maps with many texboxes * FIX: More robust handling of broken/no perfdata handling in weathermap lines of type -->BW+%-><-BW+%-- 1.7.8 Automap: * FIX: Added missing program restarted check to invalidate chaches Geomap: * FIX: Not providing auth credentials in http requests to proxy when none set Frontend: * FIX: Fixed "Undefined index" error when changing backend_id of maps * FIX: Fixed hiding of shapes during refresh (enable_refresh=1) * Reverted change from 1.7.5 (Weathermap lines with byte/bit values in labels should print human) which broke the handling for some plugins 1.7.7 Core: * Implemented "on demand" maps. Maps which only need a basic configuration of global parameters like automaps and geomaps can now be configured and created on demand by URL parameters. This mode is reached by simply calling the map URL without "show=" parameter and a bunch of parameters for the global section of the map instead. * Implemented center and bottom as label coordinate values which are automatically calculated depending on the rendered sizes Automap: * Changed default behaviour of the automap concerning the root host. By default NagVis uses a virtual root node which represents the monitoring core. It adds the parent tree and all nodes which have no parents defined below this node. If no parents are configured, all hosts are rendered below this virtual root node. 1.7.6 Core: * Improved main configuration parsing code (should not mixup comments and empty lines anymore) * Added shinken business_impact filter to automaps (set shinken_features=1 in [global] section in main configuration to enable this feature) Thanks to Thibault Cohen for the patch) Frontend: * Added support for custom context menu actions like connecting via SSH, RDP, HTTP, ... to the monitored hosts. * FIX: Removed debug output while recalculating bandwidth of weathermap lines * FIX: Fixed height of iframes in Container objects 1.7.5 Core: * Allowing rgba(255,255,255,0.6) like definitions in e.g. label_style attributes in map configuration files Frontend: * Hiding all kind of javascript error messages automatically on next successful processing * IE below 9: Fixed invisible lines (z-index was not set) * Weathermap lines with byte/bit values in labels should print human readable traffic now Automap: * Reimplemented ignore_hosts parameter (Thanks to Thibault Cohen) 1.7.4 Core: * Extended logon module CoreLogonMultisite to support the new cookie format of Check_MK 1.2.1i2 and newer Frontend: * Hiding HTTP status error messages automatically on next successful request * Bugfix: Added missing lock/unlock line middle control to BW-lines * Bugfix: Fixed "img" not defined js error in IE8 (Please note: Zoom function does not work in IE8 - IE8 event handling seems to be broken) * Bugfix: Fixed flickering hover menu on overview page when sidebar opened * Bugfix: Fixed background positioning on browser zoomed maps * Bugfix: Fixed javascript error when rotations are disabled * Bugfix: Multisite module is catching single map errors now and show all maps in the list regardless of the error. Maps with errors will be listed as UNKNOWN (orange) in the multisite snapin Geomap: * New option source_type to configure a csv file or the used backend as datasource. In backend mode, the backend used on the map must support the new geomap functions (currently only livestatus backend). All hosts to be shown need the custom variables _LAT and _LONG. The hosts can optionally be filtered by hostgroups * Bugfix: Always rounding calculated coordinates, fixed negative coords * Bugfix: Also using source_file parameter for cache file names to prevent problems with multiple geomaps 1.7.3 Core: * Bugfix: Fixed problem in geomap exception handling * Bugfix: Fixed invalid json output on uncached geomap rendering * Livestatus-Backend: Using Columns header instead of the deprecated StatsGroupBy header (maybe you need to update livestatus) * Minor output improvements in installer scripts Frontend: * Hiding rotations table on overview page when no rotations configured * Better handling of HTTP errors in ajax transactions * Big performance improvment when rendering object in frontend after adding the map zoom feature * Bugfix: Re-added "loading..." message on page redering * Bugfix: Only show enabled grid in "edit mode" Geomap * Bugfix: Fixed status updates of objects on geomaps 1.7.2 Core: * Multisite auth module: Removed deprecated permission * Reimplemented automaps hostgroup filter * Bugfix: TestBackend - Fixed parent processing * Bugfix: Fixed parent processing in automap Frontend: * Improved object refreshing code to take always the oldest objects first * Bugfix: Fixed broken rotation links on overview page * Bugfix: Zoom code: Catching not handleable font-size declarations * Bugfix: Fixed bandwidth calculations for bandwidth weathermap lines Installer: * Check wether or not rsync is installed (terminating if not) 1.7.1 Core * Added new object type "container" to render a textbox like object which fetches its contents from a configured URL. Take a look at the docs for details. Thanks to Tiri GmbH (www.tiri.li) for providing this feature. Frontend * Localized some non localized strings like "more items..." in the hover menu * Bugfix: Fixed javascript error in state change eventhandler on e.g. automaps * Bugfix: Cloning of textbox objects is now possible again * Bugfix: Don't try to flash deleted map objects during eventhandling 1.7 Core * Added new weathermap line type which shows only the used bandwidth in labels * Bugfix: Geomaps use real generated object_ids instead of hostnames for transactions (prevents problems with spaces in hostnames and so on) * Bugfix: Allowing percentages above 999 in weathermap_line_colors option * Bugfix: Geomap: Fixed validation problem when editin map global options Frontend * Bugfix: Not showing "acknowledge" link when not permitted to perform this action * Bugfix: Fixed hover menu positioning in scrolled maps * Bugfix: Fixed hover menu positioning in IE Automap: * Bugfix: Fixed automaps object_id persisting code 1.7b3 Core * Allowing empty lines in main configuration sections now * Set default http_timeout value to 10 * Introduced different icons for different states in downtime/ack state (All iconsets need to be reworked - take a look at the docs for a list of needed icons if you use custom iconsets) * Bugfix: Suppressing debug messages in non debug mode * Bugfix: Better catching of exceptions on nested maps * Bugfix: Map configs can be edited using the GUI even in case of source errors * Bugfix: Fixed re-rendering of geomaps after map source changes * Bugfix: Fixed re-fetching of background image after changed geomap source file * Bugfix: Geomap allows placing only one host on the geomap now (Added geomap_border option) * Bugfix: Fixed PHP error in multisite snapin code Frontend * Added new map config option (global section) event_on_load to raise frontend events also on page loading * Added new options event_repeat_interval and event_repeat_duration to configured repeated frontend events * Added rotations to sidebar * Info page shows json_encode/json_decode capability of used PHP * Host/Service problems can now be acknowledged from host/service context menus Options dialog_ack_sticky, dialog_ack_notify, dialog_ack_persist control the preselected checkboxes in this dialog * Bugfix: When releasing relative coordinates the parent object is not highlighted anymore * Bugfix: Fixed bug which suppressed the hover menu on overview page in some cases * Bugfix: Fixed some IE css warning message * Bugfix: Fixed icons not being displayed in IE (version 9 in this case) * Bugfix: Fixed rendering errors in IE (below version 9) * Bugfix: Fixed zoom function problem in Chrome * Bugfix: Fixed PHP error when rendering "General Configuration" dialog in some PHP versions Installer * Moved javascript compress code to make it available in omd_install script 1.7b2 Core * Checking conf.d directory modification time to detect removed config files to be able to delete the config cache in this case * Multisite auth: Don't redirect the browser on ajax calls Frontend * Bugfix: Fixed pre-selected values in map options modify dialog Installer * Automatically removing showautomaps option from nagvis.ini.php during update 1.7b1 Core * Introducing the "map source" feature. Take a look at the docs for details * Implemented geomaps using the new "map source" feature based on an Open Street Map static map API Automap * Removed the special map type "automap". The automaps have been replaced by regular maps which use the "automap" source. Migration Notes: We do not migrate the automap config files automatically. if you like to have them migrated please move the files from etc/automaps to etc/maps and add the parameter 'source="automap"' to the global section. * Added new render mode "undirected3" which uses the sfdp binary of graphviz (Thanks to Pedro) * Added new rankdir and overlap options (Thanks to Pedro) Frontend * Added zoom function in frontend. It can be controlled using the view option "zoom". It is possible to edit zoomed maps but recommended to edit maps with zoom set to 100. * Improved scrolling eventhandler * Bugfix: Fixed page/background scaling on open sidebar menu Geomap * Added parameter geomap_zoom (Geomap zoom is not given as percentage zoom (http://wiki.openstreetmap.org/wiki/Zoom_levels) * Added main config option geomap_server to configure the url to the mapping webservice (Default is now http://geomap.nagvis.org/) * Default geomap type is now Mapnik (Had problems in the past with others) 1.6.6 Frontend * Bugfix: Fixed JS error in template object management dialog * Added updated french language files (Thanks to Nicolas Chancereul!) Core * Installer: Fixed sqlite3 package test on debian systems * Line weathermaps colors definition can now be set as float values (Thanks to Ormi for the patch!) * Bugfix: Made shortly introduced recoding of map config files optional * Bugfix: Fixed stuck icon update on overview page 1.6.5 Core * Added line_weather_colors option to nagvis.ini.php [defaults] section * Bugfix: Fixed wrong variable in MySQL connect error handler * Bugfix: Fixed bug in 1.6.1 auth db update scripts * Bugfix: Added missing permission for the Url module which is used when having URLs in rotations * Bugfix: Fixed exclude_member_states for map objects * Bugfix: ISO-8859-1 encoded map config files are now converted to UTf-8 during parsing the map config file Frontend * Made hover menus work on stateless lines (Thanks to Oliver Graf) * Bugfix: Fixed cloning shape objects (view_type error message) * Bugfix: Stateless lines - only showing the hover area when it is needed * Bugfix: Fixed dragging of relative labels of relative objects * Bugfix: Fixed javascript error when switching pages while an ajax call is being processed 1.6.4 Core * Made template objects work again. Added doc note which does not recommend usage of templates and the webbased editor at the same time. * Livestatus Backend: Added 'timeout' parameter to be able to configure the socket timeout while connecting to the livestatus socket * Livestatus Backend: Only try to connect to livestatus once per page load * Bugfix: Fixed wrong computed shape urls which broke all shapes * Added new iconset std_dot * The label_show parameter can now be configured for the whole installation in the [defaults] section of the main configuration * The audit.log is disabled by default now (can be enabled using the audit_log parameter in [global] section) * Bugfix: Fixed problem with not real asynchronous ajax calls caused by locking PHP sessions * Bugfix: Fixed update of states on overview page * NDO Backend: Removed query debug outputs Automap * Added new parameter "margin" to control the offset of the automap to the edge of the map * Recoded all automap parameters. All camel case options have been changed to underscore separated vars (e.g. childLayers -> child_layers). These options are now available in the global section of the automaps. * Removed default_params option from global sections. Use the regular options in global section to define default options. * The option of adding a __dummy__ host to the automap configurations has been removed. It is not supported anymore. Frontend * Weathermap line color definitions support usage values above 100% and below 0% * Better error handling during coord parsing * Reduced ajax calls during regular map updating * Switched ajax calls during view rendering to be asynchronous (Prevents locked up browsers during ajax calls) * Suppressing transfer of non set attributes during ajax calls * Bugfix: Always remove the last frontend error message when clicking "close" 1.6.3 Core * Bugfix: Made upper/lower case rotation_id/backend_id definitions possible * Added ; and | to allowed signs for urls * Undefined backend in single objects does not prevent whole map loading anymore * Overview page: Better handling of invalid map configuration files * Multisite auth: Redirecting to login page when auth.secret does not exist * Made default gadgets aware of OMD default and local path handling Frontend * Showing dummy shape image when configured shape does not exist * Added the color picker to background image creation form * Bugfix: Non user-configured (-> conf.d) backends can be configured as default backends using the web GUI; Non user-configurex: Non can not be edited using the web GUI * Bugfix: Preventing loops in relative coords * Bugfix: Preventing JS error when trying to position objects relative but no target object can be found * Bugfix: Fixed file upload input field styling issues (at least in Firefox) * Bugfix: Removed backendtype fields from "Manage Backends" dialog forms * Bugfix: Fixed problem with the hover menu when using the hover_delay parameter Automap * Handling centron style host links during automap parsing (host_name=) * Bugfix: Added missing view_type=line parameter to automap exported maps * Bugfix: filterByState was always enabled after modifying the automap parameters via web form 1.6.2 Core * Switched CRITICAL and UNREACHABLE state weights. CRITICAL now overlaps the UNREACHABLE states * Changed multisite authorization module to new WATO auth export API (Needs at least Check_MK 1.1.13i2) * Bugfix: Fixed problem with form based login when opened via link from another webpage 1.6.1 Core * LogonDialog: Changed _origin parameter to _origtarget to support current multisite * Added nagvis-make-admin helper script to assign the Administrators role to the given user using the command line. This script might help when the admin lost its permissions. * NagVis creates now "omdadmin" user in OMD environments when creating new auth.db files * Bugfix: Added missing default permissions for guest role (viewing demo maps) * Bugfix: Fixed version number format for stable versions like (1.6) Frontend * Ajax call for redrawing map objects is not cacheable anymore (prevent strange hopping of icons after unlock -> edit -> lock in some cases. * Context menu: Small spacer row styling (preventing hover effect) * Add the language to the target url when the user requested a specific language 1.6 Core * Implented conf.d/ directory to have an optional modular main configuration * omd_install.sh deals now correctly with new conf.d directory * Improved the installer a bit: Better directory detections; Less questions during update * Removed all old demo maps and created new ones using an the internal test backend to be able to show a bit more details. * Using [service_description] as default value for label_text attribute * Using z=5 for textboxes and z=1 for shapes again as default values * Added new config option line_label_y_offset to configure the label offset used in weathermap lines which show percentage and absolute bandwidth labels * Added new LogonMultisite module to use the new Check_MK multisite auth cookie * Recoded logon and authentication module interface * Several code cleanups * Made view templates configurable (defaults / view_template) * Bugfix: Correctly adding object_id=0 to global section when creating maps * Bugfix: Adding map/automap type to cache files to prevent confilcts with equal map and automap names Frontend * Sorting maps by alias in header menu now * Added map name dropdown to parent_map option when editing global map configuration * iconset option is now optional when creating maps using the GUI * Reimplemented the "clone object" functionality in edit mode * Only show the edit links in context menu when permitted to edit the map * long text values with no spaces do not stretch the add/modify dialog anymore * Ignoring right clicks and clicks on the header menu when currently adding an object to the map * Bugfix: Not adding default_params parameter to all maps after editing the global map configuration using the web frontend * Bugfix: Don't enable map_image when not set when editing the global sections of maps * Bugfix: Removing just dragged new lines before opening the add/modify dialog * Bugfix: Not terminating map rename when one map contains a syntax error Automap * Finally removed the deprecated option maxLayers. Use childLayers instead. 1.6rc4 Core * Bugfix: Fixed inclusion problem of default settings in some rare cases * Added workaround for the annoying PHP warning which occurs on some systems: It is not safe to rely on the system's timezone settings * Bugfix: Fixed problem with some PHP 5.1.2 installations while reading the map configuration files * Switched mod_rewrite redirects of index pages to php redirect scripts Frontend * Recoded editing features to be available via context menu of the icons. Removed object controls for moving/editing objects * Added a colorpicker for the color selection fileds in add/modify dialog * Bugfix: Fixed handling of enableHover/enableContext URL options * Bugfix: Fixed object link follow after moving object in edit mode when using IE<8 * Bugfix: Fixed javascript several onload javascript errors when using IE<8 * Bugfix: Fixed add/modify dialog styling in IE/Chrome * Bugfix: Fixed dragging relative positioned lines Automap * Improved coord parsing code to make it graphviz-2.6-22.2 compatible * Bugfix: Fixed automap alias on overview page and in lists 1.6rc3 Core * Bugfix: Fixed problem in summary state detection of downtime (resulted e.g. in wrong icons) Installer * Bugfix: Installing offline docs correctly again Frontend * Bugfix: Fixed problem when editing the main configuration file 1.6rc2 Core * Bugfix: Fixed HTTP redirects in installations using omd_install.sh * Bugfix: Removed session cookie domain by default * Bugfix: Installer: Fixed problems copying files with spaces in names during update * Bugfix: SQLite Auth DB: Fixed missing permissions for User/setOption * Bugfix: Fixed missing 'url' attributes for map and servicegroup objects * Added NagiosBP backend to connect directly to NagiosBP using the JSON API Thanks to Bacher Systems (bacher.at) for providing this backend. Frontend * Bugfix: Added missing list code for header templates (map global section editing) * Bugfix: Don't hide dependent fiels where the master attribute is not available * Bugfix: Fixed map global section editing * Bugfix: IE8 fixing event registration (javascript errors on page loading) * Updating map object information while having the hover menu open does not close open hover menus anymore 1.6rc1 Core * Bugfix: Fixed SQL syntax error in MySQL auth backend * Bugfix: Fixed login problems in opera (Not setting auth cookie when using ip addresses as host address * Removed option "-B" from installer, it is not needed anymore * Installer skips .gitignore files during installation now * Added exclude_members and exclude_member_states options to stateful objects for excluding specific member objects completely or only during summary state calculations. * Several code cleanups * Cleanup: Consolidated code of main handlers ajax_handler and frontend index * Cleanup: Recoded message class calls to exceptions * omd_install.sh can now be called from other directories * Allowing more unicode signs in e.g. map aliases * Added new icon *_unreachable icon to represent the UNREACHABLE host state * Backends can now override the NagVis summary_output/summary_state algorithms to provide their own custom information * Internal cleanup in map configuration attribute definitions Frontend * Bugfix: Fixed several umlauts in edit mode warning messages * Bugfix: Fixed 100% sidebar height * Bugfix: Fixed initial positioning of relative positioned gadgets * Bugfix: Fixed dragging handling of relative positioned gadgets * Bugfix: Fixed backendid showing up in host_name field of add/modify dialog in some rare cases * Bugfix: Object positions can never be floats (always integers) * Bugfix: Fixed wrong positions of controls during page load (at least in firefox) * Bugfix: Registering drag stop event globally to prevent dragging problems on slower clients * Bugfix: Fixed javascript error "Error: attempt to run compile-and-go script on a cleared scope" after changed main configuration file in FF4 * Bugfix: Fixed hanging controls/labels when dragging objects out of screen * Bugfix: It is now possible to unset backend attributes using the "Edit backend" dialog * Bugfix: It is now possible to choose none as map_image in map options to disable the background image * Bugfix: std_speedometer.php fixed min/max handling (Thanks to foxkilo) * Bugfix: Fixed broken URL handling in e.g. rotation pools * Bugfix: Fixed styling of maps with config errors in sidebar * Bugfix: Fixed X coords when adding new objects with opened sidebar menu * Bugfix: Fixed automap links in header dropdown * Readded the "edit" action to the maps module. In this mode all object are automatically unlocked and changes to the lock state are not persisted * Also disabling the object left click actions in unlocked mode * Icon/Gadget/Shape/Textbox dragging is done by dragging the real icons again, like it was in WUI before. The drag controls for these objects has been removed. * Sorting maps on overview page and in multisite snapin by aliases * Readded the "edit" action to the maps module. In this mode all object are automatically unlocked and changes to the lock state are not persisted * Also disabling the object left click actions in unlocked mode * Icon/Gadget/Shape/Textbox dragging is done by dragging the real icons again, like it was in WUI before. The drag controls for these objects has been removed. * Added [alias] macro to context menus * Header menu handles map parent/child relations correctly * Recoded the add/modify dialog to add/edit map objects * Merged frontendEventlog.css into template css file * Reduced HTTP requests during initial page loading * Updating the editing grid when resizing the browser window Automap * Bugfix: Made the problem automap work again 1.6b3 Frontend * Frontend hides ajax/json errors now after first successfull action of that type * Header menu does not wrap anymore on small browser windows * Bugfix: Fixed background image positioning with enabled sidebar and small screens * Bugfix: Fixed coloring of two part lines in IE * Bugfix: Fixed drawing of second part in two part lines in IE * Bugfix: Preventing text selections while dragging objects in IE * Bugfix: Fixed undefied var error when having no maps and displaying the overview page * Bugfix: Fixed problem with rotation links in header menu with IE8 * Bugfix: A lot of links were not working in IE caused by a broken event handler * Bugfix: Preventing JS errors when dragging objects out of screen Core * omd_install: Installing missing doc/ dir now; Cleaning cache files on install * Checking read permissions before reading directory contents * Main Config: [paths] "gadget, icon, shape, map" internal options are now deprecated and have been renamed to "gadgets, icons, shapes, backgrounds". * Bugfix: Added backgrounds/styles [paths] options to main cfg definitions * Bugfix: Fixed comment line mixup in main config when using multiple config files * Bugfix: Not storing config options from other config files like the OMD site config in nagvis.ini.php anymore Automap * Improved coordinate parsing regex to match graphviz output of more versions * Commented out __dummy__ host in sample automap config to prevent confusions with the automaps host urls 1.6b2 Core * Added omd_install.sh to install NagVis to the local/ path of OMD sites (ONLY FOR TESTING!!!) * Main Config: [paths] "wuijs" and "htmlwuijs" are now deprecated * Bugfix: MKivestatus backend does correct type casting to integers for stats now * Bugfix: NDO Backend: Fixed wrong SQL syntax in getHostState function * Bugfix: NDO Backend: Fixed wrong hard state handling * Bugfix: Fixed redirects after map add/rename/delete * Bugfix: NDO backend does correct type casting to integers for stats now (Thanks to Oliver Graf) * Bugfix: Fixed false CRITICAL states when using NDO Backend (Thanks to Oliver Graf) * Bugfix: Added missing permissions for User/setOption * Bugfix: Fixed javascript error "getSidebarWidth() not definied" when header menu is disable by config Automap * Added new context menu action "make root" to automap nodes to change the root of the automap on-the-fly (Thanks to Oliver Graf) * Bugfix: Fixed parent calculation in automap (Thanks to Oliver Graf) * Bugfix: Automap could not be used in IE due to javascript error Frontend * Labels of objects can now be moved again; The edit mode is affected by the objects lock/unlock state * Labels of lines with line_type=14 have more offset now to look better when using horizontal lines * While objects are unlocked the hover menus are disabled * Controls are now resizable using the config option controls_size in [global] section in nagvis.ini.php * Documentation link in header menu only points to available docs. Fallback is en_US * Bugfix: Added missing controls to services which are displayed as gadgets * Bugfix: Fixed parsing of label_type=14 lines (Thanks to Laurent Lebatard) * Bugfix: Label positioning in case of weathermap lines (Thanks to Laurent Lebatard) * Bugfix: Fixed empty warning popups in map management dialogs * Bugfix: Fixed color selection of weathermap lines (Thanks to Laurent Lebatard) 1.6b1 Core * Default admin credentials for inital auth databases are now: User: admin Password: admin Admin credentials in existing auth databases are not changed. * Added user/role profile config files located in nagvis/etc/profiles/(user|role).profile The profile files can contain user/role specific options like languages and so on * The language of a user is stored in the profile file now * The eventlog hide state is stored in the profile file now and used when the eventlog is enabled for a map * Added new options {file_group} and {file_mode} to global section of nagvis.ini.php. These options are used whenever a file is written by NagVis * Livestatus backend: Better error handling when writing to livestatus socket * Lines can have three coords now to reposition the middle of lines having two arrows * Better handling for map config errors on overview page and map links - no whole screen errors anymore * The check_command parameter is available in NagVis now. NDO and MKLivestatus backends fetch this info from the datasources now * Hostgroup and Servicegroup aliases work again now. It might be neccessary to update livestatus to the newest 1.1.9i* version. * All map objects need to have an object id which needs to be unique on each map. All map objects which have no object id defined will ge one created. This makes migration easier. * Catching ps_files_cleanup_dir error message (strange error debian/ubuntu) * Changed PENDING state for host objects to UNCHECKED; This was needed to prevent mixups with service and host objects * Fixed inconsistence with iconsets when refreshing overview maps/automaps * Cleaned up session auth code (Moved session module code to auth handler) * Bugfix: The installer overwrites the default iconset files on upgrade as expected * Added mechanism to search userfiles in independent structures. This allows usage of the local/ structure in OMD * Bugfix: Fixed section merging in main config when using more than one config file * Using configured permissions on uploaded files (backgrounds, shapes, maps) now * Gadgets: Added gadget_type option which can now be img/html. The value defaults to img which is the default behaviour for all existing gadgets. The html mode assumes that the gadget does not render images as classic gadgets but renders HTML code * Changed redirect scripts index.php/config.php to ignore hosts/ports/proto just care about the paths - should be more robust Automap * Made automap coord parsing regex resistent against html entities in the URL * Automap params changed via GUI can be made permanent now * The x/y coords don't need to be set as dummy values in automap configs anymore Backend: Livestatus * Bugfix: PHP error when trying to write to socket while the remote host is not available Frontend * Completely removed the WUI and merged the functionality into the regular frontend. You can now "lock/unlock" all objects for editing using the "Edit Map" menu. * Added new sidebar for better navigation. It can be opened by clicking on the "Open" label in the header menu. The state of the sidebar and the single nodes is stored in user specific profile files * Added new parameter {parent_map} to map/automap global sections which is used in header/sidebar menus to draw a map hierarchy * Colors and ranges of weathermap lines are now customizable using the object configuration option line_weather_colors * Fixed wrong label for MBit/s in weathermap bandwidth display * It is now possible to lock/unlock objects in regular frontend (with the necessary permissions) * Lines can now be repositioned by dragging the ends using the anchors in unlocked mode in regular frontend * The Line middle position can now be edited using the frontend for lines with two line parts * Added password reset form to user management dialog * Reduced ajax calls on map/automap/overview page load * Several code cleanups; Reduced duplicate code * Made background color in frontend configurable now * The header menu has a minimal width now to prevent broken header menu on small screens * The header menu is now positioned to be shown on the screen all the time * Recoded the header menu submenu code (simplified the HTML and JS code) * Added buttons to show/hide the header menu (state saved per user) * Added new option: event_log_events to define the number of events in the eventlog scrollback * Bugfix: Fixed php error when using custom css files in maps * Bugfix: Fixed css notices in firefox caused by invalid statements (transparency in IE, invalid width values for lines) nagvis-1.7.10+dfsg1/INSTALL000066400000000000000000000031631225466040700151310ustar00rootroot00000000000000============================================================================== NagVis 1.6 Quick Installation Instructions ============================================================================== Author: Andreas Husch, Lars Michelsen Document Version: 0.7 Date: 2011-04-02 Applies to: NagVis 1.4 - 1.6 ============================================================================== 1. Download NagVis -------------------- Get NagVis. The latest release can be found at www.nagvis.org. 2. Unpack NagVis -------------------- Unpack the archive to a temporary place (for example /tmp). And change to that directory > tar xvzf nagvis-1.6*.tar.gz /tmp > cd /tmp/nagvis-1.6* 3. Make installer executable -------------------- The installer is located in the root directory of the NagVis package. The installer has to be made executable before you can use it. > chmod +x install.sh 4. Run installer -------------------- Now you can run the installer. > ./install.sh Following the instructions of the installer should lead you to a working installation of NagVis. If you experience any problems please let us know. 5. Cleanup -------------------- You can remove the sources after installation. > rm -rf /tmp/nagvis-1.6* 6. Additional information -------------------- 6.1 Command line parameters ------------------ For details about the command line parameters call the installer with the "-h" option. ============================================================================== Have fun using NagVis and please report bugs! ============================================================================== nagvis-1.7.10+dfsg1/LICENCE000066400000000000000000000434061225466040700150710ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.nagvis-1.7.10+dfsg1/README000066400000000000000000000030021225466040700147500ustar00rootroot00000000000000============================================================================== NagVis 1.6 Readme ============================================================================== Author: Lars Michelsen Date: 2011-04-02 ============================================================================== README ------------------ Home of the official documentation: http://www.nagvis.org/doc INSTALL ------------------ Please have a look at the "INSTALL" file or visit the online documentation on the official NagVis Homepage (http://www.nagvis.org/doc). SUPPORT ------------------ There are many ways to get in touch with the NagVis team/community. For a detailed list just have a look at http://www.nagvis.org/support. Besides the free community support it is also possible to get paid services for NagVis. We offer different types of services like for example custom developement and support contracts. BUGS ------------------ You found a bug in NagVis? The best way to submit the bug report is the NagVis-Developers-Mailinglist (nagvis-devel@lists.sourceforge.net). LICENSE ------------------ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. For details please have a look at the "LICENCE" file. ============================================================================== Have fun using NagVis and please report bugs! ============================================================================== nagvis-1.7.10+dfsg1/TODO000066400000000000000000000726771225466040700146100ustar00rootroot00000000000000This is a small file for storing quick thoughts about new features and needed changes: =============================================================================== Offene Punkte: - Automap zu source umbauen - filter_by_state neu implementieren (Und evtl. auch für alle Ansichten) Das ist ein Problem. Denn die Objekte werden ja schon positioniert, wenn der Status der Objekte noch gar nicht vorhanden ist. Was kann man da nun tun? Eine Möglichkeit wäre die Objekte einfach zu verstecken, die nicht angezeigt werden sollen. Das würde dann zu leeren flecken auf der Map führen. - Doku: - Alte zu neuen Automap Parametern - Automap Migration - WUI: printLang() durch neuen _() Mechnismus ersetzen ------------------------------------------------------------------------------- Relative Koordinaten: - Wie funktionieren Linien zu Linien Referenzen? Geht das überhaupt? - An Shapes anheften fehlt - Eventuell auch nicht. Was ist denn, wenn man Shapes als Design Elemente nutzen möchte, die einfach im Hintergrund liegen? Eventuell muss man das beim Shape konfigurierbar machen. - Sidebar Folder auf/zu klappbar - In Sidebar/Dropdown die aktuelle Map highlighten - Hover- und Contextmenü-Macros vereinheitlichen - Rotationen: Externe Seiten alternativ in iframe öffnen (z.B. Check_MK Views) - Geomap: - Andere Objekte in Geomaps erlauben (Dazu die Felder type, name1, name2) einführen - Automap: User Defined Coords: - Speichern testen (Nur nötigste Attribute schreiben) - Werden die korrekt übernommen? - margin abziehen? Da diese Umsetzung mit Graphviz nicht möglich ist, bleiben nun zwei Möglichkeiten: 1. Das Feature wieder abklemmen. 2. Das Programm zum Rendering wechseln <<< - Header Dropdown bei zu vielen Elemenenten nach rechts verbreitern - Zeige Rotations in Sidebar - Verzeichnis-Hierarchie unterhalb von maps/ - Anstatt flachem Listing einen Walk machen - Map-Name enthält dann den Pfad relativ zum Maps Verzeichnis - Eventuell auch auf Teile des Map Namens (Verzeichnisse) Rechte verteilen - Make stateless lines or other single part lines splittable - Weathermap Line Parser pro Check-Kommando behandeln - Das sollte den Code wesentlich sauberer machen - SQLite/MySQL Handling/Update abstrahieren und wesentliche Dinge an zentraler Stelle definieren - NagVis Multisite Snapin optional als Baum - Backends: - Zusätzlich beliebige Variablen vom Backend holen lassen Pro Objekt "Custom Vars" für Context- und Hover-Menus einbauen. Diese werden dann pro Objekt u.U. sogar in separaten Queries an das Backend abgefragt und in Hover- und Context-Menus als spezielle Macros angeboten. Installer: - Der Installer sollte beim Update headermenu, headertemplate aus [wui] Sektion entfernen. Leider ist das nicht ganz so einfach, wie bei den anderen Attributen, da in anderen Sektionen diese Optionen noch erlaubt sind. *** Linien (Auch für neue Automap wichtig!) *** - Pfeilspitzen konfigurierbar machen - Größe - Stil - Farbe (?) - Offset zum Ziel *** Cleanups *** - Variablen nach int/boolean casten, wenn sinnvoll - Objekte klonen wieder implementieren - Weathermap Linien Perfdata Berechnungen nach check_command aufräumen - ajax Funktionen aufräumen/konsolidieren - OMD Tests *** Icon Koordinaten zentrieren *** Die Icon Koordinaten beziehen sich momentan auf die linke obere Ecke der Icons. Eine Änderung auf einen Bezug zum Zentrum eines Objekts würde mehrere Vorteile mit sich bringen. Beispielsweise könnten die Icons innerhalb eines Iconsets verschiedene Größen haben. Wie soll das bei Textboxen gehen? Eventuell muss man bei jedem neu Rendern die Maße des Objektes ermitteln und prüfen, ob es neu positioniert werden muss. Eine Nebenwirkung könnte sein, dass die Entfernungen der Controls und die anderer relativ positionierten Objekte nicht automatisch mitskaliert werden. *** Nicht kompletter Reload bei veränderter Map Konfiguration *** Der Trend geht an einigen Stellen stark richtung dynamische Map Konfigurationen. Dem sollte man irgendwie begegnen. Momentan wird die Seite vom JS Frontend komplett neu geladen. Der bessere Weg wäre, wenn das Frontend irgendwie die Differenz zwischen der aktuell geladenen Konfiguration und der aktuellen Konfigurationsdatei ermitteln könnte und dann anhand dessen einzelne Objekte hinzufügt/aktualisiert/entfernt. Fälle: 1. Neues Objekt - Neues Objekt in oMapObjecs erzeugen - Neues Objekt malen .parse() 2. Gelöschtes Objekt - Objekt von Map entfernen .remove() - Objekt aus oMapObjects entfernen 3. Geändertes Objekt - Objekt .conf aktualisieren - Objekt von Map entfernen .remove() - Objekt neu malen .parse() 4. Geänderte Hauptkonfiguration 5. Geändertes Global-Objekt - mapProperties neu laded - setMapBasics() - setMapBackgroundImage() - FIXME: Was wird noch aus den mapProperties abgeleitet? - .conf bei allen Objekten aktualisieren - Objekte von Map entfernen .remove() - Objekte neu malen .parse() So. Und wie erkennen wir das nun? Wie wäre es bei einer geänderten Konfiguration einfach die aktuellen mapObjects laden (getMapObjects) und dann die Differenz zum aktuell geladenen oMapObjects Objekt ermitteln? So kann man dann im JS frontend genau ermitteln welche Dinge sich geändert haben. *** Installer renovieren *** Der erste Punkt: Die Nutzer Einstellungen für eine Installation sollen gespeichert werden. Das kann z.B. in einer Datei im Home-Verzeichnis gespeichert werden. Der Pfad zu dieser Datei könnte beispielsweise auch über eine Umgebungsvariable oder einen Parameter verändert werden. Dann braucht man auch nicht mehr versuchen eine mögliche Kommandozeile für den nächsten Lauf zusammen zu bauen. Bei den Default-Einstellungen für die einzelnen Optionen gibt es folgende Möglichkeiten: 1. Hart codierte Defaults 2. Aufrufparameter 3. In einem vorherigen Lauf eingegebene Optionen 4. Automatisch ermittelte Optionen Alle Abfragen genau prüfen, ob diese wirklich abgefragt werden müssen. Beim Update eventuell einige Abfrage weglassen. Wie z.B. die Konfiguration der Backends. Beim automatischen Ermitteln von Pfaden/Nutzern könnte man auch alternativen anbieten, wenn mehrere Nagios Prozesse gefunden werden. Eventuell auf Python umstellen. Das macht die ganze Programmierung um einiges einfacher und das ganze Zeug auch wartbarer. *** Shortcuts einbauen *** Gerade der Edit-Modus im normalen Frontend sollte Hotkeys haben. Diese sollten nach Möglichkeit nicht mit Hotkeys von FF/IE kollidieren. *** Fehlerbehandlung *** Ajax Schnittstelle umbauen: Kleines Protokoll einbauen, mit Header inkl. Fehlercodes etc. und man muss nicht bei jeder Anfrage immer die Feld-Namen mitsenden (-> weniger Overhead). Bessere Fehlerbehandlung z.B. auf Übersichtsseite, wenn Antwort kein gültiges JS ist. Exception/Error log bauen: PHP Fehler loggen Eventuell sogar Javascript fehler loggen *** Dokumentation *** - Neue Editier-Möglichkeiten in der normalen GUI - Mittleren Teil der Linien festmachen oder positionieren - Relative Koordinaten - Relative Koordinaten via Ctrl setzen und via Shift lösen - Backend Schnittstelle =============================================================================== # ERLEDIGT =============================================================================== - Overview-Seite: Bei HTTP Fehler, z.b. 500 wegen Memory-Limit, ordentlichen Fehler zeigen - CSV Quelle und geomap aufteilen *** NagVis Map Zoom *** Ziel: Das Ziel ist es die NagVis Maps zoombar zu machen. Ein stufenloser Zoom ist nicht nötig. Es wäre ausreichend z.b. in 10er Schritten die Map zu zoomen, wobei die Seitenverhältnisse der Map immer beibehalten werden müssen. Es ist also nicht einfach möglich die Map auf eine feste Breite/Höhe zu zoomen. Nice2Have: Also Zusatzfeature kann man einen Knopf machen "fit screen size". Dieser errechnet im Javascript den Zoomfaktor und malt die Map mit den neuen Koordinaten neu. Umsetzung: Die Umsetzung muss im Frontend passieren. Also rein im Javascript. Vom PHP Backend werden nur die Parameter (Koordinaten, Zoomfaktor, Objekt Größe) zur Verfügung gestellt. Beim Rendern der Objekte werden die Koordinaten umgerechnet. Bei der Implementierung muss auf folgende Werte geachtet werden: 1. Koordinaten der Objekte 2. Maße der Objekte (Icons, Textbox (width, height), Linien-Breiten) 3. Beim Editieren müssen die Koordinaten zurückgerechnet werden 4. Controls der Objekte 5. Labels der Objekte 6. Das Grid vom Editier-Modus 7. Relative Koordinaten bewegen 8. Textbox resize Zoomfaktor: Der Zoomfaktor ist per Default auf 100% gesetzt. Damit müssen keine Koordinaten umgerechnet werden. Nun kann man z.b. den Zoomfaktor auf 50% setzen um weiter aus der Map raus zu zoomen. Ein Zoomfaktor von 200% zoomt damit weiter rein. Der Default Zoomfaktor kann als view_parameter in der Map Konfiguration vorgegeben werden. Wenn der Nutzer diesen Wert verändert, dann wird dieser in seinem Profil gespeichert. Von da an wird dieser Wert benutzt. Der Zoomfaktor kann mit zwei Knöpfen, z.b. im Headermenu (oder als Overlay auf der Map selbst) beeinflusst werden. Der aktuelle Zoomfaktor wird dort auch irgendwie dargestellt. Damit die Maps bei starkem Zoom nicht schlimm aussehen, ist es eventuell nötig für die Hintergründe, Icons und Shapes nötig SVG Unterstützung zu implementieren. Dabei muss aber bei jedem Objekt zusätzlich zum Iconset noch die Default Größe festglegt werden. Eventuell ist es sogar notwendig die Map Koordinaten der Objekte selbst zu zentrieren (Siehe Text weiter unten). Implementierungsdetails: - Im Javascript Frontend gibt es bereits die Funktion parseCoord(). Die ist dazu da die Koordinaten eines Objekts auszurechnen und einen Integer zurück zu geben. Diese Funktion könnte ohne Änderungen an der Funktionssignatur intern den Zoomfaktor berücksichtigen. - Bei Bildern müsste man die aktuelle Breite auslesen. Dann muss man den Zoomfaktor einbeziehen und die neuen Maße setzen. Das muss nach dem Laden des Bildes passieren. Außerdem sollte das Bild bis zum Festlegen der entgültigen Größe/Position versteckt sein. Sonst gibt es irgendwelche Effekte, dass ein Bild erst groß und dann klein gemalt wird. Offene Fragen: - Maße der Objekte werden verändert - Dementsprechend müssen auch die Objekte anders positioniert werden. nheight = (height * zoom / 100) hoffset = height - nheight newx = x + (hoffset / 2) - Problem ist hier aber, dass beim Positionieren des Objektes gar nicht bekannt ist wie groß das Objekt selbst ist - Nach dem Einrechnen des Zoomfaktors ist auch die ursprüngliche Größe nicht mehr bekannt - Width/Height hängt oft an einem anderen Objekt, als die Position selbst Die Position hängt eher am Container -> Nachdenken - Wenn man beim Verändern der Höhe/Breite auch die Position verändert, dann würden die Objekte vermutlich korrekt positionert werden können. Dieses Offset müsste dann beim Editieren der Objekte berücksichtigt werden. *** Redesign main configuration *** Momentan können zwei Konfigurationsdateien benutzt werden. Besser wäre ein conf.d Verzeichnis zu haben um die Konfiguration, zumindest optional, modularer aufbauen zu können. Aus diesem Verzeichnis werden die Dateien in alphabetischer Reihenfolge geladen. Dabei ist zu beachten, dass die Sektionen Dateiübergreifend gemergt werden können müssen. Außerdem ist es wichtig, dass man die Datei weiterhin über die Weboberfläche editieren kann. Das könnte man so lösen, dass man nur eine spezielle Datei via Weboberfläche editierbar macht. Da müsste man beim rendern des Dialogs eben nur die Konfigurationdateien, die vor der Web-Datei kommen, laden und die daraus resultierenden Werte als Default-Wert annehmen. Dabei ist wichtig, dass die Optionen, die der Nutzer über die Webgui editiert nur in die eine Datei geschrieben werden, die durch die Webgui kontrolliert wird. Reihenfolge: conf.d/ nagvis.ini.php Das conf.d Verzeichnis ist optional. Es muss nicht existieren. Die Sektionen müssen gemergt werden können. Das betrifft alle Sektionen, sowohl Backends, als auch die Standard-Sektionen. Backends, die in den conf.d/ Verzeichnissen angelegt werden, können nicht per Webgui editiert werden (?). Eventuell kann man das dort irgendwie hervorheben. Aktuell gibt es einen Config Parser Cache. Dieser ist dateibasiert programmiert. Es gibt pro Konfigurationsdatei einen eigenen Cache. Bei der Aufteilung in ein conf.d/ Verzeichnis würde es ausreichen einen einzigen Cache für die Gesamte Konfiguration zu halten. Wenn eine Datei neuer ist, als dieser globale Cache, dann werden alle Dateien neu eingelesen. Die Klasse GlobalFileCache müsste optional eine Liste von Dateien mitbekommen können. Die Klasse regelt das Handling mehrerer Dateien dann transparent. *** Child-Objekte Filtern *** - Zwei Möglichkeiten a) Für tatsächliche Verarbeitung (Status Ermittlung + Child Anzeige) b) Nur für Status Ermittlung - Neues Attribut einführen, welches die Definition enthält um Childs zu filtern - Namen könnte exclude_members sein bzw. exclude_member_states - Es können alle Childs gefiltert werden, bei Maps von allen Typen - Gematcht wird auf den Namen des Childs bzw. bei Services auf den Service-Namen - Als Wert könnten Case Insensitive Reguläre Ausdrücke genutzt werden, z.B. exclude_childs="^Uptime$" - Wenn ein Match auf mehrere Elemente nötig ist, z.B. bei Services (Hostname und Service Description), dann werden zwei Reguläre Ausdrücke formuliert, welche durch "~~" getrennt werden. So können auch in Hostgruppen individuelle Services eines Hosts ausgeklammert werden. Beispiel: exclude_childs="^localhost$~~^CPU load$" zum Ausklammern eines bestimmten Dienstes. - Notizen: - CoreBackendMgmt->queue() fasst gleiche Anfragen zu einer Liste zusammen, um die Anzahl der Backend Queries zu reduzieren. z.B. werden Anfragen vom gleichen Typ und mit gleichen Optionen (hardstates, ...) zusammengefasst. Diese werden zusammen mit den objekttyp spezifischen Filtern an das Backend weitergegeben um die richtigen Daten zu holen. Als weiteres Kriterium kommen nun die Objekt individuellen Filter dazu. Diese müssen beim CoreBackendMgmt->queue() auch dazu führen, dass Objekte mit unterschiedlichen Filtern einzeln abgefragt werden. Der Grund ist, dass im Backend eine einzige Anfrage mit einem globalen Filter für alle angefragten Objekte ausgelöst wird. - Verworfen/Zurückgestellt: - Man kann mehrere Pattern angeben. Sobald ein Pattern zutrifft, wird übersprungen - Mehrere Patterns werden durch ; Zeichen getrennt, z.B. exclude_childs="/^Uptime$/;/^PING$/" *** Map Config Redesign *** Pro Objekttyp können beliebige Variablen zugewiesen werden. Diese werden für den Objekttyp registriert und sind unabhängig von den Definitionen der Variablen selbst. Bei der Zuweisung handelt es sich um eine einfache Auflistung von Variablen-Namen. Definition von Variablen Die Variablen selbst werden an zentraler Stelle registriert. Jede Option wird als ein Eintrag in einem Array registriert. Der Schlüssel ist der Name der Variable. Ein Array stellt diese Variable dar. Folgende mögliche Schlüssel sind zu befüllen: must - Muss in jedem Fall gesetzt sein (egal ob vererbt oder nicht). match - Regex zum validieren des Wertes default - Vererbter Wert / Default Wert Folgende optionale Attribute können gesetzt werden: deprecated - Wenn veraltet und nicht berücksichtigt. field_type - Wenn abweichend von 'text'. depends_on - Name der "parent" Variable zum Anzeigen im Add/Modify Dialog depends_value - Wert der "parent" Variable list - Funktionsname zum Erstellen eines Arrays, der für die Dropdown-Felder die Liste der möglichen Werte zurückliefert. Es wird das Array $mapConfigVars gefüllt. Die Definitionen werden in Dateien in share/server/core/mapcfg/*.php abgelegt. Darin können nicht nur Definitionen erstellt werden, sondern auch Funktionen zum Füllen eventueller Listen registriert werden. Zuweisung von Variablen Die Zuweisung von Variablen zu den Objekttypen geschieht über das $mapConfigVarMap Array. Das Array ernhält die Objekttypen als Schlüssel und darunter jeweils ein Array mit den möglichen Variablen als Schlüssel und "null" oder den Typ spezifischen Namen als Wert. *** Add/Modify Redesign *** Aufrufe: 1. Neues Objekt - x/y Koordinaten als Parameter - Parameter: type, x, y 2. Objekt klonen - Aktuell konfigurierte Parameter + Objekt-ID generieren - Parameter: object_id 3. Objekt bearbeiten - Aktuell konfigurierte Parameter - object_id => Es können beliebige Variablen via POST/GET übergeben werden. Hierbei muss zwischen den Standard-Variablen für das Modul, die Action etc. und den Attributen unterschieden werden. 1. Default Variablen werden außenvor gelassen und am Anfang der "Action" verarbeitet und gefiltert 2. Alle Attribute des Objekt-Typs werden versucht aus den Variablen auszulesen. 3. Die übrigen Variablen werden als Hidden-Felder zum Formular hinzugefügt und so durchgeschleust. Feld-Eigenschaften: - Vor jedem Wert ein Kästchen anzeigen, mit welchem dieses Attribut aktiviert wird - Bei nicht angehaktem Kästchen wird der Wert geerbt. - Die Checkbox wird bei Pflichtfeldern nicht angezeigt. - Je nach Attribut-Typ verschiedene Felder anzeigen (Text, Select, ...) - Abhängige Felder je nach Wert eines anderen Feldes zeigen/verstecken - Leere Variablen müssen auch gesetzt werden können - Wenn Dropdown wegen Exception nicht befüllt werden kann, diese abfangen und dann anstatt des Feldes die Fehlermeldung anzeigen - Wenn bei Dropdowns ein Wert gesetzt ist, der nicht in den Listen vorhanden ist, dann keine Dropdown-Liste anzeigen. Fehlerbehandlung: - Direkt im Dialog: Feldbezogene Fehler direkt unter den Feldern anzeigen - Generelle Fehler/Meldungen als über Formular anzeigen - Validierung/Verarbeitung ohne Javascript, kompletter Dialog wird neu generiert - Beim Abschicken des Formulars den Dialog nicht schließen - Der Dialog muss neu generiert werden, wenn a) Der Wert von Feldern mit Abhängigkeiten geändert wird b) Ein Feld mit Abhängkgeiten von Geerbt auf Konfiguriert geändert wird - Das Formular wird abgeschickt und verarbeitet -> Im Fehlerfall wird die Antwort in den Dialog gemalt, wobei der vorherige Inhalt überschrieben wird -> Bei Erfolg wird der Dialog nach X Sekunden geschlossen, es wird kurz eine Erfolgsmeldung gezeigt. Aktuell muss dann die Seite neu geladen werden *** Auth redesign *** Das Ganze ist zu kompliziert! Es gibt im Grunde 2 Schritte. Wobei der erste Schritt optional ist. 1. Logindaten abfragen - Formular anbieten 2. Logindaten einsammeln - $_POST, $_COOKIE, $_SERVER['REMOTE_USER'], ... 3. Dann das Ganze an AUTH übermitteln 4. Optional: In Session speichern, wenn das Logon Modul das anfordert LogonMixed: 1. REMOTE_USER gesetz? -> nehmen und trusted auth machen (Nur Nutzer vorhanden prüfen) -> Direkt angeforderte Seite malen -> Nicht in Session speichern 2. Wenn nicht, dann Login-Seite direkt malen (keine Weiterleitung) 3. Formular wird abgeschickt -> Daten prüfen -> ok: direkt die angeforderte Seite malen -> In Session speichern -> nok: Wieder die Login-Seite malen LogonDialog: 1. Login Dialog zeigen 2. Formular wird abgeschickt -> Daten prüfen -> ok: direkt die angeforderte Seite malen -> Nicht in Session speichern -> nok: Wieder die Login-Seite malen LogonMultisite 1. Cookie da? 2. Cookie prüfen -> ok: direkt die angeforderte Seite malen -> Nicht in Session speichern -> nok: Zur Loginseite umleiten (inkl. _origin) *** NagVis Featureitis *** - Plattform zum Vorschlagen von Features - Pro Features können Kosten angeben werden - Öffentlich sind Prozentzahlen sichtbar wieviel von einem Feature schon finanziert ist - Features können von anonymen und eingeloggten Nutzern vorgeschlagen werden - Bei anonymen Nutzern muss moderiert werden - Für neue Features werden Mails generiert - Ein/Mehrere "Supporter" können sich mit Beträgen zu den einzelnen Features melden - Per Default werden nur die Anzahl der Supporter angezeigt - Ein Supporter kann optional seinen Namen und seinen Betrag öffentlich machen *** Synchrone Ajax Aufrufe minimieren *** Wenn ein synchroner Ajax Call läuft, dann kann die Webseite währenddessen nicht benutzt werden. Das geht ziemlich auf die Usability. - Synchrone Aufrufe ermitteln - Code umstellen auf Asynchronen Aufruf mit Callback - Verhindern dass sich eine Queue von hängenden/zu lang laufenden Ajax Calls aufbaut? - Calls mit Timeouts versehen - parseMap() handler: eventlog("worker", "info", "Finished parsing " + sType); eventlog("worker", "error", "Problem while parsing the " + sType + " on page load"); - Updates nur machen wenn initiales Parsen erledigt ist - getObjectStates bekommt Zeiten der Konfigurationsdateien vom Frontend mit - Wenn die Dateien neuer sind, dann wird das dem Frontend gemeldet - Die angefragten Daten werden nicht mehr verarbeitet - Parameter: f -> liste von Dateien - Wert: f[]=,, - Wert: f[]=maincfg,,0123456789&f[]=map,name,0123456789 *** locking php sessions *** - PHP Session schließen sobald möglich Das verhindert blockierende HTTP Requests SESS->storeInSession() CoreLogonDialogHandler->check() SESS->changePassword() CoreModChangePassword->handleAction() SESS->logout() CoreLogonMultisite->checkAuth() *** View Parameter *** - Aktuell kann man bei den Views eigene Parameter vorsehen, die die Werte aus z.b. _GET Variablen beziehen - Die Idee ist im Grunde, dass der Nutzer an der aktuellen Ansicht zur Laufzeit Dinge ändern kann - Die Default Werte für diese Parameter ziehen sich zum Teil aus der Option default_params der Global Sektion - Es gibt also folgende Quellen für die Werte der View Parameter: - Maincfg (Default Wert) - Mapcfg (Default Wert) - Hart-Codierter Default Wert - default_param in Global Sektion - _GET Parameter - Wäre es nicht toll wenn man alle Global-Optionen via URL anpassen könnte? - Die möglichen Optionen werden durch die Map Global Optionen und die Optionen aus den Sourcen definiert - Die Verarbeitung findet in der MapCfg Klasse statt, so dass die einzelnen Module sich da nicht drum kümmern müssen - Jede Source kann selbst !neue! Optionen registrieren - Zusätzlich kann jede Source festlegen welche Parameter für diese Source modifizierbar sein sollen *** Dynamische Map Konfiguration *** Das Format der Map Konfiguration ist in erster Linie dazu da Anfängern die Arbeit mit den Konfig-Dateien zu erleichtern. Mit PHP Dateien hat es in der Vergangenheit immer wieder Syntaxfehler etc. gegeben. Nun gibt es aber einige Anwendungsfälle, in denen man anstatt eine Map Konfiguration zu parsen lieber eine dynamische Konfiguration erzeugen möchte. In dem Fall ist die Map Konfiguration eher hinderlich. Man könnte gleich ein PHP Datenkonstrukt erzeugen. Beispielsweise auch bei den Automaps wäre dieses Vorgehen denkbar. Dann könnte man die Objekte via Backend ermitteln, mit graphviz positionieren und eventuell noch durch eine manuelle Konfiguration wieder modifizieren. Vielleicht könnte man dann in Zukunft die Sonderbehandlungen für Automaps entfernen und daraus wieder ganz normale Maps machen. Vielleicht kann man in dem Zuge auch realisieren, dass man gewisse Objekte auf der Automap manuell positioniert und die anderen Objekte dann mit graphviz positionieren lässt. Am Beispiel der Automap lässt sich erahnen, dass man pro Map u.U. mehrere dynamische Datenquellen anzapfen möchte. Man müsste also pro Map definieren können welche dynamischen Komponenten man in welcher Reihenfolge nutzen können möchte. Was muss an die Dynamischen Datenquellen übergeben werden, was kommt zurück? In der Klasse GlobalMapCfg gibt es zwei Arrays, die aus der Map-Konfiguration befüllt werden: 1. mapConfig: Dieses assoziative Array enthält für jedes Map Objekt ein weiteres Array, wobei die Objekt-ID als Schlüssel benutzt wird. Das Array des Objektes enthält pro Konfigurations-Variable jeweils ein Schlüssel-Wert Paar. 2. typeDefaults: Dieses Array enthält für jeden Objekt-Typ ein weiteres Array, in dem die Default Werte für die einzelnen Objekt-Typen aufgelistet sind. Diese Angaben speisen sich aus der Global-Sektion der Map und diese erhält Default-Optionen wiederrum aus der Hauptkonfiguration. Man könnte die dynamischen Datenquellen auf die Manipulation von Objekten beschränken. Dementsprechend würden diese nur das mapConfig Array betreffen. Eine dynamische Komponente kann z.B. eine Funktion sein, die die aktuelle Map-Konfiguration als assoziativen Array übergeben bekommt und eine aktualisierte Version von diesem Array zurückgeben kann. Darüber hinaus sollte man der Funktion auch noch den Namen der aktuellen Map und eine Möglichkeit zum Backend-Zugriff geben. Bei solchen dynamischen Konfigurationen muss man nur dem JS Frontend irgendwie mitteilen, wenn es Änderungen gibt. Vielleicht wäre eine Möglichkeit die Map auf Basis von Zeit als Dirty zu betrachten. Oder aber man prüft Serverseitig in festgelegten Intervallen, ob die endgültige Map-Konfiguration sich geändert hat. Eine Alternative wäre, dass in jeder *.php Datei einer Map auch eine changed() Funktion deklariert werden muss. Diese gibt einen Unix Timestamp aus, welcher darüber Auskunft gibt, ob die Map neu geladen werden muss. Diese Funktion wird aufgerufen, wenn das JS frontend den configChanged Poll schickt. Die bisherige Methode zur Prüfung der mtime der *.cfg Datei wird um den Zeitstempel der changed() Funktion ergänzt. Die Funktion bekommt die angefragte Zeit als Parameter übergeben. So kann man auch berechnen, dass eine Map alle X Minuten/Stunden/Tage neu geladen werden muss. Wie könnte das alles aussehen? Es gibt ganz normale Map-Konfigurationen, in denen die Global-Sektion und andere Objekte definiert werden können. Diese können auch über die GUI editiert werden. Als vorgelagerten Mechanismus kann jede Map optional auch über eine eigene *.php Datei dynamisiert werden. Diese PHP-Datei muss mindestens eine render() Funktion deklarieren, welche einen mapConfig Array zurückgibt. Dieses Array wird dann als Basis für die Definitionen aus der normalen Map-Konfiguration genutzt. Die map spezifischen *.php Dateien liegen in share/userfiles/mappers/.php. Was gehen muss: - Man muss der Render-Funktion Parameter mitgeben können, z.B. aus der Global-Sektion der Map Konfiguration. - Außerdem wäre es noch nett, wenn man auch schon die Objekte der Map Konfiguration zur Verfügung hätte. Ja wie jetzt? Ich denke die Map Konfiguration kommt später drauf? z.B. als Initial-Koordinaten für die Automap wäre es interessant die Koordinaten von bestimmten Objekten vorzugeben. --------------------------------------------- define global { source=fetch_parents(root,levels),dynamic_coords } --------------------------------------------- --------------------------------------------- Einige weitere Gedankenfetzen: Es gibt im Grunde drei Ansätze um das ganze zu vereinfachen: 1. Der einfache Ansatz: Einfach ein leichter zu parsendes Format zulassen. z.B. ein JSON Objekte. Dieses Objekt kann in den meißten Sprachen einfach aus einem Objekt erzeugt werden. Das würde das Parsen und wieder Einlesen von Konfigurationen durch externe "Generatoren" vereinfachen. 2. Eine Alternative zum Generatoren-Ansatz: Man könnte auch einfach die Mechanismen zum Generieren der Map-Konfiguration in die Map Definitionen verlagern. Dazu braucht man Dateien, in denen man "frei" programmieren kann. Das läuft auf PHP-Dateien hinaus, die am Ende eine Variable mit der Map-Konfiguration füllen. In dem Script kann dann alles erdenkliche gemacht werden. Probleme hierbei: - Immer die Daten abfragen, oder einen/den Cache benutzen? - Wenn Cache: Wie bekommt man mit, dass die Config neu generiert werden muss? - Wie bekommt das JS frontend mit, dass sich etwas geändert hat? 3. Es gibt einen neuen Mechanismus der Daten erzeugt, zu denen die normale Map Konfiguration gemergt wird. Dieser Mechanismus generiert eine Konfiguration, erstellt z.B. Hosts Objekte. Die normale Map-Konfiguration kann dann noch Änderungen/Ergänzungen vornehmen. Map Aufbau gliedert sich in 2 Phasen 1. Was kommt auf die Map? Mögliche Quellen: - Map-Konfiguration - Funktion liefert Datenkostrukt zurück (wird zu Map-Konfiguration gemerged) - Nagios Parents (Automap) - Externe DB - Es könnte auch ein Include auf irgendeine Datei sein - Die Funktion wird nur beim Parsen der Map Konfiguration geladen; Die Daten kommen mit in den Map-Cache - Frage hier: Wie wird der Map-Cache ungültig gemacht? - Die Funktion kann dann z.B. externe Datenbanken/Livestatus oder so anzapfen um von dort automatisch Objekte zu holen - Das Konstrukt kann auch Objekte mit Eigenschaften enthalen, diese könnten dann von der Map Konfiguration überschrieben werden (?) nagvis-1.7.10+dfsg1/docs/000077500000000000000000000000001225466040700150255ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/docs/cleanup_new_notes.sh000077500000000000000000000002121225466040700210670ustar00rootroot00000000000000#!/bin/bash find -name *.html -exec sed -r -i 's% ?\(?\(?(New|Neu|neu) in 1\.5\.?.?\)?:?\)?%%g' {} \; nagvis-1.7.10+dfsg1/docs/de_DE/000077500000000000000000000000001225466040700157655ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/docs/de_DE/about.html000066400000000000000000000130531225466040700177670ustar00rootroot00000000000000 Über

Über

Was ist NagVis?

NagVis ist ein Visualisierungs-Addon für das bekannte Netzwerk-Management-System Nagios® (bzw. Icinga, das ein Fork von Nagios ist).

NagVis kann benutzt werden, um Nagios-Daten zu visualisieren, d.h. IT-Prozesse wie ein Mail-System oder eine Netzwerkinfrastruktur darzustellen. Durch die Benutzung von Daten, die von einem Backend zur Verfügung gestellt werden, kann NagVis die Objekte auf den Maps in regelmäßigen Intervallen aktualisieren. Diese Maps ermöglichen es, die Objekte auf verschiedene Arten zu arrangieren:

  • physikalisch (z.B. alle Hosts in einem Rack/Raum/Bereich)
  • logisch (z.B. alle Applikations-Server)
  • geographisch (z.B. alle Hosts in einem Land)
  • Geschäftsprozesse (z.B. alle Hosts/Services, die in einen Prozess involviert sind)

Wie arbeitet NagVis?

NagVis ist ein Präsentationswerkzeug für die Informationen, die von Nagios gesammelt und mit Hilfe eines Backends zur Verfügung gestellt werden.

Die unterstützten Backends sind:

Das Backend bekommt die Informationen vom Nagios-Prozess (mklivestatus) oder von einer Datenbank (NDOUtils/IDOUtils, merlin).

Sie können alle Nagios-Objekte (Hosts, Services, Hostgroups, Servicegroups) zu so genannten Maps hinzufügen. Jede Map kann durch ihre eigene Konfigurationsdatei konfiguiert werden. Sie können diese Konfigurationsdateien mit Ihrem bevorzugten Texteditor oder mit Hilfe des Web-Konfigurations-Tool namens WUI anpassen. Außerdem können Sie einige spezielle NagVis-Objekts zu den Maps hinzufügen. Diese Objekte sind "Shapes", "Textboxen" und Referenzobjekte für andere Maps.

Jedes der Objekte auf Ihren Maps kann nach Ihren Bedürfnissen angepasst werden. Es gibt z.B. Verweise auf das Nagios-Frontend für jedes Objekt, das ein Nagios-Objekt repräsentiert. Sie können diese Verweise einfach anpassen.
Es gibt ein Hover-Menü, das per Default aktiviert ist. Das Hover-Menü zeigt detaillierte Informationen für jedes Objekt. Hover-Menüs können einfach geändert werden, indem die Templates angepasst werden. Sie können auch das Hover-Menü deaktivieren.
Per Default werden die Zustände von Objekten als Icons auf der Map angezeigt. Sie können diese Icons durch Iconsets von der NagVis-Homepage oder durch eigene ersetzen. Die Zustände von Objekten können auch als Linien oder als Gadgets angezeigt werden.

Neben den normalen Maps gibt es die Automap. Abhängig von der Einstellung der Direktive "filterByState" zeigt sie alle Objekte oder nur diejenigen in einem nicht-OK-Zustand inklusive des Weges vom Root-Objekt bis zum jeweiligen nicht-OK-Objekt.
Sie wird automatisch auf Basis der Nagios-Konfiguration generiert. Zur Nutzung der Automap müssen Sie die "Parent"-Abhängigkeiten in Nagios nutzen. Die Automap erzeugt ein Hintergrundbild basierend auf der Konfiguration, den Layout-Parametern und den Parent-Abhängigkeiten.
Ab NagVis 1.5 können Sie auch mehrere Automaps definieren.

Lizenzierung

NagVis ist freie Software. Sie können es unter den Bedingungen der GNU General Public License Version 2 verteilen und/oder modifizieren, die von der Free Software Foundation veröffentlicht wurden.

NagVis wird in der Hoffnung verteilt, dass es nützlich ist, aber OHNE JEGLICHE GARANTIE, auch ohne die implizite Garantie der VERMARKTBARKEIT oder der TAUGLICHKEIT FüR EINEN BESTIMMTEN ZWECK. Genauere Details finden Sie in der GNU General Public License.

nagvis-1.7.10+dfsg1/docs/de_DE/after_installation.html000066400000000000000000000122631225466040700225410ustar00rootroot00000000000000 Nach der Installation

Nach der Installation

Demo-Ansichten

Nach der Installation enthält NagVis verschiedene Demo-Maps. Außerdem ist eine Rotation definiert, um Ihnen ein Beispiel für die Möglichkeiten von NagVis zu zeigen. Sicherlich hat NagVis viel mehr Features als wir Ihnen mit Hilfe dieser Demo-Konfigurationen zeigen können. Daher sollten Sie die Dokumentation lesen und kreativ sein.

Wenn Sie mit NagVis vertraut sind, können Sie diese Demo-Maps und die Rotation ohne Probleme löschen.

Konfigurationsdateien

NagVis basiert auf verschiedenen Konfigurationsdateien. Die Hauptkonfigurationsdatei enthält grundlegende und globale Konfigurationsoptionen. Die Map-spezifischen Konfigurationsoptionen werden in etc/maps/in den Map-Konfigurationsdateien abgelegt. Ein spezieller Typ von Maps sind die Automaps. Mehr Informationen dazu finden Sie in der Dokumentation zur Automap-Konfiguration.

Die gesamte NagVis-Konfiguration kann mit Hilfe des webbasierten Konfigurationsprogramms geändert werden.

Authentifizierung/Autorisierung

Als Standard benutzt NagVis eine interne Benutzer- und Berechtigungsdatenbank (SQLite) für Authentifizierung und Autorisierung. NagVis besitzt ein rollenbasiertes Berechtigungssystem. Nach der Installation sind zwei Default-Benutzer definiert:

  • Username: admin, Password: admin
  • Username: guest, Password: guest

Die folgenden Rollen mit diesen Berechtigungen sind verfügbar:

  • Administratoren: Volle Berechtigungen in der gesamten Installation
  • Benutzer: Lesezugriff auf alle Maps, Automaps und Rotationen in der gesamten Installation
  • Gäste: Lesezugriff auf alle Demo-Maps, Automaps und Rotationen

Diese Default-Benutzer und Rollen sollten für den Anfang ausreichen. Sie können diese Benutzer und Rollen löschen, aber passen Sie auf, dass Sie nicht den letzten administrativen Benutzer löschen.

Fehlersuche

während der Installation

  • Der Installer beschwert sich über fehlende Voraussetzungen/Module.

    Bitte stellen Sie sicher, dass Sie eine aktuelle PHP-Version benutzen, dass alle für NagVis und das Backend benötigten Module vorhanden sind und dass GraphViz bereits installiert ist. Einige PHP-Module sind ggf. im Basis-Paket enthalten (bitte benutzen Sie "php -m" zur Prüfung).

    Bitte prüfen Sie install.log auf Fehler.

Nach der Installation

  • Sie erhalten lediglich eine leere Seite beim Zugriff auf die Hauptseite.

    Bitte prüfen Sie die Apache-Logs auf "permission denied"-Meldungen. Es ist ziemlich wahrscheinlich, dass SElinux aktiviert ist. Bitte deaktivieren Sie es (setenforce 0) oder erlauben Sie NagVis den Zugriff auf die Dateien.

  • Nach dem Hinzufügen von Objekten zu einer Map wird diese nicht mehr angezeigt.

    Bitte prüfen Sie die Apache-Logs auf "memory limit exceeded"-Meldungen. Es ist ziemlich wahrscheinlich, dass die memory-Einstellungen in der php.ini erhöht werden müssen. Starten Sie Ihren Web-Server nach der Änderung neu.

Bitte werfen Sie außerdem einen Blick auf die doc section der offiziellen Website ("FAQ" und "Often reported errors"). Falls das nicht hilft, dann lesen Sie weiter.

HILFE

Möglicherweise suchen Sie Hilfe auf der offiziellen NagVis-Website oder benutzen das Monitoring-Portal, das auch ein Board für NagVis-Fragen anbietet.

Bitte liefern Sie in jedem Fall WENIGSTENS Informationen über

  • das Betriebssystem (Distribution, Version)
  • die NagVis-Version (inkl., ob Sie NagVis über ein Paket aus der Distribution oder aus den Sourcen installiert haben)
  • grep "^[^;|^$]" <config-Datei> (falls Sie ein Problem mit der Konfiguration haben). Ersetzen Sie "<config-Datei>" durch den Namen der Datei, in der Sie einen Fehler vermuten
  • Apache-Meldungen (error log)
  • die Support-Informationen (Menü -> "Hilfe ?" -> "NagVis-Support-Informationen")
  • nagvis-1.7.10+dfsg1/docs/de_DE/auth.html000066400000000000000000000042241225466040700176160ustar00rootroot00000000000000 Authentifizierung / Autorisierung

    Authentifizierung / Autorisierung (AA)

    In den Versionen vor 1.5 kümmerte sich NagVis nicht viel um Authentifizierung und Autorisierung. In den meisten Umgebungen nutzte es die Authentifizierung von Nagios. Das war ein Nebeneffekt, da NagVis im nagios/share-Verzeichnis platziert war.

    Mit NagVis 1.5 wurde das Default-Installationsverzeichnis in ein eigenes Basisverzeichnis verschoben. Dieser Schritt erforderte einen neuen Authentifizierungs- und Autorisierungsmechanismus. Das Hauptaugenmerk dieses Konzeptes liegt auf Modularität und Flexibilität.

    Modularität

    Das AA wurde in drei Module aufgeteilt: LogonDialogs, Authentifizierung, Autorisierung. Jedes einzelne Modul kann geändert werden, ohne die anderen zu beeinträchtigen.

    Default-Module

    Per Default nutzt NagVis einen gemischten Logon-Request-Modus für die Anmeldung und eine SQLite-Datenbank für die Speicherung von Benutzern, Passwörtern und Berechtigungen. Dafür verwendet NagVis das LogonMixed-Modul, das im Hintergrund auf LogonEnv und LogonDialog zugreift. Das LogonMixed-Modul versucht, den Benutzernamen über das Web-Server-Environment zu ermitteln. Das bedeutet, dass NagVis der Web-Server-Authentifizierung vertraut, wenn eine benutzt wird. Falls keine verwendet wird, zeigt es den LogonDialog an, um interaktives Login durch den HTML-Logon-Dialog zu ermöglichen.

    Andere Module

    Bei der Auslieferung gibt es nur die o.g. Authentifizierungs- und Autorisierungsmodule. Durch die modulare Struktur sollte es einfach sein, LDAP-, MySQL- und dateibasierende Authentifizierungs- und Autorisierungsmechanismen zu erstellen.

    nagvis-1.7.10+dfsg1/docs/de_DE/auth_old_style.html000066400000000000000000000037631225466040700217030ustar00rootroot00000000000000 Authentifizierung / Autorisierung

    "Alte" Authentifizierung

    In den Versionen vor 1.5 kümmerte sich NagVis nicht viel um die Authentifizierung und Autorisierung. In den meisten Umgebungen nutzte es die Authentifizierung von Nagios. Dies war ein Nebeneffekt, da NagVis im Verzeichnis nagios/share platziert war.

    Mit NagVis 1.5 wurde das Default-Installationsverzeichnis in ein eigenes Basisverzeichnis verschoben. Dieser Schritt erforderte einen neuen Authentifizierungs- und Autorisierungsmechanismus. Das Hauptaugenmerk dieses Konzeptes liegt auf Modularität und Flexibilität.

    Wenn Sie wirklich die Authentifizierung von Nagios nutzen möchten, dann können Sie das LogonMixed- (default) oder das LogonEnv-Modul nutzen, um eine zuverlässige Authentifizierung einzusetzen. Der einzige Unterschied besteht darin, dass das LogonMixed-Modul den HTML-LogonDialog nutzt, wenn kein Benutzer vom Web-Server übergeben wird, während LogonEnv einfach nur eine "Zugriff verweigert"-Meldung anzeigt.

    Um dies zu erreichen, setzen Sie einfach die folgenden Optionen im [global]-Abschnitt der NagVis-Hauptkonfigurationsdatei:

    logonmodule="LogonEnv"
    logonenvvar="REMOTE_USER"
    logonenvcreateuser="1"

    Diese Zeilen weisen NagVis an, das LogonEnv-Modul zu nutzen, das den authentifizierten Benutzer aus einer Umgebungsvariablen ausliest. Der zweite Parameter teilt dem LogonEnv-Modul mit, welche Variable für das Auslesen benutzt werden soll. Die dritte Variable bewirkt, dass unbekannte Benutzer in der NagVis-AA-Datenbank angelegt werden sollen.

    nagvis-1.7.10+dfsg1/docs/de_DE/authorisation_roles_perms.html000066400000000000000000000133551225466040700241650ustar00rootroot00000000000000 Rollen / Berechtigungen

    Berechtigungsverwaltung

    Ab Version 1.5 enthält NagVis eine sehr detaillierte Berechtigungsverwaltung. Es ist ein rollenbasiertes Konzept, bei dem Benutzer einer oder mehreren Rollen zugeordnet werden, denen die Berechtigungen zugeordnet sind.

    Die Berechtigungen der verschiedenen Rollen eines Benutzers werden zusammengefasst und kontrollieren die Aktionen, die ein Benutzer ausführen darf.

    Rollen

    Standardrollen

    Bei einer frischen Installation sind vier Rollen definiert:

    • Administratoren: volle Berechtigungen für die gesamte Installation
    • Manager: Schreib- und Lesezugriff auf alle Maps, Automaps und Rotationen. Berechtigt, neue Maps, Automaps und Rotationen anzulegen
    • User (nur-lesend): Lesezugriff auf alle Maps, Automaps und Rotationen in der Installation
    • Guests: Lesezugriff auf alle Demo-Maps, Automaps und Rotationen

    Diese Standardrollen sollten für den Anfang ausreichen. Sie können diese Benutzer und Rollen löschen, aber denken Sie daran, dass Sie NICHT die letzte administrative Rolle bzw. den Benutzer löschen.

    Anpassen der Rollen

    Es ist möglich, neue Rollen anzulegen, um die Berechtigungen von Benutzern und Benutzergruppen anzupassen.

    Es ist z.B. einfach, eine Rolle für alle SAP-Administratoren anzulegen, die nur auf die SAP-relevanten Maps zugreifen können.

    Berechtigungen

    Die Berechtigungen sind in NagVis hartkodiert. Eine Berechtigung besteht aus drei Teilen:

    • Modul: Die verbundenen Module (Map, Automap, Rotation, ...)
    • Aktion: Die verbundene Aktion (view, edit, delete, ...)
    • Objekt: Das verbundene Objekt (ein bestimmter Benutzer, eine Map, ...)

    Jedes dieser drei Dinge kann durch einen dedizierten Namen oder alternativ durch ein Wildcard-Zeichen "*" gesetzt werden, das dann auf alle Module, Aktionen oder Objekts zutrifft.

    Hier ist eine Liste aller verfügbaren Berechtigungen:

    nagvis-1.7.10+dfsg1/docs/de_DE/automap.html000066400000000000000000000273101225466040700203240ustar00rootroot00000000000000nagvis_automap

    Automap

    Einleitung

    Die NagVis-Automap wurde mit NagVis-1.3 eingeführt. Die Hauptaufgabe dieses Features ist der Ersatz der eingebauten Map von Nagios. Das größte Problem der Nagios-Map ist die fehlende Skalierbarkeit. In großen Nagios-Installationen ist die Automap nicht nutzbar. Das liegt u.a. an fehlenden Konfigurationsoptionen wie z.B. der Selektion von bestimmten anzuzeigenden Elementen.

    NagVis behandelt die Objekte und definiert eine Konfiguration für Graphviz. Das Map-Bild und der HTML-Code für die Links werden von GraphViz erzeugt und an NagVis weitergeleitet.

    Voraussetzungen

    • GraphViz >= 2.14 für die Automap (niedrigere Versionen haben Probleme mit Truecolor-Unterstützung beim Rendering). Sie benötigen weitere Pakete wie gd, libpng und freetype, ... aber wenn Sie graphviz kompiliert/installiert haben, sollte es funktionieren.
    • Sie müssen Abhängigkeiten zwischen den einzelnen Hosts definieren. Hinweise finden Sie u.a. hier.

    Erster Aufruf

    Wenn Sie bisher keine Erfahrung mit der Automap haben, dann werfen Sie einen Blick auf die Demo-Automaps, die mit NagVis installiert werden (demo-automap und demo-automap2). Sie sollten in der Lage sein, diese Automaps direkt nach der NagVis-Installation über das "Öffnen"-Menü in der Kopfzeile zu öffnen. Wenn alles korrekt konfiguriert ist, sollten auf der Demonstrations-Map "demo-automap" der root-Host und drei Ebenen von Kind-Hosts angezeigt werden.

    Map-Konfiguration

    In der Vergangenheit wurden die Automaps durch spezielle Map-Konfigurationsdateien konfiguriert, die im Verzeichnis etc/automaps abgelegt waren, aber dies wurde mit NagVis 1.7 geändert. Die Automap-Konfigurationsdateien werden nun wie normale Map-Konfigurationen erzeugt (wie in Map-Konfigurationsdatei beschrieben. Um ab NagVis 1.7 eine Automap zu erzeugen, müssen Sie die Map-Source auf automap setzen. Um dies zu tun, müssen Sie im global-Abschnitt den sources-Parameter einfügen und ihm den Wert automap geben.

    Hauptkonfiguration

    Einige Parameter für die Automap können in der Hauptkonfiguration von NagVis gesetzt werden. Weitere Informationen finden Sie in der Beschreibung der Hauptkonfigurationsdatei.

    URL-Parameter

    Die Automap kann mit verschiedenen URL-Parametern aufgerufen werden. Seit NagVis 1.7 können diese Optionen in den global-Abschnitt der Map-Konfiguration eingetragen werden, damit sie persistent sind. Hier eine Liste aller verfügbarer Optionen:
    ModulAktionObjektBeschreibung
    ***Gewährt vollen Zugriff auf NagVis. Es werden keine weiteren Berechtigungen benötigt.
    Authlogout*Erlaubt einem Benutzer, sich aus NagVis abzumelden.
    AutoMapadd*Anlegen einer neuen Automap.
    AutoMapdelete*Löschen aller Automaps.
    AutoMapedit*Editieren aller Automaps.
    AutoMapview*Ansehen aller Automaps.
    AutoMapdelete<Name>Löschen einer bestimmten Automap.
    AutoMapedit<Name>Editieren einer bestimmten Automap.
    AutoMapview<Name>Ansehen einer bestimmten Automap.
    ChangePasswordchange*Erlaubt einem Benutzer, das eigene Passwort zu ändern.
    General**
    MainCfgedit*
    Mapadd*
    Mapdelete*
    Mapedit*
    Mapview*
    Mapdelete<Name>Löschen einer bestimmten Map.
    Mapedit<Name>Editieren einer bestimmten Map.
    Mapview<Name>Ansehen einer bestimmten Map.
    Overviewview*
    RoleMgmtmanage*
    Rotationview*
    Rotationview<Name>Ansehen einer bestimmten Rotation.
    Searchview*Suche Objekte auf Maps und Automaps.
    UserMgmtmanage*
    LR
    Parameter Default Beschreibung
    show Der Name der Automap. Seit NagVis 1.5 können verschiedene Automap-Konfigurationsdateien definiert werden. Die anzuzeigende Automap muss hier angegeben werden.
    backend_id backend default backend Die Backend-Id des Backends, dessen Objekte benutzt werden sollen. Einzelheiten finden Sie im [backend_*]-Abschnitt der Beschreibung der Hauptkonfigurationsdatei.
    root siehe root object definitionDies ist der Name des Root-Objektes. Es ist nicht notwendig, den Host hier zu setzen. Es gibt mehrere Wege, das Root-Objekt zu ermitteln. Einzelheiten finden Sie im Root-Objekt-Definition-Kapitel auf dieser Seite
    child_layers childLayers 2 maximale Anzahl von anzuzeigenden Ebenen abhängiger "Child"-Hosts.
    parent_layers parentLayers 0 maximale Anzahl von anzuzeigenden Ebenen darüber liegender "Parent"-Hosts.
    render_mode renderMode undirected Setzt den Render-Modus der Map. Einzelheiten finden Sie unter verfügbare Render-Modi
    width 1024 Breite der Automap in Pixeln
    height 786 Höhe der Automap in Pixeln
    ignore_hosts ignoreHosts none Kommaseparierte Liste von Hosts (einschließlich abhängiger Hosts), die nicht angezeigt werden sollen
    filter_by_state filterByState none Bei einem Wert von 1 ist der "Problem Automap"-Modus aktiviert. Dabei werden alle Zweige ausgefiltert, die nur Hosts im Status "UP" enthalten. Das resultiert in einer "Problem-Automap", die einen Baum zeigt, in dem in jedem Zweig mindestens einen Host mit einem Problem gibt
    filter_by_id Die angegebenen object_ids ausschließen; wird hauptsächlich intern genutzt (neu in 1.7).
    filter_group filterGroup none Geben Sie den Namen einer Hostgruppe an. Nur Hosts dieser Hostgruppe werden auf der Map angezeigt.
    search none Suche nach einem Map-Objekt während des Map-Ladens. Passende Objekte werden hervorgehoben.
    rankdir none Konfiguriert die Richtung von gerichteten Automaps, kann auf TB (Top/Bottom) oder LR (Links/Rechts) gesetzt werden (neu in 1.7).
    rotation none Rotieren der Map-Objekte im angegebenen Rotations-Pool
    header_menu enableHeader none Aktivieren/Deaktivieren des Header-Menüs durch 1 bzw. 0. Übersteuert die Konfiguration.
    hover_menu enableHover none Aktivieren/Deaktivieren des Hover-Menüs durch 1 bzw. 0. Übersteuert die Konfiguration.
    context_menu enableContext none Aktivieren/Deaktivieren des Context-Menüs durch 1 bzw. 0. Übersteuert die Konfiguration.
    margin none Setzt den freien Bereich am Rand des Automap-Graphen. Die Angabe erfolgt in Pixeln.
    overlap none Konfigurieren der Kollisionsbehandlung von Objekten (eine Erklärung der Werte finden Sie in der GraphViz-Dokumentation) ((neu in 1.7)

    Root-Objekt-Definition

    Die Vorgehensweise der Automap ist, beim Root-Objekt zu beginnen und den in Nagios definierten Abhängigkeitsbaum zu durchlaufen und die gefundenen Objekte auf der Map anzuzeigen.
    Es gibt mehrere Wege, um das Root-Objekt zu ermitteln:
    • URL-Parameter: das Root-Objekt kann durch den Parameter root gesetzt werden
    • Hauptkonfiguration: die defaultroot-Option kann im [automap]-Abschnitt gesetzt werden
    • automatische Erkennung: Das Backend nach einem Host ohne Eltern fragen. Das funktioniert allerdings nur, wenn es genau EINEN Host ohne Eltern gibt.
    Die obige Liste ist nach Priorität geordnet.

    Verfügbare Render-Modi

    Es gibt verschiedene verfügbare Render-Modi:
    Modus Beispiel-Bild
    directed
    undirected
    radial
    circular
    undirected2

    Automap-nach-Map-Export

    Seit NagVis 1.5 ist es möglich, die aktuelle Automap-Ansicht als normale NagVis-Map zu exportieren. Durch den Export erhalten Sie Vorteile aus beiden Ansichten.

    Sie können mit der Automap beginnen, um mit Hilfe der Automap-Render-Modi die Objekte auf Ihrer Automap zu positionieren. Sobald Sie fertig sind, exportieren Sie die Automap zusammen mit dem generierten Hintergrundbild in eine reguläre Map. Dazu benutzen Sie den Punkt "Export to map", den Sie im "Aktionen"-Menü Ihres Header-Menüs finden.

    Auf der exportierten Map können Sie - abhängig von Ihren Anforderungen - zusätzliche Design-Elemente platzieren oder das Layout anpassen.

    Eine Automap kann beliebig oft in die gleiche Ziel-Map exportiert werden (wodurch natürlich Ihre Anpassungen in der Ziel-Map überschrieben werden!). Sie können nur Maps überschreiben, wenn Sie die Berechtigung dazu haben.

    Eine normale Map kann nicht in eine Automap konvertiert werden.

    Host-URLs

    Die URLs von Host-Objekten werden zur Identifizierung der Objekte während des Renderns benutzt. Speziell der "host="-Parameter ist wichtig. Wenn dieser Parameter in der Host-URL fehlt, dann können die Objektpositionen nicht ermittelt werden.

    Normalerweise sollte diese Information nicht von Interesse für Sie sein. Wenn Sie aber die Host-URLs in Ihrer NagVis-Installation anpassen, dann ist es wichtig zu wissen, dass Ihre benutzerdefinierte URL den Parameter "host=" enthalten muss, der mit dem Hostnamen des Objekts zu füllen ist, damit die Hosts in der Automap benutzt werden können.

    nagvis-1.7.10+dfsg1/docs/de_DE/automap_config_format.html000066400000000000000000000315111225466040700232170ustar00rootroot00000000000000 Beschreibung des Automap-Konfigurationsformats

    Beschreibung des Automap-Konfigurationsformats

    Allgemeine Information

    Das NagVis-Automap-Konfigurationsformat gleicht dem Map-Konfigurationsformat mit kleinen Unterschieden bei den verfügbaren Parametern.

    Objekttypen

    Beschreibung der Objekttypen

    Global

    Die erste Definition in jeder Konfigurationsdatei sollte vom speziellen Typ "global" sein. Optionen in diesem Paragraph gelten für die gesamte Map und werden auf andere Typen vererbt, die nachfolgend definiert werden.

    Beispiel mit allen Optionen, die gesetzt werden müssen:

    define global {
        map_image=lan.png
        }
    WertDefaultBeschreibung
    aliasMap-NameDer Alias ist das Label für jede Map. Wenn definiert, wird es überall im NagVis-Frontend und WUI angezeigt
    backend_idvererbt (nagvis.ini.php)Die in der Hauptkonfigurationsdatei definierte Backend-ID, die angibt, wo NagVis nach Objektzuständen suchen soll. Wenn dieser Parameter nicht angegeben wird, wird das in der Hauptkonfigurationsdatei unter "defaultbackend" angegebene Backend benutzt.
    background_colorvererbt (nagvis.ini.php)Hintergrundfarbe dieser Map. Falls dieser Wert nicht gesetzt wird, wird die Hintergrundfarbe aus der Hauptkonfigurationsdatei genommen.
    context_menu vererbt (nagvis.ini.php) Aktivieren/deaktivieren des Kontext-Menüs auf Ihren Map-Objekten.
    context_templatevererbt (nagvis.ini.php)Default Context-Template, das auf dieser Map benutzt werden soll
    default_paramsvererbt (nagvis.ini.php)zu benutzende Default-Parameter, wenn keine per URL übergeben wurden. Das Format ist wie bei dem URL, z.B. &childLayers=2. Gültige Optionen finden Sie hier.
    event_backgroundvererbt (nagvis.ini.php)Aktivieren/deaktivieren der sich ändernden Hintergrundfarbe bei Statusänderungen (die konfigurierte Farbe wird angezeigt, wenn der Gesamtstatus PENDING, OK oder UP ist).
    event_highlightvererbt (nagvis.ini.php)Aktivieren/deaktivieren der Hervorhebung des sich ändernden Objekts durch eine blinkende Umrandung.
    event_highlight_durationvererbt (nagvis.ini.php)Setzt die Dauer der Hervorhebung in Millisekunden.
    event_highlight_intervalvererbt (nagvis.ini.php)Setzt die Dauer des Hervorhebungs-Intervalls in Millisekunden.
    event_logvererbt (nagvis.ini.php)Aktivieren/deaktivieren des Eventlogs im neuen JavaScript-Backend. Das Eventlog protokolliert wichtige Aktionen und Informationen.
    event_log_levelvererbt (nagvis.ini.php)Loglevel des Eventlogs (verfügbar: debug, info, warning, critical).
    event_log_heightvererbt (nagvis.ini.php)Höhe des JavaScript-Eventlogs in Pixeln.
    event_log_hiddenvererbt (nagvis.ini.php)Verstecken/zeigen des JavaScript-Eventlogs während des Map-Ladens.
    event_scrollvererbt (nagvis.ini.php)Aktivieren/deaktivieren des Fokussierens auf das Icon, das den Zustand verändert hat, wenn dieses außerhalb des sichtbaren Bereichs ist.
    event_soundvererbt (nagvis.ini.php)Aktivieren/deaktivieren von Sound-Signalen bei Statusänderungen.
    header_menuvererbt (nagvis.ini.php)aktivieren/deaktivieren des Header-Menüs
    header_templatevererbt (nagvis.ini.php)header template für diese Map
    hover_menuvererbt (nagvis.ini.php)aktivieren/deaktivieren von Hover-Menüs
    hover_delayvererbt (nagvis.ini.php)Verzögerung der Anzeige des Hover-Menus in Sekunden
    hover_templatevererbt (nagvis.ini.php)Default hover template für diese Map
    hover_childs_limitvererbt (nagvis.ini.php)max. Anzahl von Child-Objekten
    hover_childs_ordervererbt (nagvis.ini.php)Reihenfolge von Child-Objekten ("asc"=aufsteigend, "desc"=absteigend)
    hover_childs_showvererbt (nagvis.ini.php)Anzeigen von Child-Objekten in Hover-Menüs
    hover_childs_sortvererbt (nagvis.ini.php)Sortierreihenfolge von Child-Objekten ("s"=Status, "a"=Alphabet)
    iconsetvererbt (nagvis.ini.php)Iconset, das als Standard für alle auf der Map platzierten Objekte benutzt werden soll. Kann für jedes Objekt überschrieben werden.
    Im Beispiel wird "std_small" benutzt, was bedeutet, dass ein OK-Zustand das Icon "std_small_ok.png", benutzt, ein CRITICAL-Zustand "std_small_critical.png" usw.
    in_maintenance0aktiviert/deaktiviert den Wartungsmodus. Wenn eine Map im Wartungsmodus ist, wird statt der Map lediglich ein Hinweis angezeigt
    label_show0Labelanzeige für die Map-Objekte aktivieren/deaktivieren
    label_x-20x-Position der Label in Pixeln (mit Vorzeichen +/- relativ zur linken, oberen Ecke der Icons, sonst absolute Position)
    label_y+20y-Position der Label in Pixeln (mit Vorzeichen +/- relativ zur linken, oberen Ecke der Icons, sonst absolute Position)
    label_width auto Default-Breite der Label in Pixeln
    label_backgroundtransparentDefault-Hintergrundfarbe der Label. Die Farbe sollte als Hexcode angegeben werden, kann aber auch "transparent" sein.
    label_border#000000Default-Rahmenfarbe der Label. Die Farbe sollte als Hexcode angegeben werden, kann aber auch "transparent" sein.
    label_styleBenutzerdefiniertes Aussehen des Label-Textes im Format von HTML-Style-Attributen, z.B. font-family:sans;font-weight:bold;.
    line_arrowforward Dies definiert die Pfeile am Linienende. Bisher wird dieses Attribut nur für die Linien zwischen Hosts in der Automap benutzt. Mögliche Werte: forward, back, both, none.
    line_type Gibt den Linientyp an, wenn view_type=line. Gültige Werte sind:
    "11" für Linien mit einem Pfeil am Linienende.
    "10" für Linien mit zwei Pfeilen, die in der Linienmitte aufeinander zeigen.
    "12" für Linien ohne Pfeil(e).
    line_width3 Dies definiert die Linienbreite in px, wenn dieses Objekt als Linie angezeigt wird.
    only_hard_statesvererbt (nagvis.ini.php)Gibt an, ob Soft-Zustände ignoriert werden sollen. Default ist 0.
    recognize_servicesvererbt (nagvis.ini.php)Definiert, ob die Services des Hosts den angezeigten Status beeinflussen. Wenn auf "1" gesetzt, wird ein Service im Status CRITICAL auch den HOST als CRITICAL anzeigen. Wenn auf "0" gesetzt, wird nur der Host-Zustand (UP oder DOWN) angezeigt und der Status der Services ignoriert. Ist dieser Wert nicht in der Konfiguration angegeben, wird er auf 1 gesetzt.
    show_in_listsvererbt (nagvis.ini.php)Map-Anzeige in Listenformat (Dropdowns, Indexseite, ...)
    stylesheetvererbt (nagvis.ini.php)Dateiname des benutzerdefinierten Stylesheets zur Verwendung in den Maps. Die Datei muss im share/nagvis/style-Verzeichnis abgelegt sein.
    url_target _selfZiel des Icon-Links, diese Option passt <a target=""> an (_self ist das gleiche Fenster)
    nagvis-1.7.10+dfsg1/docs/de_DE/backend_nagiosbp.html000066400000000000000000000073571225466040700221400ustar00rootroot00000000000000 NagVis NagiosBP-Backend

    NagiosBP-Backend

    Das NagiosBP-Backend wird benutzt, NagVis direkt mit den Nagios Business Process-Addons zu verbinden, die verwendet werden, um aus den Nagios-Statusinformationen Geschäftsprozessaggregationen zu erstellen.

    Die NagiosBP-API

    NagiosBP bietet einen Web-Service, der durch HTTP-Get-Anfragen aufgerufen wird und mit JSON-Objekten antwortet. Die Dokumentation dieser JSON-API finden Sie hier.

    Darstellung in NagVis

    Dieses Backend ist besonders verglichen mit den anderen Backends, die Nagios-Statusinformationen 1:1 behandeln. Dieses Backend verarbeitet hauptsächlich Geschäftsprozesse, aber auch Nagios-Zustandsinformationen. Als Ergebnis dieser Tatsache muss das Backend eine Art von Übersetzung durchführen, um aus den Geschäftsprozessen Nagios-ähnliche Objekte zu erzeugen.

    Während der Entwicklung dieses Backends stellte sich heraus, dass die Geschäftsprozesse auf Servicegruppen-Objekte abgebildet werden sollten. Daraus ergeben sich zwei Dinge:

    • Jeder Geschäftsprozess resultiert in einer Servicegruppe
    • Das Backend liefert nur Servicegruppen-Objekte (die anderen Objekte müssen mit den anderen Backends direkt von Nagios geholt werden)

    Eine andere besondere Eigenschaft des NagiosBP-Backends besteht darin, dass NagVis nicht die Gesamt- (aggregierten) Zustände mit eigenen Algorithmen berechnen muss. Statt dessen setzt das NagiosBP-Backend die Zustände/Ausgaben der NagiosBP-Servicegruppen mit Hilfe der von NagiosBP gelieferten Zustandsinformationen.

    Die Servicegroup-Verweise (Links-Klick auf Icon) werden automatisch durch das NagiosBP-Backend gesetzt, um auf die NagiosBP-GUI zu zeigen, außer wenn der url-Parameter der Servicegruppe konfiguriert ist, um auf eine andere Map zu zeigen (z.B. [htmlbase]/index.php?mod=Map&act=view&show=bp-webshop-details).

    Konfiguration

    Sie können die folgenden Parameter benutzen, um das NagiosBP-Addon zu konfigurieren:

    WertDefaultBeschreibung
    base_url http://localhost/nagios/cgi-bin/nagios-bp.cgi Die vollständige URL zum nagios-bp.cgi-Script, das Teil von NagiosBP ist. Es bedient die AJAX-API, mit der sich das Backend verbindet. Diese URL muss von dem Host erreichbar sein, auf dem NagVis läuft.
    auth_user Optionaler Benutzer, der als Basic-Authentifizierungs-Benutzer benutzt werden soll, um auf die base_url zuzugreifen.
    auth_pass Optionales Passwort, das als Basic-Authentifizierungs-Passwort benutzt werden soll, um auf die base_url zuzugreifen.

    Es gibt auch einige allgemeine Parameter. Sie finden sie in der Formatbeschreibung der Hauptkonfigurationsdatei.

    nagvis-1.7.10+dfsg1/docs/de_DE/backends.html000066400000000000000000000035131225466040700204270ustar00rootroot00000000000000 Backends

    Backends

    Allgemeine Informationen

    Der NagVis-Code besteht aus mehreren Schichten. Eine dieser Schichten ist die "Daten-Schicht". Die Datenschicht wird benutzt, um Informationsanfragen von Dritten zu behandeln, wie z.B. Nagios NDO. Wir nennen diese Schicht im Allgemeinen "Backend". Innerhalb von NagVis gibt es einige Komponenten, um diese Backends zu verwalten und sie dienen als "Kleber" zwischen den einzelnen Backends und den anderen Schichten.

    Default-Backend

    Zur Zeit werden mit dem NagVis-Kern drei Backends ausgeliefert: das mklivestatus, ndomy und merlinmy Backend. Alle Backends werden im Folgenden genauer beschrieben.
    Das ndomy-Backend ist das Default-Backend von NagVis 1.0 bis NagVis 1.4.x. Es holt Nagios-Informationen aus der NDO-MySQL-Datenbank. Seit NagVis 1.5 ist MKLivestatus das Default-Backend.

    Backend-Typen

    Konfigurieren von Backends

    Die Backends werden in der Hauptkonfigurationsdatei definiert. Schauen Sie in die Formatbeschreibung der Hauptkonfigurationsdatei, wie Backends definiert werden.

    nagvis-1.7.10+dfsg1/docs/de_DE/changelog.html000066400000000000000000000011271225466040700206030ustar00rootroot00000000000000 Changelog

    Changelog

    Die aktuellen Änderungen finden Sie im NagVis Change Tracker. Das Tracking-System "trac" wird von sourceforge.net zur Verfügung gestellt.

    Alle Änderungseinträge finden Sie hier.

    nagvis-1.7.10+dfsg1/docs/de_DE/changelog2.html000066400000000000000000000035341225466040700206710ustar00rootroot00000000000000 Changelog

    Changelog

    Subversion - aktuelle Entwicklung

    Allgemein

    • Speedometer Gadget: Critical/Warning-Bereich korrigiert, wenn kein Max-Wert in den Performance-Daten angegeben wurde
    • verbesserte JavaScript-Fehlerbehandlung: Protokollierung und Popup-Meldung hinzugefügt, um JavaScript-Fehler zu behandeln
    • Berechtigungsproblemerkennung in ndo2fs-Dateien verbessert
    • Bugfix: Problem bei der Anzeige eines Hosts ohne Services auf der Automap bei der Nutzung von ndo2fs korrigiert
    • Bugfix: Fehlendes Objekt-Highlighting im Internet-Explorer korrigiert

    Installer

    • Bugfix: Ausschließen von Dateien beim Kopieren von Dateien im Installer funktioniert wieder

    Automap

    • Die Automap kann nun mit index.php?automap= aufgerufen werden, um verschiedene Automap-Konfigurationen für unterschiedliche Ansichten zu benutzen
    • Automap-Konfigurationsdateien vom maps-Verzeichnis in separates etc/automaps-Verzeichnis verlagert
    • Automaps werden nun auf der Übersichtsseite nun separat angezeigt
    • Es gibt nun eine Option zum (De)aktivieren der Automap-Liste auf der Übersichtsseite
    NagVis 1.5 Code startete mit NagVis 1.4.1 Code. nagvis-1.7.10+dfsg1/docs/de_DE/context_templates.html000066400000000000000000000160371225466040700224240ustar00rootroot00000000000000 Kontext-Templates

    Kontext-Templates

    Einleitung

    Kontext-Templates sind HTML-Dateien, die u.a. Makros enthalten. Dieses Dateien können als Kontextmenüs ("Rechtsklick"-Menüs) für die Objekte auf der Map benutzt werden.

    Die Kontextmenüs befinden sich in share/userfiles/templates/ relativ zum NagVis-Root-Verzeichnis. Die Templates sind wie folgt benannt: <name>.context.html. Es ist möglich, eine CSS-Datei zum Template hinzuzufügen, der Name lautet dann: <name>.context.css.

    Es gibt einige sogenannte Makros in Kontextmenüs, die für alle Objekte verfügbar sind, und einige, die nur für spezielle Makros gelten. Alle Standardmakros sind nachfolgend aufgeführt.

    Allgemeines

    Die folgenden Makros sind in Hover-Menüs für alle Objekttypen verfügbar:

    Makro Beschreibung
    Allgemein
    [obj_id]ID des Objekts in JavaScript. Wird benötigt, um die objektspezifischen Teile zu lokalisieren, z.B. für eine manuelle Aktualisierung einer Statusinformation.
    [type]Typ des Objekts
    [name]Name des Objekts (Hostname, Hostgroupname, Servicegroupname, Mapname,...)
    [backend_id]Die backend_id des verwendeten Backends dieses Objekts.
    [custom_1]Das erste benutzerdefinierte Makro je Backend. Kann nützlich sein, um Backend-spezifische URLs zu setzen.
    [custom_2]Zweites benutzerdefiniertes Makro je Backend (s.o.).
    [custom_3]Drittes benutzerdefiniertes Makro je Backend (s.o.).
    [map_name]Name der aktuellen Map/Automap.
    Sprachmakros
    [lang_refresh_status]Bezeichnung für die Auffrischung des Zustands des Objekts im Frontend.
    [lang_schedule_downtime]Bezeichnung für die Planung einer Ausfallzeit in Nagios.
    [lang_reschedule_next_check]Bezeichnung für die erneute Planung der nächsten Prüfung des Objekts in Nagios.
    [lang_connect_by_ssh]Label für die Verbindung eines Hosts per ssh.
    Pfade
    [html_base]Absolute URL zur HTML-Basis (Default: /nagios/nagvis)
    [html_cgi]Absolute URL zu den Nagios-CGIs. Benutzt einen objektabhängigen Wert. Hängt vom verwendeten Backend ab. Wird kein backend-spezifischer Wert gesetzt, gilt der Default. (Default: /nagios/cgi-bin)
    [html_templates] Pfad zum Context-Templates-Verzeichnis (Default: /nagios/nagvis/nagvis/etc/templates/context)
    [html_template_images] Pfad zum Context-Template-Images-Verzeichnis (Default: /nagios/nagvis/nagvis/images/templates/context)

    Spezielle Makros

    Es gibt Makros für Context-Templates eines bestimmten Typs. Diese Makros sollten zwischen "Section"-Makros stehen. Die "Section"-Makros definieren, dass der eingeschlossene Code entfernt wird, wenn das Hover-Template nicht für diesen Typ geparst wird.

    Ein "Section"-Makro für Host-Makros sieht wie folgt aus:

    <!-- BEGIN host -->.+?<!-- END host -->

    Nachfolgend finden Sie eine vollständige Liste der speziellen Makros.

    Host-Objekte

    MakroBeschreibung
    [address]Adresse des in Nagios konfigurierten Hosts
    [pnp_hostname]Hostname für Links zu PNP (Leerzeichen ersetzt)

    Service-Objekte

    MakroBeschreibung
    [service_description]Service-Beschreibung in Nagios
    [pnp_service_description]Service-Beschreibung für Links zu PNP (Leerzeichen ersetzt)

    Host- und Servicegroup-Objekte

    Die Abschnittsmakros <!-- BEGIN hostgroup --> und <!-- BEGIN servicegroup --> existieren, um speziellen Template-Code für Hostgroup- und Servicegroup-Kontextmenüs zu ermöglichen. Beide bringen keine speziellen objektspezifischen Makros mit sich.

    Andere Abschnittsmakros

    Es gibt einige andere spezielle Abschnittsmakros. Um bspw. Teile des Templates nur für Line-Objekts zu zeigen:

    <!-- BEGIN line -->This is only shown on line objects<!-- BEGIN servicegroup -->
    AbschnittBeschreibung
    lineDies nur für Line-Objekte zeigen.
    statefulDies nur für "stateful"-Objekte zeigen.
    not_automapDies nur für nicht-Automap-Ansichten zeigen (reguläre Maps).
    lockedDies nur für gesperrte Objekte zeigen.
    unlockedDies nur für nicht gesperrte Objekte zeigen.
    permitted_editNur zeigen, wenn der Benutzer die Map editieren darf.
    nagvis-1.7.10+dfsg1/docs/de_DE/extending/000077500000000000000000000000001225466040700177525ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/docs/de_DE/extending/custom_context_actions.html000066400000000000000000000125161225466040700254430ustar00rootroot00000000000000 Eigene Kontext-Menü-Aktionen

    Eigene Kontext-Menü-Aktionen

    Einleitung

    NagVis 1.4 bringt ein neues mächtiges Feature namens Kontext-Menüs. Dies sind grundsätzlich Rechtsklick-Menüs bei Status-Icons. Sie können diese Menüs durch Editieren von Template-Dateien anpassen. Diese Template-Dateien sind einfache HTML-Dateien mit einigen Makros, die während des Renderns im NagVis ersetzt werden.

    Die Kontext-Menüs geben Ihnen die Möglichkeit, Ihre administrative Arbeitsweise mit den Überwachungsinformationen dramatisch zu verbessern. Stellen Sie sich vor, Sie haben eine NagVis-Map als das primäre Benutzer-Interface, um Statusinformationen über Ihre Systeme zu sammeln oder sogar als Basis zur Kontrolle Ihrer Systeme. Stellen Sie sich vor, Sie können Statusinformationen über NagVis ansehen und sich mit zwei einfachen Klicks per ssh oder über eine Terminal-Session mit dem problematischen System verbinden. Es ist auch möglich, einige Standard-Wiederherstellungsjobs in Scripts zu speichern oder ähnliches.

    Werfen Sie einen Blick in diese Anleitung, um einen Eindruck über die Mächtigkeit dieses neuen Features zu bekommen.

     

    Kurzes How-To

    Dies ist ein kurzes How-To, um eine "connect by ssh"-Option zu den NagVis-Host-Kontext-Menüs hinzuzufügen. Die meisten der Änderungen müssen beim Client-Browser durchgeführt werden, damit mit dieser SSH-Verbindungen umgehen kann. In dieser Anleitung benutze ich den Firefox-Browser auf Ubuntu. Es ist kein Problem, diese Dinge auch auf anderen Systemen wie z.B. Windows zum Laufen zu bringen.

    1. Lesen Sie die Grundlagen zu Kontext-Templates

    Die Grundlagen zu Kontext-Templates sind hier beschrieben. Bitte lesen Sie sie, bevor Sie fortfahren.

    2. Erstellen eines eigenen Kontext-Templates

    Kopieren Sie einfach das Default-Context-Template:
    cd /usr/local/nagvis
    cp share/userfiles/templates/default.context.html share/userfiles/templates/default-ssh.context.html
    Nun fügen Sie eine Zeile zum Host-spezifischen Makroabschnitt hinzu
    <li><a href="ssh://[address]">[lang_connect_by_ssh]</a></li>
    Das Template ist fertig.

    3. Konfigurieren Sie den Host, damit das neue Template benutzt wird

    Setzen Sie die Option, um das neue Template namens default-ssh zu nutzen:
    context_menu=true
    context_template=default-ssh
    Sie können diese Option im global-Abschnitt einer Map setzen, in einem Host-Objekt oder sogar ein Template, das in einem Host-Objekt benutzt wird.

    4. Konfigurieren Sie Ihren Client, um ssh://-URIs verarbeiten zu können

    In diesem Fall konfiguriere ich Firefox auf Ubuntu-Linux. Dies mag von Ihrem System abweichen. Öffnen Sie about:config im Firefox. Fügen Sie einige neue Optionen hinzu:
    Name: network.protocol-handler.app.ssh
    Type: String
    Value: /usr/local/bin/ssh-connect-handler
    Name: network.protocol-handler.expose.ssh
    Type: Boolean
    Value: true
    Name: network.protocol-handler.external.ssh
    Type: Boolean
    Value: true
    Name: network.protocol-handler.warn-external.ssh
    Type: Boolean
    Value: false

    5. Erstellen eines Handler-Scripts

    Erstellen Sie das Script im angegebenen Script-Pfad. In meinem Fall ist es /usr/local/bin/ssh-connect-handler.
    #!/bin/bash
    xterm -e ssh ${1#ssh:\/\/*}
    Sie müssen das Script ausführbar machen.
    chmod +x /usr/local/bin/ssh-connect-handler

    6. Testen des Handler-Scripts

    Geben Sie einfach ssh://<test-host> in Ihre Browser-Zeile ein und drücken Enter. Wenn sich ein xterm mit der ssh-Session öffnet, ist alles OK hier.

    7. Testen von Kontext-Links

    Nun öffnen Sie die Map, die Sie für die Nutzung des neuen Kontext-Templates konfiguriert haben. Dann rechtsklicken Sie den konfigurierten Host und klicken Sie den Menü-Eintrag "Connect by ssh". Ein Terminal-Fenster sollte sich öffnen.

    Ausblick

    Mit diesem Wissen sind Sie bereit, NagVis als Kern Ihrer täglichen Administratiions- und Überwachungs-Aufgaben zu konfigurieren. Seien Sie kreativ!

    Wir freuen uns auf Ihr Feedback zu diesem Feature und wie Sie es nutzen.

    nagvis-1.7.10+dfsg1/docs/de_DE/extending/iconsets.html000066400000000000000000000073721225466040700225000ustar00rootroot00000000000000 iconsets

    Eigene Iconsets hinzufügen

    Beispiel

    Ihr Chef kommt herein und erzählt Ihnen, dass ein Techniker eine übersichtliche Map mit mehr als 250 Hosts benötigt. Sie denken: "Hey, das ist unmöglich bei einer vollständigen Beschreibung für jeden Host." Die Schriftgröße des Hintergrundbildes ist nicht das Problem, aber der std_small-Iconset von NagVis ist zu groß für solch eine Anforderung.

    Lösung

    Erstellen Sie Ihr eigenes Iconset.

    Was ist ein Iconset?

    Ein vollständiges Iconset besteht aus elf Dateien. Diese Dateien sind PNG-Bilder, die folgendermaßen heißen müssen:

    Dateiname Beschreibung
    <set>_ack.png bestätigtes Problem (acknowledged)
    <set>_critical.png kritischer Zustand (critical)
    <set>_down.png Down-Zustand (Host)
    <set>_downtime.png Ausfallzeit (Host)
    <set>_error.png Fehler beim Holen des Zustands
    <set>_ok.png OK-Status
    <set>_pending.png Pending-Zustand
    <set>_sack.png bestätigtes Problem (Service)
    <set>_sdowntime.png Ausfallzeit (Service)
    <set>_unchecked.png ungeprüfter Zustand (Pending)
    <set>_unknown.png unbekannter Zustand (unknown)
    <set>_unreachable.png unerreichbarer Zustand (Host)
    <set>_up.png Up-Zustand (Host)
    <set>_warning.png Warning-Zustand

    NagVis sucht nach <set>_ok.png-Bildern, um die Iconsets aufzulisten. Das heißt, dass ein <set>_ok.png-Bild vorhanden sein muss, damit man ein komplettes Iconset über die WUI auswählen kann.

    Welches Programm soll ich benutzen, um ein Iconset zu erstellen?

    Fast jedes Grafikprogramm ist in der Lage, PNG-Dateien zu erstellen. In diesem Beispiel wird Photoshop(TM) benutzt, um eine kleinere Version des std_small-Iconsets namens std_mini zu erstellen.

    Die folgenden Dateien sollten erstellt werden, um ein Iconset zu erhalten

    Iconset Icon-Größe Icon-Map
    std_small 16x16 pixel
    mini 9x9 pixel

    Implementieren des Iconsets

    Um das Iconset in Ihrer NagVis-Installation zu nutzen, kopieren Sie alle Dateien in den iconset-Ordner (share/userfiles/images/iconsets).

    Der Test

    öffnen Sie eine Ihrer Maps und fügen Sie ein neues Host-Icon hinzu. Sie sollten nun in der Lage sein, std_mini als Iconset auszuwählen.
    nagvis-1.7.10+dfsg1/docs/de_DE/extending/languages.html000066400000000000000000000057661225466040700226240ustar00rootroot00000000000000 Sprachdatei-Format

    Sprachdatei-Format

    Allgemeines

    Mit NagVis 1.4 ist das Sprachformat von XML-Dateien ins gettext-Sprachformat geändert worden. Die alten XML-Dateien bedeuteten eine Menge Overhead und verbrauchten viel CPU-Zeit beim Parsen.
    Der Hauptvorteil besteht in viel besserer Performance. Mehr Informationen zu gettext finden Sie auf der offiziellen gettext-Seite.

    Die Sprachdateien werden in nagvis/includes/locale abgelegt.
    Die deutsche Sprachdatei ist de_DE/LC_MESSAGES/nagvis.mo.

    Die Dateien mit .po-Dateierweiterung sind die Sourcen, die zu .mo-Dateien umgewandelt werden müssen.

    Im Moment gibt es Sprachdateien für die folgenden Sprachen:

    • Englisch
    • Deutsch
    • Französisch
    • Spanisch
    • brasilianisches Portugiesisch

    Erzeugen Sie Ihre eigene...

    Ihre Sprache wird von NagVis nicht unterstützt? Kein Problem! Sie können einfach Ihre eigene Sprachdatei erstellen. Kopieren Sie eine bestehende Datei, benennen Sie sie um und passen Sie alle Werte an, die Sie ändern möchten.

    Wenn Sie eine neue Sprachdatei erstellt oder etwas in einer bestehenden korrigiert haben, dann schicken Sie diese bitte an uns, so dass wir sie in die nächste NagVis-Version einbauen oder auf Nagvis.org veröffentlichen können.

    Makros

    Es gibt Unterstützung für die Ersetzung von vorgegebenen Zeichenketten durch einige Werte.

    Ein Beispiel für ein Makro ist die Zeichenkette ([USER]), die vor der Anzeige in NagVis ersetzt wird, wenn der Spracheintrag dies unterstützt.

    Default-Makros

    Default-Makros sind so etwas wie HTML-Tags, die nicht durch den Benutzer definiert werden müssen. Zur Zeit werden die folgenden Default-Makros unterstützt:

    Makro ersetzt durch
    [i] <i>
    [/i] </i>
    [b] <b>
    [/b] </b>

    Spezielle Zeichen

    Spezielle Zeichen wie ä,ö,ü,",',... müssen als HTML-Entities geschrieben werden (z.B. &nbsp;)

    nagvis-1.7.10+dfsg1/docs/de_DE/extending/shapes.html000066400000000000000000000027021225466040700221240ustar00rootroot00000000000000 shapes

    Eigene Shapes hinzufügen

    Seit NagVis 1.x können Sie "zustandslose Icons" in Ihren Maps benutzen, wir nennen sie shapes. Diese Icons sind genauso wie die anderen Icons, sie haben lediglich keinen Zustand.

    Was ist ein shape?

    Ein shape ist nichts anderes als ein simples Bild. Wir empfehlen, Bilder im PNG-Format für die shapes zu benutzen.

    Welches Programm soll ich zur Erstellung von shapes benutzen?

    Fast jedes Grafikprogramm ist in der Lage, PNG-Dateien zu erstellen.

    Shapes implementieren

    Die shapes werden in nagvis/images/shapes abgelegt. Kopieren Sie sie einfach in dieses Verzeichnis und dann können sie in Ihren Maps benutzt werden.

    Der Test

    öffnen Sie eine Ihrer Maps und fügen Sie ein neues shape-Icon hinzu. Sie sollten nun in der Lage sein, Ihre eigenen shapes auszuwählen. nagvis-1.7.10+dfsg1/docs/de_DE/extending/templates.html000066400000000000000000000044641225466040700226460ustar00rootroot00000000000000 Templates

    Templates installieren

    Seit NagVis 1.1x können Sie Templates hinzufügen, um das Aussehen von Header- und Hover-Menüs anpassen zu können. Einige dieser Templates erhalten Sie auf der NagVis template download-Seite.

    Hinweis: Die Verzeichnisstruktur hat sich zwischen den NagVis-Versionen mehrfach geändert, so dass es Kompatibilitätsprobleme geben kann.

    Templates entpacken

    Entpacken Sie NagVis-Templates in einem Verzeichnis Ihrer Wahl
    tar xvzf NagVis-Template-<name>-<version>.tar.gz

    NagVis-Template installieren

    Mischen Sie den NagVis-Template-Verzeichnisbaum mit Ihrem NagVis-Ordner (Default /usr/local/nagvis/share/userfiles/templates).
    cp -r nagvis /usr/local/nagvis/share/userfiles/templates

    Konfigurieren

    Nun sollten Sie das neue Template nutzen können. Sie müssen nur die Maps oder Objekte so konfigurieren, dass sie das Template nutzen.

    Header-Templates

    Sie können das Header-Template in der Hauptkonfiguration von NagVis oder im global-Abschnitt der Map-Konfiguration setzen. Details finden Sie in der Map-Konfigurationsformatbeschreibung.

    Hover-Templates

    Sie können das Hover-Template in der Hauptkonfiguration für all Ihre Maps setzen, im global-Abschnitt einer Map für alle Objekte auf dieser Map oder in jedem Objekt, um ein angepasstes Menü für spezielle Objekte zu erhalten. Details finden Sie in der Map-Konfigurationsformatbeschreibung.

    nagvis-1.7.10+dfsg1/docs/de_DE/gadgets.html000066400000000000000000000254231225466040700202770ustar00rootroot00000000000000 Gadgets

    Gadgets

    Allgemeine Informationen

    "Gadgets" sind kleine Programme, die Bilder aus Informationen erzeugen, die von NagVis geliefert werden. Die Hauptidee besteht darin, die Performance-Daten von Nagios an diese Programme zu liefern, um daraus nette Grafiken oder schicke Tachos, Thermometer oder ähnliches zu machen.
    share/userfiles/gadgets enthält einige Beispiele, andere finden Sie unter Nagvis Exchange[1].

    Die Gadgets können in jeder Sprache geschrieben werden, die von Ihrem Webserver interpretiert wird, wie z.B. PHP, Perl, ...

    Gadgets werden nur für Services unterstützt. Ein Objekt kann in ein Gadget verwandelt werden, indem Sie view_type="gadget" und eine gültige gadget_url setzen.

    NagVis unterstützt Gadgets ab Version 1.4[1].

    Seit NagVis 1.6 &oum;nnen die Gadgets nicht nur Bilder rendern. Als neue Option können die Gadgets HTML-Code rendern, der auch JavaScript oder jede Art von dynamischem HTML-Code enthalten kann. Um die Benutzung von HTML zu aktivieren muss die Option gadget_type auf den Wert "html" gesetzt werden.

    NagVis 1.4 std_speedometer gadget with label and hover menu

     NagVis 1.4 std_speedometer-Gadget auf einer Test-Map mit aktiviertem Label.

    Parameter

    Die Gadgets bekommen ihre Informationen durch einen HTTP-Get-Aufruf von NagVis (wenn Sie share/userfiles/gadgets/gadget_core.php einbinden, werden zwei Arrays gefüllt. Mehr Informationen finden Sie in der (englischen) Beschreibung dort).

    Die folgenden Parameter werden an die Gadgets geliefert:

    Parameter Beispielwert Beschreibung Variable
    name1 localhost Der Name des Hosts $aOpts['name1']
    name2 Current Load Die Service-Beschreibung des Objekts $aOpts['name2']
    scale 100 Die Größe des Gadgets (in Prozent) $aOpts['scale']
    state OK Die Zeichenkette, die den aktuellen Status beschreibt (OK, WARNING, CRITICAL, UNKNOWN) $aOpts['state']
    stateType HARD Der Typ des aktuelles Status. Kann HARD oder SOFT sein $aOpts['stateType']
    ack 0 Wird auf 1 gesetzt, wenn der Status des entsprechenden Objekts bestätigt wurde $aOpts['ack']
    downtime 0 Wird auf 1 gesetzt, wenn sich das entsprechende Objekt in einer Ausfallzeit (Downtime) befindet $aOpts['downtime']
    perfdata load1=0.960;5.000;10.000;0; load5=0.570;4.000;6.000;0; load15=0.540;3.000;4.000;0; Die aktuellen Performance-Daten, die von Nagios geliefert werden. Es ist wichtig, gültige Performance-Daten zu haben! $aPerfdata[<index>][<tag>]

    Ein gültiger HTTP-get zum std_speedometer.php sieht wie folgt aus:

    std_speedometer.php?name1=localhost&name2=Current%20Load&state=OK&stateType=HARD&perfdata=load1=0.450;5.000;10.000;0;%20load5=0.260;4.000;6.000;0;%20load15=0.750;3.000;4.000;0;

    wie ist es zu konfigurieren?

    Bitte prüfen Sie die Parameter view_type, gadget_url und gadget_opts des Service-Objekts in der Formatbeschreibung der Map-Konfiguration. Hier eine Beispiel-Definition in Ihrer Map-Datei:

    define service {
       host_name=localhost
       service_description=root-volume
       x=50
       y=50
       view_type=gadget
       gadget_url=std_bar.php     // name of the file in share/userfiles/gadgets/
       // gadget_url=[http://localhost/nagvis/userfiles/gadgets/std_bar.php]     // valid as well
       // gadget_scale=200        // default is 100 (percent)
       // gadget_opts=columns=3 label=1    // gadget dependent
    }

    wie man ein eigenes Gadget anlegt

    Mit Hilfe des Codes in gadgets_core.php werden zwei Arrays gefüllt. $aPerfdata enthält die Performance-Daten. $aOpts enthält die Optionen, die in gadget_opts gesetzt werden.

    Das Einfachste ist, einen Blick auf std_speedometer zu werfen und die Kernbestandteile von dort anzupassen.

    Sie sollten einen Beispiel-Performance-Daten-String in den Gadget-Code einfügen, indem Sie die Variable $sDummyPerfdata nutzen. Dies erlaubt es, das Gadget mit Dummy-Daten in der WUI anzuzeigen. Es ist viel einfacher, die Maps zu erstellen, wenn die Gadgets dort angezeigt werden. Wichtig: die Variable muss gesetzt werden, bevor gadgets_core.php über den include-Befehl geladen wird.

    Ein zweites Beispiel finden Sie in std_speedometer2.php. Im Gegensatz zu std_speedometer unterstützt es auch check_multi-Ausgaben. Verschiedene Optionen beeinflussen das Verhalten des Gadgets:
    ParameterBeispielwertBeschreibung
    label11 = Anzeige von Host-Name / Service-Beschreibung in der linken oberen Ecke des Graphen; 0 = Informationen nicht anzeigen (Default)
    current11 = Anzeige des aktuellen Performance-Daten-Wertes (Default); 0 = Informationen nicht anzeigen
    columns5Graphen können in Spalten angezeigt werden. Die Zahl der Zeilen wird anhand der maximalen Anzahl von Performance-Daten-Elementen ermittelt. Default ist 3
    stringpctDas Performance-Daten-Label muss die Zeichenkette enthalten, damit der Graph angezeigt wird. Im Falle von check_multi-Ausgaben wird nur der letzte Teil untersucht. Default ist eine leere Zeichenkette
    NagVis 1.5 std_speedometer2-Gadget

     NagVis 1.5 std_speedometer2-Gadget im normalen, warnenden und kritischen Zustand

    Ein drittes Beispiel basiert auf einer Idee auf Nagvis Exchange. Performance-Daten werden als horizontaler Balken dargestellt. Das letzte Viertel des Graphs wechselt auf gelb oder rot, wenn die Performance-Daten WARNING oder CRITICAL andeuten. Der Status ist nicht der Zustand des Service! Das liegt daran, dass die Daten ggf. mehrere Datenreihen enthalten. In vielen Fällen sind nicht alle Datenreihen eines Service WARNING oder CRITICAL, so dass Sie sonst falsche Alarme bekommen würden (neu in 1.5.7 oder git neuer als 2010.12.12).

    ParameterBeispielwertBeschreibung
    label11 = Anzeige von Host-Name / Service-Beschreibung im letzten Viertel des Graphen (Default); 0 = Informationen nicht anzeigen
    current11 = Anzeigen der aktuellen Performance-Daten (Default); 0 = Informationen nicht anzeigen
    columns5Graphen können in Spalten angezeigt werden. Die Zahl der Zeilen wird anhand der maximalen Anzahl von Performance-Daten-Elementen ermittelt. Default ist 3
    stringpctDas Performance-Daten-Label muss die Zeichenkette enthalten, damit der Graph angezeigt wird. Im Falle von check_multi-Ausgaben wird nur der letzte Teil untersucht. Default ist eine leere Zeichenkette
    thresholdvalueLegt fest, ob die WARNING- und CRITICAL-Schwellwerte in Prozent (Default) oder als Zahlenwert angezeigt werden
    NagVis 1.5 std_bar-Gadget

     NagVis 1.5 std_bar-Gadget im normalen, warnenden und kritischen Zustand

    Anmerkung: Dieses Gadget benutzt einen TrueType-Font, dessen Position und Name hartkodiert ist (Variablen $fontDir und $fontName). Wird die Datei nicht gefunden, dann wird ein eingebauter Font benutzt. Der Wert von $fontDir wechselt zwischen den Distributionen. Falls der Font nicht korrekt skaliert, dann prüfen Sie bitte die Einstellung (sie ist korrekt für OpenSuSE, andere Einstellungen sind auskommentiert).

    [1] Die Verzeichnisstruktur hat sich zwischen NagVis 1.4.x und NagVis 1.5 geändert. Gadgets wurden in nagvis/nagvis/gadgets abgelegt und werden nun in share/userfiles/gadgets gespeichert. Gadgets von NagVis Exchange benutzen möglicherweise die alte Struktur, so dass Sie die Dateien ggf. an die neue Stelle kopieren müssen (z.B. cp -pr <Quelle>/nagvis/nagvis/gadgets/<Gadget> <Ziel>/share/userfiles/gadgets/). nagvis-1.7.10+dfsg1/docs/de_DE/geomap.html000066400000000000000000000162061225466040700201300ustar00rootroot00000000000000 NagVis-Geomap

    NagVis-Geomap

    Einleitung

    Die NagVis-Geomap-Map-Source wurde in NagVis 1.7 eingeführt. Sie wurde entwickelt, um ohne viel Arbeit sauber gerenderte und skalierte Übersichts-Maps zu erhalten.

    Die Geomap rendert verschiedene Hosts auf einer von Open Street Map als Hintergrundbild zur Verfügung gestellten Karte.

    Für die aktuelle Geomap benötigen Sie lediglich eine CSV-Datei, die NagVis die Hosts und die Geo-Koordinaten für die zu platzierenden Objekte angibt.

    Voraussetzungen

    Es ist keine spezielle Software auf dem NagVis-Host erforderlich. Allerdings gibt es eine besondere Anforderung. Um dieses Feature nutzen zu können benötigt NagVis Zugriff auf den Host geomap.nagvis.org via port 80. NagVis benutzt eine simple HTTP-basierte API, um das Map-Image und die Koordinaten dieses Images zu erhalten.

    In den meisten Fällen hat der NagVis-Host keinen direkten Internet-Zugriff. Sie können die http_proxy Option im [global]-Abschnitt Ihrer NagVis-Hauptkonfigurationsdatei (nagvis.ini.php) verwenden, um NagVis anzuweisen, einen Proxy für solche Anfragen zu benutzen. Die meisten Proxies erfordern eine Authentifizierung, um den Zugang zum Internet zu kontrollieren. Mit der Option http_proxy_auth können die Zugangsdaten gesetzt werden.

    Der erste Aufruf

    NagVis wird mit einer Demo-Geomap namens "demo-geomap" ausgeliefert. Wenn Ihr NagVis korrekt konfiguriert ist, sollten Sie eine Karte von Deutschland mit zwei Knoten sehen. Ein Knoten zeigt den Host "ham-srv1" in Hamburg. Der andere Knoten "muc-srv1" steht in München.

    Die Geomap wird definiert mit Hilfe der Map-Konfigurationsdatei "demo-geomap.cfg". Der Inhalt sieht ungefähr so aus:

    global {
        sources=geomap
        alias=Demo: 4 Geomap
        parent_map=demo-overview
        iconset=std_medium
        backend_id=demo
        # Geomap Parameters
        source_type=csv
        source_file=demo-locations
        width=800
        height=600
    }

    Die Zeile sources=geomap bewirkt, dass die geomap-Source benutzt werden soll, um die Map-Konfiguration zu ändern. Die Zeile source_type=csv (neu in 1.7.4) weist den geomap-Code an, die CSV-Datei zu lesen, die in source_file=demo-locations angegeben und im Verzeichnis etc/geomap abgelegt ist, um mit einer Liste von Hosts und Koordinaten eine Geomap zu füllen.

    Die Datei demo-locations.csv enthält die folgenden zwei Zeilen:

    ham-srv1;Hamburg Server 1;53.556866;9.994622
    muc-srv1;Munich Server1;48.1448353;11.5580067

    Jede Zeile definiert einen Host, der zur Map hinzugefügt werden soll. Die Spalten werden durch ;-Zeichen getrennt. Die ersten Spalte enthält den Host-Namen, die zweite einen optionalen Alias, die dritte die LAT-Koordinate (Breitengrad) und die vierte die LONG-Koordinate (Längengrad).

    (Ab Git-Version vom 21.03.2013): Zeilen, die mit den üblichen Kommentarzeichen beginnen (;, # oder //), werden als Kommentar behandelt.

    Neu in 1.7.4: Es ist auch möglich, source_type=backend zu setzen, um das per backend_id eingestellte Backend für die Ermittlung der anzuzeigenden Hosts und ihrer Koordinaten zu nutzen. Das ist nur möglich, wenn das livestatus-Backend genutzt wird. Es holt alle Hosts, bei denen die benutzerdefinierten Objektvariablen _LAT und _LONG konfiguriert sind. Es ist möglich, die ermittelten Hosts durch Angabe der Option filter_group auf die Mitgliedschaft der angegebenen Host-Gruppe einzugrenzen.

    Konfigurieren von Geomaps

    Die Geomap-Source benutzt Anzeigeparameter zur Konfiguration. Für Einzelheiten werfen Sie einen Blick auf den "Ansicht ändern"-Dialog, der im Header-Menü über "Aktionen -> Ansicht ändern" geöffnet werden kann.

    Die Anzeigeparameter können auch als Map-Konfigurationsattribute im global-Abschnitt der Maps angegeben werden.

    ParameterDefaultBeschreibung
    geomap_type mapnik Definiert den Render-Modus der Geomap. Gültige Werte sind: osmarender, mapnik oder cycle.
    geomap_zoom Konfiguriert den Zoom-Faktor der Geomap während der Map-Abfragen. Werfen Sie einen Blick auf die OSM-Zoom-Dokumentation für weitere Details.
    geomap_border 0.25 Der Rand, der auf jeder Seite der Geomap hinzugefügt werden soll. Dieser Wert wird einfach zu den berechneten min/max Geo-Koordinaten addiert.
    source_type csv Der Typ der Data-Source, die genutzt wird, um die Geomap-Objekte zu ermitteln. Kann csv oder backend sein.
    source_file Der Name der CSV-Datei, die als Quelle für das Rendering der Geomap genutzt werden soll. Das wird nur genutzt, wenn source_type auf csv gesetzt ist.
    width Definiert die Breite der Geomap in Pixeln. Die maximale Größe ist begrenzt durch den benutzten Web-Service. geomap.nagvis.org unterstützt bis zu 50 "Kacheln", was ein Auflösind bis zu 1920x1080 ermöglichen sollte. Bitte kontaktieren Sie uns, falls Sie mehr benötigen sollten.
    height Definiert die Höhe der Geomap in Pixeln. Die maximale Größe ist begrenzt durch den benutzten Web-Service. geomap.nagvis.org unterstützt bis zu 50 "Kacheln", was ein Auflösind bis zu 1920x1080 ermöglichen sollte. Bitte kontaktieren Sie uns, falls Sie mehr benötigen sollten.
    nagvis-1.7.10+dfsg1/docs/de_DE/header_templates.html000066400000000000000000000231211225466040700221600ustar00rootroot00000000000000 Header-Templates

    Header-Templates

    Einleitung

    Header-Templates sind HTML-Dateien, die einige Makros enthalten. Diese Dateien können als Header-Menü in den Maps benutzt werden. Die Header-Templates sind im Verzeichnis share/userfiles/templates/pages/ relativ zum NagVis-Root-Verzeichnis abgelegt. Die Template sind wie folgt benannt: *.header.html.
    ACHTUNG: Seit NagVis 1.5 hat sich das Format der Templates geändert, um flexibler sein zu können. Das bedeutet, dass bei einer Umstellung von einer älteren Version alle Templates angepasst werden müssen.

    Makros

    Die folgenden Makros sind in den Header-Menüs verfügbar:

    MakroBeschreibung
    {currentMap} (war [current_map])Name der aktuellen Map (z.B. demo,demo2)
    {currentMapAlias} (war [current_map_alias])Alias der aktuellen Map
    {currentLanguage} (war [current_language])Zeichenkette, die die aktuell eingestellte Sprache enthält (z.B. de_DE). Dies wird für den Verweis auf die Dokumentation benötigt.
    {$currentUser}Name des aktuellen Benutzers.
    {$mod}Das aktuelle Modul (Map, AutoMap, Overview, Welcome, ...).
    {$act}Die aktuelle Aktion (view, edit, ...).
    {$bEnableFade}Bewirkt bei Hover-Menüs sich schnell öffnende oder langsam abblendende Menüs.
    {$bRotation}Ist "true" wenn gerade eine Rotation betrachtet wird, sonst "false"..
    {$permittedOverview}Ist "true", wenn der Benutzer für die Übersichtsseite berechtigt ist, sonst "false"..
    {$permittedEdit}Ist "true", wenn der Benutzer die aktuelle Map editieren darf, sonst "false"..
    {$permittedEditAnyMap}Ist "true",wenn der Benutzer mindestens eine Map editieren darf, sonst "false"..
    {$permittedChangePassword}Ist "true", wenn der Benutzer berechtigt ist, sein eigenes Passwort zu ändern, sonst "false"..
    {$permittedEditMainCfg}Ist "true", wenn der Benutzer berechtigt ist, die Hauptkonfigurationsdatei zu ändern, sonst "false"..
    {$permittedManageBackgrounds}Ist "true", wenn der Benutzer berechtigt ist, Hintergründe zu verwalten, sonst "false"..
    {$permittedManageMaps}Ist "true", wenn der Benutzer berechtigt ist, Maps zu verwalten, sonst "false"..
    {$permittedManageShapes}Ist "true", wenn der Benutzer berechtigt ist, Shapes zu verwalten, sonst "false"..
    {$permittedUserMgmt}Ist "true", wenn der Benutzer berechtigt ist, Benutzerkonten zu verwalten, sonst "false"..
    {$permittedRoleMgmt}Ist "true", wenn der Benutzer berechtigt ist, Benutzerrollen zu verwalten, sonst "false"..
    {$permittedLogout}Ist "true", wenn der Benutzer berechtigt ist, sich abzumelden, sonst "false"..
    {$supportedChangePassword}Ist "true", wenn das aktuelle Authentifizierungsmodul das Ändern von Passwörtern unterstützt, sich abzumelden, sonst "false"..
    {foreach $maps map}
    {$map.mapName}
    {/foreach}
    Eine Liste aller Maps, die in NagVis definiert sind. Der Code zwischen {foreach $maps map} und {/foreach} wird für jede Map ausgeführt. Ein Beispiel finden Sie in share/userfiles/templates/pages/default.header.html.

    Innerhalb der BEGIN/END-Tags sind die folgenden Makros verfügbar:
    * {$map.mapName} (war [map_name]): Name der Map
    * {$map.mapAlias} (war [map_alias]): Alias der Map
    * {$map.permittedEdit}: Ist der Benutzer zur Änderung dieser Map berechtigt?
    {foreach $langs lang}
    {$lang.language}
    {/foreach}
    Eine Liste aller Sprachen, die für die Benutzer verfügbar sind. Der Code zwischen {foreach $langs lang} und {/foreach} wird für jede Sprache ausgeführt. Ein Beispiel finden Sie in share/userfiles/templates/pages/default.header.html.

    Innerhalb der BEGIN/END-Tags sind die folgenden Makros verfügbar:
    * {$lang.language}: Interner Name der Sprache
    * {$lang.classUnderline}: Unterstreichen der Sprache
    * {$lang.langLanguageLocated}: Gefundener Name der Sprache.
    {if $viewType == 'Map' || $viewType == 'Automap'} Um in den Templates flexibler zu sein, haben wir eine Art von "if"-Statement hinzugefügt. Es kann wie in PHP benutzt werden. Ein Beispiel finden Sie in share/userfiles/templates/pages/default.header.html..
    {$pathBase} (war [html_base])URL zur HTML-Basis (/nagvis)
    {$pathImages} (war [html_images])URL zu den HTML-Images (/nagvis/images)
    {$pathHeaderJs} Pfad zur Header-spezifischen JavaScript-Datei (neu in 1.6)
    {$pathTemplates} (war [html_templates])Pfad zu den Header-Templates (/nagvis/userfiles/templates)
    {$pathTemplateImages} (war [html_template_images])Pfad zu den Header-Template-Images (/nagvis/userfiles/images/templates)
    {$langOpen} (war [lang_select_map])Label für das Öffnen neuer Ansichten
    {$langEditMap} (war [lang_edit_map])Label zum Editieren einer Map
    {$langNeedHelp} (war [lang_need_help])Label für Hilfe-Auswahl
    {$langOnlineDoc} (war [lang_online_doc])Label für den Link zur Online-Dokumentation
    {$langForum} (war [lang_forum])Label für den Link zum NagVis-Forum
    {$langSupportInfo} (war [lang_support_info])Label für den Link zu Support-Informationen
    {$langOverview} (war [lang_overview])Label für Überblick
    {$langInstance} (war [lang_instance])Label für den Instanznamen
    {$langRotationStart} (war [lang_rotation_start])Label zum Starten der Map-Rotation
    {$langRotationStop} (war [lang_rotation_stop])Label zum Stoppen der Map-Rotation
    {$langSearch}Label für das Suchen von Objekten auf der Map.
    {$langToggleGrid}Label für das De/Aktivieren des Rasters.
    {$langActions}Label für die Auswahl verfügbarer Aktionen.
    {$langUser}Label für den Benutzer.
    {$langLoggedIn}Label für "Logged in as".
    {$langChangePassword}Label für das Ändern des Benutzer-Passworts.
    {$langUserMgmt}Label für die Verwaltung der Benutzer.
    {$langManageRoles}Label für die Verwaltung der Rollen.
    {$langLogout}Label für das Abmelden des Benutzers.
    {$langChooseLanguage}Label für die Auswahl der Benutzer-Sprache.
    nagvis-1.7.10+dfsg1/docs/de_DE/hover_templates.html000066400000000000000000000225621225466040700220630ustar00rootroot00000000000000 Hover-Templates

    Hover-Templates

    Einleitung

    Hover-Templates sind HTML-Dateien, die einige Makros enthalten. Diese Dateien können als Hover-Menüs in den Maps benutzt werden. Die Hover-Templates sind im Verzeichnis share/userfiles/templates/ relativ zum NagVis-Root-Verzeichnis zu finden. Die Templates sind wie folgt benannt: *.hover.html
    Es gibt Makros, die in Hover-Menüs aller Objekttypen verfügbar sind und bestimmte, die nur bei speziellen Objekten verfügbar sind. Alle Standard-Makros finden Sie nachfolgend.

    Allgemeines

    Die folgenden Makros sind in allen Objekttypen verfügbar:

    MakroBeschreibung
    Allgemeines
    [obj_type]Art des Objekts (host, service, hostgroup, ...)
    [obj_name]Name des Objekts (hostname, hostgroupname, servicegroupname, mapname, ...)
    [obj_alias]Alias des Objekts (wenn kein Alias definiert ist, ist es identisch zu [obj_name])
    [obj_display_name]Anzeigename des Objekts
    [obj_state]Zustand des Objekts (OK,WARNING,CRITICAL,...)
    [obj_summary_state]Gesamtzustand des Objekts und aller abhängigen Objekte (OK,WARNING,CRITICAL,...)
    [obj_acknowledged]wenn der Status bestätigt ist, wird das Makro durch "(Acknowledged)" ersetzt
    [obj_summary_acknowledged]wenn der Gesamtzustand bestätigt ist, wird das Makro durch "(Acknowledged)" ersetzt
    [obj_in_downtime]wenn das Objekt gerade in einer Ausfallzeit ist, wird das Makro durch "(In Downtime)" ersetzt
    [obj_summary_in_downtime]wenn das Objekt gerade in einer Ausfallzeit ist, wird das Makro durch "(In Downtime)" ersetzt
    [obj_output]Ausgabe für dieses Objekt
    [obj_summary_output]Gesamtausgabe des Objekts
    Sprach-Makros
    [lang_name]Label für den Objektnamen
    [lang_child_name] Label für Child-Objektnamen
    [lang_alias] Label für den Objektalias
    [lang_address] Label für die Objektadresse
    [lang_state]Label für den Objektzustand
    [lang_obj_type]Label für die Objektart
    [lang_summary_state]Label für den Gesamtzustand
    [lang_output]Label für die Objektausgabe
    [lang_summary_output]Label für die Gesamtausgabe
    [lang_overview]Label für Überblick
    [lang_instance]Label für die Instanz-Zeichenkette
    [lang_next_check]Label für den nächsten Check des Objekts
    [lang_last_check]Label für den letzten Check des Objekts
    [lang_current_attempt]Label für den aktuellen Versuch
    [lang_last_state_change]Label für den letzten Zustandswechsel
    [lang_state_duration]Label für die Dauer des Zustands
    [lang_service_description]Label für die Service-Beschreibung
    [lang_notes]Label für die Objekt-Anmerkungen
    Pfade
    [html_base]URL zur HTML-Basis (/nagios/nagvis)
    [html_templates]Pfad zu Hover-Templates (nagvis/nagvis/etc/templates/hover)
    [html_template_images]Pfad zu Hover-Template-Images (nagvis/nagvis/images/templates/hover)

    spezielle Makros

    Es gibt Makros für Hover-Templates eines angegebenen Typs. Diese Makros sollten von Abschnittsmakros umgeben werden. Die Abschnittsmakros definieren, dass der angegebene Code entfernt wird, wenn das Hover-Template nicht dem angebenen Typ entspricht. Ein Abschnittsmakros für Host-Makros könnte bspw. so aussehen: <!-- BEGIN host -->.+?<!-- END host -->

    Nachfolgend finden Sie eine vollständige Liste der Spezialmakros

    Alle außer Map-Objekten

    MakroBeschreibung
    [obj_backendid]die Backend-id des Backend-Objekts (backend_<*>)
    [obj_backend_instancename]der NDO-Instanzname des Backend-Objekts

    Host-/Service-Objekte

    MakroBeschreibung
    [obj_address]Die Adresse des Host-Objekts.
    [obj_last_check]Datum und Uhrzeit des letzten Checks dieses Objekts; Angabe im definierten Format.
    [obj_next_check]Datum und Uhrzeit des nächsten Checks dieses Objekts; Angabe im definierten Format.
    [obj_state_type]der aktuelle Zustandstyp (HARD/SOFT)
    [obj_current_check_attempt]die aktuelle Zahl der Check-Versuche
    [obj_max_check_attempts]die Zahl der max. Check-Versuche
    [obj_last_state_change]Datum und Uhrzeit des letzten Zustandswechsels; Angabe im definierten Format.
    [obj_last_hard_state_change]Datum und Uhrzeit des letzten HARD-Zustandswechsels; Angabe im definierten Format.
    [obj_state_duration]die Dauer des aktuellen Zustands
    [obj_notes]die Anmerkungen für die Host- oder Service-Objekte

    Service-Objekte

    MakroBeschreibung
    [service_description]Service-Beschreibung in Nagios
    [pnp_hostname]Hostname PNP (Leerzeichen ersetzt durch Unterstrich)
    [pnp_service_description]Service-Beschreibung für PNP (Leerzeichen ersetzt durch Unterstrich)

    Host-Objekte

    MakroBeschreibung
    [pnp_hostname]Hostname PNP (Leerzeichen ersetzt durch Unterstrich)

    Servicegroup-Objekte

    Es gibt ein sehr spezielles Makro für abhängige Services einer Servicegroup, das Auswahlmakro <!-- BEGIN servicegroup_child --><!-- END servicegroup_child -->.
    MakroBeschreibung
    [lang_child_name1]Label des Hostnamens des abh. Service
    [obj_name1]Hostname des abh. Service
    nagvis-1.7.10+dfsg1/docs/de_DE/index.html000066400000000000000000000016771225466040700177750ustar00rootroot00000000000000 NagVis 1.7 Dokumentation nagvis-1.7.10+dfsg1/docs/de_DE/install_omd_site.html000066400000000000000000000053441225466040700222120ustar00rootroot00000000000000 Installieren von Nagvis in eine OMD site

    Installieren von Nagvis in eine OMD site

    Seit 1.6b2 ist es möglich, NagVis in den local/-Pfad von OMD-Sites zu kopieren. Bitte beachten Sie: Dies wird lediglich zu Testzwecken empfohlen, z.B. wenn Sie brandneue Features von neuen NagVis-Versionen testen möchten, die noch nicht in OMD enthalten sind. Wir empfehlen nicht, dies in produktiven Umgebungen zu tun, es sei denn, Sie wissen wirklich was Sie tun!

    Den OMD-Site-Installer benutzen

    Melden Sie sich an Ihrer OMD-Site an

    In den meisten Fällen erfolgt dies durch ausführen von

    su - <sitename>

    Laden Sie NagVis herunter

    Holen Sie sich das aktuelle Paket Die letzte Ausgabe finden Sie unter nagvis.org.

    Entpacken Sie NagVis

    Entpacken Sie das Archiv an eine temporäre Stelle (z.B. /tmp) und wechseln Sie in dieses Verzeichnis

    tar xvzf nagvis-1.7*.tar.gz /tmp
    cd /tmp/nagvis-1.7*

    Machen Sie den Installer ausführbar

    Der OMD-Site-Installer befindet sich im root-Verzeichnis des NagVis-Pakets. Der Installer muss ausführbar gemacht werden, bevor Sie ihn benutzen können.

    chmod +x omd_install.sh

    Führen Sie den Installer aus

    Nun können Sie das Installer-Skript ausführen.

    ./omd_install.sh

    Bestätigen Sie die Frage mit y und warten Sie, bis das Skript endet. Das sollte schnell passieren.

    Aufräumen

    Sie können die Sourcen nach der Installation entfernen.

    rm -rf /tmp/nagvis-1.7*

    Benutzen Sie es ...

    Nun sollten Sie die neue Version benutzen können, indem Sie in Ihrem Browser die folgende URL eingeben

    http://<hostname>/<sitename>/nagvis

    nagvis-1.7.10+dfsg1/docs/de_DE/installation_instructions.html000066400000000000000000000160401225466040700242010ustar00rootroot00000000000000 installation_instructions

    NagVis 1.7 Installationsanweisungen

    Diese Anweisungen gelten für eine Neuinstallation.
    Wenn Sie Ihre alte NagVis-Installation aktualisieren, raten wir dringend dazu, ein Backup Ihres NagVis-Verzeichnisses zu machen und die Konfigurationsdateien manuell anzupassen.

    SCHRITT 0: das System vorbereiten

    Stellen Sie sicher, dass Ihr System den Systemanforderungen entspricht.

    SCHRITT 1: NagVis herunterladen

    Holen Sie sich NagVis, die neueste Version finden Sie unter www.nagvis.org.

    SCHRITT 2: entpacken Sie NagVis

    tar xvzf nagvis-1.7.x.tar.gz

    SCHRITT 3: verschieben Sie das entpackte NagVis-Verzeichnis

    Platzieren Sie den NagVis-Verzeichnisbaum irgendwo in Ihrem System. In den meisten Fällen ist /usr/local/nagvis die beste Wahl.
    mv nagvis-1.7.x /usr/local/nagvis
    Sie sollten mindestens die folgenden Dateien und Verzeichnisse unter dem nagvis-Verzeichnis sehen
    ls -l /usr/local/nagvis
        etc
        LICENSE
        README
        share
        var
    Verschieben Sie KEINE Dateien oder Verzeichnisse innerhalb des NagVis-Verzeichnisses (Sie können das tun, aber in diesem Fall müssen Sie einige Parameter und Werte in der Hauptkonfigurationsdatei anpassen/hinzufügen wenn Sie nichts verändern, sollte es sofort funktionieren)

    SCHRITT 4: konfigurieren Sie NagVis

    Wechseln Sie zur neuen Position des NagVis-Verzeichnisses
    cd /usr/local/nagvis
    Eine Beispiel-Hauptkonfigurationsdatei finden Sie als etc/nagvis.ini.php-sample. Wenn Sie Einstellungen verändern möchten, kopieren Sie dieses Beispiel nach etc/nagvis.ini.php:
    cp etc/nagvis.ini.php-sample etc/nagvis.ini.php
    Nun können Sie dieses Datei mit Ihrem bevorzugten Texteditor ändern ich benutze vi:
    vi etc/nagvis.ini.php
    Die meisten Zeilen in der frisch kopierten nagvis.ini.php sind auskommentiert (beginnen mit einem Semikolon). Wenn Sie verschiedene Einstellungen setzen möchten, dann entfernen Sie das Kommentarzeichen und ändern Sie den Wert.
    Informationen zu allen möglichen Werten finden Sie in der Formatbeschreibung der Hauptkonfigurationsdatei.

    SCHRITT 5: konfigurieren des Web-Servers

    Seit NagVis 1.5 ist es notwendig, den Web-Server zu konfigurieren, um NagVis zu nutzen. Sie finden eine Beispiel-Konfigurationsdatei in etc/apache2-nagvis.conf-sample.
    Kopieren Sie einfach die Datei in das conf.d-Verzeichnis Ihres Web-Servers. Dies ist z.B. /etc/apache2/conf.d.

    cp etc/apache2-nagvis.conf-sample /etc/apache2/conf.d/apache2-nagvis.conf
    Nun müssen Sie die Datei öffnen und auf Ihre Anforderungen anpassen. Es ist wichtig, die Makros @NAGVIS_WEB@ und @NAGVIS_PATH@ durch die korrekten Werte zu ersetzen.
    In diesem Beispiel müssen Sie @NAGVIS_WEB@ durch /nagvis und @NAGVIS_PATH@ durch /usr/local/nagvis/share ersetzen.

    SCHRITT 6: Berechtigungen

    Dies ist sehr wichtig für eine funktionierende Installation.

    Prüfen Sie zuerst, welcher Unix-Account für Ihren Webserver benutzt wird (in meinem Fall wwwrun). Wenn Sie nicht wissen, mit welchem Benutzer der Webserver läuft, dann werfen Sie einen Blick in die Webserver-Konfiguration. Im Falle von Apache können Sie dies mit dem folgenden Befehl tun:

    Ubuntu
    grep -e 'USER' /etc/apache2/envvars
    SuSE/RedHat/Debian (SLES, OpenSuSE, Fedora)
    grep -e '^User' /etc/apache2/*.conf
    Wenn Ihre Konfigurationsdatei an anderer Stelle liegt, dann passen Sie den obigen Befehl an.
    Gewähren Sie nun dem Webserver-Benutzer Berechtigungen für das NagVis-Verzeichnis (in meinem Fall sind die Pfade wie folgt):
    chown wwwrun:www /usr/local/nagvis -R
        chmod 664 /usr/local/nagvis/etc/nagvis.ini.php
        chmod 775 /usr/local/nagvis/etc/maps
        chmod 664 /usr/local/nagvis/etc/maps/*
        chmod 775 /usr/local/nagvis/etc/automaps
        chmod 664 /usr/local/nagvis/etc/automaps/*
        chmod 775 /usr/local/nagvis/share/userfiles/images/maps
        chmod 664 /usr/local/nagvis/share/userfiles/images/maps/*
        chmod 775 /usr/local/nagvis/var
        chmod 664 /usr/local/nagvis/var/*
        chmod 775 /usr/local/nagvis/var/tmpl/cache
        chmod 664 /usr/local/nagvis/var/tmpl/cache/*
    Es ist möglich, restriktivere Berechtigungen für die Dateien zu setzen, aber für die meisten Setups sollten die Beispiele ausreichen. Verändern Sie die Werte nur dann, wenn Sie wissen, was Sie tun!

    SCHRITT 7: konfigurieren Sie die Maps

    Es gibt zwei Wege, NagVis zu konfigurieren. Der erste ist die web-basierte Konfiguration mit Hilfe des NagVis-Frontends (http://<nagiosserver>/<Pfad-zu-NagVis>/). Schauen Sie sich die Optionen des Header-Menüs an. Zum Editieren von Map-Objekten müssen Sie das Objekt entsperren, das Sie bearbeiten möchten.

    Beim zweiten Weg bearbeiten Sie direkt die Konfigurationsdateien mit dem Text-Editor Ihrer Wahl. Die Map-Konfigurationsdateien befinden sich in etc/maps/. Gültige Formate und Werte finden Sie unter Map Config Format Description.

    SCHRITT 8: betrachten Sie die Maps

    Sie sollten nun in der Lage sein, Ihre definierten Maps in Ihrem Browser anzusehen:
    http://<nagiosserver>/<Pfad-zu-NagVis>/frontend/nagvis-js/?mod=Map&show=<mapname>
    (z.B. http://localhost/frontend/nagvis-js/?mod=Map&show=deutschland)

    Viel Spaß und bitte melden Sie Bugs!
    nagvis-1.7.10+dfsg1/docs/de_DE/installer.html000066400000000000000000000044331225466040700206540ustar00rootroot00000000000000 NagVis-Installer

    NagVis-Installer

    Seit NagVis 1.4 gibt es einen neuen Installer. Dieser Installer wurde erstellt, um die Installation oder Aktualisierung zu vereinfachen. Der Installer ist ein bash-Script, das alle benötigten Informationen zur Installation oder Aktualisierung von NagVis abfragt. Sie können auch alle Optionen über Kommandozeilenparameter steuern.

    Benutzung des Installers

    NagVis herunterladen

    Holen Sie sich NagVis. Die neueste Version finden Sie unter nagvis.org.

    NagVis entpacken

    Entpacken Sie das Archiv in ein beliebiges Verzeichnis (z.B. /tmp) und wechseln Sie in dieses Verzeichnis

    tar xvzf nagvis-1.7*.tar.gz /tmp
    cd /tmp/nagvis-1.7*

    Machen Sie den Installer ausführbar

    Den Installer finden Sie im Hauptverzeichnis des NagVis-Package. Der Installer muss ausführbar gemacht werden, bevor Sie ihn nutzen können.

    chmod +x install.sh

    Starten Sie den Installer

    Sie können nun den Installer aufrufen:

    ./install.sh

    Wenn Sie Icinga verwenden, sollten Sie "-s icinga" hinzufügen.

    ./install.sh -s icinga

    Wenn Sie den Anweisungen des Installers folgen, sollten alle benötigen Dateien an die richtigen Stellen kopiert werden. Bitte beachten Sie, dass die Konfigurationsdatei nagvis.ini.pnp angepasst werden muss. Bei Problemen informieren Sie uns bitte.

    Aufräumen

    Sie können die Sourcen nach der Installation entfernen.

    rm -rf /tmp/nagvis-1.7*

    Kommandozeilenparameter

    Für Details zu den Kommandozeilenparametern rufen Sie den Installer mit der Option "-h" auf.

    nagvis-1.7.10+dfsg1/docs/de_DE/lines_weathermap_style.html000066400000000000000000000105211225466040700234210ustar00rootroot00000000000000 Wetterkarten ähnliche Linien in NagVis

    Wetterkarten ähnliche Linien in NagVis

    Als Standard kann NagVis nur die normalen Zustände in roten, gelben und grünen Linien darstellen. Wollten Sie schon immer schöne wetterkartenähnliche Linien in NagVis anzeigen?

    Farbenfrohere Linien

    NagVis Weathermap style lines

    Seit NagVis 1.5 ist es möglich, solche wetterkartenähnliche Linien zu zeichnen, die mehr als drei Farben haben können, um so z.B. die aktuelle Auslastung des Netzwerk-Interfaces darzustellen. Es gibt beispielsweise eine Palette von sieben unterschiedlichen Farben. Werfen Sie einen Blick auf das Bild - schön, oder?

    Wetterkarten ähnliche Linientypen

    Die Wetterkarten-Linientypen bieten aktuell zwei Typen von Linien:

    • ---%--><--%----: Pfeile mit Prozentangaben in der Mitte der Linie
    • ---%+BW--><--%+BW---: Pfeile mit Prozentangaben in der Mitte der Linie und zusätzliche Label, die die aktuelle Bandbreitennutzung anzeigen.

    Fokus auf Bandbreitenvisualisierung

    Die neuen Linien zielen auf Bandbreitenvisualisierung. Da NagVis die Performance-Daten untersuchen muss, um die richtige Farbe für die Linie zu ermitteln, gibt es spezielle Anforderungen an den Aufbau der Performance-Daten. Es gibt ein Bandbreitenmess-Plugin für Nagios, das bereits die richtigen Performance-Daten-Informationen liefert. Sie erhalten es auf Nagios Exchange.

    Wie legt man Wetterkarten-Linien an?

    Um Wetterkarten-Linientypen in NagVis anzulegen, benötigt man Services, die die richtigen Performance-Daten an Nagios liefern. Wenn Sie das haben, dann platzieren Sie einfach ein Linienobjekt auf der Map und wählen Sie den richtigen Linientyp. Nun werfen Sie einen Blick auf Ihre Map - es sollte bereits funktionieren.

    Sie möchten vielleicht eine Legende, die Ihnen die Bedeutung der verschiedenen Farben anzeigt. Kein Problem. Fügen Sie ein Shape zu Ihrer Map hinzu und wählen Sie das "demo_traffic_load_legend"-Shape, das mit dem NagVis-Basis-Package ausgeliefert wird.

    Benötigtes Performance-Daten-Format

    Die Wetterkartenlinien erfordern kein spezielles Nagios-Plugin. Lediglich die Performance-Daten müssen einem der beiden folgenden Formate entsprechen:

    • prozentuale Verwendung: vier Datenreihen, wobei die ersten beiden die Prozentwerte und die letzten beiden die Auslastung in Bytes pro Sekunde enthalten.
      Beispiel: inUsage=21103.42%;85;98 outUsage=226363.55%;85;98 inBandwidth=105.52MBs outBandwidth=212.22MBs.
    • Bandbreitenverwendung: benötigt mindestens zwei Datenreihen mit den Labeln "in" und "out" sowie einem leeren UOM. Es benutzt den aktuellen und den maximalen Wert zur Berechnung des momentanen Prozentwertes. Der aktuelle Wert sollte als Byte-Rate angegeben werden. Der maximale Wert sollte die Bandbreite des Netzwerk-Interface in Byte pro Sekunde enthalten.
      Beispiel: in=7196.50566429;;;0;1250000.0 inucast=11.6273564992;;;; innucast=0.017617206817;;;; indisc=0.0;;;; inerr=0.0;0.01;0.1;; out=4044.9635368;;;0;1250000.0 outucast=12.1734899105;;;; outnucast=0.0;;;; outdisc=0.0;;;; outerr=0.0;0.01;0.1;; outqlen=0;;;;.

    Danke an gjfrater für die Implementierung dieser Linien!

    nagvis-1.7.10+dfsg1/docs/de_DE/map_config_format_description.html000066400000000000000000002315041225466040700247350ustar00rootroot00000000000000 NagVis 1.6 Formatbeschreibung der Map-Konfiguration

    NagVis 1.6 Formatbeschreibung der Map-Konfiguration

    Allgemeine Informationen

    Das NagVis-Konfigurationsdateiformat ist sehr ähnlich zu dem Format, das von Nagios(TM) benutzt wird.

    Konfigurationsanweisungen beginnen mit dem Schlüsselwort "define" gefolgt von einem Typfeld und einer öffnenden geschweiften Klammer ({). Jede folgende Zeile definiert Variablen-Werte-Paare, getrennt durch ein Gleichheitszeichen ( = ), bis zu einer schließenden geschweiften Klammer (}).

    Hashes (#) werden benutzt, um Kommentare zu markieren. Beachten Sie, dass eine Kommentarzeile mit einem Hash-Zeichen beginnen MUSS, alle anderen Zeichen (auch "Whitespaces") sind ungültig!

    Objekttypen

    Beschreibung der Objekttypen

    global

    Die erste Definition in jeder Konfigurationsdatei sollte vom Typ "global" sein. Optionen in diesem Abschnitt gelten für die gesamte Map und werden an andere Typen vererbt, die später definiert werden.

    Beispiel mit allen Optionen, die gesetzt werden müssen:
    define global {
          map_image=lan.png
        }
    WertDefaultBeschreibung
    allowed_for_config Kommaseparierte Liste von Nagios-Benutzern, die diese Map editieren dürfen. EVERYONE erlaubt jedem den Zugriff (veraltet ab 1.5)
    allowed_user Kommaseparierte Liste von Nagios-Benutzern, die berechtigt sind, diese Maps anzusehen. EVERYONE erlaubt jedem den Zugriff (veraltet ab 1.5)
    map_image Das Bild, das als Hintergrund der NagVis-Map angezeigt werden soll (z.B. eine Visio (TM)-Zeichnung).
    Der Wert kann auch "none" oder leer sein für kein Hintergrundbild
    Es ist auch mölich URLs anzugeben. Diese mssen zwischen eckige Klammern [ ] gesetzt werden.
    aliasMap-NameDer Alias ist das Label für jede Map. Wenn definiert, wird es überall im NagVis-Frontend und WUI angezeigt
    backend_idvererbt (nagvis.ini.php)Die in der Hauptkonfigurationsdatei definierte Backend-ID, die angibt, wo NagVis nach Objektzuständen suchen soll. Wenn dieser Parameter nicht angegeben wird, wird das in der Hauptkonfigurationsdatei unter "defaultbackend" angegebene Backend benutzt.
    background_colorvererbt (nagvis.ini.php)Hintergrundfarbe dieser Map. Falls dieser Wert nicht gesetzt wird, wird die Hintergrundfarbe aus der Hauptkonfigurationsdatei genommen.
    context_menu vererbt (nagvis.ini.php) Aktivieren/deaktivieren des Kontext-Menüs auf Ihren Map-Objekten.
    context_templatevererbt (nagvis.ini.php)Default Context-Template, das auf dieser Map benutzt werden soll
    event_backgroundvererbt (nagvis.ini.php)Aktivieren/deaktivieren der sich ändernden Hintergrundfarbe bei Statusänderungen (die konfigurierte Farbe wird angezeigt, wenn der Gesamtstatus PENDING, OK oder UP ist).
    event_highlightvererbt (nagvis.ini.php)Aktivieren/deaktivieren der Hervorhebung des sich ändernden Objekts durch eine blinkende Umrandung.
    event_highlight_durationvererbt (nagvis.ini.php)Setzen der Hervorhebungsdauer in Millisekunden
    event_highlight_intervalvererbt (nagvis.ini.php)Setzen des Hervorhebungsinterall in Millisekunden
    event_logvererbt (nagvis.ini.php)Aktivieren/deaktivieren des Eventlogs im neuen JavaScript-Backend. Das Eventlog protokolliert wichtige Aktionen und Informationen.
    event_log_levelvererbt (nagvis.ini.php)Loglevel des Eventlogs (verfügbar: debug, info, warning, critical).
    event_log_heightvererbt (nagvis.ini.php)Höhe des JavaScript-Eventlogs in Pixeln.
    event_log_hiddenvererbt (nagvis.ini.php)Verstecken/zeigen des JavaScript-Eventlogs während des Map-Ladens.
    event_scrollvererbt (nagvis.ini.php)Aktivieren/deaktivieren des Fokussierens auf das Icon, das den Zustand verändert hat, wenn dieses außerhalb des sichtbaren Bereichs ist.
    event_soundvererbt (nagvis.ini.php)Aktivieren/deaktivieren von Sound-Signalen bei Statusänderungen.
    exclude_members

    Es ist möglich, member-Objekte komplett auszuschließen, während die Objektinformationen vom Backend geholt werden. Die gefilterten Elemente werden nirgendwo in diesem Objekt auftauchen.

    Details zur Filter-Syntax finden Sie bei der exclude regex-Definition. (Neu in 1.6b4)

    exclude_member_states

    Es ist möglich, ein oder mehrere member-Zustände während der Ermittlung des Gesamtzustands von Objekten auszuschließen. Die gefilterten Elemente werden in der member-Liste auftauchen, aber nicht für Gesamtstatusberechnungen benutzt.

    Details zur Filter-Syntax finden Sie bei der exclude regex-Definition. (Neu in 1.6b4)

    grid_colorvererbt (nagvis.ini.php)Die Farbe der Rasterlinien
    grid_showvererbt (nagvis.ini.php)Aktivieren/deaktivieren von Rasterlinien zur Ausrichtung von Objekten im WUI. Objekte werden an der linken, oberen Ecke ausgerichtet
    grid_stepsvererbt (nagvis.ini.php)Abstand der Rasterlinien
    header_fade vererbt (nagvis.ini.php)aktivieren/deaktivieren des Abblendeffekts in den Untermenüs des Header-Menüs (wenn das verwendete Header-Menü diese Option unterstützt).
    header_menuvererbt (nagvis.ini.php)aktivieren/deaktivieren des Header-Menüs
    header_templatevererbt (nagvis.ini.php)header template für diese Map
    hover_childs_limitvererbt (nagvis.ini.php)max. Anzahl von Child-Objekten
    hover_childs_ordervererbt (nagvis.ini.php)Reihenfolge von Child-Objekten ("asc"=aufsteigend, "desc"=absteigend)
    hover_childs_showvererbt (nagvis.ini.php)Anzeigen von Child-Objekten in Hover-Menüs
    hover_childs_sortvererbt (nagvis.ini.php)Sortierreihenfolge von Child-Objekten ("s"=Status, "a"=Alphabet)
    hover_delayvererbt (nagvis.ini.php)Verzögerung der Anzeige des Hover-Menus in Sekunden
    hover_menuvererbt (nagvis.ini.php)aktivieren/deaktivieren von Hover-Menüs
    hover_templatevererbt (nagvis.ini.php)Default hover template für diese Map
    hover_timeoutvererbt (nagvis.ini.php)Default-Timeout (in Sekunden) bei Ajax-Abfragen in Hover-Menüs (veraltet ab 1.4)
    iconsetvererbt (nagvis.ini.php)Iconset, das als Standard für alle auf der Map platzierten Objekte benutzt werden soll. Kann für jedes Objekt überschrieben werden.
    Im Beispiel wird "std_small" benutzt, was bedeutet, dass ein OK-Zustand das Icon "std_small_ok.png", benutzt, ein CRITICAL-Zustand "std_small_critical.png" usw.
    in_maintenance0aktiviert/deaktiviert den Wartungsmodus. Wenn eine Map im Wartungsmodus ist, wird statt der Map lediglich ein Hinweis angezeigt
    label_show0Labelanzeige für die Map-Objekte aktivieren/deaktivieren
    label_x-20x-Position der Label in Pixeln (mit Vorzeichen +/- relativ zur linken, oberen Ecke der Icons, sonst absolute Position)
    label_y+20y-Position der Label in Pixeln (mit Vorzeichen +/- relativ zur linken, oberen Ecke der Icons, sonst absolute Position)
    label_width auto Default-Breite der Label in Pixeln
    label_backgroundtransparentDefault-Hintergrundfarbe der Label. Die Farbe sollte als Hexcode angegeben werden, kann aber auch "transparent" sein.
    label_border#000000Default-Rahmenfarbe der Label. Die Farbe sollte als Hexcode angegeben werden, kann aber auch "transparent" sein.
    label_style#000000Benutzerdefiniertes Aussehen des Label-Textes im Format von HTML-Style-Attributen, z.B. font-family:sans;font-weight:bold;.
    line_arrowforward Dies defniert die Pfeile am Linienende. Bisher wird dieses Attribut nur für die Linien zwischen Hosts in der Automap benutzt. Mögliche Werte: forward, back, both, none.
    line_type Gibt den Linientyp an, wenn view_type=line. Gültige Werte sind:
    "11" für Linien mit einem Pfeil am Linienende.
    "10" für Linien mit zwei Pfeilen, die in der Linienmitte aufeinander zeigen.
    "12" für Linien ohne Pfeil(e).
    line_width3 Dies definiert die Linienbreite in px, wenn dieses Objekt als Linie angezeigt wird.
    line_weather_colors10:#8c00ff,25:#2020ff,40:#00c0ff,55:#00f000,70:#f0f000,85:#ffc000,100:#ff0000Dies definiert die Farben von Wetterkarten-Farben in den unterschiedlichen Prozentstufen. Über 10% wird z.B. #8c00ff als Farbe benutzt. (Neu in 1.6)
    only_hard_statesvererbt (nagvis.ini.php)Gibt an, ob Soft-Zustände ignoriert werden sollen. Default ist 0.
    parent_mapDie Eltern-Map dieser Karte. Die Option wird nur bei den Menü-Visualisierungen des Header-Menüs und der Sidebar benutzt (Neu in 1.6)
    recognize_servicesvererbt (nagvis.ini.php)Definiert, ob die Services des Hosts den angezeigten Status beeinflussen. Wenn auf "1" gesetzt, wird ein Service im Status CRITICAL auch den HOST als CRITICAL anzeigen. Wenn auf "0" gesetzt, wird nur der Host-Zustand (UP oder DOWN) angezeigt und der Status der Services ignoriert. Ist dieser Wert nicht in der Konfiguration angegeben, wird er auf 1 gesetzt.
    show_in_listsvererbt (nagvis.ini.php)Map-Anzeige in Listenformat (Dropdowns, Indexseite, ...)
    show_in_multisite vererbt (nagvis.ini.php) Zeigen der Maps im Multisite-Snapin
    stylesheetvererbt (nagvis.ini.php)Dateiname des benutzerdefinierten Stylesheets zur Verwendung in den Maps. Die Datei muss im share/nagvis/style-Verzeichnis abgelegt sein.
    url_target _selfZiel des Icon-Links, diese Option passt <a target=""> an (_self ist das gleiche Fenster)
    usegdlibsvererbt (nagvis.ini.php)Aktiviert die Benutzung der GD-Libs für diese Map (Linien können nur benutzt werden, wenn die GD-Libs aktiviert sind) (veraltet ab 1.4)

    host

    Beispiel mit allen Optionen, die gesetzt werden müssen (beachten Sie, dass Optionen nicht gesetzt werden müssen, wenn sie bereits im global-Abschnitt definiert wurden):
    define host {
          host_name=localhost
          x=100
          y=200
        }
    WertDefaultBeschreibung
    object_id Eindeutiger Bezeichner des Objekts auf der aktuellen Map. Jedes Objekt der Map benötigt eine object_id. Die object_id besteht aus alphanumerischen Zeichen beliebiger Länge. Wenn keine object_id angegeben ist, wird NagVis für das Objekt eine erzeugen (neu in 1.6)
    host_name Name des Hosts wie in Nagios definiert
    x X-Koordinate
    y Y-Koordinate
    backend_idvererbt (global) Die in der Hauptkonfigurationsdatei definierte Backend-ID, die angibt, wo NagVis nach Objektzuständen suchen soll. Wenn dieser Parameter nicht angegeben wird, wird das in der Hauptkonfigurationsdatei unter "defaultbackend" angegebene Backend benutzt.
    context_menu vererbt (nagvis.ini.php) Aktivieren/deaktivieren des Kontext-Menüs auf Ihren Map-Objekten.
    context_templatevererbt (nagvis.ini.php)Default Context-Template, das auf dieser Map benutzt werden soll
    exclude_members

    Es ist möglich, member-Objekte komplett auszuschließen, während die Objektinformationen vom Backend geholt werden. Die gefilterten Elemente werden nirgendwo in diesem Objekt auftauchen.

    Details zur Filter-Syntax finden Sie bei der exclude regex-Definition. (Neu in 1.6b4)

    exclude_member_states

    Es ist möglich, ein oder mehrere member-Zustände während der Ermittlung des Gesamtzustands von Objekten auszuschließen. Die gefilterten Elemente werden in der member-Liste auftauchen, aber nicht für Gesamtstatusberechnungen benutzt.

    Details zur Filter-Syntax finden Sie bei der exclude regex-Definition. (Neu in 1.6b4)

    hover_menuvererbt (nagvis.ini.php)aktivieren/deaktivieren von Hover-Menüs
    hover_delayvererbt (nagvis.ini.php)Verzögerung der Anzeige des Hover-Menus in Sekunden
    hover_templatevererbt (nagvis.ini.php)Default hover template für diese Map
    hover_timeoutvererbt (nagvis.ini.php)Default-Timeout (in Sekunden) bei Ajax-Abfragen in Hover-Menüs
    hover_url URL, der im Hover-Menu statt der Standard-Informationen angezeigt werden soll. Verfügbare Makros:
    [host_name]: Dieses Makro steht für den Objektnamen.
    hover_childs_showvererbt (nagvis.ini.php)Anzeigen von Child-Objekten in Hover-Menüs
    hover_childs_sortvererbt (nagvis.ini.php)Sortierreihenfolge von Child-Objekten ("s"=Status, "a"=Alphabet)
    hover_childs_ordervererbt (nagvis.ini.php)Reihenfolge von Child-Objekten ("asc"=aufsteigend, "desc"=absteigend)
    hover_childs_limitvererbt (nagvis.ini.php)max. Anzahl von Child-Objekten
    iconsetvererbt (global)Spezielles Iconset. Wird vom global-Paragraph vererbt, falls es hier nicht angegeben wird.
    label_showvererbt (global) Labelanzeige für die Map-Objekte aktivieren/deaktivieren
    label_text[name]Text des Labels. Verfügbare Makros: [name], [output]
    label_xvererbt (global) x-Position der Label in Pixeln (mit Vorzeichen +/- relativ zur linken, oberen Ecke der Icons, sonst absolute Position)
    label_yvererbt (global) y-Position der Label in Pixeln (mit Vorzeichen +/- relativ zur linken, oberen Ecke der Icons, sonst absolute Position)
    label_widthvererbt (global) Breite des Labels in Pixeln
    label_backgroundvererbt (global) Hintergrundfarbe des Labels. Die Farbe sollte als Hexcode angegeben werden, kann aber auch "transparent" sein.
    label_bordervererbt (global) Rahmenfarbe des Labels. Die Farbe sollte als Hexcode angegeben werden, kann aber auch "transparent" sein.
    label_stylevererbt (global) benutzerdefiniertes Aussehen des Label-Textes im Stil von HTML-Attributen, z.B. font-family:sans;font-weight:bold;
    line_arrow vererbt (global) Dies definiert die Pfeile am Linienende. Bisher wird dieses Attribut nur für die Linien zwischen Hosts in der Automap benutzt. Mögliche Werte: forward, back, both, none.
    line_type vererbt (global)Gibt den Typ der Linie an, wenn view_type=line ist. Gültige Werte sind
    "11" für Linien mit einem Pfeil an jedem Ende
    "10" für Linien mit zwei Pfeilen in der Mitte der Linie, die aufeinander zeigen
    "12" für Linien ohne Pfeile
    line_width vererbt (global) Dies definiert die Breite der Linie, wenn dieses Objekt als Linie angezeigt wird.
    only_hard_statesvererbt (global) Gibt an, ob Soft-Zustände ignoriert werden sollen. Default ist 0.
    recognize_servicesvererbt (global)Definiert, ob die Services des Hosts den angezeigten Status beeinflussen. Wenn auf "1" gesetzt, wird ein Service im Status CRITICAL auch den HOST als CRITICAL anzeigen. Wenn auf "0" gesetzt, wird nur der Host-Zustand (UP oder DOWN) angezeigt und der Status der Services ignoriert. Ist dieser Wert nicht in der Konfiguration angegeben, wird er auf 1 gesetzt.
    url URL, auf den das Icon verweisen soll. Default ist ein Verweis auf die Nagios-CGIs. Die Makros [host_name], [htmlcgi] und [htmlbase] sind verfügbar.
    Der Wert kann leer sein, um den Link zu deaktivieren.
    url_target_selfZiel des Icon-Links, diese Option passt <a target=""> an (_self ist das gleiche Fenster). Das Makro [name] ist verfügbar.
    use Kommaseparierte Liste von zu benutzenden Objekt-Templates. Details siehe template
    view_type icon Diese Option definiert das Aussehen dieses Objekts. Mögliche Werte sind: "icon" oder "line". Vor NagVis 1.4 konnten Sie das Aussehen eines Objekts durch die Option line_type ändern. Seit NagVis 1.4 müssen Sie die Option view_type benutzen, um Icons als Linien anzuzeigen.
    z1Die z-Option definiert die Reihenfolge, in der die Icons aufeinander gestapelt werden. Das Icon mit dem höchsten Wert wird auf der Spitze dargestellt. Das Hintergrundbild hat den Wert 0, so dass gültige Werte 1 oder größer sein müssen. Hinweis: Um Konflikte mit der Header-Navigation zu verhindern, sollte dieser Wert unter 100 bleiben.

    Service

    Beispiel mit allen Optionen, die gesetzt werden müssen (beachten Sie, dass Optionen nicht gesetzt werden müssen, wenn sie bereits im global-Abschnitt definiert wurden):
    define service {
          host_name=localhost
          service_description=ping
          iconset=std_big
          x=100
          y=200
        }
    WertDefaultBeschreibung
    object_id Eindeutiger Bezeichner des Objekts auf der aktuellen Map. Jedes Objekt der Map benötigt eine object_id. Die object_id besteht aus alphanumerischen Zeichen beliebiger Länge. Wenn keine object_id angegeben ist, wird NagVis für das Objekt eine erzeugen (neu in 1.6)
    host_name Name des Hosts wie in Nagios definiert
    service_description Name des Service wie in Nagios definiert
    x X-Koordinate
    y Y-Koordinate
    backend_idvererbt (global) Die in der Hauptkonfigurationsdatei definierte Backend-ID, die angibt, wo NagVis nach Objektzuständen suchen soll. Wenn dieser Parameter nicht angegeben wird, wird das in der Hauptkonfigurationsdatei unter "defaultbackend" angegebene Backend benutzt.
    context_menu vererbt (nagvis.ini.php) Aktivieren/deaktivieren des Kontext-Menüs auf Ihren Map-Objekten.
    context_templatevererbt (nagvis.ini.php)Default Context-Template, das auf dieser Map benutzt werden soll
    exclude_members

    Es ist möglich, member-Objekte komplett auszuschließen, während die Objektinformationen vom Backend geholt werden. Die gefilterten Elemente werden nirgendwo in diesem Objekt auftauchen.

    Details zur Filter-Syntax finden Sie bei der exclude regex-Definition. (Neu in 1.6b4)

    exclude_member_states

    Es ist möglich, ein oder mehrere member-Zustände während der Ermittlung des Gesamtzustands von Objekten auszuschließen. Die gefilterten Elemente werden in der member-Liste auftauchen, aber nicht für Gesamtstatusberechnungen benutzt.

    Details zur Filter-Syntax finden Sie bei der exclude regex-Definition. (Neu in 1.6b4)

    gadget_urlDer Wert kann ein Gadget-Script im Gadget-Verzeichnis (nagvis/gadgets) sein, z.B. "std_speedometer.php" oder eine in Klammern gesetzte komplette URI auf ein Gadget-Script, z.B. "[http://127.0.0.1/nagvis/gadgets/std_speedometer.php]". Details zu Gadgets finden Sie hier. Diese Option wird nur erkannt, wenn view_type="gadget" gesetzt ist.
    gadget_scale 100 Die Größe des Gadgets. Default ist 100 (Prozent). Die Gadgets sollten in der Lage sein, abhängig von diesem Parameter zu skalieren
    gadget_opts Optionale Gadget-spezifische Parameter. Die Inhalte können für jedes Gadget frei definiert werden. Der Wert wird als GET-Parameter "opts" verarbeitet. Wir empfehlen, ein var/val-Format zu nutzen: key1=val1,key2=val2. Dadurch können Sie diese Zeichenkette im Gadget leicht in ein Array aufteilen.
    hover_menuvererbt (nagvis.ini.php)aktivieren/deaktivieren von Hover-Menüs
    hover_templatevererbt (global) Hover template für dieses Objekt
    hover_timeoutvererbt (nagvis.ini.php)Default-Timeout (in Sekunden) bei Ajax-Abfragen in Hover-Menüs (veraltet ab 1.4)
    hover_delayvererbt (nagvis.ini.php)Verzögerung der Anzeige des Hover-Menus in Sekunden
    hover_url URL, der im Hover-Menu statt der Standard-Informationen angezeigt werden soll. Verfügbare Makros:
    [host_name]: Dieses Makro steht für den Objektnamen.
    [service_description]: Dieses Makro steht für die Service-Beschreibung und wird nur in Service-Objekten ersetzt.
    hover_childs_showvererbt (nagvis.ini.php)Anzeigen von Child-Objekten in Hover-Menüs
    hover_childs_sortvererbt (nagvis.ini.php)Sortierreihenfolge von Child-Objekten ("s"=Status, "a"=Alphabet)
    hover_childs_ordervererbt (nagvis.ini.php)Reihenfolge von Child-Objekten ("asc"=aufsteigend, "desc"=absteigend)
    hover_childs_limitvererbt (nagvis.ini.php)max. Anzahl von Child-Objekten
    iconsetvererbt (global) Spezielles Iconset. Wird vom global-Paragraph vererbt, falls es hier nicht angegeben wird
    label_showvererbt (global) Labelanzeige für die Map-Objekte aktivieren/deaktivieren
    label_text[name][service_description]Text des Labels. Verfügbare Makros: [name], [service_description], [output]
    label_xvererbt (global) x-Position der Label in Pixeln (mit Vorzeichen +/- relativ zur linken, oberen Ecke der Icons, sonst absolute Position)
    label_yvererbt (global) y-Position der Label in Pixeln (mit Vorzeichen +/- relativ zur linken, oberen Ecke der Icons, sonst absolute Position)
    label_widthvererbt (global) Breite des Labels in Pixeln
    label_backgroundvererbt (global) Hintergrundfarbe des Labels. Die Farbe sollte als Hexcode angegeben werden, kann aber auch "transparent" sein.
    label_bordervererbt (global) Rahmenfarbe des Labels. Die Farbe sollte als Hexcode angegeben werden, kann aber auch "transparent" sein.
    label_stylevererbt (global) benutzerdefiniertes Aussehen des Label-Textes im Stil von HTML-Attributen, z.B. font-family:sans;font-weight:bold;
    line_arrow vererbt (global) Dies definiert die Pfeile am Linienende. Bisher wird dieses Attribut nur für die Linien zwischen Hosts in der Automap benutzt. Mögliche Werte: forward, back, both, none.
    line_cut 0.5 Linien mit zwei Teilen haben den Schnitt in der Mitte der Linie. Dies entspricht einem "line_cut"-Wert von "0.5". Es ist möglich, den Schnitt durch Veränderung des Wertes zu verschieben. Gültige Werte sind 0.0 bis 1.0.
    line_label_pos_in 0.5 Bei Wetterkarten-Linien sind die Bezeichnungen normalerweise in der Mitte der Linie. Dies entspricht einem Wert von "0.5". Es ist möglich, die Platzierung durch diesen Werte zu verschieben. Gültige Werte liegen zwischen 0.0 to 1.0.
    line_label_pos_out 0.5 Bei Wetterkarten-Linien sind die Bezeichnungen normalerweise in der Mitte der Linie. Dies entspricht einem Wert von "0.5". Es ist möglich, die Platzierung durch diesen Werte zu verschieben. Gültige Werte liegen zwischen 0.0 to 1.0.
    line_label_y_offset 2 Diese Option definiert den Abstand der Bezeichnungen zur Linie beim Rendern von Wetterkarten-Linien, die Prozent- und absolute Bandbreitendaten anzeigen. (Neu in 1.6)
    line_weather_colorsvererbt (global)Dies definiert die Farben von Wetterkarten-Farben in den unterschiedlichen Prozentstufen. Über 10% wird z.B. #8c00ff als Farbe benutzt. (Neu in 1.6)
    line_typevererbt (global)Gibt den Typ der Linie an, wenn view_type=line ist. Gültige Werte sind
    "11" für Linien mit einem Pfeil an jedem Ende
    "10" für Linien mit zwei Pfeilen in der Mitte der Linie, die aufeinander zeigen
    "12" für Linien ohne Pfeile
    line_width vererbt (global) Dies definiert die Breite der Linie, wenn dieses Objekt als Linie angezeigt wird.
    only_hard_statesvererbt (global) Gibt an, ob Soft-Zustände ignoriert werden sollen. Default ist 0.
    url URL, auf den das Icon verweisen soll. Default ist ein Verweis auf die Nagios-CGIs. Verfügbare Makros: [host_name], [service_description], [htmlcgi] und [htmlbase]. Der Wert kann leer sein, um den Link zu deaktivieren.
    url_target_selfZiel des Icon-Links, diese Option passt <a target=""> an (_self ist das gleiche Fenster). Verfügbare Makros: [name], [service_description]
    use Kommaseparierte Liste von zu benutzenden Objekt-Templates. Details siehe template
    view_type icon Diese Option definiert das Aussehen dieses Objekts. Mögliche Werte sind: "icon" oder "line". Vor NagVis 1.4 konnten Sie das Aussehen eines Objekts durch die Option line_type ändern. Seit NagVis 1.4 müssen Sie die Option view_type benutzen, um Icons als Linien anzuzeigen.
    z1Die z-Option definiert die Reihenfolge, in der die Icons aufeinander gestapelt werden. Das Icon mit dem höchsten Wert wird auf der Spitze dargestellt. Das Hintergrundbild hat den Wert 0, so dass gültige Werte 1 oder größer sein müssen. Hinweis: Um Konflikte mit der Header-Navigation zu verhindern, sollte dieser Wert unter 100 bleiben.

    Hostgroup

    Beispiel mit allen Optionen, die gesetzt werden müssen (beachten Sie, dass Optionen nicht gesetzt werden müssen, wenn sie bereits im global-Abschnitt definiert wurden):
    define hostgroup {
          hostgroup_name=servers
          x=100
          y=200
        }
    WertDefaultBeschreibung
    object_id Eindeutiger Bezeichner des Objekts auf der aktuellen Map. Jedes Objekt der Map benötigt eine object_id. Die object_id besteht aus alphanumerischen Zeichen beliebiger Länge. Wenn keine object_id angegeben ist, wird NagVis für das Objekt eine erzeugen (neu in 1.6)
    hostgroup_name Name der Hostgroup wie in Nagios definiert
    x X-Koordinate
    y Y-Koordinate
    backend_idvererbt (global) Die in der Hauptkonfigurationsdatei definierte Backend-ID, die angibt, wo NagVis nach Objektzuständen suchen soll. Wenn dieser Parameter nicht angegeben wird, wird das in der Hauptkonfigurationsdatei unter "defaultbackend" angegebene Backend benutzt.
    context_menu vererbt (nagvis.ini.php) Aktivieren/deaktivieren des Kontext-Menüs auf Ihren Map-Objekten.
    context_templatevererbt (nagvis.ini.php)Default Context-Template, das auf dieser Map benutzt werden soll
    exclude_members

    Es ist möglich, member-Objekte komplett auszuschließen, während die Objektinformationen vom Backend geholt werden. Die gefilterten Elemente werden nirgendwo in diesem Objekt auftauchen.

    Details zur Filter-Syntax finden Sie bei der exclude regex-Definition. (Neu in 1.6b4)

    exclude_member_states

    Es ist möglich, ein oder mehrere member-Zustände während der Ermittlung des Gesamtzustands von Objekten auszuschließen. Die gefilterten Elemente werden in der member-Liste auftauchen, aber nicht für Gesamtstatusberechnungen benutzt.

    Details zur Filter-Syntax finden Sie bei der exclude regex-Definition. (Neu in 1.6b4)

    hover_menuvererbt (nagvis.ini.php)aktivieren/deaktivieren von Hover-Menüs
    hover_templatevererbt (global) Hover template für dieses Objekt
    hover_timeoutvererbt (nagvis.ini.php)Default-Timeout (in Sekunden) bei Ajax-Abfragen in Hover-Menüs (veraltet ab 1.4)
    hover_delayvererbt (nagvis.ini.php)Verzögerung der Anzeige des Hover-Menus in Sekunden
    hover_url URL, der im Hover-Menu statt der Standard-Informationen angezeigt werden soll. Verfügbare Makros:
    [hostgroup_name]: Dieses Makro steht für den Objektnamen.
    hover_childs_showvererbt (nagvis.ini.php)Anzeigen von Child-Objekten in Hover-Menüs
    hover_childs_sortvererbt (nagvis.ini.php)Sortierreihenfolge von Child-Objekten ("s"=Status, "a"=Alphabet)
    hover_childs_ordervererbt (nagvis.ini.php)Reihenfolge von Child-Objekten ("asc"=aufsteigend, "desc"=absteigend)
    hover_childs_limitvererbt (nagvis.ini.php)max. Anzahl von Child-Objekten
    iconsetvererbt (global) Spezielles Iconset. Wird vom global-Paragraph vererbt, falls es hier nicht angegeben wird
    label_showvererbt (global) Labelanzeige für die Map-Objekte aktivieren/deaktivieren
    label_text[name]Text des Labels, verfügbare Makros: [name] und [output]
    label_xvererbt (global)x-Position der Label in Pixeln (mit Vorzeichen +/- relativ zur linken, oberen Ecke der Icons, sonst absolute Position)
    label_yvererbt (global) y-Position der Label in Pixeln (mit Vorzeichen +/- relativ zur linken, oberen Ecke der Icons, sonst absolute Position)
    label_widthvererbt (global) Breite des Labels in Pixeln
    label_backgroundvererbt (global) Hintergrundfarbe des Labels. Die Farbe sollte als Hexcode angegeben werden, kann aber auch "transparent" sein.
    label_bordervererbt (global) Rahmenfarbe des Labels. Die Farbe sollte als Hexcode angegeben werden, kann aber auch "transparent" sein.
    label_stylevererbt (global) Benutzerdefiniertes Aussehen des Label-Textes im Format von HTML-Style-Attributen, z.B. font-family:sans;font-weight:bold;.
    line_arrow vererbt (global) Dies definiert die Pfeile am Linienende. Bisher wird dieses Attribut nur für die Linien zwischen Hosts in der Automap benutzt. Mögliche Werte: forward, back, both, none.
    line_typevererbt (global)Gibt den Typ der Linie an, wenn view_type=line ist. Gültige Werte sind
    "11" für Linien mit einem Pfeil an jedem Ende
    "10" für Linien mit zwei Pfeilen in der Mitte der Linie, die aufeinander zeigen
    "12" für Linien ohne Pfeile
    line_width vererbt (global) Dies definiert die Breite der Linie, wenn dieses Objekt als Linie angezeigt wird.
    recognize_servicesvererbt (global) Definiert, ob die Services des Hosts den angezeigten Status beeinflussen. Wenn auf "1" gesetzt, wird ein Service im Status CRITICAL auch den HOST als CRITICAL anzeigen. Wenn auf "0" gesetzt, wird nur der Host-Zustand (UP oder DOWN) angezeigt und der Status der Services ignoriert. Ist dieser Wert nicht in der Konfiguration angegeben, wird er auf 1 gesetzt.
    url URL, auf den das Icon verweisen soll. Default ist ein Verweis auf die Nagios-CGIs. Die Makros [hostgroup_name], [htmlcgi] und [htmlbase] sind verfügbar. Der Wert kann leer sein, um den Link zu deaktivieren.
    url_target_selfZiel des Icon-Links, diese Option passt <a target=""> an (_self ist das gleiche Fenster). Verfügbares Makro: [name]
    use Kommaseparierte Liste von zu benutzenden Objekt-Templates. Details siehe template
    view_type icon Diese Option definiert das Aussehen dieses Objekts. Mögliche Werte sind: "icon" oder "line". Vor NagVis 1.4 konnten Sie das Aussehen eines Objekts durch die Option line_type ändern. Seit NagVis 1.4 müssen Sie die Option view_type benutzen, um Icons als Linien anzuzeigen.
    z1Die z-Option definiert die Reihenfolge, in der die Icons aufeinander gestapelt werden. Das Icon mit dem höchsten Wert wird auf der Spitze dargestellt. Das Hintergrundbild hat den Wert 0, so dass gültige Werte 1 oder größer sein müssen. Hinweis: Um Konflikte mit der Header-Navigation zu verhindern, sollte dieser Wert unter 100 bleiben.

    Servicegroup

    Beispiel mit allen Optionen, die gesetzt werden müssen (beachten Sie, dass Optionen nicht gesetzt werden müssen, wenn sie bereits im global-Abschnitt definiert wurden):
    define servicegroup {
          servicegroup_name=servicegroup1
          x=100
          y=200
        }
    WertDefaultBeschreibung
    object_id Eindeutiger Bezeichner des Objekts auf der aktuellen Map. Jedes Objekt der Map benötigt eine object_id. Die object_id besteht aus alphanumerischen Zeichen beliebiger Länge. Wenn keine object_id angegeben ist, wird NagVis für das Objekt eine erzeugen (neu in 1.6)
    servicegroup_name Name der Servicegroup wie in Nagios definiert.
    x X-Koordinate
    y Y-Koordinate
    backend_idvererbt (global) Die in der Hauptkonfigurationsdatei definierte Backend-ID, die angibt, wo NagVis nach Objektzuständen suchen soll. Wenn dieser Parameter nicht angegeben wird, wird das in der Hauptkonfigurationsdatei unter "defaultbackend" angegebene Backend benutzt.
    context_menu vererbt (nagvis.ini.php) Aktivieren/deaktivieren des Kontext-Menüs auf Ihren Map-Objekten.
    context_templatevererbt (nagvis.ini.php)Default Context-Template, das auf dieser Map benutzt werden soll
    exclude_members

    Es ist möglich, member-Objekte komplett auszuschließen, während die Objektinformationen vom Backend geholt werden. Die gefilterten Elemente werden nirgendwo in diesem Objekt auftauchen.

    Details zur Filter-Syntax finden Sie bei der exclude regex-Definition. (Neu in 1.6b4)

    exclude_member_states

    Es ist möglich, ein oder mehrere member-Zustände während der Ermittlung des Gesamtzustands von Objekten auszuschließen. Die gefilterten Elemente werden in der member-Liste auftauchen, aber nicht für Gesamtstatusberechnungen benutzt.

    Details zur Filter-Syntax finden Sie bei der exclude regex-Definition. (Neu in 1.6b4)

    hover_menuvererbt (nagvis.ini.php)aktivieren/deaktivieren von Hover-Menüs
    hover_url URL, der im Hover-Menu statt der Standard-Informationen angezeigt werden soll. Verfügbare Makros:
    [servicegroup_name]: Dieses Makro steht für den Objektnamen.
    hover_templatevererbt (global) Hover template für dieses Objekt
    hover_timeoutvererbt (nagvis.ini.php)Default-Timeout (in Sekunden) bei Ajax-Abfragen in Hover-Menüs (veraltet ab 1.4)
    hover_delayvererbt (nagvis.ini.php)Verzögerung der Anzeige des Hover-Menus in Sekunden
    hover_childs_showvererbt (nagvis.ini.php)Anzeigen von Child-Objekten in Hover-Menüs
    hover_childs_sortvererbt (nagvis.ini.php)Sortierreihenfolge von Child-Objekten ("s"=Status, "a"=Alphabet)
    hover_childs_ordervererbt (nagvis.ini.php)Reihenfolge von Child-Objekten ("asc"=aufsteigend, "desc"=absteigend)
    hover_childs_limitvererbt (nagvis.ini.php)max. Anzahl von Child-Objekten
    iconsetvererbt (global) Spezielles Iconset. Wird vom global-Paragraph vererbt, falls es hier nicht angegeben wird
    label_showvererbt (global) Labelanzeige für die Map-Objekte aktivieren/deaktivieren
    label_text[name]Text des Labels, verfügbare Makros: [name] und [output]
    label_xvererbt (global)x-Position der Label in Pixeln (mit Vorzeichen +/- relativ zur linken, oberen Ecke der Icons, sonst absolute Position)
    label_yvererbt (global) y-Position der Label in Pixeln (mit Vorzeichen +/- relativ zur linken, oberen Ecke der Icons, sonst absolute Position)
    label_widthvererbt (global) Breite des Labels in Pixeln
    label_backgroundvererbt (global) Hintergrundfarbe des Labels. Die Farbe sollte als Hexcode angegeben werden, kann aber auch "transparent" sein.
    label_bordervererbt (global) Rahmenfarbe des Labels. Die Farbe sollte als Hexcode angegeben werden, kann aber auch "transparent" sein.
    label_stylevererbt (global) Benutzerdefiniertes Aussehen des Label-Textes im Format von HTML-Style-Attributen, z.B. font-family:sans;font-weight:bold;.
    line_arrow vererbt (global) Dies definiert die Pfeile am Linienende. Bisher wird dieses Attribut nur für die Linien zwischen Hosts in der Automap benutzt. Mögliche Werte: forward, back, both, none.
    line_typevererbt (global)Gibt den Typ der Linie an, wenn view_type=line ist. Gültige Werte sind
    "11" für Linien mit einem Pfeil an jedem Ende
    "10" für Linien mit zwei Pfeilen in der Mitte der Linie, die aufeinander zeigen
    "12" für Linien ohne Pfeile
    line_width vererbt (global) Dies definiert die Breite der Linie, wenn dieses Objekt als Linie angezeigt wird.
    only_hard_statesvererbt (global) Gibt an, ob Soft-Zustände ignoriert werden sollen. Default ist 0.
    url URL, auf den das Icon verweisen soll. Default ist ein Verweis auf die Nagios-CGIs. Verfügbare Makros: [servicegroup_name], [htmlcgi] und [htmlbase]. Der Wert kann leer sein, um den Link zu deaktivieren.
    url_target_selfZiel des Icon-Links, diese Option passt <a target=""> an (_self ist das gleiche Fenster). Verfügbare Makros: [name].
    use Kommaseparierte Liste von zu benutzenden Objekt-Templates. Details siehe template
    view_type icon Diese Option definiert das Aussehen dieses Objekts. Mögliche Werte sind: "icon" oder "line". Vor NagVis 1.4 konnten Sie das Aussehen eines Objekts durch die Option line_type ändern. Seit NagVis 1.4 müssen Sie die Option view_type benutzen, um Icons als Linien anzuzeigen.
    z1Die z-Option definiert die Reihenfolge, in der die Icons aufeinander gestapelt werden. Das Icon mit dem höchsten Wert wird auf der Spitze dargestellt. Das Hintergrundbild hat den Wert 0, so dass gültige Werte 1 oder größer sein müssen. Hinweis: Um Konflikte mit der Header-Navigation zu verhindern, sollte dieser Wert unter 100 bleiben.

    Map

    Beispiel mit allen Optionen, die gesetzt werden müssen (beachten Sie, dass Optionen nicht gesetzt werden müssen, wenn sie bereits im global-Abschnitt definiert wurden):
    define map {
          map_name=webserver
          x=77
          y=156
        }
    WertDefaultBeschreibung
    object_id Eindeutiger Bezeichner des Objekts auf der aktuellen Map. Jedes Objekt der Map benötigt eine object_id. Die object_id besteht aus alphanumerischen Zeichen beliebiger Länge. Wenn keine object_id angegeben ist, wird NagVis für das Objekt eine erzeugen (neu in 1.6)
    map_name Name der Map-Konfigurationsdatei (ohne .cfg-Erweiterung)
    x X-Koordinate
    y Y-Koordinate
    context_menu vererbt (nagvis.ini.php) Aktivieren/deaktivieren des Kontext-Menüs auf Ihren Map-Objekten.
    context_templatevererbt (nagvis.ini.php)Default Context-Template, das auf dieser Map benutzt werden soll
    exclude_members

    Es ist möglich, member-Objekte komplett auszuschließen, während die Objektinformationen vom Backend geholt werden. Die gefilterten Elemente werden nirgendwo in diesem Objekt auftauchen.

    Details zur Filter-Syntax finden Sie bei der exclude regex-Definition. (Neu in 1.6b4)

    exclude_member_states

    Es ist möglich, ein oder mehrere member-Zustände während der Ermittlung des Gesamtzustands von Objekten auszuschließen. Die gefilterten Elemente werden in der member-Liste auftauchen, aber nicht für Gesamtstatusberechnungen benutzt.

    Details zur Filter-Syntax finden Sie bei der exclude regex-Definition. (Neu in 1.6b4)

    hover_menuvererbt (nagvis.ini.php)aktivieren/deaktivieren von Hover-Menüs
    hover_url URL, der im Hover-Menu statt der Standard-Informationen angezeigt werden soll. Verfügbare Makros:
    [map_name]: Dieses Makro steht für den Objektnamen.
    hover_templatevererbt (global) Hover template für dieses Objekt
    hover_delayvererbt (nagvis.ini.php)Verzögerung der Anzeige des Hover-Menus in Sekunden
    hover_timeoutvererbt (nagvis.ini.php)Default-Timeout (in Sekunden) bei Ajax-Abfragen in Hover-Menüs (veraltet ab 1.4)
    hover_childs_showvererbt (nagvis.ini.php)Anzeigen von Child-Objekten in Hover-Menüs
    hover_childs_sortvererbt (nagvis.ini.php)Sortierreihenfolge von Child-Objekten ("s"=Status, "a"=Alphabet)
    hover_childs_ordervererbt (nagvis.ini.php)Reihenfolge von Child-Objekten ("asc"=aufsteigend, "desc"=absteigend)
    hover_childs_limitvererbt (nagvis.ini.php)max. Anzahl von Child-Objekten
    iconsetvererbt (global) Spezielles Iconset. Wird vom global-Paragraph vererbt, falls es hier nicht angegeben wird
    label_showvererbt (global) Labelanzeige für die Map-Objekte aktivieren/deaktivieren
    label_text[name]Text des Labels, verfügbare Makros: [name] und [output]
    label_xvererbt (global)x-Position der Label in Pixeln (mit Vorzeichen +/- relativ zur linken, oberen Ecke der Icons, sonst absolute Position)
    label_yvererbt (global) y-Position der Label in Pixeln (mit Vorzeichen +/- relativ zur linken, oberen Ecke der Icons, sonst absolute Position)
    label_widthvererbt (global) Breite des Labels in Pixeln
    label_backgroundvererbt (global) Hintergrundfarbe des Labels. Die Farbe sollte als Hexcode angegeben werden, kann aber auch "transparent" sein.
    label_bordervererbt (global) Rahmenfarbe des Labels. Die Farbe sollte als Hexcode angegeben werden, kann aber auch "transparent" sein.
    label_stylevererbt (global) Benutzerdefiniertes Aussehen des Label-Textes im Format von HTML-Style-Attributen, z.B. font-family:sans;font-weight:bold;.
    line_arrow vererbt (global) Dies definiert die Pfeile am Linienende. Bisher wird dieses Attribut nur für die Linien zwischen Hosts in der Automap benutzt. Mögliche Werte: forward, back, both, none.
    line_typevererbt (global)Gibt den Typ der Linie an, wenn view_type=line ist. Gültige Werte sind
    "11" für Linien mit einem Pfeil an jedem Ende
    "10" für Linien mit zwei Pfeilen in der Mitte der Linie, die aufeinander zeigen
    "12" für Linien ohne Pfeile
    line_width vererbt (global) Dies definiert die Breite der Linie, wenn dieses Objekt als Linie angezeigt wird.
    only_hard_statesvererbt (global) Gibt an, ob Soft-Zustände ignoriert werden sollen. Default ist 0.
    url URL, auf den das Icon verweisen soll. Default ist kein Verweis. Verfügbare Makros: [map_name], [htmlcgi] und [htmlbase]. Der Wert kann leer sein, um den Link zu deaktivieren.
    url_target_selfZiel des Icon-Links, diese Option passt <a target=""> an (_self ist das gleiche Fenster). Verfügbare Makros: [name].
    use Kommaseparierte Liste von zu benutzenden Objekt-Templates. Details siehe template
    view_type icon Diese Option definiert das Aussehen dieses Objekts. Mögliche Werte sind: "icon" oder "line". Vor NagVis 1.4 konnten Sie das Aussehen eines Objekts durch die Option line_type ändern. Seit NagVis 1.4 müssen Sie die Option view_type benutzen, um Icons als Linien anzuzeigen.
    z1Die z-Option definiert die Reihenfolge, in der die Icons aufeinander gestapelt werden. Das Icon mit dem höchsten Wert wird auf der Spitze dargestellt. Das Hintergrundbild hat den Wert 0, so dass gültige Werte 1 oder größer sein müssen. Hinweis: Um Konflikte mit der Header-Navigation zu verhindern, sollte dieser Wert unter 100 bleiben.

    Textbox

    Beispiel mit allen möglichen Optionen:
    define textbox {
          text="This is an informational text which can be placed anywhere on the map, HTML can also be used for formatting purposes"
          x=200
          y=100
          w=200
        }
    WertDefaultBeschreibung
    object_id Eindeutiger Bezeichner des Objekts auf der aktuellen Map. Jedes Objekt der Map benötigt eine object_id. Die object_id besteht aus alphanumerischen Zeichen beliebiger Länge. Wenn keine object_id angegeben ist, wird NagVis für das Objekt eine erzeugen (neu in 1.6)
    text Ihr eigener Text, HTML ist möglich. Es gibt die Makros
    [refresh_counter]: zeigt die Zeit bis zur nächsten Aktualisierung/Rotation
    [worker_last_run]: zeigt die Zeit des letzten "Worker-Runs"
    x X-Koordinate
    y Y-Koordinate
    wautoBreite der Textbox in px (Pixeln). "auto" bedeutet automatische Skalierung
    hautoHöhe der Textbox in px (Pixeln). "auto" bedeutet automatische Skalierung
    background_color#C0C0C0Hintergrundfarbe der Textbox. Die Farbe sollte als Hexcode angegeben werden, kann aber auch "transparent" sein.
    border_color#000000Rahmenfarbe der Textbox. Die Farbe sollte als Hexcode angegeben werden, kann aber auch "transparent" sein.
    style#000000Benutzerdefiniertes Aussehen des Textes im Format von HTML-Style-Attributen, z.B. font-family:sans;font-weight:bold;.
    use Kommaseparierte Liste von zu benutzenden Objekt-Templates. Details siehe template
    z1Die z-Option definiert die Reihenfolge, in der die Icons aufeinander gestapelt werden. Das Icon mit dem höchsten Wert wird an der Spitze dargestellt. Das Hintergrundbild hat den Wert 0, so dass gültige Werte 1 oder größer sein müssen. Hinweis: Um Konflikte mit der Header-Navigation zu verhindern, sollte dieser Wert unter 100 bleiben.

    Shape

    Beispiel mit allen Werten, die gesetzt werden müssen:
    define shape {
          icon="test"
          x=200
          y=100
        }
    WertDefaultBeschreibung
    object_id Eindeutiger Bezeichner des Objekts auf der aktuellen Map. Jedes Objekt der Map benötigt eine object_id. Die object_id besteht aus alphanumerischen Zeichen beliebiger Länge. Wenn keine object_id angegeben ist, wird NagVis für das Objekt eine erzeugen (neu in 1.6)
    Icon Dateiname des Shapes. Shapes müssen im shape-Verzeichnis abgelegt werden (Default: nagvis/images/shapes)
    x X-Koordinate
    y Y-Koordinate
    enable_refresh 0 Diese Option aktiviert das Shape für regelmäßige Aktualisierungen im Frontent. Dies wird nur für dynamische Shapes benötigt, die sich gelegentlich ändern.
    hover_menu 0 Aktivieren/Deaktivieren von Hover-Menüs
    hover_url URL, der beim Schweben über dem Bild anzuzeigen ist. Normalerweise gibt es keine Aktion während des Schwebens.
    hover_delayvererbt (nagvis.ini.php)Verzögerung der Anzeige des Hover-Menus in Sekunden
    url URL, auf den das Icon verweisen soll. Normalerweise gibt es keinen Verweis.
    url_target_selfZiel des Icon-Links, diese Option passt <a target=""> an (_self ist das gleiche Fenster)
    use Kommaseparierte Liste von zu benutzenden Objekt-Templates. Details siehe template
    z1Die z-Option definiert die Reihenfolge, in der die Icons aufeinander gestapelt werden. Das Icon mit dem höchsten Wert wird auf der Spitze dargestellt. Das Hintergrundbild hat den Wert 0, so dass gültige Werte 1 oder größer sein müssen. Hinweis: Um Konflikte mit der Header-Navigation zu verhindern, sollte dieser Wert unter 100 bleiben.

    Line

    Die Linie ist ein statusloses Layout-Element, um Elemente zu verbinden und statuslose Verbindungen zwischen anderen Objekten darzustellen. Der Objekttyp wurde erstellt, um das Design weniger statisch zu gestalten.

    Beispiel mit allen Werten, die gesetzt werden müssen:
    define line {
          line_type=1
          x=200
          y=100
        }
    WertDefaultBeschreibung
    object_id Eindeutiger Bezeichner des Objekts auf der aktuellen Map. Jedes Objekt der Map benötigt eine object_id. Die object_id besteht aus alphanumerischen Zeichen beliebiger Länge. Wenn keine object_id angegeben ist, wird NagVis für das Objekt eine erzeugen (neu in 1.6)
    line_type Gibt den Typ der Linie an, wenn view_type=line ist. Gültige Werte sind
    "11" für Linien mit einem Pfeil an jedem Ende
    "10" für Linien mit zwei Pfeilen in der Mitte der Linie, die aufeinander zeigen
    "12" für Linien ohne Pfeile
    x X-Koordinate
    y Y-Koordinate
    hover_menu 0 Aktivieren/Deaktivieren von Hover-Menüs
    hover_url URL, der beim Schweben über dem Bild anzuzeigen ist. Normalerweise gibt es keine Aktion während des Schwebens.
    hover_delayvererbt (nagvis.ini.php)Verzögerung der Anzeige des Hover-Menus in Sekunden
    line_arrow vererbt (global) Dies definiert die Pfeile am Linienende. Bisher wird dieses Attribut nur für die Linien zwischen Hosts in der Automap benutzt. Mögliche Werte: forward, back, both, none.
    line_color #ffffff Die Füllfarbe der Linie, kann auch "transparent" sein.
    line_color_border #000000 Die Randfarbe der Linie, kann auch "transparent" sein.
    line_width vererbt (global) Dies definiert die Breite der Linie, wenn dieses Objekt als Linie angezeigt wird.
    url URL, auf den das Icon verweisen soll. Normalerweise gibt es keinen Verweis.
    url_target_selfZiel des Icon-Links, diese Option passt <a target=""> an (_self ist das gleiche Fenster)
    use Kommaseparierte Liste von zu benutzenden Objekt-Templates. Details siehe template
    z1Die z-Option definiert die Reihenfolge, in der die Icons aufeinander gestapelt werden. Das Icon mit dem höchsten Wert wird auf der Spitze dargestellt. Das Hintergrundbild hat den Wert 0, so dass gültige Werte 1 oder größer sein müssen. Hinweis: Um Konflikte mit der Header-Navigation zu verhindern, sollte dieser Wert unter 100 bleiben.

    Template

    Seit Nagvis 1.2 gibt es eine neue Objektart namens template. Mit diesem Objekt haben Sie die Möglichkeit, alle optionalen Werte in einem Objekt zu definieren, das für viele andere gilt. Sie können alle Attribute auf die Werte setzen, die Sie benötigen und diese mit dem use-Attribut an andere Objekte vererben.

    Zur Zeit müssen die Templates direkt in den Dateien definiert werden, weil die WUI die Definition nicht unterstützt. Wahrscheinlich wird dies in folgenden Versionen möglich sein.

    Beispiel mit allen Werten, die gesetzt werden müssen:
    define template {
          name=generic-template
        }
    WertDefaultBeschreibung
    name Template-Name (einfache Zeichenkette ohne Leerzeichen muss in der Map eindeutig sein)
    ... Alle Werte, die in den Objekten verfügbar sind, die dieses Template erben
    nagvis-1.7.10+dfsg1/docs/de_DE/maps.html000066400000000000000000000207361225466040700176230ustar00rootroot00000000000000 NagVis-Maps

    Statische und dynamische Maps

    Die verschiedenen Ansichten in NagVis heißen "maps". Der klassische und gebräuchlichste Typ der NagVis-Maps sind die statischen Maps. Das bedeutet, dass man mit Hilfe des Web-basierten Konfigurations-Editors oder eines Text-Editors eine Map-Konfiguration erstellt.

    Ab NagVis 1.7 gibt es eine neue Erweiterung der Map-Konfiguration. Sie basiert weiterhin auf dem statischen Map-Konfigurations-Ansatz, aber nun ist es möglich, diese statischen Konfigurationsteile mit dynamischen und programmierbaren Mechanismen zu erweitern.

    Die neue Möglichkeit wurde "map sources" benannt. Jede Map kann eine oder mehreren Map-Sources nutzen. Jede dieser Sources kann die gesamte Map-Konfiguration löschen, ersetzen oder verändern.

    Ein Map-Source besteht aus verschiedenen PHP-Funktionen mit einem standardisierten Satz von Parametern. Die Funktionen sind komplett frei in dem, was sie tun. Eine Source kann z.B. CSV-Datei mit Objekten und Koordinaten lesen, sich mit Datenbanken verbinden, um Informationen zu holen, oder Daten von externen Diensten lesen. Der Entwickler entscheidet.

    Die Map-Sources-API

    Textdateien mit PHP-Code müssen im Verzeichnis share/server/core/sources relativ zum NagVis-Basis-Verzeichnis stehen. In OMD werden die Site-spezifischen Dateien im Verzeichnis local/share/nagvis/htdocs/server/core/sources relativ zum Site-Basisverzeichnis abgelegt.

    Es gibt keine 1:1-Relation zwischen den Dateien und den Sources selbst. Eine Datei kann eine, mehrere oder gar keine Source enthalten (z.B. um Funktionen zu definieren, die von mehreren Sources benutzt werden).

    Eine Map-Source besteht aus zwei PHP-Funktionen, die die folgenden Spezifikationen erfüllen müssen:

    FunktionsnamenmusterParameter
    process_<source-name>

    Dies ist die tatsäliche Verarbeitungsfunktion. Sie kann die aktive Map-Konfiguration ersetzen. Der Return-Code der Funktion wird im Moment nicht genutzt.

    $MAPCFG - das GlobalMapCfg-PHP-Objekt
    $map_name - der Name der Map als Zeichenkette
    &$map_config - Referenz des Map-Konfigurations-Arrays. Dieses Array muss modifiziert werden, um die Map-Konfiguration zu ändern.
    changed_<source-name>

    Diese Funktion wird genutzt, um der Verarbeitung der Map-Konfigurationen mitzuteilen, ob sie erneut geladen werden muss oder nicht. Die Funktion muss "true" zurückliefern, damit NagVis die Konfiguration erneut verarbeitet. Das bedeutet auch, dass die process_* für alle konfigurierten Sources ausgeführt wird.

    $MAPCFG - das GlobalMapCfg-PHP-Objekt
    $compare_time - der Unix-Zeitstempel der aktuell zwischengespeicherten Map-Konfiguration.

    Während eine Map-Konfiguration geladen wird, prüft NagVis, ob diese bereits analysiert und zwischengespeichert wurde. Ist das der Fall und der Cache ist aktuell, dann kann NagVis diese Daten viel schneller verarbeiten als wenn die Daten erst analysiert und geprüft werden müssten.

    Im Allgemeinen vergleicht NagVis die Zeitstempel der verwendeten Konfigurationsdateien (Haupt- und Map-Konfigurationsdateien) mit dem Map-Konfigurations-Cache, um diese Entscheidung zu treffen.

    Wenn Map-Sources verwendet werden, muss jede Source dem Map-Konfigurationsverarbeitungs-Code mitteilen, ob die Map-Konfiguration erneut geladen werden muss oder der Map-Konfigurations-Cache benutzt werden kann. Dies erfolgt durch die changed_*-Funktion jeder Source. Wenn diese Funktion "true" zurückliefert, wird NagVis die Map-Konfiguration erneut laden.

    Die Map-Konfiguration zu laden bedeutet, dass NagVis die Map-Konfigurationsdatei analysiert, um das Array der Map-Objekte zu füllen. Dann werden diese Daten geprüft, um fehlerhafte Konfigurationen zu verhindern. Danach werden alle konfigurierten Map-Sources verarbeitet, um diesen die Möglichkeit zu geben, die Map-Konfiguration zu verändern.

    Jede Map-Source kann Anzeigeparameter und Konfigurationsvariablen definieren, die in den Maps verfügbar sind, die diese Sourcen verwenden. Dies ist eine Beispieldefinition der Geomap-Map-Source:

    // options to be modifiable by the user(url)
    global $viewParams;
    $viewParams = array(
        'geomap' => array(
            'zoom',
            'geomap_type',
            'source_file',
        )
    );
    
    // Config variables to be registered for this source
    global $configVars;
    $configVars = array(
        'geomap_type' => array(
            'must'       => false,
            'default'    => 'osmarender',
            'match'      => '/^(osmarender|mapnik|cycle)$/i',
            'field_type' => 'dropdown',
            'list'       => 'list_geomap_types',
        ),
        'source_file' => array(
            'must'       => false,
            'default'    => '',
            'match'      => MATCH_STRING_EMPTY,
            'field_type' => 'dropdown',
            'list'       => 'list_geomap_source_files',
        ),
        'zoom' => array(
            'must'       => false,
            'default'    => '',
            'match'      => MATCH_INTEGER_EMPTY,
        ),
    );
      

    Diese Definitionen führen zu a) drei neuen Map-Konfigurationsoptionen im global-Abschnitt der Map und b) zur Verfügbarkeit der Variablen in den URLs der Maps, die diese Source verwenden.

    Allgemeine Map-Anzeigeparameter

    Seit der Implementierung der Map-Sources können sogar reguläre Maps ohne konfigurierte Sources mit Hilfe einiger Standard- Anzeigeparameter verändert werden. Einige der Parameter sind nicht komplett neu, sondern sie wurden lediglich zu Anzeigeparametern. umkodiert. Hier ist die Liste der allgemeinen Anzeigeparameter:

    ParameterBeschreibung
    backend_id Ändert das zu verwendende Standard-Backend der aktuellen Map. Einzelheiten finden Sie in der Beschreibung der Option in der Map-Konfiguration.
    iconset Überschreibt das iconset, das im global-Abschnitt der Map konfiguriert ist. Einzelheiten finden Sie in der Beschreibung der Option Map-Konfiguration.
    width Kann benutzt werden, um die Breite der Map-Anzeige zu ändern. Wird zurzeit nicht von regulären Maps verwendet. Diese Option wird nur von einigen Map-Sources benutzt.
    height Kann benutzt werden, um die Höhe der Map-Anzeige zu ändern. Wird zurzeit nicht von regulären Maps verwendet. Diese Option wird nur von einigen Map-Sources benutzt.
    header_menu Überschreibt die header_menu-Einstellung im global-Abschnitt der Map. Einzelheiten finden Sie in der Beschreibung der Option in der Map-Konfiguration.
    hover_menu Überschreibt die hover_menu-Einstellung im global-Abschnitt der Map. Einzelheiten finden Sie in der Beschreibung der Option in der Map-Konfiguration.
    context_menu Überschreibt die context_menu-Einstellung im global-Abschnitt der Map. Einzelheiten finden Sie in der Beschreibung der Option in der Map-Konfiguration.

    Standard-Map-Sources

    Im Moment sind zwei Map-Sources für NagVis verfügbar. Beschreibungen zu den geomap- und den automap-Sources finden Sie auf den jeweils Dokumentationsseiten.

    nagvis-1.7.10+dfsg1/docs/de_DE/nagvis_config_format_description.html000066400000000000000000001111021225466040700254360ustar00rootroot00000000000000 nagvis_config_format_description

    Formatbeschreibung der Hauptkonfigurationsdatei

    Allgemeine Informationen

    Die Hauptkonfigurationsdatei ist im reinen Textformat im Stil der "ini"-Dateien.
    Abschnitte sind durch [] markiert und Variablen haben einen zugewiesenen Wert. Die Variablen müssen auch im richtigen Abschnitt stehen, so dass Sie sicherstellen müssen, dass ggf. auch der Abschnitt aktiviert ist.
    Semikola (;) werden benutzt, um Kommentare zu markieren. Abschnitte und Variablen mit einem vorangestellten Semikolon werden als Kommentare angesehen und von NagVis nicht erkannt.

    Bei einer neuen NagVis-Installation gibt es keine Datei mit einer Default-Konfiguration. Standardwerte sind im PHP-Code enthalten. Konfigurationseinstellungen in der Datei etc/nagvis.ini.php übersteuern diese Standardwerte.
    Es gibt eine Datei etc/nagvis.ini.php-sample mit Beispiel-Konfigurationswerten. Alle Werte sind auskommentiert.

    Überblick

    • global
      allgemeine Optionen, die die gesamte NagVis-Installation beeinflussen
    • paths
      Pfaddefinitionen
    • defaults
      Standardwerte, die an die Maps und ihre Objekte vererbt werden
    • index
      Optionen, um die Übersichtsseite für NagVis zu konfigurieren
    • automap
      Optionen für die Automap
    • wui
      Optionen für die WUI
    • worker
      Optionen für den Worker
    • backend_*
      Backend-Definitionen
    • rotation_*
      Rotationspool-Definitionen
    • states
      Optionen, die die Behandlung und das Aussehen der verschiedenen Zustände beeinflussen

    Beschreibung der Abschnitte im Detail

    global

    Alle Werte, die für das gesamte NagVis gelten, werden im global-Abschnitt gespeichert.
    WertDefaultBeschreibung
    audit_log1Aktivieren/deaktiviern der Protokollierung von sicherheitsrelevanten Benutzeraktionen in NagVis. Benutzeran- und abmeldungen werden z.B. in var/nagvis-audit.log protokolliert.
    authmoduleCoreAuthModSQLiteDefiniert das zu benutzende Authentifizierungsmodul. Per Default benutzt NagVis das eingebaute SQLite-Authentifizierungsmodul. Bei der Auslieferung ist kein anderes Authentifizierungsmodul verfügbar. Es ist möglich, andere Authentifizierungsmodule hinzuzufügen, um andere Authentifizierungsmechanismen zu unterstützen. Weitere Einzelheiten finden Sie in der Authentifizierungsmodul-Dokumentation
    authorisationmoduleCoreAuthorisationModSQLiteDefiniert das zu benutzende Autorisierungsmodul. Per Default benutzt NagVis das eingebaute SQLite-Autorisierungsmodul. Bei der Auslieferung ist kein anderes Autorisierungsmodul verfügbar. Es ist möglich, andere Autorisierungsmodule hinzuzufügen, um andere Autorisierungsmechanismen zu unterstützen. Weitere Einzelheiten finden Sie in der Autorisierungsmodul-Dokumentation
    controls_size (neu in 1.6) 10 Die Größe (in Pixeln) von Objekt-Kontrollelementen in entsperrten (Edit)-Modus im Frontend. Objekt-Kontrollelemente sind z.B. die "modify"-, "delete"- und "move"-Icons.
    dateformatY-m-d H:i:sDas in NagVis benutzte Format für Datum- und Zeit. Verfügbare Optionen wie bei der date()-Funktion von php
    displayheader1Anzeigen des Header-Menus in Maps Veraltet ab Version 1.4, siehe Option "headermenu" in den default- und index-Abschnitten
    languageen_USWählen Sie die Sprache, die in NagVis benutzt werden soll. de_DE (Deutsch), en_US (Englisch), fr_FR (Französisch) und pt_BR (brasilianisches Portugiesisch; ab 1.4.4) sind als Standard verfügbar). Seit 1.4 müssen Sie die Sprache in einem anderen Format angeben. ("de_DE" statt "german")
    language_availablede_DE,en_US,es_ES,fr_FR,pt_BRSie möchten Ihren Benutzern vielleicht eine Auswahl an verschiedenen Sprachen anbieten. Sie können das Verhalten kontrollieren, ohne die Sprachdateien aus Ihrer NagVis-Installation zu löschen. Wenn dieser Wert nicht gefüllt ist, werden alle vorkonfigurierten Sprachen angeboten. Wenn Sie eine weitere Sprache hinzufügen möchten, dann müssen Sie den Wert hier eintragen
    language_detectionuser,session,browser,configDies kontrolliert, wie NagVis die Sprache des Benutzers ermitteln soll. NagVis kennt mehrere Mechanismen zur Erkennung der Sprache:
    - user: explizit vom Benutzer eingestellte Sprache
    - session: wenn der Benutzer eine Sprache wählt, dann wird diese in der Session gespeichert
    - browser: NagVis versucht, die Sprache mit Hilfe des Browser-Agenten zu ermitteln
    - config: die Default-Sprache der Installation
    Die Reihenfolge der Optionen bestimmt die Reihenfolge, in der NagVis die verschiedenen Mechanismen benutzt
    logonmoduleLogonMixedDefiniert das zu benutzende Logon-Modul. Per Default benutzt NagVis das Mixed-Auth-Modul, das dem Benutzernamen vertraut, der per REMOTE_USER oder dem HTML-Logon-Dialog zur Abfrage von Authentifizierungsinformationen übergeben wurde, falls REMOTE_USER nicht gesetzt ist.

    Bei der Auslieferung sind die folgenden Module verfügbar:

    LogonMixed: Das gemischte Logon-Modul benutzt das LogonEnv-Modul als Standard und das LogonDialog-Modul als Ausweichlösung, falls LogonEnv keinen Benutzernamen zurückliefert. Das sollte den Anforderungen in den meisten Umgebungen genügen.

    LogonDialog: Dies ist ein HTML-Anmeldedialog, um die Authentifizierungsinformationen abzufragen.

    LogonEnv: Es ist möglich, einen vollständig zu "trauendem" Authentifizierungsmechanismus wie in den Vorgängerversionen von NagVis zu realisieren. Auf diese Weise wird der Benutzer nicht wirklich authentifiziert. NagVis vertraut dem gelieferten Benutzernamen implizit. NagVis benutzt die konfigurierte Umgebungsvariable, um den Benutzer zu identifizieren. Sie können Ihrem Webserver verschiedene Authentifizierungsmechanismen hinzufügen, angefangen mit der Basic-Authentifizierung, die von Nagios genutzt wird (.htaccess) bis hin zu Single-Sign-On-Umgebungen.
    Setzen Sie einfach logonmodule auf "LogonEnv", setzen Sie die als Benutzername zu verwendende Umgebungsvariable auf die Option logonenvvar und teilen Sie dem Authentifizierungsmodul mit, dass Benutzer in der Datenbank neu anzulegen sind, wenn der gelieferte Benutzer noch nicht vorhanden ist. Die Option logonenvcreaterole weist das Authentifizierungsmodul an, den neuen Benutzer einer Rolle zuzuweisen. Setzen Sie die Option auf einen leeren String, um dieses Verhalten auszuschalten.

    LogonMultisite: Dieses Modul benutzt die Authentifizierung von auth_*-Cookies, die von Check_MK-Multisite geliefert werden, wenn die Cookie-basierte Authentifizierung verwendet wird.

    Es ist möglich, eigene Logon-Module hinzuzufügen, um andere Dialoge zu bedienen. Weitere Informantionen finden Sie in der logon module-Dokumentation.

    logonenvvarREMOTE_USERDefiniert die Umgebungsvariable, die für das Holen des authentifizierten Benutzers aus der Webserver-Umgebung benutzt werden soll. Diese Option wird nur für die Logon-Module LogonEnv und LogonMixed verwendet.
    logonenvcreateuser1Veranlasst das LogonEnv/LogonMixedModul, ein Benutzerkonto für jeden unbekannten Benutzer anzulegen, der die NagVis-Seite öffnet. Diese Option wird nur für die Logon-Module LogonEnv und LogonMixed verwendet.
    logonenvcreateroleGuestsVeranlasst das LogonEnv/LogonMixedModul, die Benutzerkonten mit der angegebenen Rolle anzulegen. Diese Option wird nur für die Logon-Module LogonEnv und LogonMixed verwendet.
    logon_multisite_htpasswd Der Pfad zur htpasswd-Datei, die von Multisite benutzt wird (wird nur vom LogonMultisite-Modul verwendet).
    logon_multisite_secret Der Pfad zur auth-secret-Datei, die von Multisite benutzt wird (wird nur vom LogonMultisite-Modul verwendet).
    logon_multisite_createuser 1 Gleich wie die "logonenvcreateuser"-Option (wird nur vom LogonMultisite-Modul verwendet).
    logon_multisite_createrole Guest Gleich wie die "logonenvcreaterole"-Option (wird nur vom LogonMultisite-Modul verwendet).
    refreshtime60Aktualisierungsintervall in Maps bzw. laden der nächsten Map bei Map-Rotation
    sesscookiedomainautomatisch ermitteltVielleicht möchten Sie festlegen, für welche Domain NagVis das Session-Cookie speichern soll. Per Default versucht NagVis, den Wert mit Hilfe der Web-Server-Umgebungsvariablen selbst zu ermitteln. Dies sollte in den meisten Umgebungen funktionieren, könnte sich aber z.B. durch URL-Rewriting ändern.
    sesscookiepathautomatisch ermitteltVielleicht möchten Sie den Pfad festlegen, für den NagVis das Session-Cookie speichern soll. Per Default versucht NagVis, den Wert mit Hilfe der paths/htmlbase-Variablen selbst zu ermitteln. Dies sollte in den meisten Umgebungen funktionieren, könnte sich aber z.B. durch URL-Rewriting ändern.
    sesscookieduration86400 Lebensdauer des Cookies in Sekunden. Der Standardwert ist auf 24 Stunden eingestellt. Das NagVis-Session-Cookie wird bei jedem Seitenaufruf erneuert. Wenn eine Session lnger als die eingestellte Zeit untätig ist, wird sie ungültig.
    startmoduleoverviewDas anzuzeigende Startmodul, wenn vom Benutzer keins angegeben wird.
    startactionviewDie Default-Aktion, wenn vom Benutzer keine angegeben wird.
    startshow Der startshow-Parameter wird zur Zeit nur von einigen Views benutzt. Er wird von den Map- und AutoMap-Modulen verwendet.

    paths

    In diesem Abschnitt werden alle benötigten Pfad-Variablen definiert.
    WertDefaultBeschreibung
    base/usr/local/nagvis/share/absoluter physikalischer NagVis-Pfad
    htmlbase/nagvisabsoluter html-NagVis-Pfad
    htmlcgi/nagvis/cgi-binabsoluter html-NagVis-cgi-Pfad

    defaults

    Default-Werte für Maps, die Sie benutzen. Wenn für die Map bzw. ein Element kein Wert angegeben wurde, dann wird ein Standardwert benutzt.
    WertDefaultBeschreibung
    backendlive_1Default-Backend (ID des Backends - kopieren Sie den Text, der für <backend-id> steht, nach [backend_<backend-id>])
    backgroundcolortransparentDefault-Hintergrundfarbe für Maps
    contextmenu0Aktivieren/Deaktivieren des Kontextmenüs auf Ihren Map-Objekten.
    contexttemplatedefaultDefault context template.
    eventbackground 0 aktivieren (1) bzw. deaktivieren (0) des Wechselns der Hintergrundfarbe bei Statusänderungen (die konfigurierte Farbe wird gezeigt, wenn der Gesamtstatus PENDING, OK oder UP ist)
    eventhighlight 1 aktivieren (1) bzw. deaktivieren (0) der Hervorhebung von Statusänderungen durch Hinzufügen einer blinkenden Umrandung
    eventhighlightduration 10000 Dauer der Hervorhebung in Millisekunden
    eventhighlightinterval 500 Intervall der Hervorhebung in Millisekunden
    eventlog 0 aktivieren (1) bzw. deaktivieren (0) des Ereignisprotokolls im neuen JavaScript-Frontend. Das Ereignisprotokoll enthält wichtige Aktionen und Informationen
    eventlogevents24Anzahl von Ereignissen im Ereignisprotokoll-Rckblick
    eventloglevel info Loglevel des Ereignisprotokolls (verfügbar: debug, info, warning, critical)
    eventheight 100 Höhe des JavaScript-Eventlogs in Pixeln
    eventhidden 1 Verstecken/Zeigen des Eventlogs während des Map-Ladens
    eventscroll 1 aktivieren (1) bzw. deaktivieren (0) des Bewegens zu dem Icon, das den Status verändert hat, falls das Icon nicht im sichtbaren Bereich liegt
    eventsound 1 aktivieren (1) bzw. deaktivieren (0) von Sound-Signalen bei Statusänderungen
    headerfade 0 aktivieren/deaktivieren des Abblendeffekts in den Untermenüs des Header-Menüs (wenn das verwendete Header-Menü diese Option unterstützt).
    headermenu1aktivieren (1) bzw. deaktivieren (0) des Headermenüs
    headertemplatedefaultDefault header template
    hoverchildslimit10max. Anzahl von Child-Objekten
    hoverchildsorderascReihenfolge von Child-Objekten ("asc"=aufsteigend, "desc"=absteigend)
    hoverchildsshow1Anzeigen von Child-Objekten in Hover-Menüs
    hoverchildssortaSortierreihenfolge von Child-Objekten ("s"=Status, "a"=Alphabet)
    hoverdelay0Verzögerung des Hover-Menü-Auftretens (in Sekunden)
    hovermenu1aktivieren/deaktivieren von Hover-Menüs
    hovertemplatedefaultDefault hover template
    hovertimeout5Default-Timeout bei Ajax-Anfragen in Hover-Menüs (in Sekunden) veraltet ab 1.4
    icons std_medium Default-Iconset
    onlyhardstates0nur Hard-Zustände benutzen (keine Soft-Zustände)
    recognizeservices1Service-Zustände in Host/Hostgroup-Objekten erkennen
    showinlists1Anzeigen von Maps in Listen (Dropdowns, Index-Seite, ...)
    showinmultisite 1 Anzeigen der Maps im Multisite-Snapin
    stylesheetDateiname des benutzerdefinierten Stylesheets, das in den Maps verwendet werden soll. Die Datei muss im share/nagvis/styles-Verzeichnis abgelegt werden.
    urltarget_selfZiel des Icon-Links, diese Option passt <a target=""> an (_self ist das gleiche Fenster)
    hosturl[htmlcgi]/status.cgi?host=[host_name]Die Default-URL, die bei einem Links-Klicks des Benutzers auf ein Host-Objekt benutzt wird. Verfügbare Makros: [htmlcgi], [htmlbase], [host_name], [backend_id]
    hostgroupurl [htmlcgi]/status.cgi?hostgroup=[hostgroup_name] Die Default-URL, die bei einem Links-Klicks des Benutzers auf ein Hostgruppen-Objekt benutzt wird. Verfügbare Makros: [htmlcgi], [htmlbase], [hostgroup_name], [backend_id]
    serviceurl [htmlcgi]/extinfo.cgi?type=2&host=[host_name]&service=[service_description] Die Default-URL, die bei einem Links-Klicks des Benutzers auf ein Service-Objekt benutzt wird. Verfügbare Makros: [htmlcgi], [htmlbase], [host_name], [service_description], [backend_id]
    servicegroupurl [htmlcgi]/status.cgi?servicegroup=[servicegroup_name] Die Default-URL, die bei einem Links-Klicks des Benutzers auf ein Servicegruppen-Objekt benutzt wird. Verfügbare Makros: [htmlcgi], [htmlbase], [servicegroup_name], [backend_id]
    mapurl [htmlbase]/index.php?mod=Map&act=view&show=[map_name] Die Default-URL, die bei einem Links-Klicks des Benutzers auf ein Map-Objekt benutzt wird. Verfügbare Makros: [htmlcgi], [htmlbase], [map_name]
    view_template default In den verschiedenen Views zu benutzendes Template.

    index

    Dieses sind die Optionen für die Übersichtsseite von NagVis.
    WertDefaultBeschreibung
    backgroundcolor#ffffffDefault-Hintergrundfarbe für die Übersichtsseite
    cellsperrow4Maps pro Zeile in Map-Listen.
    headermenu1aktivieren (1) bzw. deaktivieren (0) des Headermenüs
    headertemplatedefaultDefault header template
    showautomaps1aktivieren/deaktivieren der Anzeige von Automaps
    showmaps1aktivieren/deaktivieren der Anzeige von Maps
    showmapthumbs1aktivieren/deaktivieren der Anzeige von Map-Thumbnails
    showrotations1aktivieren/deaktivieren der Anzeige von definierten Rotationen

    automap

    Setzt die Automap-Optionen.
    WertDefaultBeschreibung
    defaultparams&childLayers=2Dies sind die Parameter für die Automap-Ansichten und Links in den Listen (Map-Indexseite, Dropdown-Menüs in den Headern)
    defaultrootlocalhostDefault-Wert für das Root-Objekt. Details finden Sie in der Automap-Dokumentation
    graphvizpath/usr/local/binwenn die graphviz-Binaries (dot,neato,twopi,...) nicht über PATH gefunden werden können, muss der Pfad hier gesetzt werden
    showinlists1aktivieren/deaktivieren der Automap in Map-Listen (Map-Indexseite, Dropdown-Menüs in den Headern)

    wui

    Dieses sind die Optionen für die WUI.
    WertDefaultBeschreibung
    autoupdatefreq25In diesem Intervall wird die Map von der WUI gesichert (veraltet ab 1.6).
    grid_color#f7f7f7Die Farbe der Rasterlinien.
    grid_show0Aktivieren (1) bzw. deaktivieren (0) eines Rasters, um die Ausrichtung von Objekten im WUI zu vereinfachen. Objekte werden an der linken, oberen Ecke ausgerichtet.
    grid_steps32Größe des Rasters in Pixeln.
    headermenu1Aktivieren (1) bzw. deaktivieren (0) des Header-Menüs im WUI (veraltet ab 1.6).
    headertemplatedefaultzu benutzendes Standard-Header-Template im WUI (veraltet ab 1.5).
    maplocktime5Zeit in Minuten, die eine Map von einem editierenden Benutzer blockiert wird.

    worker

    Optionen für den neuen Worker im JavaScript-Frontend von NagVis.
    WertDefaultBeschreibung
    interval 5 Das Intervall in Sekunden, in dem der Worker auf zu aktualisierende Objekte prüft.
    requestmaxlength 1900 Die maximale Länge von HTTP-Requests während Ajax-HTTP-Requests. Einige Intrusion Detection/Prevention-Systeme haben ein Problem mit zu langen Queries.
    requestmaxparams 0 Die maximale Anzahl von Parametern in Ajax-HTTP-Requests. Einige Intrusion Detection/Prevention-Systeme haben Probleme mit zu vielen Parametern im URL. 0 = keine Begrenzung.
    updateobjectstates 15 Die Aufbewahrungszeit in Sekunden für die Zustände im Frontend. Die Statusinformationen werden nach Ablauf dieser Zeit im folgenden Worker-Intervall aufgefrischt.

    backend_*

    Die Backend-Abschnitte zur Definition der Backends werden alle [backend_<backend-id>] benannt. In dem Beispiel ist live_1 die backend_id.

    Abhängig vom Wert in backendtype müssen die gültigen Werte für die Backends gesetzt werden. In diesem Beispiel ist es das MKLivestatus-Backend.
    [backend_live_1]
        backendtype="mklivestatus"
        htmlcgi="/nagios/cgi-bin"
        ; the following options depend on the selected backendtype, in this case it is MKLivestatus
        socket="unix:/usr/local/nagios/var/rw/live
    WertDefaultBeschreibung
    backendtypemklivestatusArt des Backends - MUSS gesetzt werden
    statushost 

    Der "statushost" kann genutzt werden, um lästige Timeouts zu vermeiden, wenn ein Backend nicht erreichbar ist. Dies ist nur sinnvoll in Multi-Backend-Umgebungen.

    Es funktioniert wie folgt: Die Annahme ist, dass es ein "lokales" Backend gibt, das den Host des "entfernten" Backends überwacht. Wenn der entfernte Backend-Host als "UP" gemeldet wird, dann wird das Backend ganz normal abgefragt.

    Wenn der entfernte Backend-Host als "DOWN" oder "UNREACHABLE" gemeldet wird, dann wird NagVis solange keine Verbindung dorthin versuchen, bis der Backend-Host wieder verfügbar ist.

    Der "statushost" muss im folgenden Format angegeben werdent: "<backend_id>:<hostname>" -> e.g. "live_2:nagios"

    Der Host muss in einem anderen Backend sein als der aktuelle, damit es funktioniert.

    htmlcgi/nagios/cgi-binPfad zum cgi-bin-Verzeichnis dieses Backends (wichtig bei mehreren Backends)
    custom_1Erste benutzerdefinierte Variable, die in den Context- und Hover-Menüs verfügbar ist. Mit dieser Option können verschiedene benutzerdefinierte URLs zu den Context-/Hover-Menüs hinzugefügt werden, die jeweils vom Backend abhängig sind. Das ist u.a. nutzbar, wenn Links auf verschiedene Nagios-Instanzen hinzugefügt werden sollen.
    custom_2Zweite benutzerdefinierte Variable (s.o).
    custom_3Dritte benutzerdefinierte Variable (s.o).

    Die Backend-spezifischen Optionen finden Sie in der Backend-Dokumentation.

    rotation_*

    Definiert verschiedene Map-Rotationspools. In diesem Beispiel schaltet der Browser alle 15 Sekunden zwischen den Maps "demo" und "demo2" hin und her. Die Rotation wird aktiviert durch die URL: index.php?rotation=<rotation-id>. In diesem Fall ist die Rotation-ID "demo"
    [rotation_demo]
        maps="demo,demo2"
        interval=15
    WertDefaultBeschreibung
    interval15Map-Rotationsintervall in Sekunden
    maps kommaseparierte Liste von Maps in diesem Pool, die zu rotieren sind. Sie können auch externe URLs durch [ ] klammern (z.B. maps="demo1,[http://localhost/test.php]". Die URL muss von dem Server erreichbar sein, auf dem NagVis läuft.

    Sie können Label im folgenden Format hinzufügen: <label>:<map> und <label>:<[url]>. Die Label werden in der Rotationsliste angezeigt.

    Es ist außerdem möglich, Automaps zu Rotationen hinzuzufügen. Setzen Sie einfach ein "@"-Zeichen vor den Name der Automap, um sie der Rotation hinzuzufügen.

    states

    Optionen, die die Behandlung und das Aussehen der verschiedenen Zustände in der NagVis-Installation beeinflussen.

    Diese Einstellungen definieren das Verhalten der Zustandsbehandlung. Hauptsächlich ist es möglich zu konfigurieren, welcher Zustand einen anderen "überdeckt". Ein kritischer Zustand (5) wird eine Warnung (4) überdecken, ein bestätigter kritischer Zustand (2) wird nicht eine Warnung (4) überdecken.

    >
    WertDefault
    unreachable8
    unreachable_ack5
    unreachable_downtime5
    down7
    down_ack5
    down_downtime5
    critical7
    critical_ack5
    critical_downtime5
    warning6
    warning_ack4
    warning_downtime4
    unknown3
    unknown_ack2
    unknown_downtime2
    error3
    error_ack2
    error_downtime2
    ok1
    up1
    unchecked (neu in 1.6)0
    pending0

    Diese Einstellungen definieren das Verhalten der Zustände im Frontend.

    • *_bgcolor: Die bgcolor-Option wird als Hintergrundfarbe bei Eventhandlern benutzt.
    • *_color: Sie können die Vordergrundfarben konfigurieren, die u.a. als Linienfarben und der Hervorhebung von Eventhandlern benutzt werden.
    • *_sound: Die Sound-Dateien werden bei Änderungen in den genannten Zustand abgespielt (muss MP3-Format sein).
    ValueDefault
    unreachable_bgcolor#F1811B
    unreachable_color#F1811B
    unreachable_ack_bgcolor
    unreachable_downtime_bgcolor
    unreachable_soundstd_unreachable.mp3
    down_bgcolor#FF0000
    down_color#FF0000
    down_ack_bgcolor
    down_downtime_bgcolor
    down_soundstd_down.mp3
    critical_bgcolor#FF0000
    critical_color#FF0000
    critical_ack_bgcolor
    critical_downtime_bgcolor
    critical_soundstd_critical.mp3
    warning_bgcolor#FFFF00
    warning_color#FFFF00
    warning_ack_bgcolor
    warning_downtime_bgcolor
    warning_soundstd_warning.mp3
    unknown_bgcolor#FFCC66
    unknown_color#FFCC66
    unknown_ack_bgcolor
    unknown_downtime_bgcolor
    unknown_sound
    error_bgcolor#0000FF
    error_color#0000FF
    error_ack_bgcolor
    error_downtime_bgcolor
    error_sound
    ok_bgcolor#00FF00
    ok_color#00FF00
    ok
    up_bgcolor#00FF00
    up_color#00FF00
    up_sound
    unchecked_bgcolor (neu in 1.6)#C0C0C0
    unchecked_color (neu in 1.6)#C0C0C0
    unchecked_sound (neu in 1.6)
    pending_bgcolor#C0C0C0
    pending_color#C0C0C0
    pending_sound
    nagvis-1.7.10+dfsg1/docs/de_DE/system_requirements.html000066400000000000000000000105321225466040700230030ustar00rootroot00000000000000 system_requirements

    Systemvoraussetzungen

    Nagios®/Icinga (installiert, konfiguriert, lauffähig)

    Sie benötigen ein installiertes, konfiguriertes und lauffähiges Nagios/Icinga, damit NagVis funktioniert.
    Nagios bekommen Sie auf der offiziellen Nagios Homepage, Schnellstart-Installationsanleitungen finden Sie u.a. hier.
    Neben verfügbaren Paketen/Downloads finden Sie weitere Informationen auf der offiziellen Icinga-Homepage, die aktuelle Dokumentation hier.

    MKLivestatus (installiert, konfiguriert, lauffähig)

    Seit NagVis 1.5 ist MKLivestatus das Default-Backend, weil es viel schneller, leichtgewichtiger und stabiler als NDO ist. Außerdem ist es einfacher zu handhaben und zu installieren. Sie benötigen keine Datenbank für MKLivestatus.

    MKLivestatus ist ein Eventbroker-Modul für Nagios, das einen Unix-Socket versorgt, mit dem sich Addons wie NagVis verbinden können, um aktuelle Statusinformationen abzufragen.

    MKLivestatus bekommen Sie auf der offiziellen MKLivestatus-Homepage.

    Webserver mit PHP-Unterstützung

    NagVis ist eine webbasierte Applikation, die in JavaScript und PHP realisiert ist. Sie benötigen daher einen Web-Server mit PHP-Unterstützung. Wir empfehlen den Einsatz des Apache-Webservers mit mod_php.

    Die minimale PHP-Version ist 5.0.0

    benötigte PHP-Module

    Neben dem PHP-Basis-Paket benötigen Sie noch die folgenden Module. Die Namen sind teilweise abhängig von der Distribution:

    • php5-gd
    • php5-gettext
    • php5-mbstring
    • php5-session
    • php5-json (integriert seit PHP 5.2)
    • php5-pdo und pdo-sqlite (seit 1.5 für Authentifizierung/Autorisierung)
    Anmerkung: möglicherweise sind einige dieser Funktionen bereits in Ihrer PHP-Version enthalten. php -m zeigt die eingebauten Module.

    Spezielle Voraussetzungen für einzelne Backends

    Die Backends verbinden sich mit externen Datenquellen und benötigen oftmals spezielle Module. Hier ist eine Liste für verschiedene Backends.

    mklivestatus
    • php-net-socket (Debian) / php5-sockets (SLES)
    ndomy
    • php5-mysql
    merlinmy
    • php5-mysql

    Graphviz für die Automap-Funktionalität

    Die Automap basiert auf GraphViz. Sie brauchen es, wenn Sie das Automap-Feature nutzen möchten. Wir empfehlen GraphViz >= 2.14 für die Automap (ältere Versionen (mit niedrigeren Versionsnummern) haben Probleme mit Truecolor-Rendering).

    GraphViz ist in einigen Distributionen enthalten. Wenn Sie kein vorgefertigtes Paket benutzen können, bekommen Sie GraphViz auf der offiziellen GraphViz-Homepage, und können es selbst kompilieren.

    Sie benötigen weitere Packages wie gd, libpng, freetyp, ... aber wenn Sie Graphviz kompiliert/installiert haben, sollte es funktionieren.

    nagvis-1.7.10+dfsg1/docs/de_DE/toc.html000066400000000000000000000133251225466040700174440ustar00rootroot00000000000000 Inhalt

    Inhalt

    Über
    Was ist NagVis?
    Wie NagVis arbeitet?
    Lizenzierung

    Systemvoraussetzungen
    Changelog

    Installation/Update
    NagVis-Installer
    manuelle Installation
    manuelles Update
    Installieren in eine OMD-Site
    Nach der Installation

    Ansichten
    Nutzeransichten
    Statische und dynamische Maps
    Automap
    Geomap*

    Konfiguration
    Hauptkonfigurationsdatei
    Map-Konfigurationsdatei
    Automap-Konfigurationsdatei

    Authentifizierung/Autorisierung
    Allgemeines
    Rollen/Berechtigungen
    "Alte" Autorisierung
    erweiterte Features
    Backends
    MKLivestatus
    NDOMy
    NagiosBP
    Gadgets
    Context-Templates
    Header-Templates
    Hover-Templates
    Wetterkarten-Linien

    anpassen/erweitern
    Eigene Iconsets
    Eigene Shapes
    Sprachdateien
    Templates installieren
    Eigene Kontext-Aktionen

    NagVis Logo

    SourceForge.net Logo

    nagvis-1.7.10+dfsg1/docs/de_DE/update_instructions.html000066400000000000000000000114611225466040700227640ustar00rootroot00000000000000 Update-Hinweise

    NagVis Update-Hinweise

    Achtung: Diese Informationen sind nicht aktuell

    Wichtigste Regel: machen Sie immer ein Backup, bevor Sie eine existierende Installation aktualisieren.

    Es gibt mehrere Fälle der Aktualisierung:
    1. Aktualisierung einer sehr alten Hauptversion (1.1.x, 1.2.x, 1.3.x, 1.4.x)
    2. Aktualisierung der letzten Hauptversion (1.5.x)

    Aktualisierung von NagVis 1.4 oder darunter

    Es gab viele Änderungen an der inneren Struktur von NagVis und den Konfigurationswerten. Der beste Weg zur Aktualisierung auf die neueste NagVis-Version ist, die neue Version als Neuinstallation aufzusetzen und Ihre Maps/Icons/Konfigurationen usw. manuell zu migrieren.

    Sie sollten einen Blick auf die folgenden Stellen werfen:
    • Maps (etc/maps)
    • kopieren Sie einfach alle Map-Konfigurationsdateien
    • Hintergrundbilder (nagvis/images/maps)
    • kopieren Sie einfach alle Hintergrundbilder
    • Iconsets (nagvis/images/iconsets)
    • kopieren Sie einfach alles, was nicht "std_*" heißt
    • Shapes (nagvis/images/shapes)
    • kopieren Sie einfach alles
    • Templates (nagvis/templates/hover und nagvis/images/templates/header)
    • kopieren Sie einfach Ihre eigenen Templates. Achtung: Überschreiben Sie nicht die Default-Templates. Möglicherweise müssen Sie Ihre vor-1.4-Templates aktualisieren. Mehr Informationen finden Sie auf der Template download-Seite.
    • Template-Bilder (nagvis/images/templates/hover und nagvis/images/templates/header)
    • kopieren Sie einfach alles.
    • Hauptkonfiguration (etc/nagvis.inc.php)
    • Sie sollten diese Datei nicht kopieren. Der beste Weg ist, die Beispieldatei der neuen NagVis-Version nach etc/nagvis.inc.php zu kopieren und die Werte Ihrer alten Installation manuell in die neue Datei zu migrieren.

    Aktualisierung von NagVis 1.4x

    Von NagVis 1.4x nach 1.5x wurde eine Menge an der Verzeichnisstruktur geändert. Das mitgelieferte Installations-Script kann NagVis 1.4x/1.5x auf das letzte 1.6x-Release aktualisieren. Daher wird empfohlen, dieses Script (install.sh) zur Aktualisierung zu nutzen.

    Die Berechtigungskonfiguration hat sich in NagVis 1.5 geändert. Deshalb entfernt das Installationsscript die Direktiven allowed_for_config und allowed_users aus den Map-Konfigurationsdateien. Die Berechtigungen werden nicht automatisch in die Berechtigungsdatenbank geladen, sondern in die nagvis/etc/auth-backup-Datei geschrieben. Mit diesen Informationen können Sie die Berechtigungen für die Maps im neuen rollenbasierten Berechtigungssystem vergeben.

    Es ist auch möglich, den Update von 1.4x auf 1.6x manuell durchzuführen, aber das wurde bisher weder getestet noch dokumentiert. Generell sollte es so funktionieren wie oben beschrieben (also kopieren der eigenen Dateien an die neuen Stellen und anpassen der nagvis.ini.php, nicht kopieren).
    Wenn Sie also die Installation selbst erledigen möchten, dann werden Sie etwas probieren müssen. Bitte leiten Sie dann Ihre Erfahrungen an uns weiter, damit wir diese Dokumentation erweitern können.

    Überprüfen Sie nach der Aktualisierung die Berechtigungen nagvis-1.7.10+dfsg1/docs/de_DE/user_interface.html000066400000000000000000000065041225466040700216560ustar00rootroot00000000000000 User-Interface

    User-Interface

    Diese Seite soll die unterschiedlichen Ansichten des NagVis-User-Interfaces beschreiben. Die Pfade sind relativ zum NagVis-root-Verzeichnis.

    URLBeschreibung
    NagVis Frontend
    index.phpDies ist eine Weiterleitung zu nagvis/index.php (NagVis-Frontend)
    nagvis/frontend/nagvis-js/index.phpDies ist der Map-Index, die Hauptseite von NagVis. Auf der Hauptseite sind alle Maps aufgeführt, für die der Benutzer berechtigt ist. Sie können eine Map ausschließen, indem Sie die show_in_lists-Option auf 0 setzen.
    nagvis/frontend/nagvis-js/index.php?mod=Map&show=<name>Dies ist die klassische Map-Ansicht. In diesem Modus wird die angegebene Map angezeigt und mit Hilfe von Ajax-Aufrufen an den NagVis-Core aktualisiert.

    Die folgenden Parameter sind verfügbar:

    search=<regex>Suchen nach einem Map-Objekt während des Ladevorgangs. Gefundene Objekte werden hervorgehoben.
    rotation=<name>Rotieren der Objekte im angegebenen Rotations-Pool, wenn die Map Bestandteil des Pools ist.
    header_menu=1/0
    enableHeader=1/0
    Aktivieren/Deaktivieren des Header-Menüs, unabhängig von der Konfigurationseinstellung
    hover_menu=1/0
    enableHover=1/0
    Aktivieren/Deaktivieren des Hover-Menüs, unabhängig von der Konfigurationseinstellung
    context_menu=1/0
    enableContext=1/0
    Aktivieren/Deaktivieren des Context-Menüs, unabhängig von der Konfigurationseinstellung
    nagvis/frontend/nagvis-js/index.php?infoDies ist eine Seite mit Support-Informationen, die Sie mitliefern können, wenn Sie Probleme mit NagVis haben.
    Rotationen
    nagvis/frontend/nagvis-js/index.php?Rotation=<name>Dies ist der Map-Rotationsmodus. In diesem Modus wird die erste angegebene Map angezeigt (Rotation muss in der Hauptkonfigurationsdatei definiert werden). Nach einem definierten Intervall wird die nächste angegebene Map geladen usf.
    nagvis-1.7.10+dfsg1/docs/de_DE/welcome.html000066400000000000000000000025031225466040700203060ustar00rootroot00000000000000 Willkommen

    NagVis 1.7 Dokumentation

    Gilt für NagVis Version: 1.7.x
    Sprache: Deutsch (DE)
    Zur Verfügung gestellt durch: NagVis Project Team

    Wenn Sie Probleme bei der Nutzung dieser Informationen haben, kontaktieren Sie uns unter www.nagvis.org.

    Copyright © 2008-2012 NagVis Project

    nagvis-1.7.10+dfsg1/docs/en_US/000077500000000000000000000000001225466040700160365ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/docs/en_US/about.html000066400000000000000000000105771225466040700200500ustar00rootroot00000000000000 About

    About

    What is NagVis?

    NagVis is a visualization addon for the well known network management system Nagios® (and Icinga which is a fork of Nagios).

    NagVis can be used to visualize Nagios data, e.g. to display IT processes like a mail system or a network infrastructure. Using data supplied by a backend it will update objects placed on maps in certain intervals to reflect the current state. These maps allow to arrange the objects to display them in different layouts:

    • physical (e.g. all hosts in a rack/room/department)
    • logical (e.g. all application servers)
    • geographical (e.g. all hosts in a country)
    • business processes (e.g. all hosts/services involved in a process)

    How does NagVis work?

    In general NagVis is a presentation tool for the information which is gathered by Nagios and transferred using backends.

    The supported backends are:

    The backend gets the information from the Nagios process (mklivestatus) or from a database (NDOUtils/IDOUtils, merlin).

    You can place all objects from Nagios (Host, Services, Hostgroups, Servicegroups) on so called maps. Each map can be configured through its own configuration file. You can edit the configuration files directly by using your favourite text editor or the web configuration mechanisms. Furthermore you can add some special NagVis objects to the maps. These objects are shapes, textboxes and reference objects for other maps.

    Each of the objects on your maps can be configured to fit your needs. For example there are links to the Nagios frontend on each object which represents a Nagios object. You can easily customize these links.
    There is a hover menu which is enabled by default. The hover menu displays detailed information for each object. Hover menus can easily be modified by changing the templates for them. You can also disable the hover menu.
    By default the state of the objects is displayed using icons on the map. You can change these icons by adding iconsets from the NagVis homepage or create your own. The state of the objects can also be displayed as lines or as gadgets.

    Apart from the normal maps there is an automap. The objects are places automatically starting from the root host you specified. Depending on the value of the directice "filter_by_state" it will show all objects or only the ones in a non-OK state (including the way from the root object).
    To be able to use the automap you have to define the parents directives in your Nagios host objects.
    Starting with NagVis 1.5 you can define more than one automap.

    Licensing

    NagVis is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

    NagVis is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

    nagvis-1.7.10+dfsg1/docs/en_US/after_installation.html000066400000000000000000000110241225466040700226040ustar00rootroot00000000000000 After Installation

    After Installation

    Demonstration views

    NagVis contains several demo maps on initial installation. There is also a rotation defined to give you an example of the features of NagVis. Certainly Nagvis has a lot more features than we can show you with this demo configurations. So you should read the documentation and be creative.

    If you are familiar with NagVis you can delete these demonstration maps and rotation without problems.

    Configuration Files

    NagVis is based on several configuration files. The main configuration file stores the basic and global configuration options. The map specific configuration options are stored in map configuration files located in etc/maps. A special type of maps are the automaps. Take a look at the automap configuration documentation for details.

    The whole NagVis configuration can be changed using the web based configuration dialogs.

    Authentication/Authorisation

    By default NagVis uses an internal user and permission database (SQLite) for handling authentication and authorisation. Nagvis uses a role based permission system. After installation there are two default users defined:

    • Username: admin, Password: admin
    • Username: guest, Password: guest

    The following roles with these permissions are available:

    • Administrators: Full permissions on the whole installation
    • Users: Read access to all maps, automaps and rotations in the installation
    • Guests: Read access to all demo maps, automaps and rotations

    These default users and roles should be sufficient for the beginning. You may delete these users and roles but please be aware not to delete the last administrative user.

    Troubleshooting

    During installation

    • The installer complains about missing prerequisites/modules.

      Please be sure that you have a current PHP version, that all required modules are installed for NagVis and the backend you want to use and that GraphViz is already there. Some PHP modules might already be included in the base package (please use "php -m" to check).

      Please check install.log for errors.

    After installation

    • You only get a blank page while trying to access the main page.

      Please check the Apache logs for "permission denied" messages. It is most likely that SElinux is active. Please disable it (setenforce 0) or allow NagVis to access the files.

    • After adding objects to a map it isn't displayed any more.

      Please check the Apache logs for "memory limit exceeded" messages. It is most likely that the memory settings in php.ini have to be increased. Please restart your WebServer afterwards.

    Please take a look at the doc section of the official website (namely "FAQ" and "Often reported errors") as well. If this doesn't help then read on.

    HELP

    You might seek help at the official NagVis website or use the monitoring portal which offers a board for NagVis questions.

    In any case please provide at LEAST information about

    • the operating system (distribution, version)
    • the NagVis version (including if installed from os provided package or source)
    • grep "^[^;|^$]" <config file> (if you have a configuration related issue). Replace "<config file>" by the name of the config file which might be in error
    • Apache log messages (error log)
    • the support information (Menu -> "Need Help?" -> "NagVis Support Information")
    • nagvis-1.7.10+dfsg1/docs/en_US/auth.html000066400000000000000000000033741225466040700176740ustar00rootroot00000000000000 Authentication / Authorisation

      Authentication / Authorisation (AA)

      In the versions prior to 1.5 NagVis didn't care much about the authentication and authorisation. In most environments NagVis used the basic authentication provided by Nagios. This was a side effect of that NagVis was placed in the nagios/share directory.

      In NagVis 1.5 the default installation directory has been moved to an own base directory. With this step a new Authentication and Authorisation mechanism has been created. The main focus of this concept is to be modular and flexible.

      Modularity

      The AA has been splitted up in three module bases: LogonDialogs, Authentication, Authorisation. All modules can be changed without affecting the others.

      Default Modules

      By default NagVis uses a mixed logon information request mode for logging on users and a SQLite database for storing users, passwords and permissions. Therefor NagVis uses the LogonMixed module which uses LogonEnv and LogonDialog in the background. The LogonMixed module tries to gather the logon user name from the webserver environment. This means NagVis trusts the webserver authentication if one is used. And if there is none it displays the LogonDialog for interactive login using the HTML logon dialog.

      Other Modules

      On delivery there are only the above authentication and authorisation modules available. Having such a modular structure it should be easy to create LDAP, MySQL, file based authentication and authorisation mechanism.

      nagvis-1.7.10+dfsg1/docs/en_US/auth_modules.html000066400000000000000000000000001225466040700214030ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/docs/en_US/auth_old_style.html000066400000000000000000000032371225466040700217500ustar00rootroot00000000000000 Authentication / Authorisation

      Old Style Authentication

      In the versions prior to 1.5 NagVis didn't care much about the authentication and authorisation. In most environments NagVis used the basic authentication provided by Nagios. This was a side effect of that NagVis was placed in the nagios/share directory.

      In NagVis 1.5 the default installation directory has been moved to an own base directory. With this step a new Authentication and Authorisation mechanism has been created. The main focus of this concept is to be modular and flexible.

      If you really like to use the basic authentication provided by Nagios you may use the LogonMixed (default) or LogonEnv module to set up a trusted authentication. The only difference is that the LogonMixed falls back to the HTML form LogonDialog when no user is given by the webserver while LogonEnv simply shows an access denied message.

      To enable this simply set the following options in the [global] section of the NagVis main configuration file:

      logonmodule="LogonEnv"
      logonenvvar="REMOTE_USER"
      logonenvcreateuser="1"

      These lines advise NagVis to use the LogonEnv module which reads the authenticated user from an environment variable. The second parameter tells the LogonEnv module which variable to use for reading the users name. The third option tells the LogonEnv module to create unknown users in the NagVis AA database.

      nagvis-1.7.10+dfsg1/docs/en_US/authorisation_modules.html000066400000000000000000000000001225466040700233330ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/docs/en_US/authorisation_roles_perms.html000066400000000000000000000114361225466040700242340ustar00rootroot00000000000000 Roles / Permissions

      Permission Management

      Since release 1.5 NagVis contains a very detailed permission management. It is a role based concept where users can be assigned to one or several roles while the roles have permissions assigned.

      The permissions of the different roles of a user are summarised and control the actions the user is able to perform.

      Roles

      Default Roles

      In a fresh installation there are four roles defined:

      • Administrators: Full permissions throughout the whole installation
      • Managers: Read and write access to all maps, automaps and rotations. Allowed to create new maps, automaps and rotations.
      • Users (read-only): Read access to all maps, automaps and rotations throughout the installation
      • Guests: Read access to all demo maps, automaps and rotations

      These default roles should be sufficient in the beginning. You may delete these users and roles but please be aware NOT to delete the last administrative user and role.

      Customising the Roles

      It is possible to create new roles for customising the permissions of users and groups of users.

      For example it is easy to create a role for all SAP administrators which then can only access the SAP related maps.

      Permissions

      The permissions are hardcoded in NagVis. A single permission consists of three elements:

      • Module: The related module (Map, Automap, Rotation, ...)
      • Action: The related action (view, edit, delete, ...)
      • Object: The related object (A particular user, map, ...)

      Each of those three elements can be set by a dedicated name or alternatively by a wildcard "*" which then matches all modules, actions or objects.

      Here is a list of all available permissions in NagVis:

      nagvis-1.7.10+dfsg1/docs/en_US/automap.html000066400000000000000000000246171225466040700204040ustar00rootroot00000000000000NagVis Automap

      NagVis Automap

      Introduction

      The NagVis Automap was introduced in NagVis 1.3. The main topic of this feature is to replace the builtin map in Nagios. The main problem of the Nagios map is that it is not scalable. In big Nagios installations the automap is not usable. This is e.g. caused by missing configuration options like selecting a defined scope of elements to display. NagVis handles the objects and defines a configuration for Graphviz. The map image and the HTML-Code for the links are generated by graphviz and passed on to NagVis.

      Prerequisites

      • Graphviz >= 2.14 for the automap (lower versions have problems with truecolor rendering). You also need more packages like gd,libpng,freetype, ... but if you get graphviz compiled/installed it should work.
      • You have to define dependencies between hosts starting with the Nagios server. Please have a look at the Nagios documentation on how to do this

      First call

      If you have no experience with the automap yet, take a look at the demo automaps installed with NagVis (demo-automap and demo-automap2). You should be able to open those automaps right after installation of NagVis from the "Open" menu in header navigation. If everything is configured properly the root host and three levels of child hosts should be displayed on the demonstration automap "demo-automap".

      Map configuration

      In the past, the automaps were configured in special configuration files located in etc/automaps, but this has changed with NagVis 1.7. The automap configuration files are created as regular map configurations (like described in map configuration). To create an automap in NagVis 1.7 you have to set the map source to automap. To do this, you need to add the sources parameter to the global section and set its value to automap.

      Main configuration

      Some parameters for the automap can be set in the main configuration of NagVis. For further information see Main Configuration.

      URL Parameters

      The automap can be called with several url parameters. Since NagVis 1.7 these options can be put into the global section of the map configuration to persist those parameters. Here is a list of the automap options:
      ModuleActionObjectDescription
      ***Grants full access to NagVis. No other permissions are needed.
      Authlogout*Allows a user to logout from NagVis.
      AutoMapadd*Create a new automap.
      AutoMapdelete*Delete all automaps.
      AutoMapedit*Edit all automaps.
      AutoMapview*View all automaps.
      AutoMapdelete<Name>Delete a specific automap.
      AutoMapedit<Name>Edit a specific automap.
      AutoMapview<Name>View a specific automap.
      ChangePasswordchange*Allows a user to change one's own password.
      General**
      MainCfgedit*
      Mapadd*
      Mapdelete*
      Mapedit*
      Mapview*
      Mapdelete<Name>Delete a specific map.
      Mapedit<Name>Edit a specific map.
      Mapview<Name>View a specific map.
      Overviewview*
      RoleMgmtmanage*
      Rotationview*
      Rotationview<Name>View a specific rotation.
      Searchview*Search objects on maps and automaps.
      UserMgmtmanage*
      ParameterDefaultDescription
      showThe name of the automap. Since NagVis 1.5 different automap configuration files can be defined. The automap to view needs to be set here.
      backend_id backend default backend The backend-id of the backend to fetch the objects from. For details see the [backend_*] section in the Main Configuration
      root see root object definition This is the name of the root object. It is not essential to set the host here. There are some more ways to tell the root object. For details see the root object definition chapter on this page.
      child_layers childLayers2Maximum layers of child hosts to be displayed.
      parent_layers parentLayers0Maximum layers of parent hosts to be displayed.
      render_mode renderMode undirected Set the render mode of the map. For details see available render modes
      width 1024 width of the automap in pixels
      height 786 height of the automap in pixels
      ignore_hosts ignoreHosts none comma separated list of hosts (including children) not to display
      filter_by_state filterByStatenoneSet to 1 to enable the "problem automap" mode. When it is set to 1 it will exclude all branches which have only OK/UP hosts. This will result in a "problem automap" which only shows up a tree where each branch has at least one problem.
      filter_by_idExclude specified object_ids, is mostly used internal (new in 1.7)
      filter_group filterGroupnoneProvide a hostgroup name. Only hosts in this hostgroup will be shown on the map.
      searchnoneSearch for a map object on map load. Matching objects will be highlighted.
      rankdirLRConfigure direction of directed automaps, can be set to TB (Top/Bottom) and LR (Left/Right) (new in 1.7)
      rotationnoneRotate in the given rotation pool when the map is a step in the pool.
      header_menu enableHeadernoneEnable/Disable the header menu. To be specified as integer (1/0). Overrides the configuration.
      hover_menu enableHovernoneEnable/Disable the hover menus. To be specified as integer (1/0). Overrides the configuration.
      context_menu enableContextnoneEnable/Disable the context menus. To be specified as integer (1/0). Overrides the configuration.
      margin50Sets the free area on the border of the automap graph. Has to be specified in pixels.
      overlaptrueConfigure collision handling of objects (take a look at the graphviz docs for explanations of the values) (new in 1.7)

      Root object definition

      The approach of the automap is to start at one root object and go down the dependency-tree like defined in Nagios and show all these objects on the map. There are several ways to get the root object:
      • URL-Parameter: The root object can be set by the parameter root.
      • Main configuration: The defaultroot option can be set in the [automap] section.
      • Auto detection: Ask the backend for a host without parent. This only works when there is ONE host in your Nagios installation without any parent object.
      The list above is ordered by priority.

      Available render modes

      There are several render modes available:
      Mode Example image
      directed
      undirected
      radial
      circular
      undirected2

      Automap to Map export

      Since NagVis 1.5 it is possible to export the current automap view as a classic NagVis map. Exporting automaps to classic maps you get the advantages of both worlds.

      You can start with the automap to get all the object positioned on your maps using the automap render modes. Once you finished the rendering you can export the automap including the generated background image to a regular map using the "Export to map" which can be found in the "Actions" submenu in your header menu.

      Using the exported map you can add design elements as you like and customize your layout according to your needs.

      A map can be exported multiple times to the same target map but it will overwrite all changes you made to the target map before. You can only overwrite maps you have edit permissions on.

      A classic map can not be turned into an automap.

      Host URLs

      The URLs of the host objects are used for identifying the host objects during automap rendering. Especially the "host=" parameter is important. When this parameter is missing in the host URLs the object positions can not be gathered.

      By default this information should not be of interest to you. But when you customize the host URLs in your NagVis installation it is important to know that your custom URL needs to have the "host=" parameter set to the hostname of the object to be able to use the hosts on the automap.

      nagvis-1.7.10+dfsg1/docs/en_US/automap_config_format.html000066400000000000000000000256371225466040700233040ustar00rootroot00000000000000 Automap Configuration

      Automap configuration format description

      General Information

      The NagVis automap configuration format is equal to the map configuration format with small differences in the available parameters.

      Object types

      Description of the object types

      Global

      The first definition in every config file should be of the special type "global". Options which are defined at this paragraph are valid for the whole map and are getting inherited to other types defined later.

      Example with all options which have to be set:

      define global {
       map_image=lan.png
      }
      ValueDefaultDescription
      aliasmap_nameThe alias is the label for each map. If it is defined it is shown everywhere in NagVis frontend.
      backend_idinherited (nagvis.ini.php) Backend-ID defined in Main Configuration file where NagVis should search for the object states. If this parameter is not given, the Backend defined as "defaultbackend" at the Main Configuration file is used.
      background_colorinherited (nagvis.ini.php) Background colour of this map. If this is not set backgroundcolor from Main Configuration file is taken.
      context_menu inherited (nagvis.ini.php) Enable/Disable the context menu on your map objects.
      context_templateinherited (nagvis.ini.php)Default context template to be used on this map
      default_params inherited (nagvis.ini.php) Default parameters to take when the different options are not given by url. Format is as in the URL e.g. &childLayers=2. Valid options can be found here. Deprecated since 1.6.4 - use regualar map config options instead.
      event_backgroundinherited (nagvis.ini.php)Enable/Disable changing background colour on state changes (Configured colour is shown when summary state is PENDING, OK or UP).
      event_highlightinherited (nagvis.ini.php)Enable/Disable highlighting of the state changing object by adding a flashing border.
      event_highlight_durationinherited (nagvis.ini.php)Set the highlight duration in milliseconds
      event_highlight_intervalinherited (nagvis.ini.php)Set the highlight interval in milliseconds
      event_loginherited (nagvis.ini.php)Enable/Disable the eventlog in the new javascript frontend. The eventlog keeps track of important actions and information.
      event_log_levelinherited (nagvis.ini.php)Loglevel of the eventlog (Available: debug, info, warning, critical).
      event_log_heightinherited (nagvis.ini.php)Height of the javascript eventlog in px
      event_log_hiddeninherited (nagvis.ini.php)Hide/Show the eventlog on map loading
      event_scrollinherited (nagvis.ini.php)Enable/Disable scrolling to the icon which changed the state when the icon is out of the visible scope.
      event_soundinherited (nagvis.ini.php)Enable/Disable sound signals on state changes.
      header_menu inherited (nagvis.ini.php) Enable/Disable the header menu
      header_template inherited (nagvis.ini.php) header template to be used on ths map
      hover_menu inherited (nagvis.ini.php) Enable/Disable the hover menu
      hover_delay inherited (nagvis.ini.php) Delay of hover menu appearance in seconds
      hover_template inherited (nagvis.ini.php) Default hover template to be used on this map
      hover_childs_show inherited (nagvis.ini.php) Enable/Disable displaying child objects
      hover_childs_limit inherited (nagvis.ini.php) Number of maximum children to be displayed. Set to -1 to disable the limit.
      hover_childs_order inherited (nagvis.ini.php) Order direction of child objects
      hover_childs_sort inherited (nagvis.ini.php) Sort method of child objects
      iconset inherited (nagvis.ini.php) Iconset to use as default for all objects placed on the map. Can be overwritten on a per object base.
      In the example "std_small" is used which means an OK state will be displayed using "std_small_ok.png", a CRITICAL state will be displayed by using "std_small_critical.png" and so on.
      in_maintenance 0 Enable/Disable the maintenance mode of this map. If a map is in maintenance mode only a message gets displayed instead of the map.
      label_show 0 Enable/Disable labels for the maps objects
      label_x -20 Default x-position of the labels in px (with prefix + or - relative to the upper left corner of the icons, otherwise absolute position)
      label_y +20 Default y-position of the labels in px (with prefix + or - relative to the upper left corner of the icons, otherwise absolute position)
      label_width auto Default width of the labels in px
      label_background transparent Default background colour of the labels. The colour should be given in hexcode. Can also be "transparent".
      label_border #000000 Default border colour of the labels. The colour should be given in hexcode. Can also be "transparent".
      label_styleCustom styling for the label text. To be given like HTML style attribute contents. E.g. font-family:sans;font-weight:bold;
      line_type Specifies the type of line when view_type=line. Valid values are:
      "11" for lines with one arrow at the end of a line.
      "10" for lines with two arrows pointing to each other in the middle of the line.
      "12" for plain lines without arrow.
      line_arrowforward This defines the arrows at the end of the line. At the moment this attribute is only being used for the lines between hosts on the automap. Possible values: forward, back, both, none.
      line_width3This defines the width of the line in px when this object is being displayed as line.
      only_hard_states inherited (nagvis.ini.php) Sets whether soft states should be ignored. Default setting is 0.
      recognize_services inherited (nagvis.ini.php) Sets whether the states of the services on hosts, hostgroup objects should be recognised. If this is not given in the config it's set to 1.
      show_in_lists inherited (nagvis.ini.php) Show the maps in lists (dropdowns, index page, ...)
      stylesheetinherited (nagvis.ini.php)Filename of the custom stylesheet to use on the maps (The file needs to be located in the share/nagvis/styles directory)
      url_target_self Target of the Icon link, this option adapts <a target=""> (_self is same window)
      nagvis-1.7.10+dfsg1/docs/en_US/backend_mklivestatus.html000066400000000000000000000057001225466040700231300ustar00rootroot00000000000000 MKLivestatus NagVis backend

      MKLivestatus backend

      MKLivestatus is a very simple and smart Nagios eventbroker module. Livestatus is concepted and tuned to reduce disk, memory and cpu load caused by live-data processing on the Nagios system. Just as NDO, Livestatus makes use of the Nagios Event Broker API and loads a binary module into the Nagios process. But other than the NDO, Livestatus does not actively write out data e.g. to the disk. Instead, it opens a socket for external applications to connect to and fetches the current status information from Nagios. For details about the new data access provider take a look at the official documentation.

      Since the first NagVis 1.5 release the mklivestatus backend is included on delivery. It performs much better than all other existing backends and comes with less overhead than other backends. No additional database is needed to make this backend work.

      ValueDefaultDescription
      socket unix:/usr/local/nagios/var/rw/live

      The socket to connect to can be a local unix socket or a tcp socket. You have to define the type at the beginning of the string. Set "unix:" for unix sockets or "tcp:" for tcp sockets.

      In case of the unix socket you need to specify the path of the livestatus unix socket to connect to.

      When using a tcp socket you have to enter a host address and a tcp port using the following scheme: <host>:<port>. The host address can be an IP address or an FQDN.

      timeout 5 New in 1.6.4: This option controls the connect timeout of the livestatus socket. This is just a fallback. To prevent timeouts when accessing remote sites you really should configure a statushost for the backend. For details take a look at the general backend parameters documented in the backend section of the main configuration format description.

      There are also some general parameters. You can read about them in main configuration format description.

      nagvis-1.7.10+dfsg1/docs/en_US/backend_nagiosbp.html000066400000000000000000000066331225466040700222050ustar00rootroot00000000000000 NagVis NagiosBP Backend

      NagiosBP Backend

      The NagiosBP backend is used to connect NagVis directly with the Nagios Business Process addons which are used to build business process aggregations out of Nagios status information.

      The NagiosBP API

      NagiosBP offers a webservice which is called by HTTP GET requests and responds with JSON objects. The documentation for this JSON API can be found here.

      Representation in NagVis

      This backend is a special one compared to the other backends which handle Nagios status information 1:1. This backend mainly handles business processes but also Nagios service state information. As result of this fact the backend needs to perform some sort of translation to create Nagios-like objects from the business processes.

      During design of this backend it turned out that the business processes should be mapped to servicegroup objects. Out of this decision we have two results:

      • Each business process results in one servicegroup
      • The backend only provides servicegroup objects (the other objects need to be pulled directly from Nagios using the other backends)

      Another special property of the NagiosBP backend is the fact that NagVis has not to calculate the summary (aggregated) states using its own algorithms. Instead of this the NagiosBP backend sets the states/outputs of the NagiosBP servicegroups using the state information provided by NagiosBP.

      The servicegroup links (left click on icon) are automatically set by the NagiosBP backend to point to the NagiosBP GUI, except when the url parameter of the servicegroup is configured to point to another map (e.g. [htmlbase]/index.php?mod=Map&act=view&show=bp-webshop-details).

      Configuration

      You can use the following parameters to configure the NagiosBP backend:

      ValueDefaultDescription
      base_url http://localhost/nagios/cgi-bin/nagios-bp.cgi The full URL to the nagios-bp.cgi script which is part of NagiosBP. It serves the AJAX-API which the backend connects to. This URL must be reachable from the host NagVis is running on.
      auth_user Optional user to use for using as basic auth user to access the base_url.
      auth_pass Optional password to use for using as basic auth password to access the base_url.

      There are also some general backend parameters. You can read about them in main configuration format description.

      nagvis-1.7.10+dfsg1/docs/en_US/backend_ndomy.html000066400000000000000000000044461225466040700215310ustar00rootroot00000000000000 NagVis ndo2db MySQL backend (ndomy)

      ndo2db MySQL backend (ndomy)

      The ndo2db MySQL backend, in short ndomy backend, is used to fetch Nagios information like status and configuration data via a MySQL database. The Nagios addon called ndoutils stores all information which are present in a running Nagios in a MySQL database. This database is being queried by the NagVis ndomy backend.

      You can use the following parameters to configure an ndomy backend:

      ValueDefaultDescription
      dbhostlocalhostHostname of the NDO Database
      dbport3306Port of the NDO Database
      dbnamedb_nagiosName of the NDO Database
      dbuserrootUsername for Database Access (only needs read permissions)
      dbpassrootPassword for Database Access (only needs read permissions)
      dbprefix nagios_ Prefix of the tables in NDO Database (like defined in ndo2db.cfg)
      dbinstancename default Name of the Nagios instance in NDO Database (like defined in ndomod.cfg)
      maxtimewithoutupdate180Maximum delay in seconds after last update in NDO. NagVis will report Nagios is not running if the delay is reached

      There are also some general parameters. You can read about them in main configuration format description.

      Note: The above should be possible with the IDOUtils of Icinga as well so replace "NDO", "ndo2db.cfg", and "ndomod.cfg" with "IDO", ido2db.cfg", and "idomod.cfg", respectively.

      nagvis-1.7.10+dfsg1/docs/en_US/backends.html000066400000000000000000000036061225466040700205030ustar00rootroot00000000000000 Backends

      Backends

      General Information

      The NagVis code is separated into several layers. One of these layers is the "data layer". The data layer is used to handle requests for information from third party sources like the socket of MKLivestatus. We call this layer "backend" in general. There are some components inside NagVis to manage these backends which act as the glue between the single backends and the other layers.

      Default backend

      At the moment there are a few backends delivered with the NagVis core packages: the most important ones are the mklivestatus and ndomy backends. All backend configuration parameters are described in detail on their own pages.

      The ndomy backend has been the default backend from NagVis 1.0 to NagVis 1.5. It fetches Nagios information from the NDO MySQL database. Since NagVis 1.5 the default backend has been switched to MKLivestatus backend.

      Backend types

      Configuring backends

      The backends are defined in the main configuration file. See main configuration format description on how to define backends.

      nagvis-1.7.10+dfsg1/docs/en_US/changelog.html000066400000000000000000000006311225466040700206530ustar00rootroot00000000000000 Changelog

      Changelog

      The current changelogs are linked from the NagVis download page.

      nagvis-1.7.10+dfsg1/docs/en_US/context_templates.html000066400000000000000000000145051225466040700224730ustar00rootroot00000000000000 Context Templates

      Context Templates

      Introduction

      Context templates are html files with some macros in them. These files can be used as context menus (right click menus) for the objects on the maps.

      The context templates are located in share/userfiles/templates/ relative to the nagvis root directory. The templates are named like this: <name>.context.html. It is possible to add a css file to the template, the name has to be: <name>.context.css.

      There are some so called macros available in context menus of all object types and some which are only available for some special objects. All standard macros are listed below.

      General

      The following macros are available in hover menus of all object types:

      Macro Description
      General
      [obj_id]ID of object in JavaScript. Needed to locate the object specific parts e.g. to schedule a manual update of the state information.
      [type]Type of the object
      [name]Name of the object (Hostname, Hostgroupname, Servicegroupname, Mapname,...)
      [backend_id]Represents the backend_id of the used backend for this object.
      [custom_1]Represents the first custom macro which can be defined per backend. Might be useful to set backend individual URLs.
      [custom_2]Second custom macro. Same as above.
      [custom_3]Third custom macro. Same as above.
      [map_name]Name of the current map/automap.
      Language macros
      [lang_refresh_status]Label for refreshing the status of the object in frontend.
      [lang_schedule_downtime]Label for scheduling a downtime in Nagios.
      [lang_reschedule_next_check]Label for re-scheduling the next check of the object in Nagios.
      [lang_connect_by_ssh]Label for connecting a host by ssh.
      Paths
      [html_base]Absolute URL to HTML-Base (Default: /nagvis)
      [html_cgi]Absolute URL to the Nagios CGIs. Using object specific value. Depends on the used backend. If no backend specific value set the default value will be used. (Default: /nagios/cgi-bin)
      [html_templates] Path to context templates directory (Default: /nagvis/userfiles/templates)
      [html_template_images] Path to context template images directory (Default: /nagvis/userfiles/images/templates)

      Special macros

      There are macros for context templates of a specified type. These macros should be surrounded by section macros. The section macros define that the included code will be removed if the hover template is not parsed for this type.

      For example a section macro for host macros looks like this:

      <!-- BEGIN host -->.+?<!-- END host -->

      Below you can find a full list of the special macros.

      Host objects

      MacroDescription
      [address]Address of the host configured in Nagios
      [pnp_hostname]Hostname with replaced blanks for links to PNP

      Service objects

      MacroDescription
      [service_description]Service description in Nagios
      [pnp_service_description]Service description with replaced blanks for links to PNP

      Host- and Servicegroup objects

      The section macros <!-- BEGIN hostgroup --> and <!-- BEGIN servicegroup --> exist to make special template code for hostgroup and servicegroup context menus possible. Both don't bring any special object specific macros with them.

      Other section macros

      There are some other special section macros. For example to show parts of the template only for line objects:

      <!-- BEGIN line -->This is only shown on line objects<!-- BEGIN servicegroup -->
      SectionDescription
      lineOnly show this for line objects.
      statefulOnly show this for stateful objects.
      not_automapOnly show this for non automap views (regular maps).
      lockedOnly show for locked objects.
      unlockedOnly show for unlocked objects.
      permitted_editOnly show when the user is able to edit the map.
      permitted_performOnly show when the user is able to perform actions.
      action_*Only show when this action is registered for this object.
      nagvis-1.7.10+dfsg1/docs/en_US/extending/000077500000000000000000000000001225466040700200235ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/docs/en_US/extending/custom_context_actions.html000066400000000000000000000130451225466040700255120ustar00rootroot00000000000000 Custom Context Menu Actions

      Custom Context Menu Actions

      Please note: This document still contains valid information, however today, since version 1.7.6, it is possible to configure custom actions in the main configuration.

      Introduction

      NagVis 1.4 introduces a powerful new feature called context menus. The context menus basically are right-click menus on the status icons. You can customize these menus by simply editing some template files. The template files are simple html files including some macros which are replaced during render time in NagVis.

      The context menus give you the ability to improve your administrative workflow with the monitoring information dramatically. Imagine you have a NagVis map as the primary user interface to gather status information about your systems and even as a base to control your systems. Imagine you can view status information from NagVis and simply connect to the problematic systems by ssh or via terminal session by just two clicks. It is also possible to store some default recover jobs in scripts or anything else.

      Take a look at this guide to get some ideas of the power of this new feature.

       

      Quick how-to

      This is a quick how-to to add a "connect by ssh" option to the NagVis hosts context menu. Most of the changes have to be made on the client browsers to get it handle ssh connections. In this guide I am using the firefox on Ubuntu. It is no problem to get this work on other systems like Windows.

      1. Read basics about context templates

      The basics about the context templates are described here. Read it before proceeding.

      2. Create custom context template

      Just copy the default context template:
      cd /usr/local/nagvis
      cp share/userfiles/templates/default.context.html share/userfiles/templates/default-ssh.context.html
      Now add a line to the host specific macro section like follows
      <li><a href="ssh://[address]">[lang_connect_by_ssh]</a></li>
      The template is finished.

      3. Configure host to use the new template

      Set the option to use the new template called default-ssh:
      context_menu=true
      context_template=default-ssh
      You can set this option in the global section of a map, in a host object or even a template which is used in a host object.

      4. Configure your client to handle ssh:// uris

      In this case I configure firefox (< 3.5) on Ubuntu Linux. This may differ on your system. Open about:config in your firefox. Add some new options:
      Name: network.protocol-handler.app.ssh
      Type: String
      Value: /usr/local/bin/ssh-connect-handler
      Name: network.protocol-handler.expose.ssh
      Type: Boolean
      Value: true
      Name: network.protocol-handler.external.ssh
      Type: Boolean
      Value: true
      Name: network.protocol-handler.warn-external.ssh
      Type: Boolean
      Value: false

      4a. Firefox > 3.5

      If you are using Firefox 3.5 or above you only need to set the following options:

      String:
      network.protocol-handler.app.ssh = /usr/local/bin/ssh-connect-handler
      Boolean:
      network.protocol-handler.expose.ssh = false

      5. Create a handler script

      Create the script at the given script path. In my case it is /usr/local/bin/ssh-connect-handler.
      #!/bin/bash
      xterm -e ssh ${1#ssh:\/\/*}
      You need to make this script executable.
      chmod +x /usr/local/bin/ssh-connect-handler

      5a. gnome-terminal + root-login

      If you need explicit root login and like to use root login this might be a better script for you:

      #!/bin/bash
      #
      # /usr/local/bin/ssh-connect-handler
      
      gnome-terminal --geometry=78x10 -e "ssh root@${1#ssh:\/\/*}"

      6. Test handler script

      Just enter ssh://<test-host> in your browser address bar and press enter. If an xterm with the ssh session opens everything is ok here.

      7. Test context links

      Now open the map you configured the new context template usage. Then right-click the host you configured and hit the menu entry "Connect by ssh". A terminal window should open now.

      Perspective

      With this knowledge you are ready to configure NagVis to be the core of your daily administrative and monitoring tasks. Be creative now!

      We like you to give us some feedback on this feature and how you use it.

      nagvis-1.7.10+dfsg1/docs/en_US/extending/iconsets.html000066400000000000000000000161621225466040700225460ustar00rootroot00000000000000 Add own Iconsets

      Add own Iconsets

      Example

      Your boss is coming in and telling you that a technician needs a map with more than 250 hosts clearly laid out. You think: “Hey, that’s not possible, with a full description for every host!” The font in the background image is not the problem, but the std_small-iconset from NagVis is too big for such a request.

      Solution

      Build your own iconset.

      What is an iconset?

      A complete iconset consists of 14 files. These files are png images which are named like this:

      Filename Description
      <set>_critical.png Critical state
      <set>_critical_ack.png Acknowledged critical state
      <set>_critical_dt.png Critical state in downtime
      <set>_down.png Down state (Host)
      <set>_down_ack.png Acknowledged down state
      <set>_down_dt.png Down state in downtime
      <set>_error.png Error while fetching status
      <set>_ok.png OK state
      <set>_ok_dt.png OK state in downtime
      <set>_pending.png PENDING state
      <set>_unchecked.png Unchecked service (pending)
      <set>_unknown.png Unknown state
      <set>_unknown_ack.png Acknowledged unknown state
      <set>_unknown_dt.png Unknown state in downtime
      <set>_unreachable.png Unreachable state (Host)
      <set>_unreachable_ack.png Acknowledged unreachable state
      <set>_unreachable_dt.png Unreachable state in downtime
      <set>_up.png Up state (Host)
      <set>_up_dt.png Up state in downtime
      <set>_warning.png Warning state
      <set>_warning_ack.png Acknowledged warning state
      <set>_warning_dt.png Warning state in downtime

      NagVis checks for the <set>_ok.png image to list the iconsets, means there has to be at least a <set>_ok.png image to have a choosable iconset.

      Which programme should I use to create an iconset?

      Almost every graphic art software has the ability to build PNG-files. In this example Photoshop is used to create a smaller version of the std_small iconset called std_mini.

      Iconset Icon size icon map
      std_small 16×16 pixel

      mini 9×9 pixel

      Implementing the iconset

      To implement the set in your NagVis installation, copy all files to the iconset folder (share/userfiles/images/iconsets).

      The test

      Open one of your maps and add a new host-icon. You should now be able to select std_mini as iconset.


      nagvis-1.7.10+dfsg1/docs/en_US/extending/languages.html000066400000000000000000000053341225466040700226640ustar00rootroot00000000000000 Language file format

      Language file format

      General Information

      Since NagVis 1.4 the language format has been changed from xml files to gettext language files. The old xml files were much overhead and consumed a lot of runtime to get parsed.
      The main benefit of gettext is much better performance. For details about gettext see the official gettext page.

      The language files are stored in the language specific subdirectories of nagvis/includes/locale directory.
      The english language file is en_US/LC_MESSAGES/nagvis.mo.

      The files with .po extension are the sources which have to be compiled to .mo files.

      By default the following languages are supported in the current NagVis versions:

      • english
      • german
      • french
      • spanish
      • brazilian portugese

      Build your own...

      Your language is not supported by NagVis? No problem! You can easily build your own language file.

      If you built a new language file or fixed sth. in existing language files you're welcome to submit the file to us so we can implement it in the next NagVis release or publish it on Nagvis.org.

      Macros

      There is support for replacing given strings with some other values.

      An example for a macro is the string [USER]. This string will be replaced before displaying in NagVis when the language entry supports it.

      Default Macros

      Default Macros are sth. like HTML-Tags which don't have to be defined by the user. At the moment the following default macros are supported:

      MacroReplaced by
      [i]<i>
      [/i]</i>
      [b]<b>
      [/b]</b>

      Special Chars

      Special chars like ä,ö,ü,",',... have to be set as HTML-entities (e.g. &nbsp;)

      nagvis-1.7.10+dfsg1/docs/en_US/extending/shapes.html000066400000000000000000000021321225466040700221720ustar00rootroot00000000000000 Add own Shapes

      Add own Shapes

      Since NagVis 1.x you can add "stateless Icons" to your maps, we call them shapes. These icons are completely like the other icons, they just have no state.

      What is a shape?

      A shape is nothing else than a simple image. We recommend to use PNG as format for the shapes.

      Which programme should I use to create a shape?

      Almost every graphic art software has the ability to build PNG-files.

      Implementing the shape

      The shapes are placed in nagvis/images/shapes. Just copy them to this directory, then you can use them in your maps.

      The test

      Open one of your maps and add a new shape-icon. You should now be able to select your own shapes.

      nagvis-1.7.10+dfsg1/docs/en_US/extending/templates.html000066400000000000000000000037501225466040700227140ustar00rootroot00000000000000 Install Templates

      Install Templates

      Since NagVis 1.1x you can add templates to customize the look of header- and hover-menus. You can get some of these templates at the NagVis template download page.

      Please note: The directory structure changed between the NagVis version several times. So there may be compatibility problems between the versions.

      Unpack Template

      Unpack the NagVis template in a path of your choice.

      tar xvzf NagVis-Template-<name>-<version>.tar.gz

      Install NagVis-Template

      Merge the NagVis-Template directory tree with your NagVis Folder (default /usr/local/nagvis/share/userfiles/templates).

      cp -r nagvis /usr/local/nagvis/share/userfiles/templates

      Configure

      Now you should be able to use the new template in NagVis. You only have to configure the maps or objects to use the template.

      Header-Templates

      You can set the header template in the main configuration of NagVis or in the global section of the map configuration. For details see map configuration format description.

      Hover-Templates

      You can set the hover template in the main configuration for all your maps, in the global section of a map for all the objects on this map or in each object for having a custom hover menu for special objects. For details see map configuration format description.

      nagvis-1.7.10+dfsg1/docs/en_US/gadgets.html000066400000000000000000000242411225466040700203450ustar00rootroot00000000000000 Gadgets

      Gadgets

      General Information

      Gadgets are small programs which generate images or HTML code from information which is provided by NagVis. The main idea is to provide the performance data of Nagios to these programs for visualizing it as nice graphs or fancy speedometers, thermometers etc.
      share/userfiles/gadgets/ contains some examples, others can be found at Nagvis Exchange[1].

      The gadgets can be written in any language which can be interpreted by your webserver. Some options can be PHP, Perl,...

      Gadgets are only supported for service objects. An object can be turned into a gadget by setting view_type="gadget" and a valid gadget_url.

      NagVis supports gadgets since version 1.4.[1]

      Since NagVis 1.6 the gadgets can not only render images. As new option the gadgets can render HTML code which might also contain javascript or any kind of dynamic HTML code. To enable the usage of HTML the option gadget_type needs to be set to "html".

      NagVis 1.4 std_speedometer gadget with label and hover menu

       NagVis 1.4 std_speedometer gadget on test map with enabled label.

      Parameters

      The gadgets get their information via a HTTP-Get call from NagVis (if you include share/userfiles/gadgets/gadgets_core.php it will be placed in two arrays. For more information take a look at the description there).

      The following parameters are being passed to the gadgets:

      Parameter Example value Description Variable
      name1 localhost The name of the host $aOpts['name1']
      name2 Current Load The service description of the object $aOpts['name2']
      scale 100 The scale of the gadget $aOpts['scale']
      state OK The string which represents the current state (OK, WARNING, CRITICAL, UNKNOWN) $aOpts['state']
      stateType HARD The type of the current state. Can be HARD or SOFT $aOpts['stateType']
      ack 0 Is set to 1 if the represented object state has been acknowledged $aOpts['ack']
      downtime 0 Is set to 1 if the represented object state is in a downtime $aOpts['downtime']
      perfdata load1=0.960;5.000;10.000;0; load5=0.570;4.000;6.000;0; load15=0.540;3.000;4.000;0; The current performance data information provided by Nagios. It's important to have valid performance data here. $aPerfdata[<index>][<tag>]

      A valid http get on the std_speedometer.php looks like this:

      std_speedometer.php?name1=localhost&name2=Current%20Load&state=OK&stateType=HARD&perfdata=load1=0.450;5.000;10.000;0;%20load5=0.260;4.000;6.000;0;%20load15=0.750;3.000;4.000;0;

      How to configure?

      Please check the parameters view_type, gadget_url and gadget_opts of the service object in the map configuration format description. This is an example of a definition in your map file:

      define service {
         host_name=localhost
         service_description=root-volume
         x=50
         y=50
         view_type=gadget
         gadget_url=std_bar.php     // name of the file in share/userfiles/gadgets/
         // gadget_url=[http://localhost/nagvis/userfiles/gadgets/std_bar.php]     // valid as well
         // gadget_scale=200        // default is 100 (percent)
         // gadget_opts=columns=3 label=1    // gadget dependent
         // gadget_type=img         // Defaults to img, can also be set to "html"
      }

      How to create a custom gadget

      Using the code shown included in gadgets_core.php two arrays are filled. $aPerfdata contains the performance data. $aOpts contains the options set in gadget_opts.

      The best thing is to take a look at the code of the standard gadgets and adapt the core things from there.

      You should set a sample perfdata string in the gadget code by writing it to the variable $sDummyPerfdata. This makes it possible to show the gadget with dummy data during editing. It's much easier to edit the maps when the gadgets are shown.
      Important: The variable needs to be set before the gadgets_core.php is included.

      A second example can be found in std_speedometer2.php. In contrast to std_speedometer.php it supports output produced by check_multi. The background will be set to yellow or red if the performance data indicates such a state. The service state is not taken into account. Several options set via gadget_opts influence the behaviour of the gadget:
      ParameterExample valueDescription
      label11 = Show host name / service description in the upper left corner of the graph; 0 = don't show the information (default)
      current11 = Show the current performance data value (default); 0 = don't show the information
      columns5Graphs can be arranged in columns. The number of rows is calculated based on the maximum number of performance data items. Default is 3
      stringpctThe performance data label has to contain the string to be displayed. In case of check_multi output only the last part is examined. Default is an empty string
      NagVis 1.5 std_speedometer2 gadget

       NagVis 1.5 std_speedometer2 gadget in normal, warning and critical state

      A third example is based on an idea found on Nagvis Exchange. Performance data is shown as a horizontal bar. The last quarter of the graph changes to yellow or red if the performance data indicates a warning or critical value. The status is not the state of the service! That is due to the fact that the data might contain multiple data sources. In many cases not all data sources of a service are found to be in a warning or critical state so you don't want to get false alarms (new in 1.5.7 or git newer than 2010.12.12).

      ParameterExample valueDescription
      label11 = Show host name / service description label in the last quarter of the graph (default); 0 = don't show the information
      current11 = Show the current performance data value (default); 0 = don't show the information
      columns5Graphs can be arranged in columns. The number of rows is calculated based on the maximum number of performance data items. Default is 3
      stringpctThe performance data label has to contain the string to be displayed. In case of check_multi output only the last part is examined. Default is an empty string
      thresholdvalueDetermines if the warning and critical thresholds are shown in percent (default) or integer values
      NagVis 1.5 std_bar gadget

       NagVis 1.5 std_bar gadget in normal, warning and critical state

      Note: This gadget uses a TrueType font whose name and location is hard coded within the code (variables $fontDir and $fontName). In case the file isn't found the gadget uses a builtin font. The value of $fontDir changes between distributions so if the font doesn't scale properly please check the setting (it defaults to OpenSuSE, other settings are commented out).

      [1] The directory structure changed between NagVis 1.4.x and NagVis 1.5. Gadgets were stored in nagvis/nagvis/gadgets and are now stored in share/userfiles/gadgets. Gadgets found on NagVis Exchange might use the former structure so you might have to move the files to the new location (e.g. cp -pr <source>/nagvis/nagvis/gadgets/<gadget> <target>/share/userfiles/gadgets/). nagvis-1.7.10+dfsg1/docs/en_US/geomap.html000066400000000000000000000146641225466040700202070ustar00rootroot00000000000000 NagVis Geomap

      NagVis Geomap

      Introduction

      The NagVis Geomap map source was introduced in NagVis 1.7. It has been developed to get well rendered and scaled overview maps without much work.

      The geomap renders several hosts on an Open Street Map powered map which is used as background image.

      For the current geomap all you need is a CSV file which tells NagVis the hosts to render and the geo coordinates where the hosts should be positioned at.

      Prerequisites

      There is no special software needed on the NagVis host. But there is one special requirement. To be able to use this feature, NagVis needs to be able to access the host geomap.nagvis.org via port 80. NagVis uses a simple HTTP based API to get the map image and the coordinates of that image.

      In most cases the NagVis host does not have direct internet access. You can configure the http_proxy option in the [global] section of your NagVis main configuration to tell NagVis to use a proxy such requests. Most proxies require an authentication to control access to the internet. Please use the option http_proxy_auth to set the credentials.

      The first call

      NagVis comes with a demo geomap called "demo-geomap". If your NagVis is configured correctly you should see a map of germany with two nodes. One node is showing the host "ham-srv1" in Hamburg. The other host "muc-srv1" is located in Munich.

      The geomap is defined using the regular map configuration file "demo-geomap.cfg". The contents look like this:

      global {
          sources=geomap
          alias=Demo: 4 Geomap
          parent_map=demo-overview
          iconset=std_medium
          backend_id=demo
          # Geomap Parameters
          source_type=csv
          source_file=demo-locations
          width=800
          height=600
      }

      The sources=geomap line tells the map to use the geomap source for altering the map configuration. The source_type=csv (new in 1.7.4) line tells the geomap source to use the CSV file defined in the source_file=demo-locations definition located in the etc/geomap directory for gathering a list of hosts and coordinates to add to the geomap.

      The demo-locations.csv file contains the following two lines:

      ham-srv1;Hamburg Server 1;53.556866;9.994622
      muc-srv1;Munich Server1;48.1448353;11.5580067

      Each line defines one host to be added to the map. The columns are separated by ; signs. The first column contains the host-name, the second an optional alias, the third the LAT coordinate and the fourth the LONG coordinate.

      (starting with git-version as of 2013-03-21): Lines starting with the usual comment characters (;, #, or //) are treated as comments.

      New in 1.7.4: It is also possible to set source_type=backend to use the backend set via backend_id to gather the list of hosts to be shown on the geomap and their coordinates. This is only possible when using the livestatus backend. It fetches all hosts from the backend and uses all hosts which have the custom object variables _LAT and _LONG configured. It is possible to filter the fetched hosts by the membership in a host group by setting the option filter_group to the name of the host group.

      Configuring geomaps

      The geomap source uses view parameters for configuration. For details take a look at the modify view dialog which can be opened using the header menu "Actions -> Modify view".

      The view parameters can also be given as map configuration attributes in the global section of the maps.

      ParameterDefaultDescription
      geomap_type mapnik Define the render mode of the geomap. Can be osmarender, mapnik and cycle.
      geomap_zoom Configure the zoom level of the geomap during map request. Take a look at the OSM zoom documentation for further details.
      geomap_border 0.25 The border to add on each side of the geomap. This value is simply added to the calculated min/max geo coordinates.
      source_type csv The type of the datasource used for for fetching the geomap objects. Might be csv or backend.
      source_file The name of the CSV file to use as source for rendering the geomap. Is only used when source_type is set to csv.
      width Defines the width of the geomap in pixels. The maximum size of the geomap is limited by the queried webservice. geomap.nagvis.org supports up to 50 tiles per map which should make 1920x1080 resolutions possible. Please contact us if you need more.
      height Defines the height of the geomap in pixels. The maximum size of the geomap is limited by the queried webservice. geomap.nagvis.org supports up to 50 tiles per map which should make 1920x1080 resolutions possible. Please contact us if you need more.
      nagvis-1.7.10+dfsg1/docs/en_US/header_templates.html000066400000000000000000000210311225466040700222270ustar00rootroot00000000000000 Header Templates

      Header Templates

      Introduction

      Header templates are html files with some macros in it. These files can be used as header menu in the maps. The header templates are located at share/userfiles/templates/pages/ relative to the nagvis root directory. The templates are named like this: *.header.html.
      Since NagVis 1.5 the template format has been changed to be more flexible. Therefore all templates need to be recoded to be NagVis 1.5 compatible.

      Macros

      The following macros are available in the header templates:
      MacroDescription
      {$currentMap} (was [current_map])Name of the current map (e.g. demo,demo2)
      {$currentMapAlias} (was [current_map_alias])Alias of the current map
      {$currentLanguage} (was [current_language])String representing the current language (For example en_US). This is needed for link to documentation.
      {$currentUser}Name of the current user.
      {$mod}The current Module (Map, AutoMap, Overview, Welcome, ...).
      {$act}The current Action (view, edit, ...).
      {$bEnableFade}Tells the hover menu to use fading menus or quickly opening slide menus.
      {$bRotation}Is true when currently viewing a rotation. Otherwise it is False..
      {$permittedOverview}Is true when the user is permitted to access the overview page. Otherwise it is False..
      {$permittedEdit}Is true when the user is permitted to edit the current map. Otherwise it is False..
      {$permittedEditAnyMap}Is true when the user is allowed to edit at least one map. Otherwise it is False..
      {$permittedChangePassword}Is true when the user is permitted to change the own password. Otherwise it is False..
      {$permittedEditMainCfg}Is true when the user is permitted to edit the main configuration file. Otherwise it is False..
      {$permittedManageBackgrounds}Is true when the user is permitted to manage backgrounds. Otherwise it is False..
      {$permittedManageMaps}Is true when the user is permitted to manage maps. Otherwise it is False..
      {$permittedManageShapes}Is true when the user is permitted to manage shapes. Otherwise it is False..
      {$permittedUserMgmt}Is true when the user is permitted to manage user accounts. Otherwise it is False..
      {$permittedRoleMgmt}Is true when the user is permitted to manage roles. Otherwise it is False..
      {$permittedLogout}Is true when the user is permitted to log out. Otherwise it is False..
      {$supportedChangePassword}Is true when the current auth module supports changing passwords. Otherwise it is False..
      {foreach $maps map}
      {$map.mapName}
      {/foreach}
      A list of all maps defined in NagVis. The code between {foreach $maps map} and {/foreach} is repeated for each map. For an example have a look at share/userfiles/templates/pages/default.header.html.

      Within the BEGIN/END-Tags the following macros are available:
      * {$map.mapName} (Was [map_name]): Name of the map
      * {$map.mapAlias} (Was [map_alias]): Alias of the map
      * {$map.permittedEdit}: Is the user permitted to edit this map?
      {foreach $langs lang}
      {$lang.language}
      {/foreach}
      A list of all languages available to the users in NagVis. The code between {foreach $langs lang} and {/foreach} is repeated for each language. For an example have a look at share/userfiles/templates/pages/default.header.html.

      Within the BEGIN/END-Tags the following macros are available:
      * {$lang.language}: Internal name of the language
      * {$lang.classUnderline}: Underline the language
      * {$lang.langLanguageLocated}: Located name of the language.
      {if $viewType == 'Map' || $viewType == 'Automap'} To be more flexible in the templates we added some sort of if statements. These can be used as in native PHP. For an example have a look at share/userfiles/templates/pages/default.header.html.
      {$pathBase} (was [html_base]) URL to HTML-Base (/nagvis)
      {$pathImages} (was [html_images]) URL to HTML-Images (/nagvis/images)
      {$pathHeaderJs} Path to header specific javascript file (New in 1.6)
      {$pathTemplates} (was [html_templates]) Path to header templates (/nagvis/userfiles/templates)
      {$pathTemplateImages} (was [html_template_images]) Path to header template images (/nagvis/userfiles/images/templates)
      {$langOpen} (was [lang_select_map])Label for opening new views
      {$langEditMap} (was [lang_edit_map]) Label for edit map link
      {$langNeedHelp} (was [lang_need_help]) Label for help selection
      {$langOnlineDoc} (was [lang_online_doc]) Label for link to online documentation
      {$langForum} (was [lang_forum]) Label for link to NagVis forum
      {$langSupportInfo} (was [lang_support_info]) Label for link to support information
      {$langOverview} (was [lang_overview]) Label for overview string
      {$langInstance} (was [lang_instance]) Label for the instance string
      {$langRotationStart} (was [lang_rotation_start]) Label for starting the map rotation
      {$langRotationStop} (was [lang_rotation_stop]) Label for stopping the map rotation
      {$langSearch} Label for searching an object on the map.
      {$langToggleGrid} Label for enabling/disabling the grid.
      {$langActions}Label for choosing the available actions.
      {$langUser}Label for the user.
      {$langLoggedIn}Label for "Logged in as".
      {$langChangePassword}Label for changing the user's password.
      {$langUserMgmt}Label for managing users.
      {$langManageRoles}Label for managing user roles.
      {$langLogout}Label for logging out.
      {$langChooseLanguage}Label for choosing the user's language.
      nagvis-1.7.10+dfsg1/docs/en_US/hover_templates.html000066400000000000000000000221771225466040700221360ustar00rootroot00000000000000 Hover Templates

      Hover Templates

      Introduction

      Hover templates are html files with some macros in it. These files can be used as hover menus for the objects on the maps. The hover templates are located in share/userfiles/templates relative to the nagvis root directory. The templates are named like this: *.hover.html. There are macros which are available in hover menus of all object types and some which are only available for some special objects. All standard macros are listed below.

      General

      The following macros are available in hover menus of all object types:
      Macro Description
      General
      [obj_type] Type of the object (host, service, hostgroup, ...)
      [obj_name] Name of the object (hostname, hostgroupname, servicegroupname, mapname,...)
      [obj_alias] Alias of the object (If no alias is defined it is equal to [obj_name])
      [obj_display_name] Display name of the object
      [obj_state] State of the object (OK, WARNING, CRITICAL,...)
      [obj_summary_state] Merged state of the object and all child objects (OK, WARNING, CRITICAL, ...)
      [obj_acknowledged] When the state is acknowledged the macro is replaced with "(Acknowledged)"
      [obj_summary_acknowledged] When the summary state is acknowledged the macro is replaced with "(Acknowledged)"
      [obj_in_downtime] When the object is currenty in a downtime this macro is replaced with "(In Downtime)"
      [obj_summary_in_downtime] When the object is currenty in a downtime this macro is replaced with "(In Downtime)"
      [obj_output] Output for this object
      [obj_summary_output] Summary output of the object
      Language macros
      [lang_name] Label for the object name
      [lang_child_name] Label for the child object names
      [lang_alias] Label for the object alias
      [lang_address] Label for the object address
      [lang_state] Label for the object state
      [lang_obj_type] Label for the object type
      [lang_summary_state] Label for the summary state
      [lang_output] Label for the output
      [lang_summary_output] Label for the summary output
      [lang_overview] Label for the overview
      [lang_instance] Label for the NDO instance
      [lang_next_check] Label for the next check of the object
      [lang_last_check] Label for the last check of the object
      [lang_current_attempt] Label for the current attempt
      [lang_last_state_change] Label for the last state change
      [lang_state_duration] Label for the state duration
      [lang_service_description] Label for the service description
      [lang_notes]Label for the object notes
      Paths
      [html_base] Absolute URL to HTML-Base (/nagvis)
      [html_templates] Path to hover templates directory (/nagvis/userfiles/templates)
      [html_template_images] Path to hover template images directory (/nagvis/userfiles/images/templates)

      Special macros

      There are macros for hover templates of a specified type. These macros should be surrounded by section macros. The section macros define that the included code will be removed if the hover template is not parsed for this type. For example a section macro for host macros looks like this: <!-- BEGIN host -->.+?<!-- END host -->

      Below you can find a full list of the special macros

      All except map objects

      Macro Description
      [obj_backendid] The backend-id of the objects backend (backend_<*>)
      [obj_backend_instancename] The NDO instance name of the objects backend

      Host/Service objects

      Macro Description
      [obj_address] The address of the host object
      [obj_last_check] The date and time of the last check of this object. The datetime is printed in the defined dateformat.
      [obj_next_check] The date and time of the next check of this object. The datetime is printed in the defined dateformat.
      [obj_state_type] The current state type (HARD/SOFT)
      [obj_current_check_attempt] The number of the current check attempt
      [obj_max_check_attempts] The number of the maximum check attempts
      [obj_last_state_change] The date and time of the last state change. The datetime is printed in the defined dateformat.
      [obj_last_hard_state_change] The date and time of the last hard state change. The datetime is printed in the defined dateformat.
      [obj_state_duration] The duration of the current state
      [obj_notes]The configured notes of the host or service objects

      Service objects

      Macro Description
      [service_description] Service description in Nagios
      [pnp_hostname] Hostname with replaced blanks for links to PNP images
      [pnp_service_description] Service description with replaced blanks for links to PNP images

      Host objects

      Macro Description
      [pnp_hostname] Hostname with replaced blanks for links to PNP images

      Servicegroup objects

      There is a very special macro for the child services of a servicegroup, this is the selection macro <!-- BEGIN servicegroup_child --><!-- END servicegroup_child -->.
      Macro Description
      [lang_child_name1] Label for the host name of the child service
      [obj_name1] Hostname for the child service
      nagvis-1.7.10+dfsg1/docs/en_US/index.html000066400000000000000000000010201225466040700200240ustar00rootroot00000000000000 NagVis 1.7 Documentation nagvis-1.7.10+dfsg1/docs/en_US/install_omd_site.html000066400000000000000000000041131225466040700222540ustar00rootroot00000000000000 Install Nagvis into OMD site

      Install Nagvis into OMD site

      Since 1.6b2 it is possible to install NagVis into the local/ path of OMD sites. Please note: This is only recommended for testing purposes e.g. if you like to test brand new features of new NagVis versions which are not already included in OMD. We do not recommend using this for productive installations except you really know what you are doing.

      Using the omd site installer

      Log in to your OMD site

      In most cases this is done by doing

      su - <sitename>

      Download NagVis

      Get the current NagVis package. The latest release can be found at nagvis.org.

      Unpack NagVis

      Unpack the archive to a temporary place (for example /tmp) and change to that directory

      tar xvzf nagvis-1.7*.tar.gz /tmp
      cd /tmp/nagvis-1.7*

      Make installer executable

      The OMD site installer is located in the root directory of the NagVis package. The installer has to be made executable before you can use it.

      chmod +x omd_install.sh

      Execute the installer

      Now you can execute the installer script.

      ./omd_install.sh

      Confirm the question with y and wait for the script to complete. It should finish quickly.

      Cleanup

      You can remove the sources after installation.

      rm -rf /tmp/nagvis-1.7*

      Use it ...

      Now you should be able to use the new version opening it in the browser with the url

      http://<hostname>/<sitename>/nagvis

      nagvis-1.7.10+dfsg1/docs/en_US/installation_instructions.html000066400000000000000000000134421225466040700242550ustar00rootroot00000000000000 Installation instructions

      Installation instructions

      This instructions are meant for a new installation. If you update your old NagVis installation we strongly recommend to make a backup of your NagVis directory and merge the config files manually.

      STEP 0: Prepare System

      Make sure your system fits the System requirements.

      STEP 1: Download NagVis

      Get NagVis, the latest release can be found at www.nagvis.org.

      STEP 2: Unpack NagVis

      tar xvzf nagvis-1.7.x.tar.gz

      STEP 3: Move the unpacked NagVis directory

      Place the NagVis directory tree somewhere on your system. For most cases /usr/local/nagvis is the best place.

      mv nagvis /usr/local/nagvis

      You should see the following directory listing:

      # ls -l /usr/local/nagvis
      etc
      LICENCE
      README
      share
      var
      
      DON'T move any files or folders inside the NagVis directory (in fact you can move, but in this case you have to change/add some parameters and values in the main config file - if everything is left untouched it should run "out of the box" without changes in the configuration files)

      STEP 4: Configure NagVis

      Move to new NagVis directory
      cd /usr/local/nagvis
      An example main configuration file can be found in etc/nagvis.ini.php-sample. If you like to change some settings, copy this example to etc/nagvis.ini.php.
      cp etc/nagvis.ini.php-sample etc/nagvis.ini.php
      Now you can edit this file with your favourite text editor - I use vi:
      vi etc/nagvis.ini.php
      Most lines in the freshly copied nagvis.ini.php are commented out (starting with a semicolon). If you want to set different settings, you can simply uncomment the line and change its value.
      For information about the possible values have a look at Main Config Format Description.

      STEP 5: Configure webserver

      Since NagVis 1.5 it is necessary to configure the webserver to be able to use NagVis. You will find a sample configuration file in etc/apache2-nagvis.conf-sample.
      Simply copy the file to the conf.d directory of your webserver. For example this is /etc/apache2/conf.d.

      cp etc/apache2-nagvis.conf-sample /etc/apache2/conf.d/apache2-nagvis.conf

      Now you need to open that file and edit it to fit your needs. It is important to replace the macros @NAGVIS_WEB@ and @NAGVIS_PATH@.
      In this example you need to replace @NAGVIS_WEB@ with /nagvis and @NAGVIS_PATH@ with /usr/local/nagvis/share.

      STEP 6: Permissions

      This is very important for a neatly working installation.

      First check which unix user account is used to run your webserver (in my case it is wwwrun). If you don't know which user the webserver is running then have a look at the webserver configuration. In case of Apache you can do this by the following command:

      Ubuntu
      grep -e 'USER' /etc/apache2/envvars
      SuSE/RedHat/Debian (SLES, OpenSuSE, Fedora)
      grep -e '^User' /etc/apache2/*.conf
      If your configuration file is located at another path you should correct this in the command above.
      Set the permissions to your NagVis directory (in my case the paths are like this):
      chown wwwrun:www /usr/local/nagvis -R
      chmod 664 /usr/local/nagvis/etc/nagvis.ini.php
      chmod 775 /usr/local/nagvis/etc/maps
      chmod 664 /usr/local/nagvis/etc/maps/*
      chmod 775 /usr/local/nagvis/etc/geomap
      chmod 664 /usr/local/nagvis/etc/geomap/*
      chmod 775 /usr/local/nagvis/share/userfiles/images/maps
      chmod 664 /usr/local/nagvis/share/userfiles/images/maps/*
      chmod 775 /usr/local/nagvis/var
      chmod 664 /usr/local/nagvis/var/*
      chmod 775 /usr/local/nagvis/var/tmpl/cache
      chmod 664 /usr/local/nagvis/var/tmpl/cache/*
      It's possible to set more restrictive permissions on the files but for most setups the example should be fine. Only change them if you know what you are doing!

      STEP 7: Configure the maps

      There are two ways configuring NagVis. The first one is the web based configuration using the NagVis frontend (http://<nagiosserver>/<path-to-NagVis>/). Take a look at the header menu for options. To modify existing map objects you need to unlock the object you like to edit.

      The second way is to edit the configuration files directly using a text editor of your choice. The map config files are located at etc/maps/. For valid formats and values have a look at Map Config Format Description.

      STEP 8: View the maps

      You should now be able to view your defined maps in your browser:
       http://<nagiosserver>/<path-to-nagvis>/frontend/nagvis-js/?mod=Map&show=<mapname>
      (i.e. http://localhost/nagvis/frontend/nagvis-js/?mod=Map&show=europe).

      Have fun and please report bugs! nagvis-1.7.10+dfsg1/docs/en_US/installer.html000066400000000000000000000041061225466040700207220ustar00rootroot00000000000000 NagVis Installer

      NagVis Installer

      There is a new installer in NagVis 1.4. This installer was created to make the progress of installing or updating NagVis easier. The installer is a bash script which asks for all information needed for installing or updating NagVis.

      It is also possible to set all options via command line parameters for running the installer in quiet mode.

      Using the installer

      Download NagVis

      Get NagVis. The latest release can be found at nagvis.org.

      Unpack NagVis

      Unpack the archive to a temporary place (for example /tmp) and change to that directory

      tar xvzf nagvis-1.7*.tar.gz /tmp
      cd /tmp/nagvis-1.7*

      Make installer executable

      The installer is located in the root directory of the NagVis package. The installer has to be made executable before you can use it.

      chmod +x install.sh

      Run installer

      Now you can run the installer.

      ./install.sh

      Using Icinga you should add "-s icinga".

      ./install.sh -s icinga

      Following the instructions of the installer it should copy the necessary files to the correct places. Please keep in mind that you have to edit the config file nagvis.ini.php. If you experience any problems please let us know.

      Cleanup

      You can remove the sources after installation.

      rm -rf /tmp/nagvis-1.7*

      Command line parameters

      For details about the command line parameters call the installer with the "-h" option.

      nagvis-1.7.10+dfsg1/docs/en_US/lines_weathermap_style.html000066400000000000000000000076211225466040700235010ustar00rootroot00000000000000 Weathermap style lines in NagVis

      Weathermap style lines in NagVis

      By default NagVis can only visualize the normal states in lines using red, yellow and green coloured lines. Have you ever wanted NagVis to display nice weathermap style lines?

      More colourful lines

      NagVis Weathermap style lines

      Since NagVis 1.5 it is possible to draw such weathermap style lines which can have more than three colours depending on the current load of e.g. the network interface you like to visualize. There can be a wide colour range of e.g. seven different colours. Take a look at the example image - isn't that beautiful?.

      Weathermap line types

      The weathermap style lines currently provide two types of lines:

      • ---%--><--%----: Arrows with percentage labels in the middle of the line.
      • ---%+BW--><--%+BW---: Arrows with percentage labels in the middle of the line and additional labels which display the current bandwidth usage.

      Focus on bandwidth visualization

      The new lines are focused on bandwidth visualization. Since NagVis needs to parse the performance data to gather the current colour for the line there are special requirements on the performance data contents. There is a bandwidth measurement plugin for Nagios which comes with the correct performance data information out of the box. It is downloadable from Nagios Exchange.

      How to create weathermap lines?

      To create weathermap style lines in NagVis you need services which send the correct performance data to Nagios. If you got some then simply place a line service object on the map and choose the correct line type. Now take a look at your map - it should work now.

      You may want to have a legend which shows you the meaning of the different colours. No problem. Simply add a shape to your map and choose the "demo_traffic_load_legend" shape which is delivered with the NagVis core package.

      Needed perfdata format

      The weathermap lines do not require a specific Nagios plugin. Only the provided performance format needs to match one of the cases below:

      • Percentage usage: four perfdata sets. While the first two sets provide the percentage usage and the second two sets provide the usage in bytes per sec.
        One example: inUsage=21103.42%;85;98 outUsage=226363.55%;85;98 inBandwidth=105.52MBs outBandwidth=212.22MBs.
      • Byte rate usage: needs at least two perfdata sets with the labels "in" and "out" with an empty UOM. It uses the current value and the maximum value to calculate the current percentage usage. The current value should be given as byte rate. The maximum value should provide the network interface bandwidth as bytes per seconds.
        One example: in=7196.50566429;;;0;1250000.0 inucast=11.6273564992;;;; innucast=0.017617206817;;;; indisc=0.0;;;; inerr=0.0;0.01;0.1;; out=4044.9635368;;;0;1250000.0 outucast=12.1734899105;;;; outnucast=0.0;;;; outdisc=0.0;;;; outerr=0.0;0.01;0.1;; outqlen=0;;;;.

      Thanks to gjfrater for implementing these lines!

      nagvis-1.7.10+dfsg1/docs/en_US/logon_modules.html000066400000000000000000000000001225466040700215600ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/docs/en_US/map_config_format_description.html000066400000000000000000002561551225466040700250170ustar00rootroot00000000000000 Map configuration format description

      Map configuration format description

      General Information

      The NagVis configuration file format is very similiar to the format used by Nagios®.

      Configuration statements start with the keyword "define" followed by a type field and a left curly bracket ({). Every following line defines variable-value pairs, separated by an equal sign (=) until a right curly bracket (}) is found.

      Hashes (#) are used to mark comments, note that a comment line MUST start with a hash not with other chars like whitespaces!

      Object types

      Description of the object types

      Global

      The first definition in every config file should be of the special type "global". Options which are defined at this paragraph are valid for the whole map and are getting inherited to other types defined later.

      Example with all options which have to be set:

      define global {
       map_image=lan.png
      }
      Value Default Description
      allowed_for_config Comma separated list of Nagios users who are allowed to edit this map. Can be "EVERYONE" for no permission check. (Deprecated in 1.5)
      allowed_userComma separated list of Nagios users who are allowed to view this map. Can be "EVERYONE" for no permission check. (Deprecated in 1.5)
      map_image

      The name of the map image displayed in the background of the NagVis map, for example a Visio (TM) drawing.

      The value can even be "none" or empty for no background image.

      It is also possible to add URLs here. The URL has to be surrounded by [ and ].

      alias map name The alias is the label for each map. If it is defined it is shown everywhere in NagVis frontend.
      backend_id inherited (nagvis.ini.php) Backend-ID defined in Main Configuration file where NagVis should search for the object states. If this parameter is not given, the Backend defined as "defaultbackend" at the Main Configuration file is used.
      background_color inherited (nagvis.ini.php) Background colour of this map. If this is not set backgroundcolor from Main Configuration file is taken.
      context_menu inherited (nagvis.ini.php) Enable/Disable the context menu on your map objects.
      context_templateinherited (nagvis.ini.php)Default context template to be used on this map
      event_on_load inherited (nagvis.ini.php) Enabled/disables eventhandling on page loading. Initial problematic states will raise events in frontend during page rendering. (New in 1.7b3)
      event_repeat_interval inherited (nagvis.ini.php) Repeat frontend events in the given interval. The interval is configured in seconds. Set value to 30 to let NagVis re-raise events for problematic objects every 30 seconds. (New in 1.7b3)
      event_repeat_duration inherited (nagvis.ini.php) The time in seconds to repeat alerts for a problematic object as configured in event_repeat_interval. This value defaults to -1, this leads to repeated events until the problematic state has been fixed. (New in 1.7b3)
      event_backgroundinherited (nagvis.ini.php)Enable/Disable changing background colour on state changes (configured colour is shown when summary state is PENDING, OK or UP).
      event_highlightinherited (nagvis.ini.php)Enable/Disable highlighting of the state changing object by adding a flashing border.
      event_highlight_durationinherited (nagvis.ini.php)Set the highlight duration in milliseconds
      event_highlight_intervalinherited (nagvis.ini.php)Set the highlight interval in milliseconds
      event_loginherited (nagvis.ini.php)Enable/Disable the eventlog in the new javascript frontend. The eventlog keeps track of important actions and information.
      event_log_levelinherited (nagvis.ini.php)Loglevel of the eventlog (Available: debug, info, warning, critical).
      event_log_eventsinherited (nagvis.ini.php)Number of events in the eventlog scrollback
      event_log_heightinherited (nagvis.ini.php)Height of the javascript eventlog in px
      event_log_hiddeninherited (nagvis.ini.php)Hide/Show the eventlog on map loading
      event_scrollinherited (nagvis.ini.php)Enable/Disable scrolling to the icon which changed the state when the icon is out of the visible scope.
      event_soundinherited (nagvis.ini.php)Enable/Disable sound signals on state changes.
      exclude_members

      It is possible to exclude member objects completely while fetching the object information from the backend. The filtered elements will not appear anywhere in this object.

      For details about the filter syntax have a look at the exclude regex definition. (New in 1.6b4)

      exclude_member_states

      It is possible to exclude one or several member states while calculating the summary state of objects. The filtered elements will appear in the member lists but won't be used for summary state calculations.

      For details about the filter syntax have a look at the exclude regex definition. (New in 1.6b4)

      grid_colorinherited (nagvis.ini.php)The colour of the grid lines.
      grid_show inherited (nagvis.ini.php) Enable/Disable a grid to make the alignment of objects easier in edit mode. Objects are aligned to the upper left corner after moving.
      grid_stepsinherited (nagvis.ini.php)Scale of the grid in px.
      header_fade inherited (nagvis.ini.php)Enable/Disable the fade effect of the submenus in the header menu (When the used header menu supports that option).
      header_menu inherited (nagvis.ini.php) Enable/Disable the header menu
      header_template inherited (nagvis.ini.php) header template to be used on this map
      hover_childs_limit inherited (nagvis.ini.php) Number of maximum children to be displayed. Set to -1 to disable the limit.
      hover_childs_order inherited (nagvis.ini.php) Order direction of child objects
      hover_childs_show inherited (nagvis.ini.php) Enable/Disable displaying child objects
      hover_childs_sort inherited (nagvis.ini.php) Sort method of child objects
      hover_delay inherited (nagvis.ini.php) Delay of hover menu appearance in seconds
      hover_menu inherited (nagvis.ini.php) Enable/Disable the hover menu
      hover_template inherited (nagvis.ini.php) Default hover template to be used on this map
      hover_timeout inherited (nagvis.ini.php) Default hover menu ajax request timeout in seconds (Deprecated in 1.4)
      iconset inherited (nagvis.ini.php) Iconset to use as default for all objects placed on the map. Can be overwritten on a per object base.
      In the example "std_small" is used which means an OK state will be displayed using "std_small_ok.png", a CRITICAL state will be displayed by using "std_small_critical.png" and so on.
      in_maintenance 0 Enable/Disable the maintenance mode of this map. If a map is in maintenance mode only a message gets displayed instead of the map.
      label_show 0 Enable/Disable labels for the maps objects
      label_x center Default x-position of the labels in px (with prefix + or - relative to the upper left corner of the icons, otherwise absolute position). Since 1.7.7 this can also be set do center, which is the new default option.
      label_y bottom Default y-position of the labels in px (with prefix + or - relative to the upper left corner of the icons, otherwise absolute position). Since 1.7.7 this can also be set do bottom, which is the new default option.
      label_width auto Default width of the labels in px
      label_background transparent Default background colour of the labels. The colour should be given in hexcode. Can also be "transparent".
      label_border #000000 Default border colour of the labels. The colour should be given in hexcode. Can also be "transparent".
      label_styleCustom styling for the label text. To be given like HTML style attribute contents. E.g. font-family:sans;font-weight:bold;
      line_arrowforward This defines the arrows at the end of the line. At the moment this attribute is only being used for the lines between hosts on the automap. Possible values: forward, back, both, none.
      line_type Specifies the type of line when view_type=line. Valid values are:
      "11" for lines with one arrow at the end of a line.
      "10" for lines with two arrows pointing to each other in the middle of the line.
      "12" for plain lines without arrow.
      line_width3This defines the width of the line in px when this object is being displayed as line.
      line_weather_colorsinherited (nagvis.ini.php)This defines the colours of weathermap colours in the different percentage levels. For example above 10% load it will be coloured #8c00ff. (New in 1.6)
      only_hard_states inherited (nagvis.ini.php) Sets whether soft states should be ignored. Default setting is 0.
      parent_mapThe parent map of this map. This option is only used in the menu visualisations of the header menu and sidebar (New in 1.6)
      recognize_services inherited (nagvis.ini.php) Sets whether the states of the services on hosts, hostgroup objects should be recognised. If this is not given in the config it's set to 1.
      show_in_lists inherited (nagvis.ini.php) Show the maps in lists (dropdowns, index page, ...)
      show_in_multisite inherited (nagvis.ini.php) Show the maps in multisite snapin
      stylesheetinherited (nagvis.ini.php)Filename of the custom stylesheet to use on the maps (The file needs to be located in the share/nagvis/styles directory)
      url_target _self Target of the Icon link, this option adapts <a target=""> (_self is same window)
      usegdlibs inherited (nagvis.ini.php) Activates the usage of GD-Libs on this map (lines can only be used if GD-Libs are activated) (Deprecated in 1.4)

      Host

      Example with all options which have to be set (note that options already defined in the global section are optional):

      define host {
       host_name=localhost
       x=100
       y=200
      }
      Value Default Description
      object_id Unique identifier of the object on the current map. Each object on the map needs to have an object_id. The object_id is built of alphanumeric signs of any length. When no object_id is given NagVis will generate one for the object. (New in 1.6)
      host_name Name of the host as defined in Nagios
      x X axis coordinate(s). Take a look at the coordinate definition for details.
      y Y axis coordinate(s). Take a look at the coordinate definition for details.
      backend_id inherited (global) Backend-ID defined in Main Configuration file where NagVis should search for the object states. If this parameter is not given, the Backend which was set in global section of the map is taken.
      context_menu inherited (nagvis.ini.php) Enable/Disable the context menu for this object.
      context_templateinherited (nagvis.ini.php)Context template for this object.
      exclude_members

      It is possible to exclude member objects completely while fetching the object information from the backend. The filtered elements will not appear anywhere in this object.

      For details about the filter syntax have a look at the exclude regex definition. (New in 1.6b4)

      exclude_member_states

      It is possible to exclude one or several member states while calculating the summary state of objects. The filtered elements will appear in the member lists but won't be used for summary state calculations.

      For details about the filter syntax have a look at the exclude regex definition. (New in 1.6b4)

      hover_menu inherited (nagvis.ini.php) Enable/Disable the hover menu
      hover_delay inherited (nagvis.ini.php) Delay of hover menu appearance in seconds
      hover_template inherited (global) Hover template for this object
      hover_timeout inherited (nagvis.ini.php) Hover menu ajax request timeout in seconds for this object
      hover_url URL which should be displayed in hover menu instead of standard information. There are some macros available:
      [host_name]: This macro stands for the object name.
      hover_childs_show inherited (nagvis.ini.php) Enable/Disable displaying child objects
      hover_childs_sort inherited (nagvis.ini.php) Sort method of child objects
      hover_childs_order inherited (nagvis.ini.php) Order direction of child objects
      hover_childs_limit inherited (nagvis.ini.php) Maximum number of children to be displayed. Set to -1 to disable the limit.
      iconset inherited (global) Special iconset. Is inherited from global paragraph if not specified.
      label_show inherited (global) Enable/Disable label for this object
      label_text [name] Text of the label. Available macros: [name], [alias], [output]
      label_x inherited (global) Label X-Position (with prefix + or - relative to the upper left corner of the icons, otherwise absolute position)
      label_y inherited (global) Label Y-Position (with prefix + or - relative to the upper left corner of the icons, otherwise absolute position)
      label_width inherited (global) Width of the label in px
      label_background inherited (global) Background colour of the label. The colour should be given in hexcode. Can also be "transparent".
      label_border inherited (global) Border colour of the labels. The colour should be given in hexcode. Can also be "transparent".
      label_styleinherited (global)Custom styling for the label text. To be given like HTML style attribute contents. E.g. font-family:sans;font-weight:bold;
      line_type inherited (global)Specifies the type of line when view_type=line. Valid values are:
      "11" for lines with one arrow at the end of a line.
      "10" for lines with two arrows pointing to each other in the middle of the line.
      "12" for plain lines without arrow.
      line_arrowinherited (global) This defines the arrows at the end of the line. At the moment this attribute is only being used for the lines between hosts on the automap. Possible values: forward, back, both, none.
      line_widthinherited (global)This defines the width of the line in px when this object is being displayed as line.
      only_hard_states inherited (global) Sets whether soft states should be ignored. Default setting is 0.
      recognize_services inherited (global) Defines if the services of the host affect the displayed state. If set to "1" a critical service on the host will result in a host state display as critical too. If set to "0" only the Nagios Host State (UP or DOWN) will be used and the services of the host will be ignored.
      url URL where the Icon should link to. Default link is to the Nagios CGIs. Macros [host_name], [htmlcgi] and [htmlbase] are available. The value can be set to "#" to disable the link.
      url_target _self Target of the Icon link, this option adapts <a target=""> (_self is same window). Macro [name] is available.
      use Comma separated list of object templates to use. For details see template objects
      view_type icon This option defines the type of view for this object. Possible values are: "icon" or "line". Before NagVis 1.4 you could change the view of an object by setting the line_type. Since NagVis 1.4 you need to set the view_type for changing icons to lines.
      z 1 The z option defines the order of icons which are stacked on top of each other. The highest value will be displayed on top. The background image has the value of 0. So valid values should be above or equal 1. Note: To prevent conflicts with the header navigation you should keep this value below 100.

      Service

      Example with all options which have to be set (note that option already defined in the global section are optional):

      define service {
       host_name=localhost
       service_description=ping
       iconset=std_big
       x=100
       y=200
      }
      Value Default Description
      object_id Unique identifier of the object on the current map. Each object on the map needs to have an object_id. The object_id is built of alphanumeric signs of any length. When no object_id is given NagVis will generate one for the object. (New in 1.6)
      host_name Name of the host as defined in Nagios
      service_description Name of the service as defined in Nagios
      x X axis coordinate(s). Take a look at the coordinate definition for details.
      y Y axis coordinate(s). Take a look at the coordinate definition for details.
      backend_id inherited (global) Backend-ID defined in Main Configuration file where NagVis should search for the object states. If this parameter is not given, the Backend which was set in global section of the map is taken.
      context_menu inherited (nagvis.ini.php) Enable/Disable the context menu for this object.
      context_templateinherited (nagvis.ini.php)Context template for this object.
      exclude_members

      It is possible to exclude member objects completely while fetching the object information from the backend. The filtered elements will not appear anywhere in this object.

      For details about the filter syntax have a look at the exclude regex definition. (New in 1.6b4)

      exclude_member_states

      It is possible to exclude one or several member states while calculating the summary state of objects. The filtered elements will appear in the member lists but won't be used for summary state calculations.

      For details about the filter syntax have a look at the exclude regex definition. (New in 1.6b4)

      gadget_url The value can be a gadget script in gadget path (nagvis/gadgets) e.g. "std_speedometer.php" or a full URI to a gadget like script surrounded by brackets e.g. "[http://127.0.0.1/nagvis/gadgets/std_speedometer.php]". For details about gadgets see here. This option is only recognised when view_type="gadget" is set.
      gadget_scale 100 The scale of the gadget. Default scale is 100 (percent). The gadgets should be able to be resized by this parameter
      gadget_type img The type of the rendered output. This can be "html" when the gadget renders normal HTML code, or "img" when the gadget renders an image.
      gadget_opts Optional gadget specific params. The contents can be freely defined for each gadget. The value is processed as GET param "opts". We recommend to use a var/val format like this: key1=val1,key2=val2. Then you can easily split this string to an array in the gadget.
      hover_menu inherited (nagvis.ini.php) Enable/Disable the hover menu
      hover_template inherited (global) Hover template for this object
      hover_timeout inherited (nagvis.ini.php) Hover menu ajax request timeout in seconds for this object
      hover_delay inherited (nagvis.ini.php) Delay of hover menu appearance in seconds
      hover_url URL which should be displayed in hover menu instead of standard information. There are some macros available:
      [host_name]: This macro stands for the object name.
      [service_description]: This macro stands for the service description and will only be replaced in service objects.
      hover_childs_show inherited (nagvis.ini.php) Enable/Disable displaying child objects
      hover_childs_sort inherited (nagvis.ini.php) Sort method of child objects
      hover_childs_order inherited (nagvis.ini.php) Order direction of child objects
      hover_childs_limit inherited (nagvis.ini.php) Maximum number of children to be displayed. Set to -1 to disable the limit.
      iconset inherited (global) Special iconset. Is inherited from global paragraph if not specified.
      label_show inherited (global) Enable/Disable label for this object
      label_text [name] [service_description] Text of the label. Available macros: [name], [alias], [service_description], [output]
      label_x inherited (global) Label X-Position (with prefix + or - relative to the upper left corner of the icons, otherwise absolute position)
      label_y inherited (global) Label Y-Position (with prefix + or - relative to the upper left corner of the icons, otherwise absolute position)
      label_width inherited (global) Width of the label in px
      label_background inherited (global) Background colour of the label. The colour should be given in hexcode. Can also be "transparent".
      label_border inherited (global) Border colour of the labels. The colour should be given in hexcode. Can also be "transparent".
      label_styleinherited (global)Custom styling for the label text. To be given like HTML style attribute contents. E.g. font-family:sans;font-weight:bold;
      line_type inherited (global)Specifies the type of line when view_type=line. Valid values are:
      "11" for lines with one arrow at the end of a line.
      "10" for lines with two arrows pointing to each other in the middle of the line.
      "12" for plain lines without arrow.
      line_arrowinherited (global) This defines the arrows at the end of the line. At the moment this attribute is only being used for the lines between hosts on the automap. Possible values: forward, back, both, none.
      line_widthinherited (global)This defines the width of the line in px when this object is being displayed as line.
      line_cut 0.5 Lines with two parts have the cut in the middle of the line. This equates to a line cut value of "0.5". It is possible to relocate the cut by changing this value. Valid values are 0.0 to 1.0.
      line_label_pos_in 0.5 Weathermap lines have their labels in the middle of the line by default. This equates to a value of "0.5". It is possible to relocate the cut by changing this value. Valid values are 0.0 to 1.0.
      line_label_pos_out 0.5 Weathermap lines have their labels in the middle of the line by default. This equates to a value of "0.5". It is possible to relocate the cut by changing this value. Valid values are 0.0 to 1.0.
      line_label_y_offset 2 This option defines the offset of the labels to the line when rendering weathermap lines which show percentage and absolute bandwidth labels. (New in 1.6)
      line_weather_colorsinherited (global)This defines the colours of weathermap colours in the different percentage levels. For example above 10% load it will be coloured #8c00ff. (New in 1.6)
      only_hard_states inherited (global) Sets whether soft states should be ignored. Default setting is 0.
      url URL where the Icon should link to. Default link is to the Nagios CGIs. Macros [host_name], [htmlcgi] and [htmlbase] are available. The value can be set to "#" to disable the link.
      url_target _self Target of the Icon link, this option adapts <a target=""> (_self is same window). Available macros: [name], [service_description],
      use Comma separated list of object templates to use. For details see template objects
      view_type icon This option defines the type of view for this object. Possible values are: "icon" or "line". Before NagVis 1.4 you could change the view of an object by setting the line_type. Since NagVis 1.4 you need to set the view_type for changing icons to lines.
      z 1 The z option defines the order of icons which are stacked on top of each other. The highest value will be displayed on top. The background image has the value of 0. So valid values should be above or equal 1. Note: To prevent conflicts with the header navigation you should keep this value below 100.

      Hostgroup

      Example with all options which have to be set (note that options already defined in the global section are optional):

      define hostgroup {
       hostgroup_name=servers
       x=100
       y=200
      }
      Value Default Description
      object_id Unique identifier of the object on the current map. Each object on the map needs to have an object_id. The object_id is built of alphanumeric signs of any length. When no object_id is given NagVis will generate one for the object. (New in 1.6)
      hostgroup_name Name of the hostgroup as defined in Nagios
      x X axis coordinate(s). Take a look at the coordinate definition for details.
      y Y axis coordinate(s). Take a look at the coordinate definition for details.
      backend_id inherited (global) Backend-ID defined in Main Configuration file where NagVis should search for the object states. If this parameter is not given, the Backend which was set in global section of the map is taken.
      context_menu inherited (nagvis.ini.php) Enable/Disable the context menu for this object.
      context_templateinherited (nagvis.ini.php)Context template for this object.
      exclude_members

      It is possible to exclude member objects completely while fetching the object information from the backend. The filtered elements will not appear anywhere in this object.

      For details about the filter syntax have a look at the exclude regex definition. (New in 1.6b4)

      exclude_member_states

      It is possible to exclude one or several member states while calculating the summary state of objects. The filtered elements will appear in the member lists but won't be used for summary state calculations.

      For details about the filter syntax have a look at the exclude regex definition. (New in 1.6b4)

      hover_menu inherited (nagvis.ini.php) Enable/Disable the hover menu
      hover_delay inherited (nagvis.ini.php) Delay of hover menu appearance in seconds
      hover_template inherited (global) Hover template for this object
      hover_timeout inherited (nagvis.ini.php) Hover menu ajax request timeout in seconds for this object
      hover_url URL which should be displayed in hover menu instead of standard information. There are some macros available:
      [hostgroup_name]: This macro stands for the object name.
      hover_childs_show inherited (nagvis.ini.php) Enable/Disable displaying child objects
      hover_childs_sort inherited (nagvis.ini.php) Sort method of child objects
      hover_childs_order inherited (nagvis.ini.php) Order direction of child objects
      hover_childs_limit inherited (nagvis.ini.php) Maximum number of children to be displayed. Set to -1 to disable the limit.
      iconset inherited (global) Special iconset. Is inherited from global paragraph if not specified.
      label_show inherited (global) Enable/Disable label for this object
      label_text [name] Text of the label. Available macros: [name], [alias], [output]
      label_x inherited (global) Label X-Position (with prefix + or - relative to the upper left corner of the icons, otherwise absolute position)
      label_y inherited (global) Label Y-Position (with prefix + or - relative to the upper left corner of the icons, otherwise absolute position)
      label_width inherited (global) Width of the label in px
      label_background inherited (global) Background colour of the label. The colour should be given in hexcode. Can also be "transparent".
      label_border inherited (global) Border colour of the labels. The colour should be given in hexcode. Can also be "transparent".
      label_styleinherited (global)Custom styling for the label text. To be given like HTML style attribute contents. E.g. font-family:sans;font-weight:bold;
      line_type inherited (global)Specifies the type of line when view_type=line. Valid values are:
      "11" for lines with one arrow at the end of a line.
      "10" for lines with two arrows pointing to each other in the middle of the line.
      "12" for plain lines without arrow.
      line_arrowinherited (global) This defines the arrows at the end of the line. At the moment this attribute is only being used for the lines between hosts on the automap. Possible values: forward, back, both, none.
      line_widthinherited (global)This defines the width of the line in px when this object is being displayed as line.
      recognize_services inherited (global) Defines if the services of the hosts affect the displayed state. If set to "1" a critical service on one of the host will result in a hostgroup state display as critical too. If set to "0" only the Nagios Host State (UP or DOWN) will be used and the services of the hosts will be ignored.
      url URL where the Icon should link to. Default link is to the Nagios CGIs. Macros [host_name], [htmlcgi] and [htmlbase] are available. The value can be set to "#" to disable the link.
      url_target _self Target of the Icon link, this option adapts <a target=""> (_self is same window). Available macros: [name]
      use Comma separated list of object templates to use. For details see template objects
      view_type icon This option defines the type of view for this object. Possible values are: "icon" or "line". Before NagVis 1.4 you could change the view of an object by setting the line_type. Since NagVis 1.4 you need to set the view_type for changing icons to lines.
      z 1 The z option defines the order of icons which are stacked on top of each other. The highest value will be displayed on top. The background image has the value of 0. So valid values should be above or equal 1. Note: To prevent conflicts with the header navigation you should keep this value below 100.

      Servicegroup

      Example with all options which have to be set (note that options already defined in the global section are optional):

      define servicegroup {
       servicegroup_name=servicegroup1
       x=100
       y=200
      }
      Value Default Description
      object_id Unique identifier of the object on the current map. Each object on the map needs to have an object_id. The object_id is built of alphanumeric signs of any length. When no object_id is given NagVis will generate one for the object. (New in 1.6)
      servicegroup_name Name of the servicegroup as defined in Nagios.
      x X axis coordinate(s). Take a look at the coordinate definition for details.
      y Y axis coordinate(s). Take a look at the coordinate definition for details.
      backend_id inherited (global) Backend-ID defined in Main Configuration file where NagVis should search for the object states. If this parameter is not given, the Backend which was set in global section of the map is taken.
      context_menu inherited (nagvis.ini.php) Enable/Disable the context menu for this object.
      context_templateinherited (nagvis.ini.php)Context template for this object.
      exclude_members

      It is possible to exclude member objects completely while fetching the object information from the backend. The filtered elements will not appear anywhere in this object.

      For details about the filter syntax have a look at the exclude regex definition. (New in 1.6b4)

      exclude_member_states

      It is possible to exclude one or several member states while calculating the summary state of objects. The filtered elements will appear in the member lists but won't be used for summary state calculations.

      For details about the filter syntax have a look at the exclude regex definition. (New in 1.6b4)

      hover_menu inherited (nagvis.ini.php) Enable/Disable the hover menu
      hover_url URL which should be displayed in hover menu instead of standard information. There are some macros available:
      [servicegroup_name]: This macro stands for the object name.
      hover_template inherited (global) Hover template for this object
      hover_timeout inherited (nagvis.ini.php) Hover menu ajax request timeout in seconds for this object
      hover_delay inherited (nagvis.ini.php) Delay of hover menu appearance in seconds
      hover_childs_show inherited (nagvis.ini.php) Enable/Disable displaying child objects
      hover_childs_sort inherited (nagvis.ini.php) Sort method of child objects
      hover_childs_order inherited (nagvis.ini.php) Order direction of child objects
      hover_childs_limit inherited (nagvis.ini.php) Number of maximum children to be displayed. Set to -1 to disable the limit.
      iconset inherited (global) Special iconset. Is inherited from global paragraph if not specified.
      label_show inherited (global) Enable/Disable label for this object
      label_text [name] Text of the label. Available macros: [name], [alias], [output]
      label_x inherited (global) Label X-Position (with prefix + or - relative to the upper left corner of the icons, otherwise absolute position)
      label_y inherited (global) Label Y-Position (with prefix + or - relative to the upper left corner of the icons, otherwise absolute position)
      label_width inherited (global) Width of the label in px
      label_background inherited (global) Background colour of the label. The colour should be given in hexcode. Can also be "transparent".
      label_border inherited (global) Border colour of the labels. The colour should be given in hexcode. Can also be "transparent".
      label_styleinherited (global)Custom styling for the label text. To be given like HTML style attribute contents. E.g. font-family:sans;font-weight:bold;
      line_type inherited (global)Specifies the type of line when view_type=line. Valid values are:
      "11" for lines with one arrow at the end of a line.
      "10" for lines with two arrows pointing to each other in the middle of the line.
      "12" for plain lines without arrow.
      line_arrowinherited (global) This defines the arrows at the end of the line. At the moment this attribute is only being used for the lines between hosts on the automap. Possible values: forward, back, both, none.
      line_widthinherited (global)This defines the width of the line in px when this object is being displayed as line.
      only_hard_states inherited (global) Sets whether soft states should be ignored. Default setting is 0.
      url URL where the Icon should link to. Default link is to the Nagios CGIs. Macros [host_name], [htmlcgi] and [htmlbase] are available. The value can be set to "#" to disable the link.
      url_target _self Target of the Icon link, this option adapts <a target=""> (_self is same window). Available macros: [name]
      use Comma separated list of object templates to use. For details see template objects
      view_type icon This option defines the type of view for this object. Possible values are: "icon" or "line". Before NagVis 1.4 you could change the view of an object by setting the line_type. Since NagVis 1.4 you need to set the view_type for changing icons to lines.
      z 1 The z option defines the order of icons which are stacked on top of each other. The highest value will be displayed on top. The background image has the value of 0. So valid values should be above or equal 1. Note: To prevent conflicts with the header navigation you should keep this value below 100.

      Map

      Example with all options which have to be set (note that options already defined in the global section are optional):

      define map {
       map_name=webserver
       x=77
       y=156
      }
      Value Default Description
      object_id Unique identifier of the object on the current map. Each object on the map needs to have an object_id. The object_id is built of alphanumeric signs of any length. When no object_id is given NagVis will generate one for the object. (New in 1.6)
      map_name Name of the NagVis map cfg file (without .cfg extension)
      x X axis coordinate(s). Take a look at the coordinate definition for details.
      y Y axis coordinate(s). Take a look at the coordinate definition for details.
      context_menu inherited (nagvis.ini.php) Enable/Disable the context menu for this object.
      context_templateinherited (nagvis.ini.php)Context template for this object.
      exclude_members

      It is possible to exclude member objects completely while fetching the object information from the backend. The filtered elements will not appear anywhere in this object.

      For details about the filter syntax have a look at the exclude regex definition. (New in 1.6b4)

      exclude_member_states

      It is possible to exclude one or several member states while calculating the summary state of objects. The filtered elements will appear in the member lists but won't be used for summary state calculations.

      For details about the filter syntax have a look at the exclude regex definition. (New in 1.6b4)

      hover_menu inherited (nagvis.ini.php) Enable/Disable the hover menu
      hover_url URL which should be displayed in hover menu instead of standard information. There are some macros available:
      [map_name]: This macro stands for the object name.
      hover_template inherited (global) Hover template for this object
      hover_timeout inherited (nagvis.ini.php) Hover menu ajax request timeout in seconds for this object
      hover_delay inherited (nagvis.ini.php) Delay of hover menu appearance in seconds
      hover_childs_show inherited (nagvis.ini.php) Enable/Disable displaying child objects
      hover_childs_sort inherited (nagvis.ini.php) Sort method of child objects
      hover_childs_order inherited (nagvis.ini.php) Order direction of child objects
      hover_childs_limit inherited (nagvis.ini.php) Number of maximum children to be displayed. Set to -1 to disable the limit.
      iconset inherited (global) Special iconset. Is inherited from global paragraph if not specified.
      label_show inherited (global) Enable/Disable label for this object
      label_text [name] Text of the label. Available macros: [name], [alias], [output]
      label_x inherited (global) Label X-Position (with prefix + or - relative to the upper left corner of the icons, otherwise absolute position)
      label_y inherited (global) Label Y-Position (with prefix + or - relative to the upper left corner of the icons, otherwise absolute position)
      label_width inherited (global) Width of the label in px
      label_background inherited (global) Background colour of the label. The colour should be given in hexcode. Can also be "transparent".
      label_border inherited (global) Border colour of the labels. The colour should be given in hexcode. Can also be "transparent".
      label_styleinherited (global)Custom styling for the label text. To be given like HTML style attribute contents. E.g. font-family:sans;font-weight:bold;
      line_type inherited (global)Specifies the type of line when view_type=line. Valid values are:
      "11" for lines with one arrow at the end of a line.
      "10" for lines with two arrows pointing to each other in the middle of the line.
      "12" for plain lines without arrow.
      line_arrowinherited (global) This defines the arrows at the end of the line. At the moment this attribute is only being used for the lines between hosts on the automap. Possible values: forward, back, both, none.
      line_widthinherited (global)This defines the width of the line in px when this object is being displayed as line.
      only_hard_states inherited (global) Sets whether soft states should be ignored. Default setting is 0.
      url URL where the Icon should link to. Default link is to the Nagios CGIs. Macros [host_name], [htmlcgi] and [htmlbase] are available. The value can be set to "#" to disable the link.
      url_target _self Target of the Icon link, this option adapts <a target=""> (_self is same window). Available macros: [name]
      use Comma separated list of object templates to use. For details see template objects
      view_type icon This option defines the type of view for this object. Possible values are: "icon" or "line". Before NagVis 1.4 you could change the view of an object by setting the line_type. Since NagVis 1.4 you need to set the view_type for changing icons to lines.
      z 1 The z option defines the order of icons which are stacked on top of each other. The highest value will be displayed on top. The background image has the value of 0. So valid values should be above or equal 1. Note: To prevent conflicts with the header navigation you should keep this value below 100.

      Textbox

      Example with major options:

      define textbox {
        text="This is an informational text which can be placed anywhere on the map, HTML can also be used for formatting purposes"
       x=200
       y=100
      }
      Value Default Description
      object_id Unique identifier of the object on the current map. Each object on the map needs to have an object_id. The object_id is built of alphanumeric signs of any length. When no object_id is given NagVis will generate one for the object. (New in 1.6)
      text Your own text, HTML is possible. There are some macros:
      [refresh_counter]: Shows the time until the next reload/rotate dynamically
      [worker_last_run]: Shows the time of the last worker run
      x X axis coordinate(s). Take a look at the coordinate definition for details.
      y Y axis coordinate(s). Take a look at the coordinate definition for details.
      wautoWidth of the textbox in px (pixels). Set to "auto" for auto scaling.
      hautoHeight of the textbox in px (pixels). Set to "auto" for auto scaling.
      background_color #C0C0C0 Background colour of the textbox. The colour should be given in hexcode. Can also be "transparent".
      border_color #000000 Background colour of the textbox. The colour should be given in hexcode. Can also be "transparent".
      styleCustom styling for the text. To be given like HTML style attribute contents. E.g. font-family:sans;font-weight:bold;
      use Comma separated list of object templates to use. For details see Template
      z 1 The z option defines the order of icons which are stacked on top of each other. The highest value will be displayed on top. The background image has the value of 0. So valid values should be above or equal 1. Note: To prevent conflicts with the header navigation you should keep this value below 100.

      Shape

      Basicaly shapes are simple images which can be moved and positioned on the map. The shapes are meant to be layout elements. The shapes were added to give the users the option to create less static maps.

      Example with all values which have to be set:

      define shape {
       icon="test"
       x=200
       y=100
      }
      Value Default Description
      object_id Unique identifier of the object on the current map. Each object on the map needs to have an object_id. The object_id is built of alphanumeric signs of any length. When no object_id is given NagVis will generate one for the object. (New in 1.6)
      icon Filename of the shape. Shapes have to be located in the shape directory (default: nagvis/images/shapes). It is also possible to add URLs here. The URL has to be surrounded by [ and ].
      x X axis coordinate(s). Take a look at the coordinate definition for details.
      y Y axis coordinate(s). Take a look at the coordinate definition for details.
      enable_refresh 0 This option activates the shape for regular updates in the frontend. This is only needed for dynamic shape images which change once in a while.
      hover_menu 0 Enable/Disable the hover menu
      hover_url URL which should be displayed when hovering over the image. By default there is no action on hover.
      hover_delay inherited (nagvis.ini.php) Delay of hover menu appearance in seconds
      url URL where the Icon should link to. By default there is no link. The value can be empty to disable the link.
      url_target _self Target of the Icon link, this option adapts <a target=""> (_self is same window)
      use Comma separated list of object templates to use. For details see Template
      z 1 The z option defines the order of icons which are stacked on top of each other. The highest value will be displayed on top. The background image has the value of 0. So valid values should be above or equal 1. Note: To prevent conflicts with the header navigation you should keep this value below 100.

      Line

      The line is a stateless layout element to connect elements and visualize stateless connections between other objects. The objecttype has been created to make the design less static.

      Example with all values which have to be set:

      define line {
          line_type=1
          x=200
          y=100
      }
      Value Default Description
      object_id Unique identifier of the object on the current map. Each object on the map needs to have an object_id. The object_id is built of alphanumeric signs of any length. When no object_id is given NagVis will generate one for the object. (New in 1.6)
      line_typeSpecifies the type of line when view_type=line. Valid values are:
      "11" for lines with one arrow at the end of a line.
      "10" for lines with two arrows pointing to each other in the middle of the line.
      "12" for plain lines without arrow.
      x X axis coordinate(s). Take a look at the coordinate definition for details.
      y Y axis coordinate(s). Take a look at the coordinate definition for details.
      line_arrowinherited (global) This defines the arrows at the end of the line. At the moment this attribute is only being used for the lines between hosts on the automap. Possible values: forward, back, both, none.
      line_width3The width of the line in pixels.
      line_color#ffffffThe fill colour of the line in hex form. Can also be "transparent".
      line_color_border#000000The border colour of the line in hex form. Can also be "transparent".
      hover_menu 0 Enable/Disable the hover menu
      hover_url URL which should be displayed when hovering over the image. By default there is no action on hover.
      hover_delay inherited (nagvis.ini.php) Delay of hover menu appearance in seconds
      url URL where the Icon should link to. By default there is no link. The value can be empty to disable the link.
      url_target _self Target of the Icon link, this option adapts <a target=""> (_self is same window)
      use Comma separated list of object templates to use. For details see Template
      z1The z option defines the order of icons which are stacked on top of each other. The highest value will be displayed on top. The background image has the value of 0. So valid values should be above or equal 1. Note: To prevent conflicts with the header navigation you should keep this value below 100.

      Template

      With this object you have the ability to define all values except the must-have-attributes in one object for many others. You can set all attributes to the value you need and inherit them with the use attribute to each object.

      Please note: When editing objects using object templates using the web based editing functions the values configured in the template will be copied to the edited objects. From this time the values set in the object are not used anymore. It is not recommended to use the web editing frontend and template objects at the same time.

      Example with all values which have to be set:

      define template {
       name=generic-template
      }
      Value Default Description
      name Template name (simple string without space - has to be unique within the map)
      ... All values which are available in the objects which inherit this template

      Container (New in 1.7.1)

      Example with major options:

      define container {
        url="std_hello.php"
        x=200
        y=100
      }
      OptionDefaultDescription
      object_id Unique identifier of the object on the current map. Each object on the map needs to have an object_id. The object_id is built of alphanumeric signs of any length. When no object_id is given NagVis will generate one for the object.
      url

      The URL to load the contents of the container from. This can be given as simple filename, in this case script is loaded from the nagvis/userfiles/script directory. As alternative it is possible to configure absolute paths like e.g. /path/to/my/script.php or full URLs like e.g. http://127.0.0.1/my-script.php.

      It is possible to add a set of parameters to the URL, it is up to the script to handle them.

      x X axis coordinate. Take a look at the coordinate definition for details.
      y Y axis coordinate(s). Take a look at the coordinate definition for details.
      wautoWidth of the textbox in px (pixels). Set to "auto" for auto scaling.
      hautoHeight of the textbox in px (pixels). Set to "auto" for auto scaling.
      view_type inline This option defines the way to render the image. Possible values are: "inline" an "iframe". Inline means the fetched contents are directly put in the a container object (innerHTML). When setting the value to iframe an iframe object is created to render the given URL in this iframe.
      enable_refresh 0 Enabling this option activates regular updates for this object while being displayed in the frontend. This is only needed for contents which might change during showing the map.
      background_color #C0C0C0 Background colour of the textbox. The colour should be given in hexcode. Can also be "transparent".
      border_color #000000 Background colour of the textbox. The colour should be given in hexcode. Can also be "transparent".
      style Custom styling for the text. To be given like HTML style attribute contents. E.g. font-family:sans;font-weight:bold;. It is applied to a "span" element, the container element which gets the contents of the requested url added.
      use Comma separated list of object templates to use. For details see Template
      z 5 The z option defines the order of icons which are stacked on top of each other. The highest value will be displayed on top. The background image has the value of 0. So valid values should be above or equal 1. Note: To prevent conflicts with the header navigation you should keep this value below 100.

      Script: std_lq.php (New in 1.7.1)

      This script is delivered with NagVis. It can be used to list data fetched via livestatus on your maps to e.g. display lists of items or just raw numbers.

      Please note: By default all queries get the current username added with the AuthUser livestatus filer. Resulting from this a user can only see the hosts and services he is a contact of. To change this behaviour you can customize (copy) the std_lq.php and change the setAuthUser to the following definition:

      $setAuthUser = true;

      To add the script to your maps you need to add std_lq.php with additional parameters to the url parameter in a container object. The parameters are given as URL parameters.

      You have to call this script with at least two parameters:

      backend_idThe id of the backend to use as configured in NagVis
      queryThe livestatus query to execute (newlines must be given as \\n)

      Optional parameters:

      typeCustomize the way the resulting data is displayed

      Example calls to this script:

      Query a single cell as simple string:
      std_lq.php?backend_id=live_1&query=GET hosts\\nLimit: 1\\nColumns: host_name\\n&type=cell
      Query several columns from a single dataset. Resulting values are displayed separated by ", ":
      std_lq.php?backend_id=live_1&query=GET hosts\\nLimit: 1\\nColumns: host_name address state\\n&type=row
      Query one column from several datasets. Each cell found is displayed on a separate line:
      std_lq.php?backend_id=live_1&query=GET hosts\\nLimit: 2\\nColumns: host_name\\n&type=column
      Query several columns from several datasets and display them as a table:
      std_lq.php?backend_id=live_1&query=GET hosts\\nLimit: 2\\nColumns: host_name state address\\n&type=list

      Variable Types

      This chapter explains the different variable types used in the map configuration file.

      Coordinates

      The objects on the NagVis maps are positioned using coordinates. By default each coordinate is a single integer which defines the offset from the upper left corner of the map in px (Pixels).
      The example below is a host object which is positioned 100px from the left and 100px from the top of the map:

      define host {
       object_id=41790e
       host_name=localhost
       x=100
       y=100
      }

      It is possible to define multiple coordinates for one object. This is needed for drawing lines on the maps. One example of a line which starts at 100/100 and ends at 200/200:

      define service {
       object_id=1dd76b
       host_name=localhost
       service_description=Interface eth0
       view_type=line
       line_type=10
       x=110,200
       y=110,200
      }

      When lines have one part (e.g. --->) there must be two coords set. When using lines with two (e.g. ---><---) parts it is possible to set two coordinates for direct lines or three coordinates to reposition the middle of the line to a custom place.

      Since NagVis 1.6 it is possible to position objects depending on other objects. A relationship between two objects is defined from the "childs" view. This means the configuration needs to be done in the object which belongs to another object.
      To define a relationship the coordinate is not given as integer anymore. Instead of the px offset the object_id of the parent object is used to define a relative position.

      We adapt the examples above and give the start of the line a relative position to the host object:

      define host {
       object_id=41790e
       host_name=localhost
       x=100
       y=100
      }
      
      define service {
       object_id=1dd76b
       host_name=localhost
       service_description=Interface eth0
       view_type=line
       line_type=10
       x=41790e,200
       y=41790e,200
      }

      With the configuration above the beginning of the line is attached to the host object and moved every time the host object is moved.

      The above example does not result in exactly the same positions as the first example. The line beginning in the first example is 10px more to the left and 10px more to the bottom. To get that fixed it is possible to define an optional offset to the parent object.

      Set the following coordinates to configure an offset of 10px in both directions:

      x=41790e%+10,200
      y=41790e%+10,200

      It is also possible to set a negative offset by replacing the plus (+) sign with a minus (-) sign.

      Exclude Regex (New in 1.6b4)

      The exclude regular expressions can be used to filter out one or several members of objects. For example it is possible to filter out one specific service of a host, like in this simple example where the service "CPU load" is excluded:

      define host {
        object_id=5932ab
        host_name=localhost
        x=123
        y=123
        exclude_members=CPU load
      }
      This was not a real regex but for example this regex would exclude all services starting with the string "DB_test"
      exclude_members=^DB_test

      The same is possible for hostgroups, servicegroups and so on.

      Another more advanced task is to exclude just one service of one host from a hostgroup. This can be seen as a member element of a member. Let's exclude "CPU load" of the host "localhost".

      define hostgroup {
        object_id=b5932a
        hostgroup_name=mygroup
        x=42
        y=23
        exclude_members=localhost~~CPU load
      }

      When excluding members of members you need to use the string "~~" as separator between the two expressions for matching the member name (host_name in this case) and the regex for the name of the members member (service description in this case).

      nagvis-1.7.10+dfsg1/docs/en_US/maps.html000066400000000000000000000176621225466040700177000ustar00rootroot00000000000000 NagVis Maps

      Static and dynamic maps

      The different views in NagVis are named "maps". The classic and most common type of NagVis maps are the static maps. This means one creates a map configuration using the web based configuration editor or using a text editor to create the map configuration.

      In NagVis 1.7x a new extension has been made to the map configuration. It is still based on the static map configuration approach but now it is possible to extend those static configuration parts using dynamic and programmable mechanisms.

      The new feature has been named "map sources". Each map can make use of one or several map sources. Each of these sources can clear, replace, or alter the whole map configuration.

      A map source is built of several PHP functions which take a standardised set of parameters to do their work. The functions are completely free in what they are doing. A source can read CSV files with objects and coordinates, can connect to databases to fetch information, or read data from external services. It is up to the developer.

      The map sources API

      Text files containing PHP code need to be placed in the share/server/core/sources directory relative to the NagVis base directory. In OMD the site local files can be placed in local/share/nagvis/htdocs/server/core/sources relative to the site base directory.

      There no 1:1 relation between the files and the sources themselves. A file can contain one source, several different sources, or even no sources (e.g. to define functions needed by several sources).

      One map source consists of two PHP functions which must match the following specifications:

      Function name patternParameters
      process_<source-name>

      This is the real source processing function. It can alter the map configuration in place. The return code of the function is not used in any way at the moment.

      $MAPCFG - The GlobalMapCfg PHP object
      $map_name - The name of the map as string
      &$map_config - Reference of the map config array. This array must be modified to alter the map configuration.
      changed_<source-name>

      This function is used to tell the map config processing of NagVis whether or not the the map configuration has to be reloaded. It must return "true" to tell NagVis to reload the map configuration. This means also to execute the process_* function of all configured sources.

      $MAPCFG - The GlobalMapCfg PHP object
      $compare_time - The unix timestamp of the currently cached map configuration.

      When loading a map configuration NagVis checks whether or not the map configuration has already been parsed and cached. If the map is already cached and the cache is up-to-date NagVis can use the map configuration cache which can be processed much faster than parsing and validating the map configuration.

      In general NagVis compares the file ages of the used config files (main configuration and map configuration files) with the map configuration cache to make the decision.

      When using map sources each source must tell the map config processing code whether or not the map source thinks that the map configuration has to be reloaded or can use the map configuration cache. This is done by the changed_* function of each source. When this function returns "true" this tells NagVis to reload the map configuration.

      Loading the map configuration means that NagVis parses the map configuration file to fill the array of map objects. Then this information is validated to prevent broken configurations. Then all configured map sources are processed to provide the opportunity to alter the map configuration.

      Each map source can define view parameters and config variables to be available in maps which make use of these sources. This is an example definition of the geomap map source:

      // options to be modifiable by the user(url)
      global $viewParams;
      $viewParams = array(
          'geomap' => array(
              'zoom',
              'geomap_type',
              'source_file',
          )
      );
      
      // Config variables to be registered for this source
      global $configVars;
      $configVars = array(
          'geomap_type' => array(
              'must'       => false,
              'default'    => 'osmarender',
              'match'      => '/^(osmarender|mapnik|cycle)$/i',
              'field_type' => 'dropdown',
              'list'       => 'list_geomap_types',
          ),
          'source_file' => array(
              'must'       => false,
              'default'    => '',
              'match'      => MATCH_STRING_EMPTY,
              'field_type' => 'dropdown',
              'list'       => 'list_geomap_source_files',
          ),
          'zoom' => array(
              'must'       => false,
              'default'    => '',
              'match'      => MATCH_INTEGER_EMPTY,
          ),
      );
        

      These definitions lead to a) three new map configuration options for the global section of the map and b) make these three URL parameters available in the URLs of the maps using this source.

      General map view parameters

      Since implementation of the map sources feature even regular maps without any configured sources can be modified using some default view parameters. Some of the parameters are not completely new, they have just been recoded to be view parameters. Here is the list of general view parameters:

      ParameterDescription
      backend_id Changes the default backend to be used in the current map. Take a look at the map configuration option for details.
      iconset Overrides the iconset configured in global section of the map. Take a look at the map configuration option for details.
      width Can be used to alter the map configuration dimensions. Is not used by regular maps at the moment. This option is only used by some map sources.
      height Can be used to alter the map configuration dimensions. Is not used by regular maps at the moment. This option is only used by some map sources.
      header_menu Overrides the header_menu setting configured in global section of the map. Take a look at the map configuration option for details.
      hover_menu Overrides the hover_menu setting configured in global section of the map. Take a look at the map configuration option for details. option for details.
      context_menu Overrides the context_menu setting configured in global section of the map. Take a look at the map configuration option for details. option for details.

      Default map sources

      At the moment there are two map sources available in default NagVis. Descriptions about the geomap and the automap sources can be found on their dedicated documentation pages.

      nagvis-1.7.10+dfsg1/docs/en_US/nagvis_config_format_description.html000066400000000000000000001244651225466040700255270ustar00rootroot00000000000000 Main configuration format description

      Main configuration format description

      General Information

      The Main Configuration file is designed in plain text "ini"-like format. There are sections which are marked by the surrounding brackets [] and variables which have an assigned value. The variables have to be in the correct section so you have to ensure to have uncommented the section too. Semicolons (;) are used to mark comments. Sections and variables with a leading semicolon are commented out and won't be recognised by NagVis.

      In a fresh NagVis installation there is no file with the default configuration. The default configuration is stored in the PHP-Code of NagVis. If there is a file etc/nagvis.ini.php which has stored configuration information it will override the default configurations. There is a file etc/nagvis.ini.php-sample with sample configuration values. All values are commented out.

      Section overview

      • global
        General options which affect the whole NagVis installation
      • paths
        Path definitions
      • defaults
        Default values which are inherited to the maps and its objects
      • index
        Options to configure the Overview page of NagVis
      • automap
        Options for the Automap
      • wui
        Options for the WUI
      • worker
        Options for the Worker
      • backend_*
        Backend definitions
      • rotation_*
        Rotation pool definitions
      • action_*
        Custom context action definitions
      • states
        Options which affect the handling and appearance of the different states

      Description of the sections in detail

      global

      All values which are used througout NagVis are stored in the global section.

      Value Default Description
      audit_log1Enable/Disable logging of security related user actions in Nagvis. For example user logins and logouts are logged in var/nagvis-audit.log.
      authmoduleCoreAuthModSQLiteDefines the authentication module to use. By default NagVis uses the built-in SQLite authentication module. On delivery there is no other authentication module available. It is possible to add own authentication modules for supporting other authentication mechanism. For details have a look at the authentication module documentation.
      authorisationmoduleCoreAuthorisationModSQLiteDefines the authorisation module to use. By default NagVis uses the built-in SQLite authorisation module. On delivery there is no other authorisation module available. It is possible to add own authorisation modules for supporting other authorisation mechanism. For details have a look at the authorisation module documentation.
      controls_size (new in 1.6) 10 The size (in pixels) of object controls in unlocked (edit) mode in the frontend. Object controls are for example the modify, delete and move icons.
      dateformat Y-m-d H:i:s The format of date and time shown in NagVis. Available options like in date function of php
      dialog_ack_sticky 1 Is set to 1 by default to enable the preselection of the "sticky acknowledgement" checkbox in the problem acknowledgement dialog.
      dialog_ack_notify 1 Is set to 1 by default to enable the preselection of the "notify acknowledgement" checkbox in the problem acknowledgement dialog.
      dialog_ack_persist 0 Is set to 0 by default to disable the preselection of the "persist comment" checkbox in the problem acknowledgement dialog.
      displayheader1Show header menu in maps. (Deprecated in 1.4. Moved as option "headermenu" to default and index section.)
      geomap_server (new in 1.7) http://geomap.nagvis.org/ The server to use as source for the NagVis geomaps. Must implement the API which can be found here
      http_proxy (new in 1.6) The proxy server to use for external HTTP request.
      http_timeout (new in 1.6) 10 The timeout in seconds for external HTTP requests.
      languageen_USSelect default language to use in NagVis. There are several translations delivered by default: en_US (English), de_DE (German), fr_FR (French) and pt_BR (Brazilian Portuguese; since 1.4.4). Since NagVis 1.4 you have to select the languages in a new format ("en_US" instead of "english")
      language_availablede_DE,en_US,es_ES,fr_FR,pt_BRYou may want to give your users a limited number of languages to choose from. You can control the behaviour without deleting the language files from your NagVis installation. If this value is left empty NagVis will fallback to all configured in languages. If you like to add a new language to your NagVis installation you need to add it to the list here.
      language_detectionuser,session,browser,configThis controls how NagVis tries to detect the language of the user to translate NagVis. NagVis knows several mechanisms to detect the language:
      - user: Explicit user selected language
      - session: When the user selects a language it is stored in the current session
      - browser: NagVis tries to detect the user language by the browser agent
      - config: The installation default language
      The order you set the options determines how NagVis uses the different mechanisms.
      logonmodule LogonMixed

      Defines the logon module to use. By default NagVis uses the mixed auth module which trusts the username given in REMOTE_USER or displays a HTML logon dialog for requesting authentication information from the user when REMOTE_USER is not set.

      On delivery there are the following modules available:

      LogonMixed: The mixed logon module uses the LogonEnv module as default and the LogonDialog module as fallback when LogonEnv returns no username. This should fit the requirements of most environments.

      LogonDialog: This is an HTML logon dialog for requesting authentication information from the user.

      LogonEnv: It is possible to realise a fully "trusted" authentication mechanism like all previous NagVis versions used it before. This way the user is not really authenticated with NagVis. NagVis trusts the provided username implicitly. NagVis uses the configured environment variable to identify the user. You can add several authentication mechanisms to your webserver, starting from the basic authentication used by Nagios (.htaccess) to single sign-on environments. Simply set logonmodule to "LogonEnv", put the environment variable to use as username to the option logonenvvar and tell the authentication module to create users in the database when provided users do not exist. The option logonenvcreaterole tells the module to assign the new user to a specific role; set to empty string to disable that behaviour.

      LogonMultisite: This module uses the authentication provided by auth_* cookies which have been generated by Check_MK multisite when using the cookie based authentication.

      It is possible to add own logon modules for serving other dialogs. For details take a look at the logon module documentation.

      logonenvvarREMOTE_USERDefines the environment variable to be used for fetching the authenticated user from the webservers environment. This option is only used with the logon modules LogonEnv and LogonMixed.
      logonenvcreateuser1Tells the LogonEnv/LogonMixed module to create a user account for each unknown user who opens the NagVis pages. This option is only used with the logon modules LogonEnv and LogonMixed.
      logonenvcreateroleGuestsTells the LogonEnv/LogonMixed module to create the user accounts with the given role associated. This option is only used with the logon modules LogonEnv and LogonMixed.
      logon_multisite_htpasswd The path to the htpasswd file which is used by multisite. Only used by the LogonMultisite module.
      logon_multisite_secret The path to the auth secret file which is used by multisite. Only used by the LogonMultisite module.
      logon_multisite_createuser 1 Same as the above "logonenvcreateuser" option. Only used by the LogonMultisite module.
      logon_multisite_createrole Guest Same as the above "logonenvcreaterole" option. Only used by the LogonMultisite module.
      refreshtime60Refresh time of maps or reloading the next map in map rotation
      sesscookiedomainauto-detectYou may need to control for which domain NagVis will store the session cookie. By default NagVis tries to auto detect this option value by using the webservers environment variables. This should work in most environments but may be changed e.g. when using url rewriting.
      sesscookiepathauto-detectedYou may need to control the path on which the cookie will be set. By default NagVis uses the paths/htmlbase value for setting the cookie. This should work in most environments but may be changed e.g. when using url rewriting.
      sesscookieduration86400Lifetime of the NagVis session cookie in seconds. The default value is set to 24 hours. The value of the NagVis session cookie contains will be renewed on every page visit. If a session is idle for more time than configured here it will become invalid.
      startmoduleoverviewThe default module to show when none is given by the user
      startactionviewThe default action to do when none is given by the user
      startshow The startshow parameter is only used by some views at the moment. It is used by the Map and the AutoMap modules.

      paths

      In this section all necessary path variables are defined.
      Value Default Description
      base /usr/local/nagvis/share/ Absolute physical NagVis path
      htmlbase /nagvis Absolute html NagVis path
      htmlcgi /nagvis/cgi-bin Absolute html NagVis cgi path

      defaults

      Default values which are applied to the maps you use. If there is no value set in the map or an element on the map the default value is used.
      Value Default Description
      backend live_1 Default backend (ID of the backend - copy the text from which <backend-id> stands for in [backend_<backend-id>] )
      backgroundcolortransparentDefault background colour of maps
      contextmenu0Enable/Disable the context menu on your map objects.
      contexttemplatedefaultDefault context template.
      event_on_load 0 Enabled/disables event handling on page loading. Initial problematic states will raise events in frontend during page rendering. (New in 1.7b3)
      event_repeat_interval 0 Repeat frontend events in the given interval. The interval is configured in seconds. Set value to 30 to let NagVis re-raise events for problematic objects every 30 seconds. Setting this value smaller than [worker] interval will have no effect. (New in 1.7b3)
      event_repeat_duration -1 The time in seconds to repeat alerts for a problematic ojects for as configured in event_repeat_interval. This value defaults to -1, this leads to repeated events until the problematic state has been fixed. (New in 1.7b3)
      eventbackground 0 Enable/Disable changing background colour on state changes (configured colour is shown when summary state is PENDING, OK or UP)
      eventhighlight 1 Enable/Disable highlighting of the state changing object by adding a flashing border
      eventhighlightduration 10000 Duration of the highlighting in milliseconds
      eventhighlightinterval 500 Interval of the highlighting in milliseconds
      eventlog 0 Enable/Disable the eventlog in the new javascript frontend. The eventlog keeps track of important actions and information
      eventlogevents24Number of events in the eventlog scrollback
      eventloglevel info Loglevel of the eventlog (Available: debug, info, warning, critical)
      eventlogheight100Height of the javascript eventlog in px
      eventloghidden1Hide/Show the eventlog on map loading
      eventscroll 1 Enable/Disable scrolling to the icon which changed the state when the icon is out of the visible scope
      eventsound 1 Enable/Disable sound signals on state changes
      headerfade 0 Enable/Disable the fade effect of the submenus in the header menu (When the used header menu supports that option)
      headermenu 1 Enable/Disable the header menu
      headertemplate default Default header template
      hoverchildslimit 10 Limit hover child objects to this maximum value
      hoverchildsorder asc Order of the child objects (Available: asc/desc)
      hoverchildsshow 1 Enable/Disable the child objects in hover menu
      hoverchildssort a Sort method of the child objects (available: "s": state, "a": alphabet )
      hoverdelay 0 Delay of hover menu appearance in seconds
      hovermenu 1 Enable/Disable the hover menu
      hovertemplate default Default hover template
      hovertimeout 5 Default hover menu ajax request timeout in seconds (deprecated in 1.4)
      icons std_medium Default iconset
      onlyhardstates 0 Recognize only hard states (not soft)
      recognizeservices 1 Recognize service states in host/hostgroup objects
      showinlists 1 Show the maps in lists (dropdowns,index page,...)
      showinmultisite 1 Show the maps in multisite snapin
      stylesheetFilename of the custom stylesheet to use on the maps (the file needs to be located in the share/nagvis/styles directory)
      urltarget _self Target of the Icon link, this option adapts <a target=""> (_self is same window)
      hosturl [htmlcgi]/status.cgi?host=[host_name] The default url to follow when a user left-clicks on a host object. Available macros: [htmlcgi], [htmlbase], [host_name], [backend_id]
      hostgroupurl [htmlcgi]/status.cgi?hostgroup=[hostgroup_name] The default url to follow when a user left-clicks on an hostgroup object. Available macros: [htmlcgi], [htmlbase], [hostgroup_name], [backend_id]
      serviceurl [htmlcgi]/extinfo.cgi?type=2&host=[host_name]&service=[service_description] The default url to follow when a user left-clicks on an service object. Available macros: [htmlcgi], [htmlbase], [host_name], [service_description], [backend_id]
      servicegroupurl [htmlcgi]/status.cgi?servicegroup=[servicegroup_name] The default url to follow when a user left-clicks on an servicegroup object. Available macros: [htmlcgi], [htmlbase], [servicegroup_name], [backend_id]
      mapurl [htmlbase]/index.php?mod=Map&act=view&show=[map_name] The default url to follow when a user left-clicks on an map object. Available macros: [htmlcgi], [htmlbase], [map_name]
      view_template default Templates to be used for the different views.
      label_show 0 New in 1.6.4: Show the objects labels or not.
      line_weather_colors 10:#8c00ff,25:#2020ff,40:#00c0ff,55:#00f000,70:#f0f000,85:#ffc000,100:#ff0000 New in 1.6.5: This defines the colours of weathermap lines in the different percentage levels. For example above 10% load it will be coloured #8c00ff.

      index

      Options to configure the Overview page of NagVis
      Value Default Description
      backgroundcolor #fff Configure the background colour of the overview page
      cellsperrow 4 Maps per row in map listing
      headermenu 1 Enable/Disable the header menu
      headertemplate default Default header template
      showautomaps 1 Enable/Disable the listing of automaps
      showmaps 1 Enable/Disable the listing of maps
      showmapthumbs 0 Enable/Disable the listing of map thumbnails
      showrotations 1 Enable/Disable the listing of defined rotations

      automap

      Sets the automap options.
      Value Default Description
      defaultparams &childLayers=2 These are the parameters for the automap views and links in the lists (map index page, dropdown menus in header)
      defaultroot localhost Default value for the root object. For details see Automap documentation
      graphvizpath /usr/local/bin If the graphviz binaries (dot,neato,twopi,...) could not be found in the PATH the path has to be set here
      showinlists 1 Enable/Disable the automap in map lists (map index page, dropdown menus in header) (Deprecated in 1.7)

      wui

      These are the options for the editing mode.
      Value Default Description
      autoupdatefreq 25 In this interval the map gets backuped by the WUI. (Deprecated in 1.6)
      grid_show0Enable/Disable a grid to make the alignment of objects easier in the WUI. Objects are aligned to the upper left corner after moving.
      grid_color#F7F7F7The colour of the grid lines.
      grid_steps32Scale of the grid in px.
      headermenu1 Enable/Disable the header menu in the WUI. (Deprecated in 1.6)
      headertemplatedefaultDefault header template to use in the WUI. (Deprecated in 1.5)
      maplocktime 5 Time in minutes a map is locked by an editing user.

      worker

      Options for the new worker in the javascript frontend of NagVis.
      Value Default Description
      interval 5 The interval in seconds in which the worker will check for objects which need to be updated.
      requestmaxparams0The maximum number of parameters used in ajax http requests. Some intrusion detection/prevention systems have a problem with too many parameters in the url. Set to 0 for no limit.
      requestmaxlength1900The maximum length of http request urls during ajax http requests. Some intrusion detection/prevention systems have a problem with queries being too long.
      updateobjectstates 15 The retention time of the states in seconds in the frontend. The state information will be refreshed after this time is over on next worker interval.

      backend_*

      The backend sections to define the backends are all named [backend_<backend-id>]. In the example the backend_id is live_1.

      Depending on the value in backendtype the valid values for the backends have to be set. In this example it is the MKLivestatus backend.

      [backend_live_1]
      backendtype="mklivestatus"
      htmlcgi="/nagios/cgi-bin"
      ; the following options depend on the selected backendtype, in this case it is MKLivestatus
      socket="unix:/usr/local/nagios/var/rw/live"
      
      Value Default Description
      backendtype mklivestatus type of backend - MUST be set
      statushost 

      The status host can be used to prevent annoying timeouts when a backend is not reachable. This is only useful in multi backend setups.

      It works as follows: The assumption is that there is a "local" backend which monitors the host of the "remote" backend. When the remote backend host is reported as UP the backend is queried as normal.

      When the remote backend host is reported as "DOWN" or "UNREACHABLE" NagVis won't try to connect to the backend anymore until the backend host gets available again.

      The statushost needs to be given in the following format: "<backend_id>:<hostname>" -> e.g. "live_2:nagios"

      The host needs to be in another backend than the current one to work correctly.

      htmlcgi /nagios/cgi-bin Path to the cgi-bin directory of this backend (interesting for multiple backends)
      custom_1 First custom variable which is available in the context and hover menus. With this option different custom URLs can be added to the context/hover menus based on the backend used. Might be interesting when adding links to different Nagios instances.
      custom_2Second custom variable. Same as above.
      custom_3Third custom variable. Same as above.

      For the backendtype specific options see the backends documentation.

      rotation_*

      Defines several map rotation pools. In this example the browser switches between the maps demo and demo2 every 15 seconds. The rotation is enabled by url: index.php?rotation= in this case the rotation id is: "demo"
      [rotation_demo]
      maps="demo,demo2"
      interval=15
      Value Default Description
      interval 15 Map rotation interval in seconds
      maps

      Comma separated list of maps to rotate in this pool. You can also add external URLs surrounded by [ and ] (e.g. maps="demo1,[http://localhost/test.php]". The URL has to be reachable and accessible by the server which NagVis is running on.

      You can add labels in the following format <label>:<map> and <label>:<[url]>. The labels are displayed in the rotation list.

      action_* (new in 1.7.6)

      Since NagVis 1.7.6 it is possible to use so called actions to extend the default context menu. This enables users to connect directly to the monitored hosts from the NagVis context menu. The configuration is done using [action_*] sections in the main configuration.

      It is possible to add such actions to the context menus of service and host objects depending on the "obj_type" option. They are not added blindly to all objects of those types, you can use the attribute "condition" to configure which objects shall have the specific actions. By default we use Nagios custom macros of the host object to make the actions visible/invisible. This filtering mechanism is not limited to custom macros, you can also use regular host attributes which are available within NagVis.
      With the option "client_os" you can configure the option to only be available on the clients which have a listed operating system running.

      Here is an example for such a section, taken from the sample config:

      ; Adds the action "connect via ssh" to service/host objects which have the
      ; string "unix" in the TAGS Nagios custom macro. Is only added when NagVis
      ; detects that the client watching the map uses linux or mac os.
      ; When clicking on the link, the browser opens the URL ssh://<address>/,
      ; you need to configure your clients browser to handle these urls correctly.
      [action_ssh_url]
      action_type="ssh_url"
      obj_type="host,service"
      client_os="mac,lnx"
      condition="TAGS~unix"
      ValueDefaultDescription
      action_type The type of the custom action (used as reference to the optional custom action script files located in share/server/core/actions).
      obj_typehost,service Comma separated list of object types to display this custom action for
      client_os Comma separated list of client operating systems to display this custom action for. You can use the values win, lnx and/or mac here.
      condition

      You can use some sort of filtering mechanism to display the action not on all objects of that type. The example above can be read like this: "Add this filter to all host and service objects which contain the string unix in the custom macro TAGS". Means the action is only added to unix hosts.

      You can use regular attributes or even custom macros of the objects as keys. At the moment you can use the operator = to test if the value matches the string exactly. The operator ~ can be used to search the given substring in the value. Both operators are case sensitive.

      An action can be constructed out of three parts:

      • The configuration section, which is needed to register the action to NagVis
      • The HTML snippet to be added to the context menu in the context template
      • Optional: An action plugin which can register custom config variables for this plugin and a handler function which can be executed on the server to perform some custom action on in the context of the server (e.g. generate some files). Those files are located in share/server/core/actions).

      The sample configuration defines several sample actions, which might be useful for some users. Here is the list and a short description of the actions:

      Action IdDescription
      rdp Adds the action "connect via rdp" to service/host objects where the host object has the string "win" in the TAGS Nagios custom macro. When clicking on the link, NagVis generates a .rdp file which contains a call to make the client connect to the given host via RDP.
      win_ssh Adds the action "connect via ssh" to service/host objects which have the string "unix" in the TAGS Nagios custom macro. Is only added when NagVis detects that the client watching the map uses windows. When clicking on the link, NagVis generates a .cmd file which contains a call to putty which makes putty connect via SSH to this host.
      ssh_url Adds the action "connect via ssh" to service/host objects which have the string "unix" in the TAGS Nagios custom macro. Is only added when NagVis detects that the client watching the map uses linux or mac os. When clicking on the link, the browser opens the URL ssh://<address>/, you need to configure your clients browser to handle these urls correctly.
      http Adds the action "connect via http" to service/host objects which have the string "web-80" in the TAGS Nagios custom macro When clicking on the link, the browser opens a new window with the URL http://<host_address>/. This can be changed by modifying the context template.
      https Adds the action "connect via https" to service/host objects which have the string "web-443" in the TAGS Nagios custom macro When clicking on the link, the browser opens a new window with the URL https://<host_address>/. This can be changed by modifying the context template.

      states

      Options which affect the handling and appearance of the different states in the NagVis installation.

      These settings define the state handling behaviour. Mainly it is possible to configure which state will cover another state changing these values. The state with the highest value will become the "summary state" for an object. For example a critical state (5) will cover a warning state (4). Another example: An acknowledged critical state (2) will not cover a warning state (4).

      ValueDefault
      down10
      down_ack6
      down_downtime6
      unreachable9
      unreachable_ack6
      unreachable_downtime6
      critical8
      critical_ack5
      critical_downtime5
      warning7
      warning_ack5
      warning_downtime5
      unknown4
      unknown_ack3
      unknown_downtime3
      error4
      error_ack3
      error_downtime3
      up2
      ok1
      unchecked (new in 1.6)0
      pending0

      This settings define the behaviour of states in the frontend.

      • *_bgcolor: The bgcolor option is used in the background colour changing event handler.
      • *_color: You can configure the foreground colors which are used for example as line colors and also in the highlight event handler.
      • *_sound: The sound file is being played on changes to the mentioned state (Needs to be MP3 format).
      ValueDefault
      unreachable_bgcolor#F1811B
      unreachable_color#F1811B
      unreachable_ack_bgcolor
      unreachable_downtime_bgcolor
      unreachable_soundstd_unreachable.mp3
      down_bgcolor#FF0000
      down_color#FF0000
      down_ack_bgcolor
      down_downtime_bgcolor
      down_soundstd_down.mp3
      critical_bgcolor#FF0000
      critical_color#FF0000
      critical_ack_bgcolor
      critical_downtime_bgcolor
      critical_soundstd_critical.mp3
      warning_bgcolor#FFFF00
      warning_color#FFFF00
      warning_ack_bgcolor
      warning_downtime_bgcolor
      warning_soundstd_warning.mp3
      unknown_bgcolor#FFCC66
      unknown_color#FFCC66
      unknown_ack_bgcolor
      unknown_downtime_bgcolor
      unknown_sound
      error_bgcolor#0000FF
      error_color#0000FF
      error_ack_bgcolor
      error_downtime_bgcolor
      error_sound
      ok_bgcolor#00FF00
      ok_color#00FF00
      ok
      up_bgcolor#00FF00
      up_color#00FF00
      up_sound
      unchecked_bgcolor (new in 1.6)#C0C0C0
      unchecked_color (new in 1.6)#C0C0C0
      unchecked_sound (new in 1.6)
      pending_bgcolor#C0C0C0
      pending_color#C0C0C0
      pending_sound
      nagvis-1.7.10+dfsg1/docs/en_US/system_requirements.html000066400000000000000000000076541225466040700230670ustar00rootroot00000000000000 System requirements

      System requirements

      Nagios® / Icinga (installed, configured, running)

      You need an installed, configured and running Nagios to get NagVis working.
      You can get Nagios from the official Nagios Homepage.
      More information on available Icinga packages/downloads can be found on the official Icinga website.

      MKLivestatus (installed, added to Nagios)

      Since NagVis 1.5 we switched the default backend to MKLivestatus since it is much faster, more lightweight and stable than the NDO. And last but not least it is easy to handle and to install. You don't need any database to get MKLivestatus running.

      MKLivestatus is an Event Broker Module for Nagios which serves a unix socket where third party addons like NagVis can connect to for gathering live status information in a very fast way.

      You can get MKLivestatus from the official MKLivestatus Homepage.

      Webserver with PHP support

      NagVis is a web based application realised in Javascript and PHP. You need a webserver with PHP support to run NagVis. We recommend the usage of Apache Webserver with mod_php.

      The minimum version requirement of PHP is 5.0.0.

      PHP modules needed

      Besides the base php packet you need the following modules in your PHP installation. The names of the modules may vary between distributions:

      • php5-gd
      • php5-gettext
      • php5-mbstring
      • php5-session
      • php5-json (Builtin since PHP 5.2)
      • php5-pdo and pdo-sqlite (New in 1.5, for default Authentication/Authorisation module)

      Note: Maybe some of these functions are already compiled into your PHP. php -m will show the built-in modules.

      Special requirements by backends

      The backends connect to external datasources and often need some special modules. Here is a list of the needed modules for the different backends. You only need to meet the requirements of the backends you use.

      mklivestatus
      • php-net-socket (Debian) / php5-sockets (SLES)
      ndomy
      • php5-mysql
      merlinmy
      • php5-mysql

    Graphviz for the automap

    The Automap is based on Graphviz. You need it when you like to use the automap feature. We recommend the use of Graphviz version >= 2.14 (Earlier versions (with lower version numbers) have some problems with truecolor rendering).

    Graphviz is available in some distributions. When you can not use a precompiled distribution package, you can get Graphviz from the official Graphviz Homepage for compiling it on your own.

    You will also need more packages like gd, libpng, freetype, ... but if you get graphviz compiled and/or installed it should work.

    nagvis-1.7.10+dfsg1/docs/en_US/toc.html000066400000000000000000000127431225466040700175200ustar00rootroot00000000000000 Contents

    Contents

    About
    What NagVis?
    How does NagVis work?
    Licensing

    System requirements
    Changelog

    Installation/Upgrade
    NagVis Installer
    Manual Installation
    Manual Update
    Install into OMD site
    After Installation

    Interfaces
    User interface
    Static and dynamic maps
    Automap
    Geomap*

    Configuration Format
    Main configuration
    Map configuration
    Automap configuration

    Authentication/Autorisation
    General
    Roles / Permissions
    Old style Auth

    Advanced
    Backends
    MKLivestatus
    NDOMy
    NagiosBP
    Gadgets
    Context Templates
    Header Templates
    Hover Templates
    Weathermap Lines

    Extending
    Add own Iconsets
    Add own Shapes
    Language file format
    Install Templates
    Custom Context Actions

    (*) New in 1.7

    NagVis Logo

    SourceForge.net Logo

    nagvis-1.7.10+dfsg1/docs/en_US/update_instructions.html000066400000000000000000000077671225466040700230530ustar00rootroot00000000000000 Update instructions

    Update instructions

    Caution: This information is out of date

    First rule: Always make a backup before updating an existing installation. There are several cases for updating:
    1. Upgrading from a very old major version (1.1x, 1.2x, 1.3x)
    2. Upgrading from the last major versions (1.4x and 1.5x)
    3. Updating the sub version (1.5x to 1.5x)

    Upgrading from 1.3x or lower

    There have been many changes to the internal structure of NagVis and the configuration values.
    The recommended way for upgrading to the latest NagVis version is to set up the new version as new installation and migrate your maps/icons/configurations/... manually.

    You should take a look at the following places:

    • Maps (etc/maps)
      Just copy all map configuration files
    • Background-Images (nagvis/images/maps)
      Just copy all map background images
    • Iconsets (nagvis/images/iconsets)
      Just copy everything which is not named "std_*"
    • Shapes (nagvis/images/shapes)
      Just copy everything
    • Templates (nagvis/templates/hover and nagvis/templates/header)
      Just copy all your custom templates. Be aware: Don't replace the default templates.
      Maybe you need to update your pre 1.3 templates to 1.3 version. For more information take a look at the template download page.
    • Template-Images (nagvis/images/templates/hover and nagvis/images/templates/header)
      Just copy everything
    • Main configuration (etc/nagvis.inc.php)
      You should not copy that file. The best way is to copy the sample configuration of the new NagVis version to etc/nagvis.inc.php and merge the settings of your old installation manually to that file

    Updating from NagVis 1.4x

    From NagVis 1.4x to NagVis 1.5x we changed a lot in the directory structure. But in the newest NagVis version there is an installer script included for installing NagVis. This script can also upgrade NagVis 1.4x versions and newer to the latest NagVis release.
    So it is recommended to use this script (install.sh) distributed with the newest NagVis version to upgrade your installation.

    The permission configuration changed with NagVis 1.5. So the installer removes the allowed_for_config and allowed_users parameters from the map configuration files. The permissions are not automatically re-added to the new permission database. The removed permissions are stored as dump in the nagvis/etc/auth-backup file. With this information you can re-apply the permissions to your maps using the new role based permission system.

    It is possible to perform the 1.4x to 1.5x (or newer) update manually too but it has not been tested and documented by anyone. So if you like to update your installation manually you will need to do some research. Basically it should be the same as described above (copying custom files to the new locations and merging your settings into nagvis.ini.php. Don't copy this file!).

    Once you made some experience in updating NagVis 1.4x to 1.5 or 1.6 manually please let us know so that we can extend this documentation.

    nagvis-1.7.10+dfsg1/docs/en_US/user_interface.html000066400000000000000000000053121225466040700217230ustar00rootroot00000000000000 User Interface

    User Interface

    This page is meant do describe the different views of the NagVis User Interface. The paths are relative to the NagVis root directory.

    URLDescription
    NagVis frontend
    index.php This is a redirection to nagvis/index.php (NagVis frontend)
    nagvis/frontend/nagvis-js/index.phpThis is the overview page. On this view all maps and rotations the user is permitted for are listed and linked. You can exclude a map by setting the option show_in_lists to 0.
    nagvis/frontend/nagvis-js/index.php?mod=Map&show=<name>

    This is the classic map view. This view shows the specified NagVis map. The contents is automatically refreshed using ajax calls to the NagVis core.

    The following parameters are available:

    search=<regex>Search for a map object on map load. Matching objects will be highlighted.
    rotation=<name>Rotate in the given rotation pool when the map is part of the pool.
    header_menu=1/0
    enableHeader
    Enable/Disable the header menu. Overrides the configuration.
    hover_menu=1/0
    enableHover
    Enable/Disable the hover menus. Overrides the configuration.
    context_menu=1/0
    enableContext
    Enable/Disable the context menus. Overrides the configuration.
    nagvis/frontend/nagvis-js/index.php?mod=InfoThis is a page with some support information which you can submit when you are having problems with NagVis
    Rotations
    nagvis/frontend/nagvis-js/index.php?mod=Rotation&show=<name>This is the map rotation mode. In this mode you call a rotation (rotation has to be defined in main configuration file). The rotation switches different views after a configured timeperiod.
    nagvis-1.7.10+dfsg1/docs/en_US/welcome.html000066400000000000000000000015241225466040700203610ustar00rootroot00000000000000 Welcome

    NagVis 1.7 Documentation

    Applies to NagVis Version: 1.7.x
    Language: English (US)
    Provided by: NagVis Project Team

    If you experience any problems using this information please contact us at www.nagvis.org.

    Copyright © 2008-2012 NagVis Project

    nagvis-1.7.10+dfsg1/docs/general/000077500000000000000000000000001225466040700164425ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/docs/general/css/000077500000000000000000000000001225466040700172325ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/docs/general/css/style.css000066400000000000000000000016541225466040700211120ustar00rootroot00000000000000body { font-family: Arial, Tahoma, Verdana, Arial, sans-serif; font-size: 14px; line-height: 1.3em; } table { font-size: 1.0em; } a, a:active, a:link { color: #45b1cd; text-decoration: none; } a:visited { color: #45b1cd; } a:hover { text-decoration: underline; } h1 { margin:0 0 10px 0; font-size:2.2em; font-weight:normal; line-height: 1.5em; } h2 { margin:12px 0 12px 0; font-size:1.6em; font-weight:normal; } h3 { margin:10px 0 10px 0; font-size:1.5em; font-weight:normal; } pre, code { padding: 0; border: 1px solid gray; background-color: #E0E0E0; font-size: 1.0em; } pre { padding-top: 5px; padding-left: 5px; padding-bottom: 5px; } table { margin: 5px; } table th, table td { background-color: #E0E0E0; vertical-align: top; padding: 2px; } table th { border: 1px solid gray; } dl, dd { margin-left: 20px; } nagvis-1.7.10+dfsg1/docs/general/img/000077500000000000000000000000001225466040700172165ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/docs/general/img/favicon.ico000066400000000000000000000070661225466040700213500ustar00rootroot00000000000000h& ( @M׺MDCCsqrvī!!!͌&p]\\Ħ8нre222˹ ƭN7zPNO۰y}}}hhhqBϱC;;;іZ+**Ÿ|rWTTջW1uϹ{vwƪ@JJJ+u޷U&&&ˮ<G^u645 Ʃ;*r3y>W$$$<8:n'r*sĩ>yxxvͱE̯>չNfǷ444ƨ94yŭLDqqqdͱC@ʭ=X*tαDͲDDBCαCǭNWMrsH#Rv&xX N\.9 `}eZUoI3/$LLL{P;y Lk*pjzW>c-8w m4i+gAJQuEVn)OCDqF]'|f! <7[(1h0TK~a_6%=GY5^t?: ,2dlB"@Sb( @RͲEEEE׌lllĮ###̾{3wlYYY~~~ܬî]333ͻJ{HԜdžbAutu MMMaaavʶf͵Z===wŰ?yKV)))7~ƬFbYȶSSSqqqrƯW999:{|}ɳ_iXEyxxeeeQҗǴο_^^EDzªL\?}ghiȬCGGGPPPŰhѾU^Ł5yоz̰F:˵cf[[[IsstM\7|B{޶ȱ\p;yo %%%VVV={onn{{{ɮFVİ̲Eb```GGR5x<}ByCν8}79}9ijj<~ͰDXx\Z&)&*dJ/sEY^02r*Ӑ::tvE)PWl)r(2@e>FLLq?^r/fU,02PL-FXd~0X_> hZx0]ofڔ@efLklS|fہl1kFgKKEā4򍎏NCCfQH2EW\4fR#NS,\ щC@ś\~[±a'#VaܗAhҖ=4%OO5@{}unKcOm 4p>ٙmO5b+B!Ij ";6TGGDȚ3$yOOyz8רm99m7..Nnagvis-1.7.10+dfsg1/docs/general/img/iconset-std_mini.jpg000066400000000000000000000404351225466040700231760ustar00rootroot00000000000000JFIFHHExifMM*bj(1r2iHHAdobe Photoshop CS Windows2007:01:30 14:24:00Z &(.HHJFIFHH Adobe_CMAdobed             Z"?   3!1AQa"q2B#$Rb34rC%Scs5&DTdE£t6UeuF'Vfv7GWgw5!1AQaq"2B#R3$brCScs4%&5DTdEU6teuFVfv'7GWgw ?gCm,V+ 57?9{Tr36q)&ז}ÛRe{Jglu}5Cr~罏8x2?gP0ʦv^@}d:5G>sXHcvWӋ3f?3cv1Es>x+o]WU_ U9oo/O?/,,]m6]x˱;ֲ6?o1=@###^ǹ}[ٱ}3s??ꜣԿ][ oY~o;1>ܾXt9>}4F, ͖ks+wO[}[Je7f0,I6zMsӵѩ}tsOV~a;G&½1[n*ŷN*s=,g4ѤvvMIz~/ScM:ˬ81q fEM/ [W?ʳ~}C~R`f)//Ot{Y=1:┿_9=W$Q.ê6N}FFӷ}Nzz_W6OEK+x_ѫmMιQ Photoshop 3.08BIM%8BIMHH8BIM&?8BIM x8BIM8BIM 8BIM 8BIM' 8BIMH/fflff/ff2Z5-8BIMp8BIM8BIM8BIM@@8BIM8BIMK Z Unbenannt-4Z nullboundsObjcRct1Top longLeftlongBtomlong RghtlongZslicesVlLsObjcslicesliceIDlonggroupIDlongoriginenum ESliceOrigin autoGeneratedTypeenum ESliceTypeImg boundsObjcRct1Top longLeftlongBtomlong RghtlongZurlTEXTnullTEXTMsgeTEXTaltTagTEXTcellTextIsHTMLboolcellTextTEXT horzAlignenumESliceHorzAligndefault vertAlignenumESliceVertAligndefault bgColorTypeenumESliceBGColorTypeNone topOutsetlong leftOutsetlong bottomOutsetlong rightOutsetlong8BIM( ?8BIM 8BIM Z  JFIFHH Adobe_CMAdobed             Z"?   3!1AQa"q2B#$Rb34rC%Scs5&DTdE£t6UeuF'Vfv7GWgw5!1AQaq"2B#R3$brCScs4%&5DTdEU6teuFVfv'7GWgw ?gCm,V+ 57?9{Tr36q)&ז}ÛRe{Jglu}5Cr~罏8x2?gP0ʦv^@}d:5G>sXHcvWӋ3f?3cv1Es>x+o]WU_ U9oo/O?/,,]m6]x˱;ֲ6?o1=@###^ǹ}[ٱ}3s??ꜣԿ][ oY~o;1>ܾXt9>}4F, ͖ks+wO[}[Je7f0,I6zMsӵѩ}tsOV~a;G&½1[n*ŷN*s=,g4ѤvvMIz~/ScM:ˬ81q fEM/ [W?ʳ~}C~R`f)//Ot{Y=1:┿_9=W$Q.ê6N}FFӷ}Nzz_W6OEK+x_ѫmMιQ8BIM!SAdobe PhotoshopAdobe Photoshop CS8BIMhttp://ns.adobe.com/xap/1.0/ 1 90 9 1 72/1 72/1 2 2007-01-30T14:24:00+01:00 2007-01-30T14:24:00+01:00 2007-01-30T14:24:00+01:00 Adobe Photoshop CS Windows adobe:docid:photoshop:9f62fa6e-b064-11db-9633-ca74fb8f96ae image/jpeg XICC_PROFILE HLinomntrRGB XYZ  1acspMSFTIEC sRGB-HP cprtP3desclwtptbkptrXYZgXYZ,bXYZ@dmndTpdmddvuedLview$lumimeas $tech0 rTRC< gTRC< bTRC< textCopyright (c) 1998 Hewlett-Packard CompanydescsRGB IEC61966-2.1sRGB IEC61966-2.1XYZ QXYZ XYZ o8XYZ bXYZ $descIEC http://www.iec.chIEC http://www.iec.chdesc.IEC 61966-2.1 Default RGB colour space - sRGB.IEC 61966-2.1 Default RGB colour space - sRGBdesc,Reference Viewing Condition in IEC61966-2.1,Reference Viewing Condition in IEC61966-2.1view_. \XYZ L VPWmeassig CRT curv #(-27;@EJOTY^chmrw| %+28>ELRY`gnu| &/8AKT]gqz !-8COZfr~ -;HUcq~ +:IXgw'7HYj{+=Oat 2FZn  % : O d y  ' = T j " 9 Q i  * C \ u & @ Z t .Id %A^z &Ca~1Om&Ed#Cc'Ij4Vx&IlAe@e Ek*Qw;c*R{Gp@j>i  A l !!H!u!!!"'"U"""# #8#f###$$M$|$$% %8%h%%%&'&W&&&''I'z''( (?(q(())8)k))**5*h**++6+i++,,9,n,,- -A-v--..L.../$/Z///050l0011J1112*2c223 3F3334+4e4455M555676r667$7`7788P8899B999:6:t::;-;k;;<' >`>>?!?a??@#@d@@A)AjAAB0BrBBC:C}CDDGDDEEUEEF"FgFFG5G{GHHKHHIIcIIJ7J}JK KSKKL*LrLMMJMMN%NnNOOIOOP'PqPQQPQQR1R|RSS_SSTBTTU(UuUVV\VVWDWWX/X}XYYiYZZVZZ[E[[\5\\]']x]^^l^__a_``W``aOaabIbbcCccd@dde=eef=ffg=ggh?hhiCiijHjjkOkklWlmm`mnnknooxop+ppq:qqrKrss]sttptu(uuv>vvwVwxxnxy*yyzFz{{c{|!||}A}~~b~#G k͂0WGrׇ;iΉ3dʋ0cʍ1fΏ6n֑?zM _ɖ4 uL$h՛BdҞ@iءG&vVǥ8nRĩ7u\ЭD-u`ֲK³8%yhYѹJº;.! zpg_XQKFAǿ=ȼ:ɹ8ʷ6˶5̵5͵6ζ7ϸ9к<Ѿ?DINU\dlvۀ܊ݖޢ)߯6DScs 2F[p(@Xr4Pm8Ww)KmAdobed@ Z      u!"1A2# QBa$3Rqb%C&4r 5'S6DTsEF7Gc(UVWdte)8fu*9:HIJXYZghijvwxyzm!1"AQ2aqB#Rb3 $Cr4%ScD&5T6Ed' sFtUeuV7)(GWf8vgwHXhx9IYiy*:JZjz ?!njmT}ؘͪ{(4D(_qW᫩o+VKYOUd#=j.`[ihd; BL&.f P;%Wݧd˚7-帱ȱ4-LjdFYM@%g~N;wvuyC#^pp\= f$2S!a3;(W0s/w|o;612*_ |5`%N3F~){>N\ukn!ގfl9&o-K‘ݏlVb6bYEO}{tOɥf L2KR'>܇o<o~ܣpNP*Pj-3@_Xm;_\> {K;qk  eYխgF"= "};nmwWk7WZI;f ^ʌm|x=i6~2 {2OK*kPj%}el氏Q xSc(Tt4T_-Gom[&ݹ9+Iog~"[ {si1+r1o?[Nnx|olm̗fϒSϳr.K;:*=ӖMԥOI}yC~ncے/-}AපWXh"a,XJp'=ʶayz_p7L(Z"V]22 ₊)M qvgcK7gE-0ݿO+nm}ta:gmm1NjjJY-MWj^hc$XP3SK4$'CC|2KD[V{rE8?I4$Q 122#ji>c'Z7^}dw;76ZMvow$u%~ lNG3Ԝ8ok&ܫht0f,P#kY2=%Qeewirc1y"Ԗ1 j(T0HʾDWc9sލqQo g~zm1e⮽4)O~!~Oto¤ۯw v˓q[w .6.&jں޹JMG S;dOy^ח#B/ᯀљTMGŘJ<0rKdߺ>ڟ}wz//-չU^LwI BE<϶ݛdR6_osvTU~Tve&?Msw0gs݉29L6S cǭXM͎t$6VL]FRF]mڷ^kmV)-XJEky LZYV9 y7 ln.mi[ȯ\H\xnHT, (Luw_ޯ/QUϲz-s5';ko'ǯb{/UX] w[H_?m~a1mc{V:uFҿ;]ݯt3ٿZ7/oY9+յ,o,ޟ=ʑ?H_;ͿUޙ~Gܺ/zOovn?6? e?Q$^?MI}.=aB}[ه4ʩ#z9CKՏ˟_gwo?J_tg_o_XJWZ'_e\?( Sr~n2f2 ]JK'/hb?V/dt~Uyͤ5CյtN$ xZ}t^ӝ}̸el.ͭ\䱗U^6EF,nVCz}ޅz5!M{~g1^Ezb?eIM6mu{1U23#')`c!̯-ޛ'$"DG5^Ss9`\Rzzۗ{*gEwЯ~=vMF6%YX)t_k^E~31cTf~5vϳwEovߢEZճr0 赙N8Tm5gY<܌sK./VML8cC}cL'֋2nߗkqZ{`OY\KZ}Ͼ Z>u4U=jt?{'ث3- {M5\.E6]^Mo."'tin(3O"9S>rɎ8{xN\9=cj{W|ekv0aƽEFn}6;[OСXS_+XUWvK~nCdOno+)ci\?C.xRˌGA%ޟ[9J@d?2/6[UT?"/־{sfw̗:.S)USkkoO/e;4:dPzß{Wǻ]bz7v:ѐ+m\Oo~*QO7Yc`w}^crGHdJ5)KOX=%g/mWŞzzW>hX9zwRckvcZ뮷=}Yl}g#8 uTa,Zm}MrMQ 3q7*`-}JkIKnVceWO/3O'_e\?( Sr~n2f2 ]JK'/hb?V/dt~Uyͤ5CյtN$ xZ}t^ӝ}̸el.ͭ\䱗U^6EF,nVCz}ޅz5!M{~g1^Ezb?eIM6mu{1U23#')`c!̯-ޛ'$"DG5^Ss9`\Rzzۗ{*gEwЯ~=vMF6%YX)t_k^E~31cTf~5vϳwEovߢEZճr0 赙N8Tm5gY<܌sK./VML8cC}cL'֋2nߗkqZ{`OY\KZ}Ͼ Z>u4U=jt?{'ث3- {M5\.E6]^Mo."'tin(3O"9S>rɎ8{xN\9=cj{W|ekv0aƽEFn}6;[OСXS_+XUWvK~nCdOno+)ci\?C.xRˌGA%ޟ[9J@d?2/6[UT?"/־{sfw̗:.S)USkkoO/e;4:dPzß{Wǻ]bz7v:ѐ+m\Oo~*QO7Yc`w}^crGHdJ5)KOX=%g/mWŞzzW>hX9zwRckvcZ뮷=}Yl}g#8 uTa,Zm}MrMQ 3q7*`-}JkIKnVceWO/3O 1 153 16 1 72/1 72/1 2 2007-01-30T14:34:00+01:00 2007-01-30T14:34:00+01:00 2007-01-30T14:34:00+01:00 Adobe Photoshop CS Windows adobe:docid:photoshop:1fc3181b-b066-11db-9633-ca74fb8f96ae image/jpeg XICC_PROFILE HLinomntrRGB XYZ  1acspMSFTIEC sRGB-HP cprtP3desclwtptbkptrXYZgXYZ,bXYZ@dmndTpdmddvuedLview$lumimeas $tech0 rTRC< gTRC< bTRC< textCopyright (c) 1998 Hewlett-Packard CompanydescsRGB IEC61966-2.1sRGB IEC61966-2.1XYZ QXYZ XYZ o8XYZ bXYZ $descIEC http://www.iec.chIEC http://www.iec.chdesc.IEC 61966-2.1 Default RGB colour space - sRGB.IEC 61966-2.1 Default RGB colour space - sRGBdesc,Reference Viewing Condition in IEC61966-2.1,Reference Viewing Condition in IEC61966-2.1view_. \XYZ L VPWmeassig CRT curv #(-27;@EJOTY^chmrw| %+28>ELRY`gnu| &/8AKT]gqz !-8COZfr~ -;HUcq~ +:IXgw'7HYj{+=Oat 2FZn  % : O d y  ' = T j " 9 Q i  * C \ u & @ Z t .Id %A^z &Ca~1Om&Ed#Cc'Ij4Vx&IlAe@e Ek*Qw;c*R{Gp@j>i  A l !!H!u!!!"'"U"""# #8#f###$$M$|$$% %8%h%%%&'&W&&&''I'z''( (?(q(())8)k))**5*h**++6+i++,,9,n,,- -A-v--..L.../$/Z///050l0011J1112*2c223 3F3334+4e4455M555676r667$7`7788P8899B999:6:t::;-;k;;<' >`>>?!?a??@#@d@@A)AjAAB0BrBBC:C}CDDGDDEEUEEF"FgFFG5G{GHHKHHIIcIIJ7J}JK KSKKL*LrLMMJMMN%NnNOOIOOP'PqPQQPQQR1R|RSS_SSTBTTU(UuUVV\VVWDWWX/X}XYYiYZZVZZ[E[[\5\\]']x]^^l^__a_``W``aOaabIbbcCccd@dde=eef=ffg=ggh?hhiCiijHjjkOkklWlmm`mnnknooxop+ppq:qqrKrss]sttptu(uuv>vvwVwxxnxy*yyzFz{{c{|!||}A}~~b~#G k͂0WGrׇ;iΉ3dʋ0cʍ1fΏ6n֑?zM _ɖ4 uL$h՛BdҞ@iءG&vVǥ8nRĩ7u\ЭD-u`ֲK³8%yhYѹJº;.! zpg_XQKFAǿ=ȼ:ɹ8ʷ6˶5̵5͵6ζ7ϸ9к<Ѿ?DINU\dlvۀ܊ݖޢ)߯6DScs 2F[p(@Xr4Pm8Ww)KmAdobed@     u!"1A2# QBa$3Rqb%C&4r 5'S6DTsEF7Gc(UVWdte)8fu*9:HIJXYZghijvwxyzm!1"AQ2aqB#Rb3 $Cr4%ScD&5T6Ed' sFtUeuV7)(GWf8vgwHXhx9IYiy*:JZjz ?8?_[WbQLR8iQmsZ9Lfko|nw-1I1Fh챫0)4!Eji4yO[h۷˚lZ n lGH;!X!V `Stg^huf6Vxݾq9*l^򨨓G=eKDQfuv] {/0lDwShBϥez*$$hXjU;,Dk7F$ʶi5 (jW&ok>inߖ]3~kcTX %Y hԐS4GW4l{O<;Xr@b55N-_'{?3}(&t%;wАC|l| ĩFbmKU<+:x^foǵ[/g$5EvY566"::y%y$hԼ^M^b8$U`$E2B$Sz>֞w|{ZGl'&v]cpQ +'O <mꝕXu~s[n.3JX[G(yibsۆgDBҚ4*F*Ǿ{[l~N.exn.m $Һ4k,ǽ ēF~U,IbxR$/$tec&m]mo [e+,8Y:eFQSu#Sj@ȗnm/]b0y-׶ggܖe8|Xw*ԬUI.!Ln[U&Z˪"4VRe!z$ڹD{ZG"DMGH{ tHSIzשwx} ݽun^[&n4˛nxg F b]wݷHnFy."ktUծXk˜eAPs~{ssw Z&sBhm* Nh;'𧺷d0]3Oݹl-^۝LiݳE:\%-zED)#lD-묏Lvwv]`6kKMt֝WMKQRRwC\RH9mwsůOң=^ݟgzRnIE,=>? u qNai ۘKq,@5 [శŒ8XwP>a]o;JmwА)e4/pĪ^mz>9fK56vqCˑ qSn[_g7EusUkbYb ɷD>[ܷIw }md̗"M3U!]S:;,#E0_y gm7mk0ݬ+PQ\" ZFt645'pvhg>CGs%?em,'ySoq|)'_l-0حCYjj<̻o]]ůw-%n%-AtG>:4Jc.\{w^dl96.YK^MXn7;%Qwwks!wa[`ZïH()&rO>P|N.=;csn]ݚGqò:^oiG)QS@1>G!O&<.{\͵MnY]TPYXkcF y˗=}ۄ{K[0+ktm#`>ۄ*7۸:Ft`u4doi_~LQ|X;og썵^W&ή^궭ܛ9S35HI%.)i^BcEBk#軯z\?=: cm7guܛv-#:㐇6FVxIթ9Y|\5,MrMԋsi,,$fDԎ$Wlc1;]FݴX}:tBc5m|ڏ&;Sg{{=\,6h*A#IZW}Ǿ}~zr9۽#fm K;DvڤkKG&gͬH@2Ynd[7C]Grø4ݡyLYM͗s$W5FX[-s g|a[H 5jP+XNOޖOz>{ݣb=ۍӔy/,TXn(v6hIm;ao:ޞv]5.W7kosE)-iRF2SεQML** 2q]sh\G G! YIyg特sw-87x[a%ȑFDhxH^aRE^2@^HizSLnO]mXpmdtҺy*MdG5jvoURlšGz0F|k`'a,s|ҭʧ3GVd@N[1ܜ]?/{?=;w=D'kw>؃gWcqZrulUPtQ*r\yui˷kqIm47dՍ*efZFE˯r~͟{xym{[ E(vkhSKEGgt$M$v~vvĝ}[Un5Aeobc6v<>w3{Sg7NGUXFw{)mW2Io1 hnc ;g>yv%>׳7Hiº}-0DEUkC\oal[cfٜGsWy=헏s&~  #:r7.NRӉ^Y]XmrnvK*J(ʶGs`C)Hx<qm}ݫj-kh9+B[ø3Wݴmqe{˂ͥCu}ov=n}6}#m*_unkLyElǴ2N+:Jy_{r:]0$I UHuR h{n{9sEt׶^/מf/^=My{~=g;Kwl^ݙwNzh;uktյy'y6-ϐC&J(ꪄU>mr{'!{qmgaumZYij}E2`.'Y!7:Bt=Nwa据ęi`I:"QS $zB>Xl>w?qu{tWcw%5smFxcج]YŏcN35Fj9K݋?lImjdYx} i48s{O!緻;y{zܤp4q5‡ML~̏-s5R=5loh}q[;S Ozj,FopͳW4fUGbIjN{ eؑn5F @p Fy=s}׸i`KMd{(Z{D{C-'^5{_]?]/wTl9&'".ݕ8m˱Ք8h5lsÏWO{͛߻A$YXf]3AWO(4:@}-i><7,Ho$j[dK` 44T1۟׻gv;nQ6^v2vaTg!Yzeava<ޯ5P%"crێl6;ŭ}e&v B5 3(O3-/7 Z=Y$"#+A Z@'1{aٝ7[7;~~^bfr˴}/vOlٱV.R #_ MKyЫ`pYI<#ռȌ%XeH+Fմn\4w:$UuEu JRK vu.nagvis-1.7.10+dfsg1/docs/general/img/logo-88x23.png000066400000000000000000000054611225466040700214640ustar00rootroot00000000000000PNG  IHDRXsRGB pHYs  ~tIME IP IDATXX{PSW&X("J+mJEK8ꬃZδNm-he*Ut!T )SԎ(+ HyG޹G1(h9=y?1 ?ovz󈨉L l(?𰷽{CăD%'yC_IY@HoT1^g2rq\T*_ NzJb_ȩ !l049X4?lWAw\p!77js[VVfePVvSɭCU-QMN@[[[zzzaa–5JH|@ckpfHU'-~#2 aÆU*Uq쁩~l1 @mlC=՚ c'ۜ COqRh! {e} tU*Vxqq}Dd*//xFaqrrr`ٲeRT$1l\.wÆ ]R$ r@Q@ bfgSJG6L3lEUiWU3=y[,&Dr-vF񚚚j.ՅJHH((???Á0w}+XRG}:EQ7n,((tҞ={BaNNΙ3gj*q͚5V5 !!E>_E2ik[~hS,Hr9_ƼMY=eŔ'=Ɯ9sΝt:].ג%Kze˖YVՊ SRRz{{rV^}}__'vZо} 11[#B +WϢ" X,xd`` 88˗ a{ϗ߯HW,;J9Cև++^9288{VV̚5 :ٳgxaen#9o6MXpx6*~iLLBS0<~X)e-ǐ. ?9#(&fnx1_OXǍfåtݺuT=X\RRvZNGa4ɬl߾cyD N`ڴi%!TRRpX"f3'Id22OƧlkRSSgΜyĉJ^6mH$:xN!!DtMMMtt4+IQԝ;wFj~;+щpgw0LJJ KMK.7o޽ˋ$I@q2r3fرcGRRL& dkZ)p LNN>zhAAA~~޽{/^=uu޼y3ےS:rF'`0twwkT*gfZ HD89r̝\.ǞL$ϧ(  vxeH$9`Ϟ=#?((h޼yCы5JT:ɓ'dc1|BIENDB`nagvis-1.7.10+dfsg1/docs/general/img/logo.png000066400000000000000000000242731225466040700206740ustar00rootroot00000000000000PNG  IHDR,NT pHYs  ~(IDATx] XGg]5GV]51эdMԨ4hĨ9 7r"r7"*^ȡ"su4tuOw?a e&VR!T#n t\iv=,>e&}s=}ŇnI\)zPHf> r4ܞ:.<,J&Z1 4Ϝci"C'*G  W-;xp,/\; _OpҳU%iK6J⹑zaQ$|ATZTEEyej!С[ӏƏ b@<16Q I.\Ml *RU rdC@0iKM ʟч\P#6_ :?|:U`8ɦ'<"MA#;2 U)$}$4@=Ow?&8|x@ܗ2U`, j MiU8Tˊ0)ki]B--AVty:PO //K)T$8sX>0d":TS ybڷ zݳ.=F<ԠE*? w%PJl$*YŨriiqNNa2T>g'Fd#}@da(}7&hDio;y.0~EO p"Gu2v]f߄~p|^hqjx3#0D08uКy,`dc@~@gaÈ;TETn8_U,#!քYG=#QJXҠZTx1bn"Q.I"6:th )))y׸K- ; ұF`4J@ئM@(jurmLC!lP! <f':Y+<̝&?.L+BhO^8 37СC. E4˻f'y-*@4l0Zm@h =fr #EmIHDsX¥%>(VT##>a+鈅|tvv&"dܹH[[[AMIIa@tc;TI$ _kvbH$W' 9F1. T qBN6tɊ222 [z#諯ʽsehy`&R%aq&6 I [Z(a\5zq?2 VΙ+/\g0axg}Fk$~vƜSM-}ʇ?L{;y(uҥDEE!TAy[^Afʐ^ڸ{6^>Ah?/f]lJ y),){\e Eʬ4AdS>b666:I, ڟUE |Bo(!ɓzSiu70zys፤ܻ b=zk'7bu55X$s :*&;ǍG,_V(H`8ݬo>>\JHGM $eSz22cO/&E/_分dJJ ٳga*֢ݎU0q F^М#gX$R)^ŒaێPQk{R:K֐qH]VUjt<5gSDQ+/rrFzl 0F|<x ߱x~P;aߕl0`@֭+++i<w BysX<:@I "î൅ z:ypA`OnlYlYF.^(udz-.K+tQh 8^]B/K3si5$ĴxzRcJ IQTL>}z5 0@ "8>3SM1[87S}azp$sSiq>aqEϟ$2| Hqp +*K,YBe[=su<*IYǤ~0&a(Q/A7 nҥKwfK:RP_܁c._\5cPDÇ[ pm6]P%)tb]8oFq~ݥQX :0%1ݭne06m!i$]Fd0sssy?^m۶6!c28(obۖ-[!iTax@El(C?3|A0則KS\\wٳB$9šAp`ԉWFG\(}v̴m6!LO5uo,ppȬgԒBU!؇O .d#!] jU?}SQOJ~y:>zO:>9 B&1%Uۄ$_;ՓMׯٿ?"7o$6B]J&1?3%HPpty LKKc#(mDƷ~;77Wd _͚5mǎ?nݺU8D&y˹TFv(DkRUh3Pw4))W^!,++%N'cǎ2O?Tjiٲer@fĤɶ gϞq\T*0=ztɅ |CC/1U\zwq )^_WCUJ-pF/Zhh(|Q@25ڪj('t5NgwㄙWpNNLLd?+$i3g$эA V1~Qڰa_ $(le֭[-3y/U(CHRSSUV@L& ިQ#;;+W '?Ob~0΋4n&M$[:t [Õ݊ F(LrRJ'滎S4Cj Ti3aT5Pk'%|yX !۪U\ӓE(4yyyM6I!1dvzdAfm۶LM4Y!_}^gL upp 6 ܜ5.͚5= >iF q /%R8tYBtp3Ϳuz-W OfbMP,R=j4]}@" Ĉ0 ۗ% O5ם&Qi+X \U)U{4LQ2@2ZH2O3ePk;il:{9-|'?L*>\]h޽\t@_Éw{igڵǏ7yyyo&7с@Qƌo.u&v9sFJW*wۨM&Ij`kRJ#A*ОR'j:(j%%UQ;[PVm5$5U=9٦R{TTOL')$V#[|_I##;wUJ* Ipst Z. bK*\{pfF.+zA-*iYXID?fM^S"Fiklғ,F"$&[YYq45I]K!1SnCo( ?>d;;!޽{s;嫗6o=:h.eWQW5Romu%U*?6HoT(b-T[;/?󟡴n<0EaP[]xXĻ"j7zho#eJ@"E|}} r.DR ,//\SEĄ'O|r1Pak;Gr*--cKLCտpvx$JJ`*Yr- uOǩ9Q/{.XYE_ @-Ѥ7iz*H4@$n~,4.?~2m4!0@19 :2D"ވ2ӜB#7Ò<&8,!>fA$w:qy3aM$Uw}GVZq ^e˖\3o̘1ƪ"Ud4@-bv}3&D,5׾},6uB2I2WKl"~w"b޺)ׯa nݻw׶ +A]M;N т*$`F+K)E3 XC%{X8SW G`ۋy6i҄ zF!ßqqqs.  1_h  B|~!'|"uرiFFp={cǎv)<riRQ-: cvo*o&tUvxk׮zC_:y:yʓ]֭[7 2s֭Dʘ pdvy TTSN3G<]vέw BZ"I:Şk~2l0Se/1>*DS`:zt@c{ޣ+djݻwhEn *[=uQ;B\`q4td5؊o!13LM6%AWZ-,,%|6b}uV͛7` 4,++3Yq"0\!^IIIU e:T'7\mKBIX C ˽A UwrRl9r]0{l1d5*O>fRSS>|={5A8${޽?( $FǗ `ܹS;wmdjn:jĵ`yzk'a>8H7.( '3P\;^ó1EGKKKt h"Yk23`ƂM `maEE1Yx(}Z| dzPn2${ҥKA0>}l9[[[v۵k#o tj)0 |w8Rvg0Gwuo}rSy C05aFyGv dPx 0:Q+<p7n # 2,Wsp4G4azzѡUO& B'5{1%Tz3RZ.+(>w} #x(DP+]P$]p͂W;'!Ћ|PL 7ftmeTNj!2kУ' OCe B̕푷ܮ?㒘rJ}+j,++hԩS`?̬$FHB$152u_>^cr4: :fBCF& x;t0a„}KNŏv CRc>kP -XץK7|Sƞ72o<1CAhE/,2d1͘ $rی3dPTrOn۶rEGɁ́@%_xƍ:7;#IS޽{E") $ycqmLL)BCJa[jU(90$^u_9F4,鸅`EB#GdζgI8ۨ)dHdP,ĵޝ^IH\LMpuB"##~'p>}Z$߃SIo v Z/2Sb ߿ppȾn)!L'N4.k9dωBEժ J澇.fLE=z`/&-"C$x0~߾}]]] bixx8X֖]f\sW1@0wR ޽ ҩF#B ^;UDtzڷo_DD`VhhB3gѣ{W^0`ܧmBlllv 󂘹 77oy!kĦNT] yD^W%wVZY? VSN<ˇ߿Ϡ}v[)]|Y#jf1 o-.U0rwB2(aF_|9L7nܶm_~eܹ#Fܹ3dl+HS4eά ψh{ԓ:?p\6c",0HLL5&4h'' iT m۶5F{ $Y졸}Q|c2@mҢEI&iӦaÆ (Y HI20)AHK MIo$bd3zjy7jEAAAFQ@`ԅ'"c]_MHdA*b3Seggk׎ Bԃ{ rJb={4:p%b:u$$ZҞ”B"gJ4VԴBO`)\jٲ% l)-^=cmm-:EbӤ:@WֿC!x/``םWl߾=5X $ -XcT_m F|˖&[nPVY ͉-0߷ifkkhѢ[x-6j5|`?uH:u݅TZR麳 `13v-,,})3TZZ n޼j _7ثD&@FYL ل]޺[XoH۪MD 0 .h{(۫WzVAj_z7829|pİxy-byV?? -,,RRRLaah쵈74i-, ;q?&M]oEAd*ÂfMTEMs1G:;;'$$pOT8º2Ŭjҥ+5P={̙3>ԩ-[BCC a"FRK- ӠA߭VTTpKKKKJJJLLLNN~qqqu@Ç1yf͚) >&2 bIDDĴid[h qɩh"y!O̟?O>©;v?~Jh—S򢣣ٳf͚k޽;44ogrILzzTXtJPEG-Colorspacex333~c'zTXtJPEG-Sampling-factorsx3010adbIENDB`nagvis-1.7.10+dfsg1/docs/general/img/medium_nagvis-1.0-wui-preview.png000066400000000000000000000231151225466040700253320ustar00rootroot00000000000000PNG  IHDRxx IDATx}%u߹KUo~:3= g8)(K;lH4+0%@Oȷ|$ Vd(b82%ˌ8[wOwO׾|ܪg#ews=,u_=oE!@KB!CxyFioEڱJP3oF#J..&M0Fe\Lv>?.<`O .yed+'V>[yٍۇ7zS~NԮ]>cK7sa0\1BƩcc&cF!L a1N1ג7cs` ( ty1!+¦뗮0B8Bc@AY Ř1 $#&7WJ qC|8IcLHS~]ojh' MF^Nss.ϩ,3%Lc`EqR5ad C.qJH"r>\xxW@j(٩kԳiY2>)믿'[Ql1+< By"2U:Ujfi2O]KPj50r\Gi'ֹ"mGT`@E4upljk8S{ 3.#ca aHϫC c<|bYLˌB,d_f qbcٱѿ~gO< RG0V巿[,`<Gܼz$q\vjW~aF#w}OQݽ? ƭeF`PbA1]WISƣXqaj'Λsqsĉu\68,B4eYK?P0f<p̨Ȃ.lm3@*<eP@eJ8b"7$ X&{05Q-~KO8R-cgE b#lϑ 9ՈBI`hX0BCɕFNU-!14LԶ9GPJiF:km`Ԑ;v (*x21>szjyj~zsZ͊RYSy;~ګ=wazdZ8{fc89ToP$$IVWO<~i㉽Bѻw$l8ax#2|njBȲljipyyɲ̖IO];y魭0 Z'.K@% !jjGG+C;cE;606$EIIPJZ` /3ew뺮iө}뭮jV4opVkZE~A QIe #|p8ڊ"G0$,a^Ʈث0j0 N[U~n۞k40 1­VVoޮ_\9}x؏4v 7sBd2McMUU IA+0CѣrDAbҫD(A"#y~ڻ~sEZ2! `y+tde`\R 43r,\^;#Ҽ D)"PliYJEʲμges&MaSoU2b\&*$u\e?(0^N B&+; 4Han4O&2a粫 G*U6˄,~an),+,fsvPfWyfm*J!,@NY`/}!J\y= ԏ̽_8bba9Hҳss@>_(ݳKCG!a%+OrɂOW_^\N1 DeMˢHYf7bbV!T)GG犝QYmK3cWyl^8lL@K 1z,e{1m*ȤZͦ:L-";AT$ZnCvEBQdG~# R#*CEFyg&HSpz{8n_~8r!.Dks\h͍B"IPJ>BPJ,7J LDZQ֜bJ(:w.fIAi'Y&Y SGe&~o}O?1 "ƟS@8@~SEʪ\͵RGV\e+՝a7{G-YºEQG K-eg'2! {0PFMeG9+P/5|H.Ibw:hَEv9@[PIA9H}e? їK|oחaš$ 8gI |o ,`;:q&Qi_s*~틧()0, };O5ϴ{1;M4/֙sO|"=ʾg#g_œTŬFMy>:-c/\[[l_z4;w2 싟e,Zo=iRÒOؙ>q!kW~zSeݰwlׯ=u~E_ťE|_ǧ^|k=/޽=QGQ_~ǫ+Kko~Խn[&:\-g҃hȔ*IL\\=Lqt.?{Wk_K_/8w׫x["wۍz|?~gd2z}…~ԅUƭn`c"=}酧+oqswZѳ\A^4g Fhxm æ,ˆ0\_T)Գo:#_ EeaI7Me{w0o, ;ۋ ³._̳kÉ;O4aY:zkuM鸻*9;<|z)'aқʒWƣNtۛ[|v :-9n殌vZ:LQ4F{O/}3' $ mMB9'ƿ#(O6=| E]7ۜ(b.ugCM1z? 0e9,vb;&FqdBC.5YP+9!1$ >|8z<7wF*HGfqt :}8"o .cI۳pVV2`~IR@,#HASs8_%EAN2 8UdP냣K/#0ʍŵZsɵoˊ$1rM%YCĨi_7j.*a8 )1QAGH{v4mz͙TRi_RtMå]{CLahFJ*8~[﷗ PhsG|1bHcq fƮ=fG1f *I%H88F@,ߛZ6&4# K$ Uq0Ge!jc,Ib@`;hⳜL{0!@ HQڏ?ך`T`R% `Ǩ-N{ +:06`,cwS,Zۻ+Mi&Q12t8NM%J6x*ulɊL֥wjjr ƮJSD^#2 ]gLzNdEQ4"fFT8nZsƿ$0"0cq٪V%UN Y9w$E8'Xܬi{h]yAskntUU/١2jڕ+W,2MԩSs]K.=^Ìk[<}'{= $qBedIQ=@5w:V0&I9ӾYgVk::P$L^ a-v& Ba9 Gh( ÷z c|h|ɓ#<< 4M1=&$I0Y>T'R*:0(n4BA%EV8K(UQȀ"mT5IG k1 =lq0ᛢɌ%KZBF%4hdX/A:81Zqtu?J2d\2 cX9KwI5Ɗ=9z$@"@D*8ZdGkFHa)nͻ0eYHBe) GS}Gs 󽎌?P 2kW8:sE}MYy>t:wc)("z4w6j$UČ2 E 5Q9dE4MӚ&74K GcA!i˵Z#Ѹ۶+$pwG?D($fL8* bȝء:"%y9s=R3$*)z)\򮁭X\r5;'Ia]ż b\|7Pɓ[[[Eiof$Νp G~4]+NPP1wU\DNW5PN>}mUU~h뭭B$e9,4ΕQyQ]tIng CEi3Zd"$X6E1\=sd2Q0ZVA>G_~f}YEqg0 HGLKwPଌY.B9V"Lb}}ݲvMYYYP/$~fCߏ~qƍӧO_~!TՂ Jo~snyGp@XIDAT!a8NsxAT1npxA$Irƍ ?ϯ}GqgvptEoYgyf4}[z\AC~(8:@B3ML*[<щ7i3{݁K֧j(/,I}EQD=/chHP_~1ҝcفLZ}xx8LA ji6)a6teeUTGG۶}xv}~_^ϿGi?P766*G{)As=.ˡ#gXɄ>s+V sѦ-޾tR"ˊeiG6_;]yNm%EWb4clJvVQ=G)PU8D㨲 X御e{dwXJ٨"({ptzO񒉭sz ?(.P8{hg6gٽf.NaEu087?ح[zSO=5"VOF9gCB,Ih6Fs疖m۷ofq,ٕY7ŽS KsP \##>̢F*N&S$ICRJ Fn1vppP(RhQyjy6{e;òrQzX$۶-r]?q$^h8N$a,..nnnq(JgΜxyhg6-ˊ!oi4auJt21M$Iy$IijvƍݱBG>1pl̫cT4?F9xfٗE7 Q$$˳c$ @UջgG ߳8c={{eH  /}0v~PP*?-+54trV2Z4Y-,ފ7"b/8dQEQHn64.o}s\.o}]  EAݣ蒳EPKvp8ZDD}h ߐyT>B+l>ڢp8Tdd- =cIϡT@Q+`L&QɊ^ĄPBsF篫 \a$*(/u(5M{8yLI72e=7(B9 +`Yk $g(ۏ?I|;o+o.t{Yҵ冗^,Kkf{wo Xj/|EQM3Εvsq{-ttkgwyeU>s#( =#w 'W(C]jS2-DUIR:[֔ʃd\,K;gFG7eaq;m]( & ?*h =I@7 " C}ͬ DPb1!5N G3 7Ov ݍc䢂 6ؙY!0wY̯FK$Ryf' lV_ ̱$ TMgp\y_ێk6suC{}83/w:< ^u u?~ᠦ ,` Ð ,==H6;m&m wG*O6mf:u47z1V"tji"𵯎2H:+STTDA Ɔc:iw3>aa19b63[0LCewL/70N7  膈al1*0@gM[GRIsX@nՌb"!]mm%y] ldXIo(g"p)yxN,={N;I}(cǀ%+g'\/0z.JrkU0|H4!+:^0?3nd٪cqq$ ,kt!El6+b @6X*RW[ @*, $aX*JXVl6kN-]xG!bZZmG_>w: tUYqLIv h4,lEKs3cwFx&|@  "8v.7}-'yAgG0],,.p\.RI0I&VW\_Uv"<^l6GP'H&N^ڞxkJ%~],f3})+˫<*S 5b<%N8@$a6]}5^REQh (ErLߏl&f3MHml6S3 "rHCG{jfE$bɄiX,f Ǎ$UnDFZeM1vhz]/$r=Ӫ]xQ M$kU\y N!I¾ Qv)Ut8t lWM2R pX=Fu䒈>,\ԡ74sZ7M$d bno~2|WqZF4GOO7PW[{`yܤ۟ݧ{fBItix9Wm(yk)'8{L&( PhԐ{0 q)d3؆@Ggs/3*ڹzc2x!}qO,--Յ$Iy| L&\.|FT>#Fnb:lߔfi=S;\l$(**s?ӕm?LOOz+,#ȹe NrTh]_ /t:q M&{>r~).49 e7,p[jjH&j|*QoxQb ZRֆƏ$4&"QTUf!"HDCCpN {Cu àAb.x<f3~CTb{{>666455X,8A?܌0 V+]]]gnn0V+~χRWWܟDOOvIttt`6DWWWer:8N\.NʱnZjkkX,vV6VhnE(T{hnEQ4D8KaZƁ~./n]EEQP:nYQ"Mj$D͂d#<؏V?wleȮŇ[}"J45FK\Wtgu 8kVyL&p0I&jI3UqzC ^5WP(VhhuH&v^R( Hq?۱( ,cEuݍFu &N"rLWU\Y/fN_,u+$)J|B/' p <85Y٣znY`^|>mfMK> QxIH&+V$%(n#X[vA_UVXRwJ,+ N=:.5Ǫ}Y0f!ON̹Ί)8+o諨F穕ڦ!N/hfJ}]-|h4  07 IGN**{Hdov9gjz/&9<^\L@$de˅bք۪dH$JSS#Lłj󱾱 %+ÞCpۏ>G"6*cwFH)&رIBi- ]D*csc ׃($f 0h pב:ς6Z{^P͆o łiM&dHgg)(Zi"p8B S_W頡w߸CQW\<456"I" mmNRE˧p-6Ύ0LtR6j8=I]f`2Q[#L AKK@Ke!3ȲBG { 2nxY[}{B:S-k , Tbu]K;sM4b3 w}XX\nQ(H{YkX<n#`i'fqD hF-~jM}p6qNgM;|b(S*8rXf,W(ji~뫚Izu'Ueq~LLp;NFV x{K4х`zJ#Y-FVޤpyi()k!Hjr9bh¯%I( H&b2,#\j?ROkh6vY T#SSsFi/"pa{kݰX-RzYe^OJ$Iv_d٨*;V+h*nnۤil6~Ru*8I2@%6L-:PUB_}`Z;lr|曗ٻ З àvN:hUB_M$I<gtL|_grr:xUɓ'G{q ##8,O}T*UVQWl:6el7duu:PUB_,--k*Mre/U%@QϹSBPĪ}ulU>'޾;|9Di<ϥoU ]ʼnhmmessVV+?O BS[[K"@UU|477iɟIuZ' J2ݻȲEQjkݻwt:@en߾M6l6WJ諃p8L&ժ;{tafuRdoǏ_ ^/###i ՁrQ, 066FSS& O~3ybbRF14Ȳ\# #FM:焩)$Ib``@v,,,J}}p:tuu (JtttTAU }^&p `jj۷o${vgMsϟ#Lq S__OkkkUB:dYf~~f3 i_9nwwp8̭[lllj-N誕댎?55й$|>v;sssH],..iڑN 8Q*Al ksfܑ$ Vԙ*8kkk166v罬f ]HɀHmCefgg/0P0>>=ֲP,<,? ӳhmmϕJ3  jDZ"VVV*6Q&''+f=(tc_%111Wkhؒhdd2OFGG<1Ĵ~&&&d2UB嘙addcEB U'=oq"f3w!V% xmFFFN,TJXYYt|ĉx< caeeBpjvww%u.ckkv>.fff*e8yggA^qڰX,j244̱*)"`۷oZ5~ggDucXXZZ:"###lnnǫ)d^YYallTGHZtW~SI]VUy_CD\H襥% ̓gA]`<5EyC(2β^"dlSԻsNUBnDQv;.N䐌ym6VymA+?7:P(TˈD"hFsssec6bȲ1˭fikkluiV/J\.<PQg}r9~_隣UU) Wbll EQhoogvv{>o7bLTUgyyh,˨G}Dww7E~]^/_W*iue_+ioo?T[ykkt:,ˈ$͢z$IHT<)xUNqdYfa6󨪊BQV+:Rdƕէo Sϡ:.vJX]]Cc6+5[ZZMl(ͮU^4rL怎R#4440==} I$Jl6 4M677M,;RTsn tڌA$yll l%kT*{NEZZZ8]]]WruEEN|QL&ƈbW>4 41:;;YXXPY=O]]_/؍!tXDӴ +Vݍ=bU aL6ebbz`LLLl6#RJ)T, e"^){p;wx dzfݺuJ9\nC+OϊrŢז<*`#ihmm=UEN6<:XRWE|NDpnn#}^OO+++'2מ /$ummml6/jq˒WUUn߾}X R xnJҩk444F~@}}=---Alx|`0H{{;---ǞgkkLΤ&---W"ZvdllsRLMNRݩTv)}m fqWOJv8Dd#ӹ}>˫yՑL&QU6@KkKS/@Zfff^ǩD`0бK•( x\K/ܾ}TGגh:z% hZ__?a/=266ve1 D"++%_usX,sHbvO%r6% R[[K{{kz577}e ]__? ekk9DQ$q{ؠX,JR8 tA.t~QV=`d_; H$vd2.|NYBwwJA E2~ 7˿AQcRޛ۷_xYt2utt zeuΫ0X\\Y޶ rIDATF!\1Bhl<n_Ƚ'e)}6*u ӥiB?9+e.Rt4\j˵WU:AuD> e!~O2uk)'_EJe^kyșO?{"cPΝ;r2jO]%]4WHd}_%i P iVWWyo?l6ˇ~w%0<<}~O@y|>QxXsں\4Iuѐe9$IbpptY:sssJ%~?x˅lP(H]#Hrp\dYHKYC.E//TP(DCCÉmhhh@uH$dYx<~*xNMф^__? y4w{v 8 ,0 e,&酭0煶6&''|nP(Tn't"P #rP?9D:E]>ցT&dٍ"t4+++*KKKx뭷DYd.Hy M*JIɒ$TIndjjD͍ aB"ͱ(ܿ7 `uuB>op0??-U%Ry CP%PH xh5ᓇd,]u]X,RWWǃl7i?:32Fܛa,--U݇T_,Mn&{n=џhBD$N"t(w= W ?ѮQv;EhA*\.G8>F ULa[^rl$sNWzc {u9rb+p:GD)s34C;kVB3?#` 7Gci4}m-ڽ*ضe<|ÕmBG}dd2?|hrʶd2i$ Çig>Oƥ WRqn76t:~V+555|>E*rݭ+++|'ܿGG.ÇLOOs=b===4. I:P(_UT"PMBUT ]EUBWQEUTQ%tUBWQEUTQ%tUT ]EUBWQ%tUT ]EUBWQEUTQ%t+ tUUYآ:*U\Wsg(^pޯÿRB>i,..b2Ōt]*. hU[wEJyra'VJ%O-\,b* tvvP,I GbQҐd%Q$n2ɃO2WO[4vvv#y={TE=rfT,"2"$`N/`ۑ 44O$oy}J_={=.24b ͭmL&v:r 8[ܱ n2?avbXX,ʃN"S:Tn"AH4ii~|.䒆"tv.,R6l6aGm$)l"|:kHt]"KPrDowOs{h^h,NG{qvK2k't؉#8]Nkktt3[9.H8uHDT֭76X &Dmr2[~'?1}@"a |III38v+}N $tIQ۬I*&lk;=Ggp抄VUQQ|PI,.|fwf;0]5b/-"dEb$d!B~!bDQD.ъ " ȪD:b1K\&J2 ?.@+IENDB`nagvis-1.7.10+dfsg1/docs/general/img/nagvis-1.3-automap_undirected-1-thumb.png000066400000000000000000000264261225466040700266510ustar00rootroot00000000000000PNG  IHDR,"sRGBbKGD pHYs  tIME" tEXtCommentCreated with GIMPW IDATxil$yff2yųX'R_[=lxeb~B^x=X-<`0 k=ܖ-mmuwuuY,d3"3If*d⏮F27"s#6*?A_; w7{xpweBs͡c(}8ax=q=}s3lq1G?e6H]7Ecĝ:!ݘXյo 9F0Ll C,f1L]BVj8 %.qalϯ/q;鏓ʔTA=L(|bN9\;3K[T:L[,@[,.^ ib-~PTt8TRG sǞy8첝vm G<ǃ *7n|!#q; )!:5Zƫ# EXY/%ײ]vz;#ǃ[v02V?z #q*5U&Q~? :c]DZFLLo8\_G/19xR77ʗ/*ara0\U <,f:|? ,|`x+iqcwHh7tg}^'V%oK&]pHA\wܾ7o\+f/@R`-j("KK˼twu6ϯ*ɭ-L0\( ,--#J^AgjPz,+֗q|ukSJPRSW5NR !"v1 R(A*~TU4m6?6ܧ5n6v;mqD6.[rFV# M8tWb;2#CHV.IhᠳE %I.=NG{;j0KwE#}>z{Tg n|(;wى$IA^'b)b1z\t MӸy&. H$ 2~Q hxw$c._4 קxb=~KKT;6?lsqq>|>Zd2 H$1M6* N͕+W-TZUEϪs_0ܙrnVSKYM0Jׯw+:v/:wzB{\iZ6%\۬u|9n8AqbA,I>Mڨyj\m'dD"躎&̕JYq:"mmm* Ν\.dp:b1L0 ZZZ0MY._&NىE$|>O^-^~eJp:8$IBQv;---x<N' I ^S׹tҞ(Pvt]'#IT0$\.Goo/Wfc+A{< N`+ȼEMn'c{Yrs>E%>2&(b:Np݈v3;;˕+WV_uZ^,m.?#5:0];6)ϟ 6xt:0?sӬ*rSz0i{c]1L$ UHDM! cK dbmGvj{tPpȏ)jet_,Q Oed20~OCSUj߿Gv~ @1~J;-07Pw~A"eiy4mmqJI8fumFٮ;Y./K^>Zr:,,.1v2Uⳤh"Է KD"^l6BH,a}m@0fC%v 4 2rP|8nF2n@uDZ"^_fkefv@O*TFZx=Ƹsg_JԌ``>>m8hCp9ftwuREy ].q;H 6l63s /;c\"^~4pAg-zz=ds Є(g:am&لBVVp8(?Ng"h2w 3GRz"-l۫w5|@B1 |@&%)+ǹx<(sP ["s d;V:J*H KGw5(-2^ C$c:iفXI(.JYf18j&eh'p mL[^. I.ä^.ހI0pFFb0|$JpE4M::hUDRɈ ~zEfsvh4B\%L6+_D &˄ybnb&BN6ciyx+G^eJa GAb0/ct.(q [r( bKG/0KYG%;:DZtuu Imm! Ak=? @HANZ{, ֵ[6/xs9 J#`5oxV`Ze%<{GU[F1@w-!9NFFEvwX ެѓ)Iguu]r#+U쒄(Psa`EJZY|fD";\-W*H$5*_* 6&oM,/^@QA  bz TUxKҸ\.F$&'o| qsr7%l6{mVWWyW,&gԒ)4S0t4 k[ ч$S[]..} n `0@"",hF$V0UDQd;ͫ*mLMM }ox:>RnDb5M%Ljj#dP*rKtW(tH] ㏮ (Wʌߘ_֭)@`+B^czFY^\b3dxx?Fn'!2T J"Rk׮D.<ji<0Î!aunܸ[N[[\6GV% b I@Q$Dbo3fddR##ìoۛzn HRd2жa'dp]o~JaP* . AH0 4]qiv*auVHlX5p8dy'_#/ 5"Llˉ} m1VAp^FVjazzQ\,4 Z%<-".f5OdC8NtqVVn̬VkO%S5vSVlS@^:@Ӷc'BTWi@4LrN7\.DN,sڵfڱR^kdn~) JB0"|9~\D1Lp8BWW'5\ՕegnoTHni:XrB4LʲPQX$R6{=#prn߾M,t*~t:! >a'I7?+b(umJI8&ˡ:PӉn4*zH$ҘxlIK=ŜYX!R ܧ*4n7`h4J%bsss~\.t:wɵg|l%xE<G4L?7qD677|Ej@\^;\@r+C&azJeTU= |c$Q,ra眞&D"0 X[[^|#[^zq:{?tIfx&].[[[x<(TRD4me+W-":+++72<H9$ < i-my*mmmkVINiLOO3::zcL"7o$I8r}pEh g3mHpFv"l6i5? ---loo[ 2lv_㠽D"aӁaͮ ,B1==矫k9]]]V"TtJ?FIhFWν$ttt{zzX[[;#ӒOMV+Y,/~\.S,Opr9K8 2Qgn;2'C{JV,m_rui .\x5oPT(=Al[n1:Cc{{l6yך}v;fpfsjj+W=,zЙL}{J%LR(GX_~,,,P1*J  ?B+yͧb14O7kXZZ"6g;s:.]zh}@ @ g:0PU7o>ЀjiiuO%b}}\-Bs1>>XSVSSS{ul6N'W^}mVօB!~?H'I$IzTPПSЬ933[aw>\.3>>onra8wSo(:(Z>Kr9N(O(111A0|'BSI$I,ve_ׯL&{nb---6^677ܳC@utҡO$i,uuϟBdf^TQx⑽1Kgl=k-kOYH$ AGG ,,,O 8-,,UAn7LD1PX,IKLlO0fY*YDkk+D"C{6vs'X\\偮'!skk+>?ς$IzcUTU=p̱qD"Oүn]~٧~<(FO4k www?4"[Q,D -B?IZ%*~\1,I}}}n\r9׹t#+0>>nYK'e&MEx>=Vt:uTw~~خKg(Of ?xl\rׯx(ud2^u~oį^333ùslm eIDAT377АEgh9x^e˅ pURpK/O \pRB=JŒ80T0!2[ޯ\.S(NtRj*B'xާ>y*vDtwwz$"իW\=166:.1MX%CCCZYnQy@ʓ|Ld~~Y|܋L&:Gb("3T*=CN0MIN'G&,D!###ܹs穕%}E͛CeUUܹsQr8"GrNvsfRVwN#DvXFcb~~l6i\|Jkiiall9y~uqqQOM O%rA|>i.Iޔ@ @T:ybiZXXX`||4FEoo/gtKK r9L$?yaagr'~?tRt1FĎ㴷4CKB?B"q^HV`z `bbx)LNNX3wH$y]wuu zqqqjqsΉP(0>>΅ >44ĥK>v)y9vj5=.@__񗖖5gٸt4SW/厵XsO詩)t]Rn6 d$.t]֭[X~|؈ [>&|SZ 011q,4TԺ]B!>baOV1;;ikQ[ŋT*VWW)v^/=;;}*nOJ/>QК155xq~w-NLL`r[(;wn*922*Dv2lZY>2==ݜE}֚d6n1]kssϓH$(Jg"dG۸}\יdvv˗/sҥ3G慅v|?( \v ID?`ll Y\.?rV, krrL}9jڑ ԼM 7jzqLzW}K?Rk"jv3###Ξdgл}v'9iy6lViwE9'V ,yBORd3Z*N)K>%>Ii{Dt+碑'.x"ir9Rԁۼ~ eC_f4>8rbAOҟp{%5-I9BlooYV5|*I}Q?W_}Zsiv{SN{Ȕ/dzu%ydSvO?!l?_9C,.I T*uKNr;viܹsZ/|ׯsB/J|_sX+J6GypF'_9k8+Rj!Lv\{j5 @ҀI[]Zmzv JAV#p8{gܾ}Ixs677Q}c0 }]2 D")LNN2::rqm~mW=nW3Y|T*,..TU?1/ra o} L&YXXX,1 ]כEra&aθ>q}}}nװA\>Q£"H( zA| Ll&e9&DQ$j &?;i?o#P*͛;M;$>[[ @r3a(\pa_`^sBб PU>3Nv @ݎfp|."O 4g[>ELv:0Mei +XR9,B[T ,ÂSP9,/gjF\VjIh 6t]Z"gB_[C+%J<^.Y8v/6',njVunܜA,vَda'jX[w±#B}F~^oU{pĢ "+RmImeoUb$}xBl6Cܨy(!/M^4$IrQ( vvw0?{$ v(JX6hoۛ)*Iv;$S[k' ل`;_/0M.~?]L:%IoLH/17{s!v.Gk,: ӨuC\dݟ&A 'Yr{(8ZBtjl"%4@.(w-0>_sz)M  dގ˙lpM&baܜbdx5!D#-H^V֘"$F"ԻEu/ ?'^|qϸr 4_;S((Kx>ZȒ68b'mlTk UMXpE> z\dm}I#RgM0IENDB`nagvis-1.7.10+dfsg1/docs/general/img/nagvis-1.4-context-ssh-1.png000066400000000000000000000201161225466040700241260ustar00rootroot00000000000000PNG  IHDRwu!sRGBbKGD pHYs  tIMEDIDATxy|T' !{a =׋E/[^^bk-jѪV{{J"eG $,G0(k^ɜs?}'|cA>c:G 81E:A iNSvb,0!Tj0eEV%%tCG4tIgW.JJKDO ?1!A pɖdzYzD4;vXJVb,%{hRp\ԫ,1 _1T^K%g J4Ł*Y,XJ@ U^KVCw}J*楯b21&%+1fzIPPpn\u!q[r{& 9G5 낳GLռx /5 D+ȊLZKL@_/::$]Cv``P)egN\ 7nɻyo^*dӖ͢geT<pay}Exu/NɉjV)&R99%sP LJH|>F'V,J7b N$~f8Xcd2>6n^eHq0\ye fp<?OV.y΋yI!LUw$>S:$ Jt]YoG=~p˒_ڟ>U<fy)~hf%j:E"~T4ʍ_JFH y$Բh KG~M1M:3FyF^T/={я:֡j?tdeK󌤐+e/}/.≻Nϙ'CjbBO];>,CɼG sH=H1~7-g ?`!c.@-W0o'FXPLJjDz[ܼp%IF-IF$}3 F뱦=vÇëT_B?ENw@&*9soQnb1v5rJqL|5)&q-cz?Iu PfwٱyK>Ɨ=uPulӽw{.{zo̡(.}%fNHdSз'RnCdƆ9lyЫ6JJrP5]QtaFA9ʥ:Y1ukq.Ud@13Sw>-gsM:bdnjǚ1ʻgGu1?ee `TR&Xȶ<|3ƒefȆFxk(雔&az[6m̰Y1w0ZoMJ?LY܆Gw|C%B]G&8C􁻈廸j0FCl$ݼ[& !T^%̺@1Р!@Ԉ"+ِ5 w'j$[/[/"Yhu??ͳowÙW=Rx42/>@scZz<=5[~:E?k;.L䍥/xG/Hj٧<~)ཿmaφy5%Oi?ČOܔ#>ZCz ,.i-+<9Ut^c a)d/(&ˑp"3o2ɂ?Ï,X +A]c=dF5TܚIhcI")hFF'Mvezd]|a{=#Jwj/Nz@@`gwtNI1߹+Pl!)g0 sDŽ٬ @@E7B0tTUE׃] "[gCC h& 8:yI IA7H./?h^$ɘͦVO6>RliL3TxDq*msxVQdk4;^{iYOѝu 2ɻoգ`2H,nlB9SIdC2VgBethg)Xm|:cJNņ*\I[`=K!hn 6IPLJg:bLALbH̗ IA1q =V$WD.\ HcSirJV~ 8{! $џ3FL yL$y)8mN2sM@l#7 `8a˲w Eo e 駱MM'z{٨b-Ķ!N0мԖ"FiW|'Zv^,w %+cLskYU82U }_fѿhR"y#ӥLw s ^[c06閻yJa=`5|tkRm¤5P7.~ʢ{Б@pĤհ?S:aqCVPzƑwb_yi.a/|oy8#v qƓ0r7:~øM1ruL6iӦUTTPQQq-8Oeg\lؑ”;!)$XO pe8.=QfYC;cڰ7s؏n) {&oBb\Fk0#)ߴzRcSrW@CqҔvJXtqsNy{`1 ܻ5\ЕhY'Y!eM&JwU3Nf^)7O|y) @DRgD&sާ&J|k'S90o&ތUʏ1L,vtηdz(.HZer+BlPSpUѕbXh%[_Ks?K۱P(\WVWxGk|m2uV N?RwdJ`{r/cGI0đL"fěBN!$'&GJx& ؇}\eϦW4:ģ؂[LxYl z%#^$Gvp#q\W˜n dd".{3jQ/Ykmzq*V 1 ΉIZߞg/˗n6cIm3!6tξиZMmnī誛ڊx 8e@%ARQh|JbؘD6sT-7Pme1H0,%- ل77/"1ELMP@LВ4p^nB)b:= z  BLgҜI BLS@ $$8[8/Y<:!P+Y:j*Lb@d'X8F!c0'pє 6z t&!3>3Do/#412Ul_5%_+Eo E KmI ,bv%QOqLwl'7ɻl!-JεCT=%*[NI\.mSbJbszQU!cҧrVo2p(/׭2m4#[ʰjR(Ÿ^X%X^IΏ&B%+M)H1mu-ʩ)gRsө\My٤jYx'ȰJ)I,Mcqg/&aNn-X 9,@ >oY^dJtm5PUKٿ Gͷ D^VRĐ' 虄S+!p2h?d@n"'vxg釺D HtF ϲ;H̻Tԝ{pO:t\`'/h4Y0. GP9i"}[3 a%ugOHQC)lTݐP j:FmK2WNA/[eې"Y.PSVkBkޗvzt$a5єoMzn̞C[QvO=q(7l(M-o i>N8k誛2n`NQwlfM=&/Mj(2shشmeuxT]Tk VO\)qLng=4wD3I{fw^UMD̼<\7s=9٤mrIS: ;3b -m&bSi7R8sY"^߭$CŖ OZO+љXұ4+W|T!ttXSGrE߱d 09{9hO\qC$fwWx=i1_ wR1g!&@@p+%8,\Py3 BL@ b:Qo9'㜥 ]u|(YJExRTǙsPsLb 1qk#8: ~_uWrV˪d@xFCj''>\t S:kG5xp<8N[k<}G2gˮHF}ۊ]ՄH!gP4?~ɨ+BX(MŶlloM`\0ĮUxn+ˋf\Ь)82jdQr>D=獘\zvb4&]HX' lZA lFsc F!}Ϛm{8:>*Iˣ ω^W̺R& "Fspc|u&QYy700'e0 |[TNʸ,t U4xkF^Ǹuԋ&᧮xgT(Ϋ9qК9X sf&*V1)ѤeazKnDeM3WRZ)14RQg%cH<6p$5,ԃ9^e'I1Xd][)8ӱ/SYg%_l%lNHI"9%(WDLV5>Rݼ;.>XG-ľRxywhܞdO&e @Wj;2v@bN>4F1Hqv?ܲo棹7EMYaeZ'MR}:wPJ )1>*}E;,/ .5nw]Qw)YḬq[f'_k[–ԇٙ8N ejaX/aBEGIi}[m k)&#ӰW>b-E\F%5IrˠO6B.rYؗs,cX+}i. [pSV5;*> $ s|*Qf{Z:) ~ vd'"衏~Coȏ̳esո[; BP粘Me̖db,YIڹ˱FY'*( fѣG\yՕXl&4&%$ ['I?~<| ӮffXBu9-S(((o/lt~_bt2G fԩ;7=6/ތ+%$蒛:L>oS/ %$ ~СCq88]47^go^tM,;AիWs-0sL^#ց,˘f,v cBLСCL~ \{yb8ū{ĜIVG O@\qppczm/b 7O)wM-gml]L!o"fY4 a0 Tb2ڼnp$IENDB`nagvis-1.7.10+dfsg1/docs/general/img/nagvis-1.4-gadget-label-hover.png000066400000000000000000000051741225466040700251510ustar00rootroot00000000000000PNG  IHDRk1gsRGBbKGD pHYs  tIME !!ntEXtCommentCreated with GIMPW IDATx{lƿY1~mTZb @BQ%CEV@1 S)B -M4m*RQ5-F E R@i"d.6`ǐ`kڞ>ޙ;|s,HE#E|yo;ҝem[rU(6.Ɣ)(und>K~œ#IӠiRFdcՎJ>F1N9rWbϮ~:A0ynp7.6p y]TS}Y6!UHeeӎ?7捓4 Ș/>+7"pD u Abf#9SWN!ː֍m dL2H̙oɹ":0>E63{Sq}įץ)GJ쩭O *,q_// ' A>Roa&<ΗɚI$HO?:-G83V)oGug%?a#6Pd9vnFi3~*7D|_+hs[=ekս98qGwu|E[qz_&±"栨^ r R/x r%U0kc-Zcמ+i=):˒k/Ռc7pe1;0/O-XCY[qх1}#=h*þ X< bueMJX 'ǣ_F.n)@n?)Īb؀d ءX?1a}`<6~o)ǐ+$kn.vbL7BV &ŢEw+ݗ5#+MĐ\~խ>bWf|5O2'0,))F OC}ot>ݷo{U*j"ۊqѥ'~Ɵ58[jŅ,iF&BQR]A'σo"Q)Vb6Fh6_DSC$ԉGʱqIh(=_O4'=jGSqՈ:Lx2 hsm,Yk1f>s FK Mn ƍ3MEs3f)TqXÛ8}+pD-Zp|6ks|I0g| ~_z~M/Xmųdw_gQrgCŲB|/Ke[]7yeHIrǛKZ[m sLW$:PWѽcjs<sog01 kzU sj g ;CF;ὼ7\0[sP&k$  绚|sj;G}wi9$`[ujdl^bAs0E vNo3PNmW0vGDҍh;:QE4Ͻ;a;2 PVu4(L7*"GۡF[; |-ZYU~r"s,s*_q0|[Qu`+ YH},*}Бd1J`;4m`;4m`u tiuTAM vTAM 6sjRXpiUí66SS̩ҔnMtiJuS`fөT8ݚNMѩҔnMSP3THA.m! AXݚNMѩ)*&fAЩ):5] [C_(NO`2 bBME%A+Y$.tj*✘PS1P2E_2ּV>+dv%a<0YStcsj3x5E-]*&A?ԁ{I$T\Q|nl iWʻ퀧Y`bd2D4r@^?'؄heyG1w=8kFx<$hMNTͧU YN흂x/G@1mIENDB`nagvis-1.7.10+dfsg1/docs/general/img/sample-weathermap.jpg000066400000000000000000001237671225466040700233540ustar00rootroot00000000000000JFIF`` \ExifMM*bj(1r2i%%Adobe Photoshop 7.02010:02:13 23:17:59(& .HHJFIFHH Adobe_CMAdobed            S"?   3!1AQa"q2B#$Rb34rC%Scs5&DTdE£t6UeuF'Vfv7GWgw5!1AQaq"2B#R3$brCScs4%&5DTdEU6teuFVfv'7GWgw ? -{rZgZKYv8+}O=թZ^7C}X-axlOv5]>zI^&?ZǶmB-c:inhQ;/Pk=9pݾu$mD_R<^t$o1`7c-=ĂXccv8sQ+P*O9k;mv%~ ĵG-7{ls}!ո&?1ݛ]e$5Ԡ;r^GI=c5ܗqIH=s5ܗqIH=c5ܗqIOTI%)$IMZ◹ k_cae޳ nfŃvKw [;ܚ*#c.͵U5`}/hVv7WMϭ;|;Ic73N{&RolbJz_}?VIҘF1ݿ$uYw٨xۧk}i}no߭MSvl[GI]/m8oUVُcݷcq8wVUXexZ^L6Kh%K-e[?askjK~ulw_ Y}GflL N3M充Z@qhߡ)tΨܜgN0As[gx.E>ctks+4>ׇŹZ3ߧ_LzIdݰ7rnXd ~aKf' GI$TI%)$IJI$RI$lu2K֬Gu޴G8-u?n,_~П fv~Xr#q"$wI2iγe^FKd1KzS{p3m wc{~ޥ]{>Iwlq.Ǔ.6]c~+i dQ$)xu`,$I%?Ts%ƇsIRO[N@uUA~icZ@o]-ʳow?e?hb&|.Ǖ} %tK]s= ZS)6[ֻU]G-l Vbb92:ǹZ>ǹI$R>p^8-T]m8e8ZO#:bc^ vzkXYwSB.Yi@V[0[Yŏ~z17 Y8/?GZ/Atں<5Z_>s GKHVƲ5h5)$ւ1,#c^^RI$$I)I(MW#qol[TS`:.' j*[_{e LKG7MKi05&eŌu:*b=FgO~X!>iu^w?5 glxA#5t3?y r:͞5exkl?hsqyt+/>[C4do6=>w)몢sUUִ s{Z֬fu/-5YSEoeoe?} _ީ\{lų*yRhcsUu^_YcT3NZp"R3\?ތ# l%[watqKh7Ret]QYXu4u#cYݎ6ݳ~ʽE;0CHp1:5{>@zx;|Gl뤲k8kklnGKv?a-]f5k2wٷ~kҔ"GG· u|01-˾}:.$c?cU/Ƶ>ȝ϶yp;vVwnzcdQ>H۷ֿvozhp.1=U67e;6+)RFҺkָE>^=-՟2qUp+`Zٻ_>֗ߏQ.2\\~I*B::gG,m]!ީ;kkW]K2ne6v\XǏOmW~zT q涪aѠÝ0ΠޯqыpYeM̳mT]_ٲQ"Tʩ$ꤗʩ$TSRKTSRKTSRKTS֟K>S\?# ~o쟥e"g~WٿeD;O>Wc~i Photoshop 3.08BIM%8BIM__8BIM&?8BIM x8BIM8BIM 8BIM 8BIM' 8BIMH/fflff/ff2Z5-8BIMp8BIM8BIM8BIM@@8BIM8BIMK Unbenannt-1nullboundsObjcRct1Top longLeftlongBtomlongRghtlongslicesVlLsObjcslicesliceIDlonggroupIDlongoriginenum ESliceOrigin autoGeneratedTypeenum ESliceTypeImg boundsObjcRct1Top longLeftlongBtomlongRghtlongurlTEXTnullTEXTMsgeTEXTaltTagTEXTcellTextIsHTMLboolcellTextTEXT horzAlignenumESliceHorzAligndefault vertAlignenumESliceVertAligndefault bgColorTypeenumESliceBGColorTypeNone topOutsetlong leftOutsetlong bottomOutsetlong rightOutsetlong8BIM8BIM8BIM JS| .JFIFHH Adobe_CMAdobed            S"?   3!1AQa"q2B#$Rb34rC%Scs5&DTdE£t6UeuF'Vfv7GWgw5!1AQaq"2B#R3$brCScs4%&5DTdEU6teuFVfv'7GWgw ? -{rZgZKYv8+}O=թZ^7C}X-axlOv5]>zI^&?ZǶmB-c:inhQ;/Pk=9pݾu$mD_R<^t$o1`7c-=ĂXccv8sQ+P*O9k;mv%~ ĵG-7{ls}!ո&?1ݛ]e$5Ԡ;r^GI=c5ܗqIH=s5ܗqIH=c5ܗqIOTI%)$IMZ◹ k_cae޳ nfŃvKw [;ܚ*#c.͵U5`}/hVv7WMϭ;|;Ic73N{&RolbJz_}?VIҘF1ݿ$uYw٨xۧk}i}no߭MSvl[GI]/m8oUVُcݷcq8wVUXexZ^L6Kh%K-e[?askjK~ulw_ Y}GflL N3M充Z@qhߡ)tΨܜgN0As[gx.E>ctks+4>ׇŹZ3ߧ_LzIdݰ7rnXd ~aKf' GI$TI%)$IJI$RI$lu2K֬Gu޴G8-u?n,_~П fv~Xr#q"$wI2iγe^FKd1KzS{p3m wc{~ޥ]{>Iwlq.Ǔ.6]c~+i dQ$)xu`,$I%?Ts%ƇsIRO[N@uUA~icZ@o]-ʳow?e?hb&|.Ǖ} %tK]s= ZS)6[ֻU]G-l Vbb92:ǹZ>ǹI$R>p^8-T]m8e8ZO#:bc^ vzkXYwSB.Yi@V[0[Yŏ~z17 Y8/?GZ/Atں<5Z_>s GKHVƲ5h5)$ւ1,#c^^RI$$I)I(MW#qol[TS`:.' j*[_{e LKG7MKi05&eŌu:*b=FgO~X!>iu^w?5 glxA#5t3?y r:͞5exkl?hsqyt+/>[C4do6=>w)몢sUUִ s{Z֬fu/-5YSEoeoe?} _ީ\{lų*yRhcsUu^_YcT3NZp"R3\?ތ# l%[watqKh7Ret]QYXu4u#cYݎ6ݳ~ʽE;0CHp1:5{>@zx;|Gl뤲k8kklnGKv?a-]f5k2wٷ~kҔ"GG· u|01-˾}:.$c?cU/Ƶ>ȝ϶yp;vVwnzcdQ>H۷ֿvozhp.1=U67e;6+)RFҺkָE>^=-՟2qUp+`Zٻ_>֗ߏQ.2\\~I*B::gG,m]!ީ;kkW]K2ne6v\XǏOmW~zT q涪aѠÝ0ΠޯqыpYeM̳mT]_ٲQ"Tʩ$ꤗʩ$TSRKTSRKTSRKTS֟K>S\?# ~o쟥e"g~WٿeD;O>Wc~i 8BIM!UAdobe PhotoshopAdobe Photoshop 7.08BIMHhttp://ns.adobe.com/xap/1.0/ adobe:docid:photoshop:671a250d-18ed-11df-9706-ebd78a2652da !Adobed@    @P 0! 1"2`Ap !1A"2QaӔ @q4 PB#$0R3C68S5&`bct%EUe'7W() !1AQaq" @P20B3Rb#4rCScs$p5`D% NҤҕ5I.S>mq򋵕SxƼu,~K|#JʌgHv\B@q8+ƑV؃ydG#׬1}7KVIg/]f\< ]R#;˷]C놓5 fg}~t]E34UM=xdrWV#ZnJ)C#rif ]'D' jErN3 rJ+p; Ȯɯ2u8븖wpǾᗎ;Ƿ^6Hy4*-Uq+])r#(]}Pvm{o¾+ʵA.YwIm6%_dutQ Wetr!]fcaB@x[4x?ZYGBjl3bU%pީ#[/yT ${yGvQs[wJvT_ |Αuͽ}+'1h+#ҿR DZ("My;6jcuՌx??G,]%y!GTaBz" בv7#UH^wmf|g`g3}ou/Ʈ,=;z}? |q\OGJmS =>o2}+wh”w)LYUC*q0§ ݲ~LlٜoRz)Y6F\YtGö0石.qׯfuLMVf:G+ш"uߘ/ln+Ƴ;GO=]gƾޭLV-㻾u:}g_|һ˰@?%J%RI( +\,Ϣk&L:Hր2k;?orߧ1R#fISx}xsrK:_n+ս> xgeokΗrg| Qr3r(4?XwGWܖn-0ĻNifK+) YnR&KVY44q#~pKu[yq 6I۷`i[[ɻ%0 n#D} &F(0%-Y!ߵrm:̓K|09|Wq\8`0|JAjQ,P+L~ֹ֯!)p-}?,^l-A>vv>g@Ďa%u^f49ە@eW}kT zKtK$xMesa!.p\M~A=Dk1lz\hmWyw Ǜnr\{B/MpϺ4阯{wW˟6k)POWٳNV^=3ZUר-;7ւ`rϿ߬ܬQw|,K6,`GE= 1%y}$TJQ 5Ť-1ێXmU른քAp9V\T1Ay$_W-ZJeu<]mX\D5G*A UD(3?ے6䀖$mK }ک)LЊ2˒*T˦S$rhYb O&R%Hh"t1N6mIܑN6䍹#nHے6䍹#nHے *AKJ )nHے6ܑ$:KrFܑ$v ֑* aS%[!s!N1'MUuK$",e&^=E9d;E9o5:J,Asmox6񷍼mox6񷍼mox6񷍼v#p1$cɁw*S@]TCA@ 7$;QF#pn7F#pn7F#pn7"A>B5M(D0mN:cX[X:UN9{1A@Ca7pY˄&p70})bTۓS8rNŅ?SGT35hڤR5/Hd W,0gƭVd+gg:k Ujr\^$-gJ$tUksz'R2b>\K$]Nvz~8']DNWTZhfqڵ>nd50@O&01|&VXT{Z@jy֏[lNEyNLrkͪniI^mAP5 2)@;.2/?܌S(#.:( *\Q3u=k)Y_#d EmWhE N +~BH0YzVfy64 _mt֌ddk\0(t4S[0S0 2[?D}̹JdW7xHL0z4h (h  F#iR$L\:&/ nb\nBS u2qw=bLGЦ)(2,k +tHɝ,'g pLup($cFe?!S4jIpDGbp!T\5BdKK[( -)MCP%9ҳS8ΕvK~< 6pEi)rP06d*H/%=JlnyACMdA@Odil:n "cKgL@~z0 !4@ `c0A ar>kac=INo9 W\\ɹdHR 9J)kU(˺WitQO?r{jryMJCLFC_HN#XRF?*b.JRLn3:ODIc5PDzF L VQ2l;J0v R)}>,QMj֝27@00UkvnYV n]amN L:WWSN ꀟOW)C@F;r;܎wcv;݁V;"v;݁V;wc MpGx"v@$DqT<4Nn%bH+76\֚$Q<SS呺LI2 q|Qlj1Gr1܌nF7#cr1܌nF7#cr1܌nF7#cr1``0@aɣkX4 ( g4 g` ҺhЙC퇸Y0 `HD$#kX6mckX6mckX6mckɄCDtA>`5c)KX~NGORaȉd eHɳc-Pb͢ h@:R=sEjӆrY4ՙʗ#{YGL‘Oc5IrqSǚOt#ʫDCSL:'I#()3zUUR)0䭩ىbSffIq( E?mf`i:>>[ZMyb'̆\ZԈYfBkAؔ^qOTMY+JW}7_ڪɱPjTpjtNIExQ=bXMԾJMV '$[G5zu|/U>y@\UAJrTGJa $)P(|(>ϾJ-h\k;ˉkȗ_#[{ʻ̱l,.J94#n.`,4WHr8nXDCL$X2e@OJd 7,C0kh5cX5jGVk#P]~,k]7UO3n 4/wsxi;~vܘ>1;p]9Ⱦ=/; VPc-71ljM&MW9un/S^zwknRudRjmtyh]j%0vbO!GԣjQ5(y J<CR!GԣjQ5(y J<CR!GԣjQ5(y J<CR!G8pk-4U, qj3..AGT,}(ee@!6S0S6K% C\-Bp<1<1ā!#`DžcG8qxcdž8qxcdž8qxcdž8qxcdž8qxcdž8qxcdž8pcDwe-Fh]K MKC25q+8D}kdq&8GwHGz&yKuunN@ *%WPRikV趔7v;zrb^Pqg"mGVȳqh `s<1f^DWҩK|P8"~N,FFg/]ؖ-?/7a2 ekVEJU%{p?'^h _6הP*_+,?|rԶVސàUj\eڹ}t{jT{P).> p5q¸a%f+7UTtd\Ż栗Q{G#-rZg >?z0)\ū*砆 aYM>-XM2-}d,zA&K4\\תvn3p8ыy)9D$#@4?X#@44 #@Κ`3 pٚvNe:]0HRwlc˺Γ9ɣQTKiv~G@z9$^m縀k3նeOCz] 骙uGiȎ@3s/|"b{bC^ǜ ?oܬySzi6lkҗF6$<椄\BWe-N'BHrinq6?!E5 ]Gɟk!AO_<2a=ȝca-X1ImlK궬oTec!6fL{P(s29| o+ׇ +v8`Yda h?h2,a"7|^XcNߎGl֢җLX,<ݔ-m-W&N% mȕŎ5qBI}C̫|пCc\bQ3nGJsܑjMVNFefw,b>'LckYB*`X/m̱M7p3T8 jgۇV_/^=Q} lp~Cʶ\s`eWׅyF 5ȩ+q ýr4Uk qu;nf#Lc.IBei,yfZC VCi '$e>Z3rK\Ǎ?@uz>K>n-;9S`lc16:*TD5 uaKcc=\gpv^/Re{#l_瓕44ƥYI٪3a0RRĩ隦7`< ;L_[}DĦ0Sccw]7?Lm m>VowmWG{Y FXD8%S3;W)ĠvkT|A0͉ALؔȮ)kt+XT YM`xc'̻0,66oP(e'(IŠc^6+eeH6ݘL";m?[rԑ]TR/erլkT-/V+>c.lOONcӅVqq#:NG|<5>$/e[}=_+I7ZS: ^ŪW61/d*ӂrƳH|4$8to6v UQ\!U2wX)`(XD bNS#\6ܐ9{nZcjYmK&X1~5T{1L75EpksFf˰@vɱT5m[%xN>M5&94Z'Xr;+8۫!tqQg 0KZi4$Pfy*orjr4F9TO7b:y#ߎGkXUkS\t\r1r?]" ,Z(^εt^R+RlY\C+W ZVLCkƭި>WdIIq0bڴl^qqqAΒ+ %'krHԧBkI2MVO咹̈슍&=TJ"CJP-!2^hy}iU*&<(ƞe\WAar\2r'-z9kͳQq[_*)`D^V0K-ɺ=AwP j@:imR;ii@V[2\kh&e ٫b$b( "E$e P!}9]2ˎO!9=D8ui<䕵wq4%r-5EÕmT *CK؊M}~p?Ե8QiQ\7fjBVSpV"j@So#X޻X'^&O&RtX8 $f;qRm4d(ǫe7_5')7&4I@[}{?'~nEB6wNBReE$|w))o(g6,_b+6\EF>Rƈ!VVZ]maJ6)KnKF+[!pZV"嫐fG+y&8-^GYUUWjၧ@$ \_Dh&IܦV4sϤ2uWzn ;:7L0\xKRx!53ж H;Lj8g=TpWF\r+tn`: q FVBAA7PZ9BsImtBmd{ĸM(^0#v(D8J~$Tc~g!ywPm%kit5E˼U9E(@GxFG@Ͱ%SG4#*~6|%4.Gn>zf+V=`PK cM`lZgPٔeNr rhyM.Яn_MG~(>Ø;̤Vb(*A28[b9F=&a+O;x ![Iy%)wc]Y_1D2| h MΔ|#U8w8%U=߸A]ݸ|g3´4bي`y/~8I G;fsGiB(1'Y5NI( h& {Em oŜH6&Bd"*B?crgb+`{,;iqNH)kxZ sG7hUWbRIPjBsoۂm'9,&wO!annr -N$.!qrb\ORV}D>mTh ~S4t qq"&\I`+4qC ŧ^1;BF_{9Dm! ٹ oV KJke}8ĄSFpI7#Ie@$/lO,mvQ{N7'I$$%q88ܯ/-aK*J Eh{ЃNz5pW븋1+ȨK OѴKÉlMwhtg" \nlzFu űnouGL13J߱~`Wd#6}/tOʧz3˴ Ñ>*06B4.ng>{E9-1i%r 껐|o'p7#ڍೳ!Clڒ ^H6R;ĭ[z[hZGmAq-iϴῖ3$0##l%ޔ?$-:L'L,8Z.I#Mq߉enwX6%?d!2@|p) AJ2žp 14 zE$z}:"XT[FK},`‘;;>qeft #@ߕ38M8_ǻD^n!5t'H pq!7#]48 rn5ms&i s#smj~%C2(8-S@j`WwEZ/1QinI*.FzSwg8)ӿe]}U.>.p~<:Ž Z+=&LpOj6aZuR5R4H<ߑAP%lAJ) ̷&i5n(y@ܥȻ _hy+hH~ӹ"ݭ_, :_!h. rAۨt%qFcr^iP}d=4!Whw:kOiN[xPv\ r̟=sGf6Ŗlһ0S5@~5':V^5T1߾th :0t5~R C{(<MM֧Dxx[;8QYr7WWRS+96}LstKڷnP-J0>;p ԓ3_H7%'h/&V g(AVQcXoaJJ?)ir}rMFxK5PP f| !mâ[,w@]V5oAN!˖‹E6vS]L3BV9Uo\ @}4%F͛Jnjq۶|`vq+yy AJ@aXVaXVaXVaXVaXVaXVa oJ cX/*4ޑcV>&5cV67w :zi-/EVp8pnLЩ,E~-%:MDͰrm?gMCA4+*&p. R6hS"('-X!tETi=m9^R,_Weŵi>m:dr:7UQ+Ϯ\Im*++epwE\11j>ԗv\;2Q&D%'pHvLّG׍>9ޑvڻ Ӹ|HI$e95wzM/V(ioʇPw.ewq<ǥ[4-DmA7BHzX* Sz6 5)r&; tکKo7:n+>@#U X&8pV\]]3ZR)`7:7vQwmh9n8ĒAjSpUhP <$i3FI6|Y4 Yy}CDn(ZU Xyx-@ &T4( (K vA5U 7YvSׄo~cዺo~ʗ%qSKJnNQՀwF#0ʣܼBe86Z^ĕ(bK5N&>y&+؃µ%/슎=HCzSxM0cIM_@ %M5l9HpT2^718@}UN>e4AHCO5Cz1Fj3bgE^'uU~Sr4EkO)G_p>U_M ,#cZK H@\ "i?OM)847HUmiF=;Z^ y6 18ѻp ڦE{L^nO!tM_2Ƴa?{dec;ħ]?wT Kl$5%  0҅q犦ƶKetluZr.h%u-b5JTg2}+sۭ2֎ \X H ҂d h^Ql rw/*jL{HqV=`7[/)()YRl^&'O]s&W!a}L"/%*-J 8=Xc?qݶb ?Sչ`։- KPI ;/uq8Uo b[wu$9Fn%7ȉi_:,4oNz;kHGv/؍NSm=m.%$8ڣؐ5\lsZqҷsO!WЎG]xǦ)CԠ= y-x KIP*I~Cǽ_|{߯{~iT@~cx_>| 9^\ǽ_~=:\r:pzH:h8_αsݧ7y3Hl*vHS)nK.ԤyJppq]8mH!Ttţ}i@ U.3q)d~{ͱ߾ط7LӸ0f?SSu yl2Ėo\[qn%? JYF+ls@g J5DWv+IO֊M!.î6Smwm^j]rmnU5X?өvz텡Ji㰎3,Ǻ|3)֚V?S@$B=>2 6$8е .ko_fNݭﯶ1κ<=_!B~lUۊWi:OR1-Ns<2+^k*NVao) .$7k柇i\mIl +=$] iO:u.ChQm.TwB^}iMn%*J J\aT.,E1,4hmوo׌+DintR?!X1F4ke xnJr>Re{릫+#ZWm⭕ʒje1\ñx%HQRT8d9.zn*c,iĂ O8]R֗Tzx\f^^dut)j =OERåf! V9{t? }/-5ӖN*(oyXnW*8\-A 'T<ԃx Ib:֧ћ 6-ҥ(ju>Ǝ`LʙwnjL0 Q) $5ӊܖ>[`e30>d:^zR[%D<֍OJv 3qJ J5$D@Whi.=DVT~Q|YV5LKxOJ'ӫbCJeiK$RA'ع`trTJy(7>F:$^} IC$cv]e[%\:Ȏ֒AhJU8g 'bȻk-b9V>%]$%k!>@p%UQL5 ӟ l" mc[zT|>'*ZzO?ۈG1O" O?0t@04 t>nKPG~$zơ%7ƞMЏ:> (I%DG'_=ȟj?WǹGk(SPԟI$}4tE?t |ޟe(to:~n=Ȝ#9܉|{>~r'ڏDQ=ȟj?WǹG"}_O܉|{>~r'ڏDQ=ȟj?WǹG"}_O܉|{>~r'ڏDQ=ȟj?WǹG"}_O܉|{>~DQts$iŶ=u.d.'k6Kz#.+/=c1:y:G6v9\6,ƞ31G[YheiuZxu0~3>9d&4mE hi<On6]c[OyOţb|EJd/jT#:K@Y Y %*RO4py~_wbFe/E֖X2VN:4Kn4<Vdh[qurHJB*9+ʩ>AY uȌr 0^vS O [CsGkQP`9uV ́f."Kqj`8 AHn]I\~qn*=&LZZli%mZY!%j MH'^3:\ DRAٰ#|n}q[aMvˀYʑAoF+GYB`z%Q`ݬrKFճò_̟ܨU$-G tB8l=1/1lfR!).|_^IqA+DP{݆6.(86O!x zcP`Ki;Š;pT^,O2xSUSp+ Zh§7>״G> y]vvvq-qƀMk셨pnc psʍ"+2WT)ZZT4 Ih;mfb'|zcur/V6q]m j]ϫ1<,CyCm* s8*:,Ol{` # &ޚ *'0j$wrM6W @5n1!ɒK)/h1k ݃pv&BK~he" ޝ[LUuzQq]+DaK㹝FUQd%2q˵kyp XadӉRq NzD<F??b6h8,n$.F*ŪƜy,SSJ  x)EJJs О_/<'a7>[[!"96ڹA|zTXVj9a/m{ׄc5-mI7$k$gջV7'zR 5tRuzix=Vb6:kKءR7"c>ʼf2eUX]Qz3XRzTQ?1e'"jTYlZV6} ZmiuHRT x=}5#$xB9q;i1蓶yqx)iKf&b[3 3P::(vy_hNm%C%i.kC!χ uԄodXFՙ9q;$XJ}+R]AH:œm=yƧs:|Td8l}AA)[L?.}kHRT x+IԞ_)㹝ܞթ !pL%7~y%zҒs $`%vWE* ո}%\P*JU鮜Vmd7AeIJzR̋!(WTOa=^YAՋë ; E~ ۬j2ن$8_Zy bm<+jJ%KqjW4)tJPp+RKJݎm+ZD6uT.$) mPRH:ˆ"E"1Gm! JRR4xqLJrsÏ<8xq!' -]>?"@=%:gmc-{M&nRhetUmkhpԩRu>PS(⣩xO>a<%R:zu']W^߻8%gёnDo:*l`-5r#7uO ٻc˲1|A ZG\+2zRCן=ag?IxY3B9rKjB^)QC 2+ͼZ^F z:HRI<?'>|/)} mҐIVŏnݑcybw ZRXLps 9gDVu@o{Ξl7gVHz&W%3eh1Υ רi.:>5+%Z~q7-uu@p!%5HH'?S.q z}WIn; #WyCMJ>CMHڷbE/˭RήR ŒABl.`Aˬ}̎s7 *Iα%(TpA5*:蠢xGu1vq- "E L^Wk^UwsM"Lŏ. crzX.XH*>:SQq*+Ч'OLnקㄟ! Jt~.* fХ"4(lK6 3lHK/;gIJFiDte uVQd):()yk-ʾ+orC VJ)#̆/BOhO~ny݆fpb'R Nz+8À4,Ie~,d"%j'Ni?=k]f/; 8J76ZMϸY^4~J?I9-ɿv%1XPLpHT*Ԥ)^ Iӥ%)/8Fykĝ|cj )l5!XR#u]-sR[sd>g' }XMZoi&:4m[E*3isn8BHb8V TB$z(5N<G|uj|yG~$h6arהgr2,5)sB"ˤr|MB ;oyζLH8TmnWxu5  Zu),;sF0k(1|f;QaEa?CM$<ʏ3Jx7t3 ţ +I{nD#U( qlbV2f0]_Bg n{o Ozi @(G075#hU8ԯ]XbYJ&m)J|%UQhZM0VSe)O>^4htՠ:\.rF8ͽ]j-u\t@OR"fjob ԁACkH@RngRKgfߟطA<3$Azٽ92B ! O 0{(=˻'1fL82^[U廬VT me3kBɊ݃quuPP$.E%FCj1*l[u++1eJeAQӗPdYQϳ]e.T)3hݓQn mPPyP)>3eХ[V-fˎtz<\i@iJ#ve.h09v6-Oq}zlX.= S xٱZvCH[1ʈ\J)F^˗kxqs6`VfE i`6Ma))l+e(AGM:IG?=VtGOwøoiv?`ል 6 s I_%)j @GxEm|Vv?&6*VE% tYHlc,BpM]4v-GHm!=`M-f{^97&*oj؍⛠.ZV)} +C}w7wkpz1 Fܬ§U̕om%3q#qm$8w7Mj94|ي+#_~boQ02<*d)I JʖUƗeI1ŀۮ!RR9‚wWFZdUBu_zqnNqNFUՌ[3^Ki xN뭒5+.3W"JRC X_A.tҲHp8Z-BèQIAOPP#_.?yim x|~ {Uo&ʑWfY!s!ϒ[!)CB-×B1ZV?g9 pJAH.%hY}^n]FI}C!t1}ƨ)5!Vu%"3b[o2m#n',ؚZU8Tٹ A1DF zS!dz ^φ77'bUm{loUm@ Osl75[:e[E xCYaq⠲n*Se:\w87k<~QHqjy0`[,mLB d>={ Ϗ!o>[gTYfO5i_ݨDBZ.%=Jmwqv̩>pJl}ov;g+\0|zZ}l;S3m1wXSǤ8z)1WB6R/'uq"iʔxlOq'mnn<nG!f84}ڵ6c[eWw=Ѻ\vQ-t{gG+αsd.SX ϸdDS>XTDu9u%J)L NK>JiY JR 7l߇]oi1}l#dU\a._z;^ZF.QvKDž^Xu#x6}w /q?>:z ;ĝ4ߜ8v|pocȳVj2ލ>^ G0xxC1$2OkBypgw#h#˲Z Sr;4Hׇ= tXR[~o [ qP\sDuZǷp̭ılO +"0 Vk됣x! mּic7o1" :AS))ICl8|͍܊l֨d8>R}%@PeԥiH6c,˃-!lګ mĞJB%$ xٷ4*i5հGɓnV:x3 ?hO } {,  TCD-JFnF~{kq*jKtPsO+tPǰ80-9\mǻeZbi^ ݴr&]L/"YYCS[eiuiqНvaf/_c{쵳(M o<>>Ւ+c%T5xmK%RcLuri#G[[ ÝBA=G@o0:+b'ƨ9:Xl0⠗$peUA"߶ϰٻ7ڍkȍL!ؑU8 9UT*+#ui,͖%߻XcltrZuX_!Ekr xi_TTO9Ѱ]3-IIm[l)o>CL Q H$]=$sNAYGQRP*˩_ԓxHPVf~"l-SVZ,D~H`BP<k.#n8cbx| ťBYe<98qku:[W˨a1}eMH->ʡ^Uղ;Ǽrk,8L$e`mnv gsV5]l#&pvDoeTKYmg*^H*?'5c񷓹gm%o!AoO´=䲐^_JuZjE3| aWc]YZUα{u}NKvMU!) ̞/vؖ7Uf8{w?lXE@b2奃'P K /DKWRedcΣ"rǘVXQBCжҥZ$vo!H#m$ D0Ɯ|Tr1B$KzN utPV: _l$etF?":I)[mTB ?NDU iMt) @XI I:/$hYw1 ֣ǷtWyIW>292g qoBnTK,wU lu+mDG2Tvlf<]=hCҊzuZڜCj$#8{-wBX ȥyvԚhbRfGRhuFUx띏{&\~N3Ge9k0W_)zKP \oYRpwe]vɗp썌,b❯1Hȕ"$X!Q)*SLR3=߭k5jd'#5m$[&]usvX>]94ɜD҆]lCfJJ61ޥLs$11$)Hp=j›!)Cĉ$&.[% 0 ֵyIsOfy~Y%Zvpέr#Ϯ:S6+;qwi,lrp̙)n=:mא<#t6C\; Ƭ5FLu:zR5tnJzT_Z \VO[:)J:I<4'ђ޾\W "*)i#N{DIG+6~C?NZN5%$^AHiUӹrgeF(NC1MUZh+aCs]u74=UY&-jVڵxzfKA>'SJImj*9mgULLŬp#XQJ=zI)J"5ݍ]vll!Ӊ'MR,)'N`:-=HJuτ}mB@:>nbTkТ9rWo61jtoD"@ec!=:!Iyd HJRt$kΖ3#V߫W>a[!<{q+u"(&S)gisԡЮӶ. ~6ñZmyN\S&dl,Hu [eia?n1eM~ܮoÅ:xM0.KqPBwelʘ쇄?WtA)NyJF*wY'鶁uFO1 П)pKӫs(t#Ev'9XM,눴bQ#:R(e7cn}xr<{AI7 XNEDŽ=D|!O2 pȤȨU\mgbuȝY˯f1-r^i/(0=w;Ȱ?LYbEO79ClsBRՠyn&/;>97%Xz]SmJ|T@,cVu.Cjtl,j\q5Rx631:}Ϟv&9*kNXF2 |3a E O.9TX?[<6o>Mo }d,VDeD,@ehq mVЗXvҳܗ o;\vVwc]Y_"XDVĩ.JPeceұ ȱml"Ȍr׭KUr)}99iH}=끺ս-\DheBSQ1 -}p rJJ"8b.)*IRNېt<$.zGN)>ח#s NJVڥWUl²uJºJкL.UO&$_‹"sD\{>U|V%[^QN:VXa9NwKI]V؝VD]Q.7ԥ='3e ,.;-#ɋ]OVȴERls" '^2MZC =2H@pejBA:%)H6vi$d% z|egJ3w|D=2X[ lOPgcp۫]#Q55a6*bzTYʐTyx.,k*l+Xf;0q ZJBR ! O.׹ }O!t55۳+-s6#ad0׏Y3^*b*d>`SMPo7ݚsp1<kn 'S?`!- i%9 `YmVcT{SfU?CUsyNMK2d%s[ekH5ߪ-l`vkrj6mͬ!;7pwKY *}T[QKz+Ԙ̣m;}j\1vyU} f$:)md %H<`M>v%5C"Hr%9CA=E+QHXUbcx5 t~,w]G>HSHK(I;>λ5/nX}g}?Zyi׼'ǭk GQ?3vGl>2FVmCcL-Vccl_ n2# T6x[ߗNOiOy \avy3# %5uWRRPöKm*Bx6emosK{U+*guU1CqXm9)]Х{ʩ.96DٿfC魄 ZyH@Bm $# I 4z 61nfAMG5b τH߽,}PBR}{{wn}SEkocBhW*"1eA\ΉN ܭk/\lb^aFAnQܓ2(.6JzzӼu pt5ҠfnvgwuH:H4טNͻ!ƙҟTš[ŒpWɆwZɰ kn曫aPdB*_'GVtos;e/#21vbXCiu# +~[bc>@ @Y߮pQ[hZfYei #EeNE:Qq(;+ ^?1G xhq:B7tzzuht] NDhrQ'NzUޒV3HTPdZf}) ?  ?ב3qlGIHZ8M洟RS.pG~&sן%RBO Iß5G2uC]u#Ҥ]Zz KND|B[I;5si{9m>5~2ad0ʧJ`q[l6u19ʜd< aqv B\TJ<MɔWDŽq[q3)m$x|gw뻌7sgӅq,OV- :B\BVu)p 9~M'oF_s6u#M-1,dz ł@ejO)'A@u%Zl{D?8ׅTE$~}<>^,9ԵjGs[JRhyeyOJ*#ϫND6"Wn[SOZeL1Ry%!Sin]*rY9w*s,^l~R! 3! *-gM0ݭ\}S+b9ZbAZmTOI*Q*$!i>)P[a*=J)HS=#C)'$$r?Si::)@Zu=95tGQ?@HO<9jyq{6'p*cJeOkm>!Fooԩ*Mn5^ CMjJUYQ9s:|GfwvM__s*POVWr<mhƉn%$=@ 4[HZQ䷘*Kz, G; fh6Z>ԉ3{ϓz*2l$*<8@!HVסo;sZ㫓zܺO<#-P8R{*l[DX/O7[]'n|MvÁmMWM'_:]Aʟnagvis-1.7.10+dfsg1/docs/general/img/std_bar.png000066400000000000000000000352101225466040700213430ustar00rootroot00000000000000PNG  IHDR{sRGBgAMA a cHRMz&u0`:pQ<tEXtSoftwarePaint.NET v3.10r%9IDATx^}]W}#"*"*FTEUU1jjTDDQ#FUUj1FDD귪FTU5򎊼QQ5>{g<<{9g>{Ͻk("@XT@#D" pM D`)+J D,2$En}N  D`p۟"@» D,6$nZOXxH "T|B }`}l6? Dtys0&Nd"ŠB\QaVWVJiZ "@:CDsgi;}W۵k._n;u͚՞P{ #EHeyY}rWD$\O i 8W۰akݸ]ۿ"$~?8B+>S$~ډ Сe۴)A#0J, R Rv"BOgj|cV6gEY_"@@\#dj"  whfLZp kJ1l{FxHkKW3=BĖRspA:PTj'D`Fq\*5s}=!5"`.GxEZ)T!Ɋ"@+Y<2 fq}"BYdp7ى D 駛3`(^qlՏO=:BPH^kR;"EY/BG86+&]׬ }Q2 Dt֭ԃ8Sέ~Ś"3~#=Yq@=>na#{"@ ,(Dcc$.Ȳ_"wu8$%D ௬(8tۀ Duo`ZE;9" ?rEyzH^wwEFtt 3uҳz`v(l"V׸@}~䇂:+3s"\}QgmSznS"D6:?%e~bBRnN^׭ D`V \@9#6dB"r>D"D%k77@޽{FKk4f$F'{"1*)x%zR.gbONBǹ- jfy\۲b`unJXC=J-WouFzMH9 = =!셩\( \C ە-HBB6x .xqz|Q+]R~nG Q$Q)U&Otǖq\5BNŒ>n':<3r a=W79  Vt@o.mĂԆL8t;_e1hK`]]d]VӳABpk8RgܳfK׹ZE@5A BV5CKԳYo"0y"vu[Cu&h|Sq'B գ/=.A-~]`- okӖ(f[Es{ %#(m϶vCXgcLbV0'?:xH=bMH$֠Ųӌd \ VM`BYtNRaꓺ_zmZ-ۖ1K#1fOC'vіʡ<$KLOMlm7;At_c*Z# 14v֭!FYmgH!Ӊs YG"e`ҩa|$ kĂO*X[`ۿxA+!#[$B@(O{R)s vn %3Bl]e:ywckYL%B?N j0ܐ mXZ jYVO.~,rA_? a$?!9xF5)vnLg!Hܯ☮;lZ_4_*;G$i ìˤ,nq]rA|A^HakՅs9 ǚFtt'Q(` ]eBkBS%m˄RteXLP۶Յ @?bӏփg&/kDt!G@uD H :R%NKe= 55 jg ًYcW!־~l:ʦP~z#El}ئG kJoNGj|?7\7uN}-vŬQ kڶ.rD7Vsp13)&GȉERz<2v':hX)Z]nPQ>Ftl=JqJ\HKS!2 m9☵>:çN(ovOD^A6ƶG{ pRa6z /:2ntJ%!:aSh Qz#$[!ubg1tq'"ĺUJuZg֏FivЯ/8Jm˒kXL#!B<.Lܘ Q2#ă:`9=%3 #G<LB2&4#)|h{ж( >&NcefY|AH2DK]aIAFXBj!Z}\iT?3ʱԚ5uzrz#H(%oԠKH.W&F +!?]&fxdY,5B2&)4fDBG)Rg#ȳy&Cx0A0Gm:< X%:1gDO(ut'D(9r$#9\_jo>`눁OdQ Qib>T)ֆo1lD`@>qc,ѭ)@UtP_ek=iBONt]7)"\\! cf\Z7G>-$Z`7P6zߩC3@oD ʼn : NދPf}ёtwJT:rzJ 'g;103mǜ\EY@)nDZf3*>1GmϥXE*Khwl(keW7tanKFAP,!!N|`a5 ӍAv ;vD`m |1$ZrZma63]Qvk~uGq~!X=|Zvq{l/s 9 $GS)eGD9;Rs7w~7O&: p\|1m=~v DQYJlw~ٳ$ږ$Baab~j IkRONskl+e=8Zy<秂G}CdFpS8rN5{RcEP64".>k9=Ѕk[ή6g~Q _;Fq!eHg?YP]nDЏyΧb#7#N7tkku;yu}X Űi4q" ҔS<89HbL((!_?꛳ۥmWعJ;aC}@)CP9^\SB9a*@M,]am]cKǰt~D4/9$މP5K>_QhdR|ʠJM!sJy]6k #t 6E.8yX 䨴XQp?jnmpD,\9dK8P ,ψ7KH Jr7t^آqѺbKǰ'B<:"#SHh"#R <1fKۦgHaډ3בf9Yf\՗El*g;Kp وXf :}0":o<3m=bKǰtD(M"'-k5W/M\w8?>s58oJ$c)6:lvi0EvP|g0ʍ(Ǖii̇C_:,e_돥}87S*i،6<&%=+YSX6Z 7S/3ShKbLHRhN|c!bt~b$RgԨ{ϥt6H(?yX C-A@㒋+W;.-Zgh `;e&NmSen:78{lr93,g.`SFwz4.@mLPud# *3'87wGA6 r['gGJO]l!['B|l 9p _b]pQXvlviR8 @kڇQ^9^7{9 6_nK%PX,a똳#'C6;W%m2e&N5?%B3Gjd0\fTRB{+q uږ u*f wHpѡgv_/|+>E?z6}DjPǁX1gGJOlxĖx2?6"\Dpi3 DL?$…LcDq!:ujH!}>0>waɟ. D,.$m{ZN n@  p"@>@  p"@>@  p"@>@  p"@>@  p"@@5&h7CPBp\?"@|M1߃͛Yy1kmY'? V;{/d:"'r^msz!R.t0q+++4-O !ڹS"ӧyű]Iرc^׬ ^ '8R]w(wuLdH"EID~_ߐ cxű  n߾؍ͱ'Mr#4>EpxY;~}O"ס"0k^&Mr4 Ҡ* e'!"At&8fn3p\%D05B6  pǎfƤpʰج}g>Ft5Z dJlQ.u=;Nv"@ƁxjqTc ^.bҥ} e#D [V>PbNy;z{mX!5S[lKA=6\ܣtUS?m ic]?2Y!5ڣJf ,;R C`Dx.ts+QR3\z5bIKORZ/tDe!6}\C'vіʡ<&WK ۶`c2XSR640D}v4&Kɣ3!MnΦmwⷛc{ A~tar A/;UmkY%Ldێxdpo c GٱYքt聎L(`(f ]eJg 9b瑢kJbӕoɴ8ou#P)6h=xӉ#Tz5ײl/HJkMCpC"\\H {!ڴ8ʷ^59":(@u7E 2Fšןl6#Ꞙ!MGT7n:rz|]tzHځ ֔ nZZIjTAddߴh{ۖsmWz˩Nwƍ.y)35:zl5U\OJk4_Y"E A_~]espm@GNOf3y(~I(s5ҵ<^?օcnXomn'"/ u 䪱mb^vO̷jۓ@v4&G]GL)۩m` Uu聎 ouq0kY 6]n#_mQ-0 H/u,wЌ5ޑ!0"ķ`1Ac;%f@6(m@GNO?mYCI/4#)@,s:G^#?Jp"j8\SҾ,Ӛ, uR_ 'D*rCc4OHRZVfezeKAQSwG':rzT}R"F J08reRkxл6 xd\ =΂kJݐ1M̤1K$݉<ޯjp ˓!0"ă訿(%DX1 k~ݲDthmgh+=Y_@lbe/{? r|j MWO_n1;1MP `RRԋ״kO?btGg :pI*(◉c:ݩ9݅&A}Qݑks\cfwhȄDؚpZ <𭌎v4Ozfh&&P!D0C ZCu>˥bq+"/:B]":rzJ: էJ Xfx혓k#EAc|8tytnK^T(MBX _5f`#vX~$r&C`Dx\:0: "| *!;agRZ;G6uoVuf1fuP,JQ;U}4Ћ}NO^P] Og ؗv];>`x`W1!e-#7oc.oiKJ)MbaĎ _gNp)qÆ/1g_s~RrD:4pL,~`k'\$fA;~lk(vp o|H~0|p#8SO5qt`yp𡇚k /]Z]7;ƚ5ƍMЈ$5`xXzZrvݽ;?>nسn] Y(aXn::nR_5>돵}87ه)A?>p> lѿym)T&6YFآuW(Ŭ7JSQ΃ 'iBbنyx?!ƍ9/Z̗G}symתH;M{>1,Ia*N::<|K숵E:LKȱc"NӼRC^; 9ztC5^6c8Fx`WMC%3Csz@gp^ڥm_~ o /\hgHL[D 650B6}85S*ml)q$X yf0~}5ީAGԬ66xTlX{◎a0&N7͛+ 9@SDy*!)lzH1:lvi,)Q8,ҿ_݈3בIiC07ۀt~Bw?AyF2_Nq/b%v2CmӘbg,~VRD(DXh̫9 6 H+$Dʪa;9<;-Fl|4Ykp^gS=6 㵣:1fKۆ-ҟ3WҮ"<|Y&-Y>\26i6`wTDv yxq0Ħ>85o6 ͋cҎ2}wg0F87Go P\D#'C6vYD:V-5M!Tη}|_. 65 rym /l@ghd2޽~!ĜBmݘ`_K8X1gGJOllw-L|FБĶf<@B3m@=c3fT<:7D{Pm.R:imKم:^}u0|fX_o~v{#u67 ~;nڴ"c> ߍoI;% cΎ\-$8Keo$6g&t?}>0M>:ujH!}>0 >f,C D`V5:+D"@J 2D"0ii D @",Ae D`n m0"@(ADX"@"@"ۦaD"P%!DED8MKÈ Da J,C spn"@@ DYO1!>}`|>BO  .<8nڵ+ym}…1NNc"D| "J˱m^/DʅXo?ô4? DtHnftt#78k2];v5ի=Gx]#"TW宎 I(i"/ Ap 8a2q~9DI~pW|ާ!KuuǯI:"@f ١CiSSF4a"/ăә0$YsQ֗"/$"$D, »w;9?Z`Rp l@Lk*F%\#\8ډ QJ\DxOH "5vFu DH"D%Jm9Op~ 6@ƽY&D\_9"@̚t1qRm3ۓnkBEyDdCNvq/ u聎ںXJlZz0x ]jX9_#Ad;3jH]:kmߦp;"DvltB|+~K9מk$ bE"A"\($|!.,ؒ~DFC?w#-GpDHtKG]:J<]%D?~r?m5fsoGhﮂ2ޫvTꅬFn*1f}o{5Z:ܨ[. }R\߭隶%w"?Vth 3sc=z0tx9=6Bui'= ! $Bzu`];D+]XGu)!mEf||,0Ʈz]1[W[ϵϷp>ЏPc\tHl (h:piRkWhF =l,X->j$: k\cC=Jg[5bm!m1]&7+c㘿@{ԒYo`Dzp \P mWMI9Ց$)zڦ#-ۖ@mN,!4CyHME@fkq1m , ))K"lm׭|#yt&itҍl~/wEtFǜ`vY$XXut'1])b_`'0:=B4%dd`Dȥo|*ؓJikOW^2#X]1[Գ|k([@"$}"# GKy O` ҆t'¦8HAvߪ~0ADRג h0sF(ѩ@oYsϜtmo|!V[ׯ_w\IۦY|`po #c-Gw6: =ѕPL ]eJg +[)3)Ŧ+k߈ 86~dC6SluNI`j}JʒI3PCDc$Z(DH"xm+m"Fx`=4>4~s?Bz( =Бc9RQذ6t~nO*AOf:iz:/6ìa۴ۛRt'lhinGZ#SNx:|1_4>;~MEwzՁ!=6pt:rzJ6KĞɋ#!פJjh h/ig]>D9!E9_}cg)?/ u zUv;]8[}bU۞,_0m":2Q1D|2M{ZjuLz#$[!ubg1tq'"ĺ J|aZg9_m9_,e송_g>Dzc% J0f,ƳK <"YMɌ,k ͌Jf]聎Ց#BT4;0)5B3B+2~429_ c >&4.;ɒ$`v <anyͨ|ٮs.!=.1=\Ntx&Q Nڬ#0FkL `BzѧK 4s.|S1ha1[KqYv!Is6[?R?SЁK;Vk1i9=БӓӁztSwh˶ }Qzݑk+$ąQ{v aMeu 'Y(m.𤎅$Ll!N  Ђpw99 Nu9=%\yjJl"F~1'F AEA;#DZf3*>6>zcP,!ݱIrE"$|d&wD8 l'}>0>@"$r0Afm|1[#ֺ^WllQXD?ZGN)fAmsZ5͘nv~TȇfQT-bo`cΎ\͝g_-RJ&4VYAC7gG#LuQGZΎ(bڧJl }ٳ9;HGINB"~,YG,~'>3I0H}b;bӯl(vp ;f*{q7D`Y/;SܗcDv<#Tc(q >k9=ЅzZrvE9{ֹ^/=r#\ }C*8'yWϢcmwS$~#6xuT,uDFeBڢo7sEůP ?Mĉ7JSN(4!,/&"e@Ҷ``NJ:Ҵ93M=cMr> ? mC8}::4}sRDo[X1lĉPi^rI3o!wk"?`qlʕAϕ*!Cr=Fe,ץmvi0B`m'"׸?y,fZcKǰ62$Bqna;/aȑW'.L\w8t@gNu6cS K!Q_hV:lvi0EvP|g0pq:k Ya%,h%> ݱXڇ†DDgq%q`) :JƎ\,JſX̴xY/;q""5KYq6:ΈHIj4mS^=ynn KuDV>uᬦFK1b/X0DEjDzMyz?;9Uơfrչ"xDv y(M }liӸX]3A$8|i*|ϜƹY;uXPJ9;Rzrlb pʈBR|G:owfx ؕۥmKs/qƮ!'ɕk.U~󸼇`Y5ZKʇł9;Rzr7Dm J,xV,M J{R lk~Jzgy 0R< wgD0ѹ!%"%ѽDZzjP8m)Xǫ"O`xNPovpѡl·3LQ@O?z6}ߒZ;#q$0uّғ1=5$-؈p͋٩lwlpG?줳I^l/@>+֮x<&J|}>@,5ʆoCoM@/DXe D ջFg0֓"@@ $X"@6- #DH%(  D-$¹mZF %KPb"@[Hs۴4"@J 2D"0ii D @",Ae D`n m0"@(AwmIENDB`nagvis-1.7.10+dfsg1/docs/general/img/std_speedo2.png000066400000000000000000000217441225466040700221470ustar00rootroot00000000000000PNG  IHDR]sRGBgAMA a cHRMz&u0`:pQ<tEXtSoftwarePaint.NET v3.10r%#>IDATx^흍㪮}gn1GXYv4`U;p@@@@@f ߌA@@@@@޻@@@@@f!ᘅ,P @@@@@!@c     py`8a      Gc     py`8a      Gc     pIOf 1 <xƬt!47ǿ@>?>KەڧmkF4úiWC]A0>D柘x @EҾԿ4I`X2Ƭp&d0Z!5#{{ ȃDAxtpx0I(um_z{{ Ƭp?7-Q3*=CѪ`64Ũt!p^U<ďS^k]WYk氳`+;_hQ +1_`8\`>]55xl`8pI(yHaJZpILc]sbhpHϩgN?}4qoL] o Wp,`,jy* vhUSvƎsЈ(1Ҙ0Z"6#ppyiV-T=n6' zp(۽az[9YZ0Cߗ*Qɫi+xdf !zKUڶdJՍҸca0n6y*áogp! Q|-U3P5#"5-7 ÁX诒G zp(ۭkR?2Qڪ%yc7,9L>bVJƇǀ0 vzdHj[jFddK 4}My yz`J (DvQ ]A6DP%Ā1"8l۰nRC]A3̿7f5Tp84UC]A0Q7Û]1a80ĀPCǮ*h#d\S(u %ClAB~6&EžN G7!A0bO (ácW Y}MQXpDc@lT8Be =`8y8)}(o"-Ul1Pc8MFbeMH-Uf8 <]1gu5Eb~s88/6h dy{Y=`8y2xnIre1fnռpA/qh%kqpLd! ջگby^Xo6 x絭XV|Nj!sp0^2yЀ(áofBEGP+2lkv'(0 V@q(mS$?-gx<`<PTW3s1Z}Ŷo<ǝZ{ݭ*v81_`8n3,/=Kp/k 0L줸!ky?XHq4{{=`8Yv݂H0Shx!G| g"]:w%\˯a nٚ9?ky?kBr8'?m ES`8HnJR(=~i9睿!KsY2ybLSF+a(&`׭V10T;6̂Bo\4}MI*/~:RN%R:_JsY2yb%4:1 br.5p=7W>Ls,|ia#=1-tV3畫Q6)b8~WkX]VMnnKLM)v-vF@'m֩}qOUntH"}Z̕LLԌ.laH?qO\=Q`LT ~"``G$ۦ-cF4+Gi>t)!5(%[bdDM9G[pQ(r5Ҝ熣Vc-7rB׎s6g;J+5!!(Pv N-nFI6c?`"isd<տC`}Fھ踇qE"+}E^K lˤ Xi̖1ZQqDZ]q%{F5v_ NHXL&T4}Q~c8Y\q^U<ҊsDb\<^\p$[ڝlU+Fr#!ԴZ\1OD"+ (&"Ә-{)Au~T> Xm=1 ̺^peQYe>ڃ9ۿ XOU?Z$wv# ^7CnPwt H]FkA/<&X@M*RYXjh'~sƼe5C^eR0b +0!s8{v,c d8J6-O PpfN)c`8HUڅYp(#s8N7Oܺ<pLG(NX:\?l:ܙcƜpԾmc}=0kxA ֳDIPLV(T>7 qcyh8CIɢ 0d ,&Q=0Ҟ ǢfuZ CJID@g0$-al4>AQaWyb-C\vqvi9>*Mj5Ҙ>}?`XKI5g~癴Q`K58)%RٿY? Ј3MB}j*z1} AƻmDĨ(ʍs %h*~t;g5j6~^>{{+'JJ Tpϟ#.\O QqQTFeQEI/Z; pBI"J"Jgٵp?gcpЍ%1xoDi\ɱ>/XȄE."zm.('X*@zP3%;je*.IwQV5,b㱤1&r߭D AƢB־w-?>OD G.*p<w{{\ 8 Ly\jAޓ1_^t6YHb8j&q%CGWsYi m _ǖA; 0K3G}RÑ+YΧOTPƟ)H'󓘀Z畇,JKj~q)ǖ淾 OƖZ"5PyyUT T`2lxֵH G:Fn"jFBڮ 8gɌT(IDp(P{eANHF_p$$sDc/ g8$sp_XrֶC D6G/hOc Ā4"$5JTioy#3"\Kzc[yb6>+ڜnACp䕋|r"\[BQ=螲=q̮V秠% G?}z(TH0$Dn.jU!=|p`\F;p}hdNnBA5:_=0>m"1=q%Ā2+4 0)Gl2̥0  ?0 Ā1!RĀPC]A0. 0f5Ħ\2 zp(+×<0ƬHE~b@Axtp P1)b~&s\*á _b|"J =`8@Á@ŤcVCl%s <`8|MijF"Ťx/<-|~Z/f3\ %\(á 6#CAO }+g??0 ŀ1e+5%Q.mFT1 <| AILB8&9Y-<=wx>?-wL~?(D=sM[p g}^ Options FollowSymLinks AllowOverride None Order allow,deny Allow from all # To enable Nagios basic auth on NagVis use the following options # Just uncomment it. Maybe you need to adjust the path to the # Auth user file. # # If you use the NagVis internal auth mechanism based on the web # for you won't need this. # #AuthName "NagVis Access" #AuthType Basic #AuthUserFile @NAGIOS_PATH@/etc/htpasswd.users #Require valid-user # With installed and enabled mod_rewrite there are several redirections # available to fix deprecated and/or wrong urls. None of those rules is # mandatory to get NagVis working. RewriteEngine On RewriteBase @NAGVIS_WEB@ # Use mod_rewrite for old url redirection even if there are php files which # redirect the queries itselfs. In some cases the mod_rewrite redirect # is better than the php redirect. # # Using the php redirect seems to be better in some cases where https/http servers # are mixed. For example in OMD setups where using apache own mode and https in the # frontend and http in the backend apache servers. # # Disabling this redirect by default in the hope that the php direct works better. #RewriteCond %{REQUEST_URI} ^@NAGVIS_WEB@(/config\.php|/index\.php|/|)(\?.*|)$ #RewriteRule ^(.*)$ @NAGVIS_WEB@/frontend/nagvis-js/%1%2 [R=301,L] # Redirect old regular map links RewriteCond %{REQUEST_URI} ^@NAGVIS_WEB@/frontend/(wui|nagvis-js) RewriteCond %{QUERY_STRING} map=(.*) RewriteRule ^(.*)$ @NAGVIS_WEB@/frontend/nagvis-js/index.php?mod=Map&act=view&show=%1 [R=301,L] # Without map= param RewriteCond %{REQUEST_URI} ^@NAGVIS_WEB@/frontend(/wui)?/?(index.php)?$ RewriteRule ^(.*)$ @NAGVIS_WEB@/frontend/nagvis-js/index.php [R=301,L] # Redirect old rotation calls RewriteCond %{REQUEST_URI} ^@NAGVIS_WEB@/frontend/nagvis-js RewriteCond %{QUERY_STRING} !mod RewriteCond %{QUERY_STRING} rotation=(.*) RewriteRule ^(.*)$ @NAGVIS_WEB@/frontend/nagvis-js/index.php?mod=Rotation&act=view&show=%1 [R=301,L] nagvis-1.7.10+dfsg1/etc/conf.d/000077500000000000000000000000001225466040700160175ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/etc/conf.d/demo.ini.php000066400000000000000000000004511225466040700202320ustar00rootroot00000000000000; ; the line above is to prevent ; viewing this file from web. ; DON'T REMOVE IT! ; This file defines a backend instance of the Test backend ; which is used by some demo maps. This can be removed when ; you are not interested in the demo maps. [backend_demo] backendtype=Test nagvis-1.7.10+dfsg1/etc/geomap/000077500000000000000000000000001225466040700161205ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/etc/geomap/demo-locations.csv000066400000000000000000000001331225466040700215470ustar00rootroot00000000000000ham-srv1;Hamburg Server 1;53.556866;9.994622 muc-srv1;Munich Server1;48.1448353;11.5580067 nagvis-1.7.10+dfsg1/etc/geomap/links.xml000066400000000000000000000000601225466040700177560ustar00rootroot00000000000000 nagvis-1.7.10+dfsg1/etc/geomap/locations.xml000066400000000000000000000000641225466040700206350ustar00rootroot00000000000000 nagvis-1.7.10+dfsg1/etc/geomap/settings.xml000066400000000000000000000001541225466040700205020ustar00rootroot00000000000000 nagvis-1.7.10+dfsg1/etc/geomap/viewpoints.xml000066400000000000000000000007331225466040700210540ustar00rootroot00000000000000 nagvis-1.7.10+dfsg1/etc/maps/000077500000000000000000000000001225466040700156105ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/etc/maps/demo-automap.cfg000066400000000000000000000004351225466040700206630ustar00rootroot00000000000000define global { sources=automap alias=Demo: 5 Automap parent_map=demo-overview iconset=std_medium backend_id=demo label_show=1 label_border=transparent # Automap specific parameters render_mode=directed rankdir=TB width=500 height=300 } nagvis-1.7.10+dfsg1/etc/maps/demo-automap2.cfg000066400000000000000000000005071225466040700207450ustar00rootroot00000000000000define global { alias=Demo: 6 Automap 2 parent_map=demo-overview iconset=std_small hover_childs_sort=s hover_childs_order=asc label_show=1 label_border=transparent # Make the map an automap sources=automap # Automap specific options backend_id=demo width=500 height=500 } nagvis-1.7.10+dfsg1/etc/maps/demo-geomap.cfg000066400000000000000000000003431225466040700204630ustar00rootroot00000000000000define global { sources=geomap alias=Demo: 4 Geomap parent_map=demo-overview iconset=std_medium backend_id=demo # Geomap specific parameters source_file=demo-locations width=800 height=600 } nagvis-1.7.10+dfsg1/etc/maps/demo-germany.cfg000066400000000000000000000031421225466040700206550ustar00rootroot00000000000000define global { object_id=0 map_image=demo-germany.png iconset=std_medium background_color=#e8e8e8 backend_id=demo alias=Demo: 0 Overview Germany parent_map=demo-overview } define textbox { object_id=5148ed text=Overview Germany x=424 y=8 w=342 h=46 background_color=transparent border_color=transparent style=font-size:24px;font-weight:bold } define hostgroup { object_id=d99295 hostgroup_name=muc x=464 y=704 label_text=Munich label_border=#e8e8e8 label_show=1 label_x=+29 label_y=+9 label_style=font-size:14px;font-weight:bold label_background=#ffffff } define hostgroup { object_id=e48d61 hostgroup_name=cgn x=195 y=432 label_show=1 label_text=Cologne label_background=#ffffff label_border=#e8e8e8 label_style=font-size:14px;font-weight:bold label_x=-78 label_y=+11 } define shape { object_id=058784 icon=demo-wan-cloud.png x=385 y=378 } define service { object_id=a0aa90 host_name=cgn-gw1 service_description=Interface WAN x=371,226 y=428,441 view_type=line line_type=13 } define service { object_id=d0e8ba host_name=ham-gw1 service_description=Interface WAN x=456,380 y=376,223 view_type=line line_type=13 } define service { object_id=7ab72e host_name=muc-gw1 service_description=Interface WAN x=468,474 y=468,690 view_type=line line_type=13 } define shape { object_id=483be9 icon=demo_traffic_load_legend.png x=657 y=616 } define map { object_id=3434cb map_name=demo-ham-racks x=361 y=185 label_show=1 label_text=Hamburg label_background=#ffffff label_border=transparent label_style=font-size:12px;font-weight:bold label_x=+28 label_y=-8 } define shape { object_id=24e68e icon=demo-nagvis-sponsors.png x=588 y=833 } nagvis-1.7.10+dfsg1/etc/maps/demo-ham-racks.cfg000066400000000000000000000017021225466040700210610ustar00rootroot00000000000000define global { object_id=0 iconset=std_big backend_id=demo map_image=demo-ham-racks.png background_color=#e8e8e8 parent_map=demo-overview alias=Demo: 1 Datacenter Hamburg } define textbox { object_id=8da404 text=Datacenter Hamburg x=247 y=28 w=317 h=45 border_color=transparent style=color:#ffffff;font-size:24px;font-weight:bold } define host { object_id=46a67d host_name=ham-gw1 x=194 y=78 label_show=1 label_border=transparent label_style=font-size:16px;color:#ffffff;font-weight:bold label_x=+46 label_y=+2 } define host { object_id=be24aa host_name=ham-srv1 x=192 y=345 label_show=1 label_border=transparent label_style=font-size:16px;color:#ffffff;font-weight:bold label_x=+49 label_y=+4 } define host { object_id=27acc8 host_name=ham-srv2 x=192 y=392 label_show=1 label_x=+49 label_y=+4 label_border=transparent label_style=font-size:16px;color:#ffffff;font-weight:bold } define shape { object_id=0ba0e0 icon=demo-nagvis-sponsors.png x=579 y=697 } nagvis-1.7.10+dfsg1/etc/maps/demo-load.cfg000066400000000000000000000037721225466040700201430ustar00rootroot00000000000000define global { object_id=0 iconset=std_big backend_id=demo map_image=demo-load.png background_color=#e8e8e8 parent_map=demo-overview alias=Demo: 2 Overview System Load } define textbox { object_id=8da404 text=Overview System Load x=238 y=29 w=317 h=45 border_color=transparent style=color:#ffffff;font-size:24px;font-weight:bold } define service { object_id=43ca5e host_name=muc-srv1 service_description=CPU load x=53 y=77 label_show=1 label_text=[name] label_border=transparent label_style=color:#ffffff;font-weight:bold;font-size:16px; label_x=+47 label_y=+4 } define service { object_id=72cc2d host_name=ham-srv1 service_description=CPU load x=301 y=77 label_show=1 label_text=[name] label_border=transparent label_style=color:#ffffff;font-weight:bold;font-size:16px; label_x=+47 label_y=+4 } define service { object_id=57f30d host_name=ham-srv2 service_description=CPU load x=549 y=80 label_show=1 label_text=[name] label_border=transparent label_style=color:#ffffff;font-weight:bold;font-size:16px; label_x=+47 label_y=+4 } define service { object_id=a01a1e host_name=muc-srv1 service_description=CPU load x=20 y=128 label_text=[service_description] label_border=transparent label_style=color:#ffffff;font-weight:bold;font-size:16px; label_x=+47 label_y=+4 view_type=gadget gadget_url=std_speedometer.php } define service { object_id=517656 host_name=ham-srv1 service_description=CPU load x=264 y=127 label_text=[service_description] label_border=transparent label_style=color:#ffffff;font-weight:bold;font-size:16px; label_x=+47 label_y=+4 view_type=gadget gadget_url=std_speedometer.php } define service { object_id=aa9bfe host_name=ham-srv2 service_description=CPU load x=515 y=127 label_text=[service_description] label_border=transparent label_style=color:#ffffff;font-weight:bold;font-size:16px; label_x=+47 label_y=+4 view_type=gadget gadget_url=std_speedometer.php } define servicegroup { object_id=eb2c32 servicegroup_name=load x=195 y=30 } define shape { object_id=5ea44d icon=demo-nagvis-sponsors.png x=580 y=459 } nagvis-1.7.10+dfsg1/etc/maps/demo-muc-srv1.cfg000066400000000000000000000035531225466040700206760ustar00rootroot00000000000000define global { object_id=0 iconset=std_big backend_id=demo map_image=demo-host.png background_color=#e8e8e8 parent_map=demo-overview alias=Demo: 3 Server - muc-srv1 } define textbox { object_id=8da404 text=muc-srv1 x=336 y=30 w=317 h=45 border_color=transparent style=color:#ffffff;font-size:24px;font-weight:bold } define service { object_id=43ca5e host_name=muc-srv1 service_description=CPU load x=167 y=89 label_show=1 label_text=[service_description] label_border=transparent label_style=color:#ffffff;font-weight:bold;font-size:16px; label_x=+47 label_y=+4 } define service { object_id=72cc2d host_name=muc-srv1 service_description=Memory used x=165 y=169 label_show=1 label_text=[service_description] label_border=transparent label_style=color:#ffffff;font-weight:bold;font-size:16px; label_x=+47 label_y=+4 } define service { object_id=57f30d host_name=muc-srv1 service_description=Interface eth0 x=163 y=249 label_show=1 label_text=[service_description] label_border=transparent label_style=color:#ffffff;font-weight:bold;font-size:16px; label_x=+47 label_y=+4 } define service { object_id=a01a1e host_name=muc-srv1 service_description=fs_/ x=536 y=85 label_show=1 label_text=[service_description] label_border=transparent label_style=color:#ffffff;font-weight:bold;font-size:16px; label_x=+47 label_y=+4 } define service { object_id=517656 host_name=muc-srv1 service_description=fs_/home x=535 y=166 label_show=1 label_text=[service_description] label_border=transparent label_style=color:#ffffff;font-weight:bold;font-size:16px; label_x=+47 label_y=+4 } define service { object_id=aa9bfe host_name=muc-srv1 service_description=NTP Time x=532 y=252 label_show=1 label_text=[service_description] label_border=transparent label_style=color:#ffffff;font-weight:bold;font-size:16px; label_x=+47 label_y=+4 } define shape { object_id=ad80cd icon=demo-nagvis-sponsors.png x=576 y=459 } nagvis-1.7.10+dfsg1/etc/maps/demo-overview.cfg000066400000000000000000000013261225466040700210630ustar00rootroot00000000000000define global { alias=Demo Overview iconset=std_big label_show=1 label_border=transparent backend_id=demo object_id=0 label_style=font-size:16px;font-weight:bold;color:#ffffff map_image=demo-overview.png background_color=#e8e8e8 label_x=+46 label_y=+3 } define map { object_id=858487 map_name=demo-germany x=62 y=85 } define map { object_id=89f0b3 map_name=demo-ham-racks x=62 y=132 } define map { object_id=a1e70c map_name=demo-load x=62 y=176 } define map { object_id=476e64 map_name=demo-muc-srv1 x=62 y=219 } define map { object_id=976f64 map_name=demo-geomap x=62 y=262 } define map { object_id=976a64 map_name=demo-automap x=62 y=305 } define shape { object_id=2d699e icon=demo-nagvis-sponsors.png x=585 y=425 } nagvis-1.7.10+dfsg1/etc/nagvis.ini.php-sample000066400000000000000000000526461225466040700207220ustar00rootroot00000000000000; ; the line above is to prevent ; viewing this file from web. ; DON'T REMOVE IT! ; ---------------------------- ; Default NagVis Configuration File ; At delivery everything here is commented out. The default values are set in the NagVis code. ; You can make your changes here, they'll overwrite the default settings. ; ---------------------------- ; ---------------------------- ; !!! The sections/variables with a leading ";" won't be recognised by NagVis (commented out) !!! ; ---------------------------- ; General options which affect the whole NagVis installation [global] ; Enable/Disable logging of security related user actions in Nagvis. For ; example user logins and logouts are logged in var/nagvis-audit.log ;audit_log="1" ; ; Defines the authentication module to use. By default NagVis uses the built-in ; SQLite authentication module. On delivery there is no other authentication ; module available. It is possible to add own authentication modules for ; supporting other authorisation mechanisms. For details take a look at the ; documentation. ;authmodule="CoreAuthModSQLite" ; ; Defines the authorisation module to use. By default NagVis uses the built-in ; SQLite authorisation module. On delivery there is no other authorisation ; module available. It is possible to add own authorisation modules for ; supporting other authorisation mechanisms. For details take a look at the ; documentation. ;authorisationmodule="CoreAuthorisationModSQLite" ; ; Sets the size of the controls in unlocked (edit) mode of the frontend. This ; defaults to a value of 10 which makes each control be sized to 10px * 10px. ;controls_size=10 ; ; Dateformat of the time/dates shown in nagvis (For valid format see PHP docs) ;dateformat="Y-m-d H:i:s" ; ; Used to configure the preselected options in the "acknowledge problem" dialog ; dialog_ack_sticky=1 ; dialog_ack_notify=1 ; dialog_ack_persist=0 ; ; File group and mode are applied to all files which are written by NagVis. ; Usualy these values can be left as they are. In some rare cases you might ; want to change these values to make the files writeable/readable by some other ; users in a group. ;file_group="" ;file_mode="660" ; ; The server to use as source for the NagVis geomaps. Must implement the API which ; can be found on http://pafciu17.dev.openstreetmap.org/ ;geomap_server="http://geomap.nagvis.org/" ; ; In some cases NagVis needs to open connections to the internet. The cases are: ; - The new geomap needs access to openstreetmap webservices to be able to fetch ; mapping information ; Most company networks don't allow direct HTTP access to the internet. The most ; networks require the users to use proxy servers for outbound HTTP requests. ; The proxy url to be used in NagVis can be configured here. One possible value ; is "tcp://127.0.0.1:8080". ;http_proxy="" ; Most proxies require authentication to access the internet. Use the format ; ":" to provide auth credentials ;http_proxy_auth="" ; Set the timeout (in seconds) for outbound HTTP requests (for example geomap requests) ;http_timeout=10 ; ; Defines which translations of NagVis are available to the users ;language_available="de_DE,en_US,es_ES,fr_FR,pt_BR" ; Language detection steps to use. Available: ; - User: The user selection ; - Session: Language saved in the session (Usually set after first setting an ; explicit language) ; - Browser: Detection by user agent information from the browser ; - Config: Use configured default language (See below) ;language_detection="user,session,browser,config" ; ; Select language (Available by default: en_US, de_DE, fr_FR, pt_BR) ;language="en_US" ; ; Defines the logon module to use. There are three logon modules to be used by ; default. It is possible to add own logon modules for serving other dialogs or ; ways of logging in. For details take a look at the documentation. ; ; The delivered modules are: ; ; LogonMixed: The mixed logon module uses the LogonEnv module as default and ; the LogonDialog module as fallback when LogonEnv returns no username. This ; should fit the requirements of most environments. ; ; LogonDialog: This is an HTML logon dialog for requesting authentication ; information from the user. ; ; LogonEnv: It is possible to realise a fully "trusted" authentication ; mechanism like all previous NagVis versions used it before. This way the user ; is not really authenticated with NagVis. NagVis trusts the provided username ; implicitly. NagVis uses the configured environment variable to identify the ; user. You can add several authentication mechanisms to your webserver, ; starting from the basic authentication used by Nagios (.htaccess) to single ; sign-on environments. ; Simply set logonmodule to "LogonEnv", put the environment variable to use as ; username to the option logonenvvar and tell the authentication module to ; create users in the database when provided users does not exist. The option ; logonenvcreaterole tells the module to assign the new user to a specific role ; set to empty string to disable that behaviour. ; ; LogonMultisite: This module uses the authentication provided by auth_* cookies ; which have been generated by Check_MK multisite when using the cookie based ; authentication. Since 1.2.1i2 Check_MK uses a new cookie format. To be able ; to use this, you need to define a new option called logon_multisite_serials ; which points to the auth.serial file generated by Check_MK. ; Special options for this module: ; ; logon_multisite_htpasswd="/path/to/htpasswd" ; logon_multisite_serials="/path/to/auth.serials" ; logon_multisite_secret="/path/to/auth.secret" ; logon_multisite_createuser="1" ; logon_multisite_createrole="Guests" ; ;logonmodule="LogonMixed" ;logonenvvar="REMOTE_USER" ;logonenvcreateuser="1" ;logonenvcreaterole="Guests" ; ; Default rotation time of pages in rotations ;refreshtime=60 ; ; Some user information is stored in sessions which are identified by session ; cookies placed on the users computer. The options below set the properties ; of the session cookie. ; Domain to set the cookie for. By default NagVis tries to auto-detect this ; options value by using the webserver's environment variables. ;sesscookiedomain="auto-detect" ; Absolute web path to set the cookie for. This defaults to configured ; paths/htmlbase option ;sesscookiepath="/nagvis" ; Lifetime of the NagVis session cookie in seconds. The default value is set to ; 24 hours. The NagVis session cookie contents will be renewed on every page ; visit. If a session is idle for more time than configured here it will become ; invalid. ;sesscookieduration="86400" ; ; Start page to redirect the user to when first visiting NagVis without ; special parameters. ;startmodule="Overview" ;startaction="view" ; The startshow parameter is only used by some views at the moment. It is used ; by the Map module. ;startshow="" ; ; Turn on to enable some shinken related features in NagVis, like the ; min_business_impact-filter on automaps which can be used to render automaps ; based on the shinken attribute "business_impact". ;shinken_features=0 ; Path definitions [paths] ; absolute physical NagVis path ;base="/usr/local/nagvis/" ; absolute html NagVis path ;htmlbase="/nagvis" ; absolute html NagVis cgi path ;htmlcgi="/nagios/cgi-bin" ; Default values which get inherited to the maps and its objects [defaults] ; default backend (id of the default backend) ;backend="live_1" ; background color of maps ;backgroundcolor="#ffffff" ; Enable/Disable the context menu on map objects. With the context menu you are ; able to bind commands or links to your map objects ;contextmenu=1 ; Choose the default context template ;contexttemplate="default" ; Raise frontend events for problematic objects also on page loading. Set to 1 to ; enable this feature ;event_on_load=0 ; Repeat frontend events in the given interval. The interval is configured in seconds. ;event_repeat_interval=0 ; The time in seconds to repeat alerts for a problematic ojects for as configured in ; event_repeat_interval. This value defaults to -1, this leads to repeated events ; till the problematic state has been fixed. ;event_repeat_duration=-1 ; Enable/Disable changing background color on state changes (Configured color is ; shown when summary state is PENDING, OK or UP) ;eventbackground=0 ; Enable/Disable highlighting of the state changing object by adding a flashing ; border ;eventhighlight=1 ; The duration of the event highlight in milliseconds (10 seconds by default) ;eventhighlightduration=10000 ; The interval of the event highlight in milliseconds (0.5 seconds by default) ;eventhighlightinterval=500 ; Enable/Disable the eventlog in the new javascript frontend. The eventlog keeps ; track of important actions and information ;eventlog=0 ; Loglevel of the eventlog (available: debug, info, warning, critical) ;eventloglevel="info" ; Number of events kept in the scrollback ;eventlogevents="24" ; Height of the eventlog when visible in px ;eventlogheight="75" ; Hide/Show the eventlog on page load ;eventloghidden="1" ; Enable/Disable scrolling to the icon which changed the state when the icon is ; out of the visible scope ;eventscroll=1 ; Enable/Disable sound signals on state changes ;eventsound=1 ; enable/disable header menu ;headermenu="1" ; header template ;headertemplate="default" ; Enable/Diable the fading effect of the submenus in the header menu ;headerfade=1 ; enable/disable hover menu ;hovermenu=1 ; hover template ;hovertemplate="default" ; hover menu open delay (seconds) ;hoverdelay=0 ; show children in hover menus ;hoverchildsshow=1 ; limit shown child objects to n ;hoverchildslimit="10" ; order method of children (desc: descending, asc: ascending) ;hoverchildsorder="asc" ; sort method of children (s: state, a: alphabetical) ;hoverchildssort="s" ; default icons ;icons="std_medium" ; recognize only hard states (not soft) ;onlyhardstates=0 ; recognize service states in host/hostgroup objects ;recognizeservices=1 ; show map in lists (dropdowns, index page, ...) ;showinlists=1 ; show map in multisite snapin ;showinmultisite=1 ; Name of the custom stylesheet to use on the maps (The file needs to be located ; in the share/nagvis/styles directory) ;stylesheet="" ; target for the icon links ;urltarget="_self" ; URL template for host object links ;hosturl="[htmlcgi]/status.cgi?host=[host_name]" ; URL template for hostgroup object links ;hostgroupurl="[htmlcgi]/status.cgi?hostgroup=[hostgroup_name]" ; URL template for service object links ;serviceurl="[htmlcgi]/extinfo.cgi?type=2&host=[host_name]&service=[service_description]" ; URL template for servicegroup object links ;servicegroupurl="[htmlcgi]/status.cgi?servicegroup=[servicegroup_name]&style=detail" ; URL template for nested map links ;mapurl="[htmlbase]/index.php?mod=Map&act=view&show=[map_name]" ; Templates to be used for the different views. ;view_template="default" ; Enable/disable object labels for all objects ;label_show=0 ; Configure the colors used by weathermap lines ;line_weather_colors="10:#8c00ff,25:#2020ff,40:#00c0ff,55:#00f000,70:#f0f000,85:#ffc000,100:#ff0000" ; Options to configure the Overview page of NagVis [index] ; Color of the overview background ;backgroundcolor=#ffffff ; Set number of map cells per row ;cellsperrow=4 ; enable/disable header menu ;headermenu="1" ; header template ;headertemplate="default" ; Enable/Disable map listing ;showmaps=1 ; Enable/Disable geomap listing ; Note: It is disabled here since it is unfinished yet and not for production ; use in current 1.5 code. ;showgeomap=0 ; Enable/Disable rotation listing ;showrotations=1 ; Enable/Disable map thumbnails ;showmapthumbs=0 ; Options for the Automap [automap] ; Default URL parameters for links to the automap ;defaultparams="&childLayers=2" ; Default root host (NagVis uses this if it can't detect it via backend) ; You can configure a hostname here or use "<<>>" as "virtual" ; node which shows the parent tree and all hosts which have no parents ; defined below the is node. ;defaultroot="<<>>" ; Path to the graphviz binaries (dot,neato,...); Only needed if not in ENV PATH ;graphvizpath="/usr/bin/" ; Options for the WUI [wui] ; map lock time (minutes). When a user edits a map other users trying to edit ; the map are warned about this fact. ;maplocktime=5 ; Show/hide the grid ;grid_show=0 ; The color of the grid lines ;grid_color="#D5DCEF" ; The space between the single grid lines in pixels ;grid_steps=32 ; Options for the new Javascript worker [worker] ; The interval in seconds in which the worker will check for objects which need ; to be updated ;interval=10 ; The maximum number of parameters used in ajax http requests ; Some intrusion detection/prevention systems have a problem with ; too many parameters in the url. Give 0 for no limit. ;requestmaxparams=0 ; The maximum length of http request urls during ajax http requests ; Some intrusion detection/prevention systems have a problem with ; queries being too long ;requestmaxlength=1900 ; The retention time of the states in the frontend in seconds. The state ; information will be refreshed after this time ;updateobjectstates=30 ; ---------------------------- ; Backend definitions ; ---------------------------- ; Example definition of a livestatus backend. ; In this case the backend_id is live_1 ; The path /usr/local/nagios/var/rw has to exist [backend_live_1] backendtype="mklivestatus" ; The status host can be used to prevent annoying timeouts when a backend is not ; reachable. This is only useful in multi backend setups. ; ; It works as follows: The assumption is that there is a "local" backend which ; monitors the host of the "remote" backend. When the remote backend host is ; reported as UP the backend is queried as normal. ; When the remote backend host is reported as "DOWN" or "UNREACHABLE" NagVis won't ; try to connect to the backend anymore until the backend host gets available again. ; ; The statushost needs to be given in the following format: ; ":" -> e.g. "live_2:nagios" ;statushost="" ;socket="unix:/usr/local/nagios/var/rw/live" ; Example definition for a MySQL backend ; in this example the ID of the Backend is "ndomy_1" you can define another ID. [backend_ndomy_1] ; type of backend - MUST be set backendtype="ndomy" ; The status host can be used to prevent annoying timeouts when a backend is not ; reachable. This is only useful in multi backend setups. ; ; It works as follows: The assumption is that there is a "local" backend which ; monitors the host of the "remote" backend. When the remote backend host is ; reported as UP the backend is queried as normal. ; When the remote backend host is reported as "DOWN" or "UNREACHABLE" NagVis won't ; try to connect to the backend anymore until the backend host gets available again. ; ; The statushost needs to be given in the following format: ; ":" -> e.g. "live_2:nagios" ;statushost="" ; hostname for NDO-db ;dbhost="localhost" ; portname for NDO-db ;dbport=3306 ; database name for NDO-db ;dbname="nagios" ; username for NDO-db ;dbuser="root" ; password for NDO-db ;dbpass="" ; prefix for tables in NDO-db ;dbprefix="nagios_" ; instance name for tables in NDO-db ;dbinstancename="default" ; maximum delay of the NDO Database in seconds ;maxtimewithoutupdate=180 ; path to the cgi-bin of this backend ;htmlcgi="/nagios/cgi-bin" ; Example definition of a Merlin backend ; in this example the ID of the Backend is "merlinmy_1" you can define another ID. [backend_merlinmy_1] ; type of backend - MUST be set backendtype="merlinmy" ; hostname for Merlin db ;dbhost="localhost" ; portname for Merlin db ;dbport=3306 ; database name for Merlin db ;dbname="merlin" ; username for Merlin db ;dbuser="merlin" ; password for Merlin db ;dbpass="merlin" ; maximum delay of the Merlin Database in seconds ;maxtimewithoutupdate=180 ; path to the cgi-bin of this backend ;htmlcgi="/nagios/cgi-bin" ; ---------------------------- ; Rotation pool definitions ; ---------------------------- ; in this example the browser switches between the maps demo and demo2 every 15 ; seconds, the rotation is enabled by url: index.php?rotation=demo [rotation_demo] ; These steps are rotated. The single steps may have optional prefixes like "Demo2:" ; which are used as display text on the index pages rotation list. ; You may also add external URLs as steps. Simply enclose the url using [] ; instead of the map name. maps="demo-germany,demo-ham-racks,demo-load,demo-muc-srv1,demo-geomap,demo-automap" ; rotation interval (seconds) interval=15 ; ---------------------------- ; Action definitions ; ---------------------------- ; Since NagVis 1.7.6 it is possible to use so called actions to extend the ; default context menu. This enables users to connect directly to the monitored ; hosts from the NagVis context menu. Here you can configure those actions. ; ; It is possible to add such actions to the context menus of service and host ; objects. They are not added blindly to all objects of those types, you can ; use the attribute "condition" to configure which objects shal have the ; specific actions. By default we use Nagios custom macros of the host object ; to make the actions visible/invisible. This filtering mechanism is not limited ; to custom macros, you can also use regular host attributes which are available ; within NagVis. ; With the option "client_os" you can configure the option to only be available ; on the clients which have a listed operating system running. ; Adds the action "connect via rdp" to service/host objects where the host object ; has the string "win" in the TAGS Nagios custom macro. ; When clicking on the link, NagVis generates a .rdp file which contains makes ; the client connect to the given host via RDP. ;[action_rdp] ;action_type="rdp" ;obj_type="host,service" ;condition="TAGS~win" ;client_os="win" ;domain="" ;username="" ; Adds the action "connect via ssh" to service/host objects which have the ; string "unix" in the TAGS Nagios custom macro. Is only added when NagVis ; detects that the client watching the map uses windows. ; When clicking on the link, NagVis generates a .cmd file which contains a ; call to putty which makes putty connect via SSH to this host. ;[action_win_ssh] ;action_type="win_ssh" ;obj_type="host,service" ;client_os="win" ;condition="TAGS~unix" ; Adds the action "connect via ssh" to service/host objects which have the ; string "unix" in the TAGS Nagios custom macro. Is only added when NagVis ; detects that the client watching the map uses linux or mac os. ; When clicking on the link, the browser opens the URL ssh://
    /, ; you need to configure your clients browser to handle these urls correctly. ;[action_ssh_url] ;action_type="ssh_url" ;obj_type="host,service" ;client_os="mac,lnx" ;condition="TAGS~unix" ; Adds the action "connect via http" to service/host objects which have the ; string "web-80" in the TAGS Nagios custom macro ; When clicking on the link, the browser opens a new window with the URL ; http:///. This can be changed by modyfing the context template. ;[action_http] ;action_type="http" ;obj_type="host,service" ;condition="TAGS~web-80" ; Adds the action "connect via http" to service/host objects which have the ; string "web-443" in the TAGS Nagios custom macro ; When clicking on the link, the browser opens a new window with the URL ; https:///. This can be changed by modyfing the context template. ;[action_https] ;action_type="https" ;obj_type="host,service" ;condition="TAGS~web-443" ; ------------------------------------------------------------------------------ ; Below you find some advanced stuff ; ------------------------------------------------------------------------------ ; Configure different state related settings [states] ; State coverage/weight: This defines the state handling behaviour. For example ; a critical state will cover a warning state and an acknowledged critical ; state will not cover a warning state. ; ; These options are being used when calculating the summary state of the map ; objects. The default values should fit most needs. ; ;down=10 ;down_ack=6 ;down_downtime=6 ;unreachable=9 ;unreachable_ack=6 ;unreachable_downtime=6 ;critical=8 ;critical_ack=6 ;critical_downtime=6 ;warning=7 ;warning_ack=5 ;warning_downtime=5 ;unknown=4 ;unknown_ack=3 ;unknown_downtime=3 ;error=4 ;error_ack=3 ;error_downtime=3 ;up=2 ;ok=1 ;unchecked=0 ;pending=0 ; ; Colors of the different states. The colors are used in lines and hover menus ; and for example in the frontend highlight and background event handler ; ;unreachable_bgcolor=#F1811B ;unreachable_color=#F1811B ;unreachable_ack_bgcolor= ;unreachable_downtime_bgcolor= ;down_bgcolor=#FF0000 ;down_color=#FF0000 ;down_ack_bgcolor= ;down_downtime_bgcolor= ;critical_bgcolor=#FF0000 ;critical_color=#FF0000 ;critical_ack_bgcolor= ;critical_downtime_bgcolor= ;warning_bgcolor=#FFFF00 ;warning_color=#FFFF00 ;warning_ack_bgcolor= ;warning_downtime_bgcolor= ;unknown_bgcolor=#FFCC66 ;unknown_color=#FFCC66 ;unknown_ack_bgcolor= ;unknown_downtime_bgcolor= ;error_bgcolor=#0000FF ;error_color=#0000FF ;up_bgcolor=#00FF00 ;up_color=#00FF00 ;ok_bgcolor=#00FF00 ;ok_color=#00FF00 ;unchecked_bgcolor=#C0C0C0 ;unchecked_color=#C0C0C0 ;pending_bgcolor=#C0C0C0 ;pending_color=#C0C0C0 ; ; Sound of the different states to be used by the sound eventhandler in the ; frontend. The sounds are only being fired when changing to some ; worse state. ; ;unreachable_sound=std_unreachable.mp3 ;down_sound=std_down.mp3 ;critical_sound=std_critical.mp3 ;warning_sound=std_warning.mp3 ;unknown_sound= ;error_sound= ;up_sound= ;ok_sound= ;unchecked_sound= ;pending_sound= ; ------------------------- ; EOF ; ------------------------- nagvis-1.7.10+dfsg1/install.sh000077500000000000000000001557361225466040700161230ustar00rootroot00000000000000#!/bin/bash ############################################################################### # # install.sh - Installs/Updates NagVis # # Copyright (c) 2004-2011 NagVis Project (Contact: info@nagvis.org) # # Development: # Wolfgang Nieder # Lars Michelsen # # License: # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # ############################################################################### # Some initialisations ############################################################################### # Default action INSTALLER_ACTION="install" # Be quiet? (Enable/Disable confirmations) INSTALLER_QUIET=0 # Should the installer change config options when possible? INSTALLER_CONFIG_MOD="y" # files to ignore/delete IGNORE_DEMO="" # backends to use NAGVIS_BACKENDS="mklivestatus,ndo2db,ido2db,merlinmy" # data source SOURCE=nagios # skip checks RC=0 FORCE=0 UNDO=0 ACONF="y" REMOVE="n" LOG=install.log CALL="$0" NAGVIS_PATH_PARAM_SET=0 NAGVIS_PATH_OLD_PARAM_SET=0 # Default Path to Graphviz binaries GRAPHVIZ_PATH="/usr/local/bin" # Version of NagVis to be installed NAGVIS_VER=$(cat share/server/core/defines/global.php | grep CONST_VERSION | awk -F"'" '{ print $4 }') INSTALLER_VERSION=$NAGVIS_VER # Version of old NagVis (will be detected if update) NAGVIS_VER_OLD="" # Relative path to the NagVis configuration file NAGVIS_CONF="etc/nagvis.ini.php" # Relative path to the NagVis SQLite auth database NAGVIS_AUTH_DB="etc/auth.db" # File for saving the old removed map permissions AUTH_BACKUP="etc/auth-backup" # Default nagios web conf HTML_SAMPLE="etc/apache2-nagvis.conf-sample" # Default nagios web conf HTML_CONF="nagvis.conf" # Saving current timestamp for backup when updating DATE=$(date +%Y-%m-%d_%H:%M:%S) # Web path to the NagVis base directory HTML_PATH="" # Path to webserver conf WEB_PATH="" # Default webserver user WEB_USER="" # Default webserver group WEB_GROUP="" # Version prerequisites NEED_PHP_VERSION=$(cat share/server/core/defines/global.php | grep CONST_NEEDED_PHP_VERSION | awk -F"'" '{ print $4 }') [ -z "$NEED_PHP_VERSION" ] && NEED_PHP_VERSION="5.0" NEED_PHP_MODULES="gd mbstring gettext session xml pdo" NEED_GV_MOD="dot neato twopi circo fdp" NEED_GV_VERSION=2.14 NEED_SQLITE_VERSION=3.0 LINE_SIZE=78 GREP_INCOMPLETE=0 # Function definitions ############################################################################### . install_lib # format version string fmt_version() { V=${1//a/.0.0} V=${V//b/.0.2} V=${V//rc/.0.4} if [ ${#V} -eq 3 ]; then V=${V}.0.60 fi NV="" for S in "${V//./ }"; do NV="$NV$(printf %02d $S)" done while [ ${#NV} -lt 8 ]; do NV=${NV}0 done echo $NV } # Print usage usage() { cat < Data source, defaults to Nagios, may be Icinga -n Path to Nagios/Icinga base directory (\$BASE) Default value: $NAGIOS_PATH -b Path to graphviz binaries ($NEED_GV_MOD) Default value: $GRAPHVIZ_PATH -p Path to NagVis base directory to install to Default value: $NAGVIS_PATH -O Path to the old NagVis base directory to update from. You only need to set this if it is different than the new NagVis base directory given in "-p". This may be useful when updating from 1.4 to 1.6 where the paths to NagVis changed. Default value: $NAGVIS_PATH -W Web path to the NagVis base directory Default: $HTML_PATH -u User who runs the webserver -g Group who runs the webserver -w Path to the webserver config files -i Comma separated list of backends to use: Available backends: mklivestatus, ndo2db, ido2db, merlinmy Backend specific parameters: ndo2db, ido2db: -m Full path to the NDO/IDO module Default value: \$BASE/bin/ndo2db mklivestatus: -l MKLivestatus socket. Has to be in the following format: TCP Socket: tcp:: Unix Socket: unix: Default value: unix:\$BASE/var/rw/live Flag parameters: -o Omit demo files -a [y|n] Install the config file for the web server (y/n) -r When performing an update of an existing NagVis installation the old NagVis directory will be saved in a backup directory. When you know what you are doing you can tell the installer to remove this backup directory after a successful installation. -q Quiet mode. The installer won't ask for confirmation of what to do. The installer will use the hard coded options or the values given by command line parameters. This can be useful for automatic or scripted deployment WARNING: Only use this if you know what you are doing -F This is the force mode. Specifying this flag will call the installer skip all validity checks and install NagVis with the given options WARNING: Only use this if you know what you are doing -c [y|n] Update configuration files when possible? Parses all existing configuration files, checks for deprecated and missing options and fixes known problems. This option has only effects when updating mechanisms have been added to this installer. -v Version information -h This message EOD } # Print version information version() { cat < EOD } # Print line line() { [ $INSTALLER_QUIET -eq 1 ] && return DASHES="--------------------------------------------------------------------------------------------------------------" SIZE2=`expr $LINE_SIZE - 4` if [ -z "$1" ]; then OUT=`printf "+%${LINE_SIZE}.${LINE_SIZE}s+\n" $DASHES` else if [ -z "$2" ]; then OUT=`printf "+--- %s\n" "$1"` else OUT=`printf "+--- %${SIZE2}.${SIZE2}s+\n" "$1 $DASHES"` fi fi echo "$OUT" } # Print text text() { [ $INSTALLER_QUIET -eq 1 ] && return SIZE2=`expr $LINE_SIZE - 3` if [ -z "$1" ]; then OUT=`printf "%s%${LINE_SIZE}s%s\n" "|" "" "|"` else if [ -z "$2" ]; then OUT=`printf "%s\n" "$1"` else OUT=`printf "%-${LINE_SIZE}.${LINE_SIZE}s %s\n" "$1" "$2"` fi fi echo "$OUT" } # Ask user for confirmation confirm() { echo -n "| $1 [$2]: " read ANS [ -z $ANS ] && ANS=$2 ANS=`echo $ANS | tr "jyos" "YYYY" | cut -c 1,1` [ "$ANS" != "Y" ]&&ANS="N" } # Ask user for confirmation check_confirm() { ANS=`echo $ANS | tr "jyos" "yyyy" | cut -c 1,1` if [ "$ANS" = "y" ]; then return 0 else return 0 fi } # Check Nagios path check_nagios_path() { if [ -d $NAGIOS_PATH ]; then log " $SOURCE path $NAGIOS_PATH" "found" return 0 else log " $SOURCE path $NAGIOS_PATH" "" return 1 fi } check_web_user() { if [ "`getent passwd $WEB_USER | cut -d':' -f1`" = "$WEB_USER" ]; then return 0 else echo "| Error: User $WEB_USER not found." return 1 fi } check_web_group() { if [ "`getent group $WEB_GROUP | cut -d':' -f1`" = "$WEB_GROUP" ]; then return 0 else echo "| Error: Group $WEB_GROUP not found." exit 1 fi } ask_user() { VAR=$1 DEFAULT=$2 MANDATORY=$3 VERIFY_FUNC=$4 TEXT=$5 RETURN=1 while true; do if [ $INSTALLER_QUIET -ne 1 ]; then echo -n "| $TEXT [$DEFAULT]: " read OPT if [ ! -z $OPT ]; then eval "${VAR}=$OPT" else eval "${VAR}=$DEFAULT" fi fi if [ $MANDATORY -eq 1 -a "${!VAR}" != "" ] || [ $MANDATORY -eq 0 ]; then if [ "$VERIFY_FUNC" != "" ]; then ${VERIFY_FUNC} if [ $? = 0 ]; then RETURN=0 fi # In quiet mode break in all cases if [ $INSTALLER_QUIET -eq 1 -o $RETURN = 0 ]; then break fi else RETURN=0 break fi else break fi done return $RETURN } # Print welcome message welcome() { [ $INSTALLER_QUIET -eq 1 ] && return cat </dev/null if [[ $? -eq 0 && $N_PPID -eq $init_id ]]; then N_BIN=${N_CMD%% *} NAGIOS_PATH=${N_BIN%%/bin/$SOURCE} NAGIOS_PATH=${NAGIOS_PATH%/} fi done IFS=" " } # Tries to detect the correct path to the livestatus socket locally detect_livestatus_socket() { if [ -S "/var/run/nagios/rw/live" ]; then LIVESTATUS_SOCK="unix:/var/run/nagios/rw/live" else LIVESTATUS_SOCK="unix:$NAGIOS_PATH/var/rw/live" fi } # Check Backend module prerequisites check_backend() { # Ask to configure the backends during update if [ $INSTALLER_ACTION = "update" ]; then confirm "Do you want to update the backend configuration?" "n" if [ "$ANS" = "N" ]; then return fi fi BACKENDS="" text "| Checking Backends. (Available: $NAGVIS_BACKENDS)" "|" if [ $INSTALLER_QUIET -ne 1 ]; then if [ -z "$NAGVIS_BACKEND" ]; then ASK=`echo $NAGVIS_BACKENDS | sed 's/,/ /g'` for i in $ASK; do DEFAULT="n" if [ "$i" = "mklivestatus" ]; then DEFAULT="y" fi confirm "Do you want to use backend $i?" $DEFAULT if [ "$ANS" = "Y" ]; then BACKENDS=$BACKENDS,$i fi done NAGVIS_BACKEND=$BACKENDS fi NAGVIS_BACKEND=${NAGVIS_BACKEND#,} fi echo $NAGVIS_BACKEND | grep -i "MKLIVESTATUS" >/dev/null if [ $? -eq 0 ]; then [ -z "$LIVESTATUS_SOCK" ] && detect_livestatus_socket # Check if the livestatus socket is available # when not using a tcp socket if [[ "$LIVESTATUS_SOCK" =~ unix:* ]]; then if [ -S ${LIVESTATUS_SOCK#unix:} ]; then log " Livestatus Socket (${LIVESTATUS_SOCK#unix:})" "found" elif [ $INSTALLER_QUIET -ne 1 ]; then # Loop until we got what we want in interactive mode while [[ ! "$LIVESTATUS_SOCK" =~ tcp:* && ! -S ${LIVESTATUS_SOCK#unix:} ]]; do log " Livestatus Socket (${LIVESTATUS_SOCK#unix:})" "" text "| Valid socket formats are: tcp:127.0.0.1:7668 or unix:/path/to/live" "|" echo -n "| Please enter your MKLivestatus socket: " read APATH if [ ! -z $APATH ]; then LIVESTATUS_SOCK=$APATH if [[ ! "$LIVESTATUS_SOCK" =~ unix:* && ! "$LIVESTATUS_SOCK" =~ tcp:* ]]; then text "| Invalid socket format. Take a look above for valid formats." "|" elif [[ ! "$LIVESTATUS_SOCK" =~ unix:* ]]; then text "| Unable to check TCP-Sockets, hope you entered the correct socket." "|" fi fi done else log " Livestatus Socket (${LIVESTATUS_SOCK#unix:})" "" fi CALL="$CALL -l \"$LIVESTATUS_SOCK\"" else text "| Unable to check TCP-Sockets, hope you entered the correct socket." "|" fi # Check if php socket module is available check_php_modules "sockets" "$NEED_PHP_VERSION" if [ "$BACKENDS" = "" ]; then BACKENDS="mklivestatus" else BACKENDS="${BACKENDS},mklivestatus" fi fi echo $NAGVIS_BACKEND | grep -i "NDO2DB" >/dev/null if [ $? -eq 0 ]; then # Check ndo2db binary with version suffix [ -z "$NDO_MOD" ]&&NDO_MOD="$NAGIOS_PATH/bin/ndo2db-3x" NDO=`$NDO_MOD --version 2>/dev/null | grep -i "^NDO2DB"` # Check ndo2db binary without version suffix if [ -z "$NDO" ]; then NDO_MOD="$NAGIOS_PATH/bin/ndo2db" NDO=`$NDO_MOD --version 2>/dev/null | grep -i "^NDO2DB"` fi [ -z "$NDO" ]&&NDO_MOD="NDO Module ndo2db" log " $NDO_MOD (ndo2db)" $NDO # Check if php mysql module is available check_php_modules "mysql" "$NEED_PHP_VERSION" if [ "$BACKENDS" = "" ]; then BACKENDS="ndo2db" else BACKENDS="${BACKENDS},ndo2db" fi fi echo $NAGVIS_BACKEND | grep -i "IDO2DB" >/dev/null if [ $? -eq 0 ]; then # Check IDO if [ -z "$NDO" ]; then NDO_MOD="$NAGIOS_PATH/bin/ido2db" fi NDO=`$NDO_MOD --version 2>/dev/null | grep -i "^IDO2DB"` [ -z "$NDO" ]&&NDO_MOD="IDO Module ido2db" log " $NDO_MOD (ido2db)" $NDO # Check if php mysql module is available check_php_modules "mysql" "$NEED_PHP_VERSION" if [ "$BACKENDS" = "" ]; then BACKENDS="ido2db" else BACKENDS="${BACKENDS},ido2db" fi fi # Check merlin prerequisites if necessary echo $NAGVIS_BACKEND | grep -i "MERLINMY" >/dev/null if [ $? -eq 0 ]; then #text "| *** Sorry, no checks yet for merlin" "|" # Check if php mysql module is available check_php_modules "mysql" "$NEED_PHP_VERSION" if [ "$BACKENDS" = "" ]; then BACKENDS="merlinmy" else BACKENDS="${BACKENDS},merlinmy" fi fi if [ -z "$BACKENDS" ]; then log "NO (valid) backend(s) specified" fi BACKENDS=${BACKENDS#,} [ ! -z "$BACKENDS" ] && CALL="$CALL -b $NAGVIS_BACKEND" } # Check Apache PHP module check_apache_php() { DIR=$1 [ ! -d $DIR ] && return WEB_PATH=${DIR%%/} [ -d $DIR/conf.d ]&&WEB_PATH=$WEB_PATH/conf.d # The apache user/group are defined by env vars in Ubuntu, set them here [ -f $DIR/envvars ] && source $DIR/envvars MODPHP=`find $DIR -type f -exec grep -ie "mod_php.*\.so" -e "libphp.*\.so" {} \; | tr -s " " | cut -d" " -f3 | uniq` # Only try to detect user when not set or empty if [ -z "$WEB_USER" ]; then WEB_USER=`find $DIR -type f -name "*conf" -exec grep -i "^User" {} \; | grep -vi "UserDir" | cut -d" " -f2 | uniq` VAR=`echo $WEB_USER | grep "$" >/dev/null 2>&1` [ $? -eq 0 ] && WEB_USER=`eval "echo $WEB_USER"` fi # Only try to detect group when not set or empty if [ -z "$WEB_GROUP" ]; then WEB_GROUP=`find $DIR -type f -name "*.conf" -exec grep -i "^Group" {} \; | cut -d" " -f2 | uniq` VAR=`echo $WEB_GROUP | grep "$" >/dev/null 2>&1` [ $? -eq 0 ] && WEB_GROUP=`eval "echo $WEB_GROUP"` fi } # Check Graphviz version by installed system package check_graphviz_version() { if [ "${PKG##/*/}" = "dpkg" ]; then GRAPHVIZ_VER=`$PKG -l "graphviz" | grep "graphviz" | grep ii | awk -F' ' '{ print $3 }' | sed "s/-.*$//" | cut -d"." -f1,2` elif [ "${PKG##/*/}" = "rpm" ]; then GRAPHVIZ_VER=`$PKG -qa "graphviz" | sed "s/graphviz-//g" | sed "s/-.*$//" | cut -d"." -f1,2` elif [ "${PKG##/*/}" = "pkginfo" ]; then GRAPHVIZ_VER=`$PKG -l "SMCgviz" | grep VERSION | awk '{print $2}'` else GRAPHVIZ_VER=`$PKG list installed "graphviz" | grep "installed" | awk -F' ' '{ print $2 }' | sed "s/-.*$//" | cut -d"." -f1,2` fi GRAPHVIZ_FMT=`fmt_version $GRAPHVIZ_VER` if [ -z "$GRAPHVIZ_VER" ]; then log "WARNING: The Graphviz package was not found." "warning" log " This may not be a problem if you installed it from source" "warning" else log "Graphviz $GRAPHVIZ_VER" $GRAPHVIZ_VER if [ $GRAPHVIZ_FMT -lt $GRAPHVIZ_REQ ]; then log "| Error: Version >= $1" "needed" fi fi } # Check Graphviz Modules check_graphviz_modules() { for MOD in $1 do TMP=`which $MOD 2>/dev/null` [ -z "$TMP" ] && TMP=`which $GRAPHVIZ_PATH/$MOD 2>/dev/null` if [ -s "$TMP" ]; then GV_MOD_VER=`$MOD -V 2>&1` GV_MOD_VER=${GV_MOD_VER#*version } GV_MOD_VER=${GV_MOD_VER% (*} fi log " Graphviz Module $MOD $GV_MOD_VER" $TMP if [ -n "$GV_MOD_VER" ]; then GV_MOD_FMT=`fmt_version $GV_MOD_VER` if [ $GV_MOD_FMT -lt $GRAPHVIZ_REQ ]; then log "| Error: Version >= $2" "needed" fi fi done } # Check PHP Version check_php_version() { if [ "${PKG##/*/}" = "dpkg" ]; then PHP_VER=`$PKG -l "php[0-9]" 2>/dev/null | grep "php" | grep ii | awk -F' ' '{ print $3 }' | sed "s/-.*$//" | cut -d"." -f1,2` elif [ "${PKG##/*/}" = "rpm" ]; then PHP_VER=`$PKG -qa "php[0-9]" | sed "s/php[0-9]\-//g" | sed "s/-.*$//" | cut -d"." -f1,2` else PHP_VER=`$PKG list installed "php[0-9]" 2>/dev/null | grep "installed" | awk -F' ' '{ print $2 }' | sed "s/-.*$//" | cut -d"." -f1,2` fi PHP=`which php 2>/dev/null` if [ -z "$PHP_VER" ]; then if [ -s "$PHP" -a -x "$PHP" ]; then PHP_VER=`$PHP -v | head -1 | sed -e "s/PHP \([0-9\]\+\.[0-9\]\+\).*/\1/"` fi fi log "PHP $PHP_VER" $PHP_VER if [ -n "$PHP_VER" ]; then PHP_FMT=`fmt_version $PHP_VER` PHP_REQ=`fmt_version $NEED_PHP_VERSION` if [ $PHP_FMT -lt $PHP_REQ ]; then log "| Error: Version >= $1" "needed" fi fi } # Check PHP modules check_php_modules() { for MOD in $1 do TMP="" if [ "${PKG##/*/}" = "dpkg" ]; then MOD_VER=`$PKG -l "php[0-9]-$MOD" 2>/dev/null | grep "php" | grep "ii" | awk -F' ' '{ print $3 }' | sed "s/-.*$//" | cut -d"." -f1,2` elif [ "${PKG##/*/}" = "rpm" ]; then MOD_VER=`$PKG -qa "php[0-9]?-$MOD" | sed "s/php[0-9]?\-$MOD-//g" | sed "s/-.*$//" | cut -d"." -f1,2` else MOD_VER=`$PKG list installed "php[0-9]-$MOD" 2>/dev/null | grep "php" | grep "installed" | awk -F' ' '{ print $2 }' | sed "s/-.*$//" | cut -d"." -f1,2` fi # maybe compiled in module if [ -s "$PHP" -a -x "$PHP" ]; then TMP=`$PHP -m 2>&1 | grep -i "^$MOD$"` [ -z "$MOD_VER" -a -n "$TMP" ]&&MOD_VER="compiled_in" fi if [ -z "$TMP" ]; then TMP=`find /etc/ -type f -name "php?" -exec grep -ie "$MOD" {} \; | cut -d"=" -f2` fi # RedHat: /etc/php.d/... if [ -z "$TMP" -a -d /etc/php.d/ ]; then TMP=`grep -ie "$MOD" /etc/php.d/* | cut -d"=" -f2` fi # Ubuntu: /etc/php5/conf.d if [ -z "$TMP" -a -d /etc/php5/conf.d ]; then TMP=`grep -ie "extension=$MOD" /etc/php5/conf.d/* | sed 's/.*=//;s/\.so*//'` fi log " PHP Module: $MOD $MOD_VER" $TMP if [ -n "$MOD_VER" ]; then if [ `echo "$2 $MOD_VER" | awk '{if ($1 > $2) print $1; else print $2}'` = $2 ]; then log " WARNING: Module $MOD not found." "warning" log " This may not be a problem. You can ignore this if your php" "warning" log " was compiled with the module included" "warning" fi fi done } # Check SQLite version check_sqlite_version() { if [ "${PKG##/*/}" = "dpkg" ]; then SQLITE_VER=`$PKG -l "sqlite3" | grep "sqlite" | grep ii | awk -F' ' '{ print $3 }' | sed "s/-.*$//" | cut -d"." -f1,2` elif [ "${PKG##/*/}" = "rpm" ]; then SQLITE_VER=`$PKG -qa "sqlite" | sed "s/sqlite-//g" | sed "s/-.*$//" | cut -d"." -f1,2` else SQLITE_VER=`$PKG list installed "sqlite" | grep "installed" | awk -F' ' '{ print $2 }' | sed "s/-.*$//" | cut -d"." -f1,2` fi SQLITE_FMT=`fmt_version $SQLITE_VER` if [ -z "$SQLITE_VER" ]; then log "WARNING: The SQLite package was not found." "warning" log " This may not be a problem if you installed it from source" "warning" else log "SQLite $SQLITE_VER" $SQLITE_VER if [ $SQLITE_FMT -lt $SQLITE_REQ ]; then log "| Error: Version >= $1" "needed" fi fi } # Check return code chk_rc() { LRC=$? if [ $LRC -ne 0 ]; then echo $* Return Code: $LRC if [ $UNDO -eq 1 ]; then ANS="n" ask_user "ANS" "y" 1 "check_confirm" \ "Do you want to revert to old NagVis version?" if [ "$ANS" = "y" ]; then text "| Trying to revert to old NagVis version" "|" text "| Renaming $NAGVIS_PATH to ${NAGVIS_PATH}_broken" "|" [ -d $NAGVIS_PATH ]&& mv $NAGVIS_PATH ${NAGVIS_PATH}_broken text "| Renaming $NAGVIS_PATH_BACKUP to $NAGVIS_PATH_OLD" "|" [ -d $NAGVIS_PATH_BACKUP ]&& mv $NAGVIS_PATH_BACKUP $NAGVIS_PATH_OLD fi fi exit 1 else if [ "$2" != "" ]; then echo "$2" fi fi } rename_template_files() { DONE="" # 1: source directory SOURCE=$1 # 2: target directory TARGET=$2 # 3: template type TYPE=$3 [ -n "$LINE" ] && DONE=`log "$LINE" done` FILES=`find $NAGVIS_PATH/$SOURCE -type f -printf "%f\n"` IFS=$'\n' for FILE in $FILES; do IFS=" " FILE_NEW=`echo "$FILE" | sed 's/tmpl\.//g' | sed "s/\.html/\.$TYPE\.html/g" | sed "s/\.css/\.$TYPE\.css/g"` cp -p "$NAGVIS_PATH/$SOURCE/$FILE" "$NAGVIS_PATH/$TARGET/$FILE_NEW" chk_rc "| Error renaming $TYPE template file ($SOURCE/$FILE to $TARGET/$FILE_NEW)" "$DONE" done IFS=" " } copy_dir_xpath() { DONE="" # 1: Exclude pattern # 2: Old dir # 3: New dir [ -n "$LINE" ] && DONE=`log "$LINE" done` # Get files and directories to copy. This takes only the elements in the # given directory. # FILES=`find $NAGVIS_PATH_BACKUP/$2 -mindepth 1 -maxdepth 1` FILES=`find $NAGVIS_PATH_BACKUP/$2/* -prune 2> /dev/null` # Maybe exclude some files if [ "$1" != "" ]; then FILES=`echo "$FILES" | grep -vE $1` fi if [ "$FILES" != "" ]; then cp -pr `echo "$FILES" | xargs` $NAGVIS_PATH/$3 chk_rc "| Error copying dir $2 to $3" "$DONE" fi } restore() { copy $NAGVIS_PATH_BACKUP/$1 $NAGVIS_PATH/$1 "$2" "$3" } copy() { DONE="" # DEBUG: [ -n "$LINE" ] && line "$LINE" [ -n "$LINE" ] && DONE=`log "$LINE" done` [ -z "$3" ] && WHAT=$1 || WHAT=$3 # When trying to copy a file/dir which does not exist just skip it if [[ "$1" != */ && ! -e "$1" ]]; then return fi FILTER= if [ "$4" != "" ]; then for F in $4; do FILTER=$FILTER\ --exclude\ $F done fi rsync -aq -f "- .gitignore" $FILTER $1 $2 chk_rc "| Error copying $WHAT" "$DONE" LINE="" DONE="" } set_perm() { if [ -d "$2" -o -f "$2" -o "${2#${2%?}}" = "*" ]; then # Don't do anything when called with globbing and directory is empty if [[ "${2#${2%?}}" = "*" && "`ls -1 "${2%*\*}"`" = "" ]]; then return 0 else DONE=`log "$2" done` chmod $1 $2 chk_rc "| Error setting permissions for $2" "$DONE" fi fi } makedir() { if [ ! -d $1 ]; then DONE=`log "Creating directory $1..." done` mkdir -p $1 chk_rc "| Error creating directory $1" "$DONE" fi } # Main program starting ############################################################################### # More (re)initialisations # Version info NAGVIS_TAG=`fmt_version "$NAGVIS_VER"` [ -z "$NAGVIS_TAG" ]&&NAGVIS_TAG=01000000 if [ $NAGVIS_TAG -lt 01050000 ]; then echo "Error: This installer version only installs NagVis 1.5x or newer" exit 1 fi S=`echo $* | grep -i "\-s icinga"` [ $? -eq 0 ]&&SOURCE=icinga # Default hardcoded Nagios path NAGIOS_PATH="/usr/local/$SOURCE" # Try to detect the Nagios path with some magic detect_nagios_path # Default hardcoded NagVis base NAGVIS_PATH="${NAGIOS_PATH%%nagios}" NAGVIS_PATH="${NAGVIS_PATH%/}/nagvis" NAGVIS_PATH_OLD=$NAGVIS_PATH # Default nagios share webserver path HTML_PATH="/nagvis" # Process command line options if [ $# -gt 0 ]; then while getopts "p:n:m:l:w:W:u:b:g:c:i:s:O:a:ohqvFr" options $OPTS; do case $options in n) NAGIOS_PATH=${OPTARG%/} ;; m) NDO_MOD=$OPTARG ;; l) LIVESTATUS_SOCK=$OPTARG ;; b) GRAPHVIZ_PATH=$OPTARG ;; p) NAGVIS_PATH=${OPTARG%/} NAGVIS_PATH_PARAM_SET=1 if [ $NAGVIS_PATH_OLD_PARAM_SET -eq 0 ]; then NAGVIS_PATH_OLD=$NAGVIS_PATH fi ;; O) NAGVIS_PATH_OLD=${OPTARG%/} NAGVIS_PATH_OLD_PARAM_SET=1 ;; w) WEB_PATH=${OPTARG%/} ;; W) HTML_PATH=$OPTARG ;; u) WEB_USER=$OPTARG ;; g) WEB_GROUP=$OPTARG ;; i) NAGVIS_BACKEND=$OPTARG ;; o) IGNORE_DEMO="demo*cfg demo*png demo*ini.php demo-*.csv" ;; q) INSTALLER_QUIET=1 ;; c) INSTALLER_CONFIG_MOD=$OPTARG ;; s) SOURCE=`echo $OPTARG | tr [A-Z] [a-z]` ;; a) ACONF="$OPTARG" ;; F) FORCE=1 ;; r) REMOVE="y" ;; h) usage exit 0 ;; v) version exit 0 ;; *) echo "Error: Unknown option." usage exit 1 ;; esac done fi if [ $FORCE -eq 1 ]; then if [ -z "$WEB_USER" -o -z "$WEB:GROUP" -o -z "$WEB_PATH" ]; then echo "ERROR: Using '-F' you also have to specify '-u ...', '-g ...' and '-w ...'" exit 1 fi fi find_bin() { bin=$1 case `uname -s` in SunOS) which $bin | grep -v "^no $bin in" ;; *) which $bin 2> /dev/null ;; esac } { # Print welcome message welcome # Start gathering information line "" text "| Starting installation of NagVis $NAGVIS_VER" "|" line "" [ -f /etc/issue ]&&OS=`grep -v "^\s*$" /etc/issue | sed 's/\\\.*//' | head -1` [ -n "$OS" ]&&text "| OS : $OS" "|" text line "Checking for tools" "+" WHICH=`whereis which | awk '{print $2}'` if [ -z $WHICH ]; then log "'which' not found (maybe package missing). Aborting..." exit 1 fi PKG=`find_bin dpkg` [ -z "$PKG" ] && PKG=`find_bin rpm` [ -z "$PKG" ] && PKG=`find_bin yum` [ -z "$PKG" ] && PKG=`find_bin pkginfo` if [ -z "$PKG" ]; then log "No packet manager (rpm/dpkg/yum/pkginfo) found. Aborting..." exit 1 fi log "Using packet manager $PKG" $PKG SED=`which sed` if ! which rsync >/dev/null 2>&1; then log "rsync is not installed. Aborting..." exit 1 fi # checking grep option as non-Linux might not support "-r" grep -r INSTALLER_VERSION install.sh >/dev/null 2>&1 if [ $? -ne 0 ]; then GREP_INCOMPLETE=1 log "grep doesn't support option -r" "warning" fi text line "Checking paths" "+" if [ $FORCE -eq 0 ]; then # Get Nagios/Icinga path ask_user "NAGIOS_PATH" "$NAGIOS_PATH" 1 "check_nagios_path" \ "Please enter the path to the $SOURCE base directory" [ $RC != 1 ] && RC=$? NAGIOS_PATH=${NAGIOS_PATH%/} CALL="$CALL -n $NAGIOS_PATH" # Get NagVis path TMP=$NAGVIS_PATH ask_user "NAGVIS_PATH" "$NAGVIS_PATH" 1 "" \ "Please enter the path to NagVis base" NAGVIS_PATH=${NAGVIS_PATH%/} [ $RC != 1 ] && RC=$? # Also update old path when it was equal to the new directory or empty before [ "$NAGVIS_PATH_OLD" = "" -o "$NAGVIS_PATH_OLD" = "$TMP" ] && NAGVIS_PATH_OLD=$NAGVIS_PATH CALL="$CALL -p $NAGVIS_PATH" # Maybe the user wants to update from NagVis 1.4x. The paths # have changed there. So try to get the old nagvis dir in nagios/share # path. When there is some, ask the user to update that installation. if [ ! -d "$NAGVIS_PATH_OLD" -a -d ${NAGIOS_PATH%/}/share/nagvis -a "$NAGVIS_PATH" != "${NAGIOS_PATH%/}/share/nagvis" ]; then # Found nagvis in nagios/share and this run wants to install NagVis somewhere else NAGVIS_PATH_OLD="${NAGIOS_PATH%/}/share/nagvis" if [ $INSTALLER_QUIET -ne 1 ]; then text "| The installer will install NagVis to $NAGVIS_PATH. But the installer found" "|" text "| another NagVis installation at $NAGVIS_PATH_OLD." "|" ANS="n" ask_user "ANS" "y" 1 "check_confirm" \ "Do you want to update that installation?" if [ "$ANS" != "y" ]; then text "| Okay, not performing an update with changing paths." "|" text "|" "|" NAGVIS_PATH_OLD=$NAGVIS_PATH fi fi CALL="$CALL -O $NAGVIS_PATH_OLD" fi fi # When the old directory exists this is an update run if [ -d "$NAGVIS_PATH_OLD" ]; then INSTALLER_ACTION="update" fi text line "Checking prerequisites" "+" # Set Nagios binary when not set yet [ -f "$NAGIOS_PATH/bin/icinga" ]&&SOURCE=icinga [ -f "$NAGIOS_PATH/bin/nagios" ]&&SOURCE=nagios if [ $FORCE -eq 0 ]; then # Check PHP Version check_php_version $NEED_PHP_VERSION # Check PHP Modules check_php_modules "$NEED_PHP_MODULES" "$NEED_PHP_VERSION" # Check Apache PHP Module check_apache_php "/etc/apache2/" check_apache_php "/etc/apache/" check_apache_php "/etc/http/" check_apache_php "/etc/httpd/" check_apache_php "/usr/local/etc/apache2/" # FreeBSD log " Apache mod_php" $MODPHP # Check Backend prerequisites check_backend # Check Graphviz GRAPHVIZ_REQ=`fmt_version $NEED_GV_VERSION` check_graphviz_version $NEED_GV_VERSION # Check Graphviz Modules check_graphviz_modules "$NEED_GV_MOD" $NEED_GV_VERSION # Check SQLite SQLITE_REQ=`fmt_version $NEED_SQLITE_VERSION` check_sqlite_version $NEED_SQLITE_VERSION if [ $RC -ne 0 ]; then text line "Errors found during check of prerequisites. Aborting..." exit 1 fi text line "Trying to detect Apache settings" "+" HTML_PATH=${HTML_PATH%/} ask_user "HTML_PATH" "$HTML_PATH" 1 "" \ "Please enter the web path to NagVis" HTML_PATH=${HTML_PATH%/} [ $RC != 1 ] && RC=$? ask_user "WEB_USER" "$WEB_USER" 1 "check_web_user" \ "Please enter the name of the web-server user" [ $RC != 1 ] && RC=$? ask_user "WEB_GROUP" "$WEB_GROUP" 1 "check_web_group" \ "Please enter the name of the web-server group" [ $RC != 1 ] && RC=$? ask_user "ACONF" "$ACONF" 1 "check_confirm" \ "create Apache config file" CALL="$CALL -u $WEB_USER -g $WEB_GROUP -w $WEB_PATH -a $ACONF" fi text line "Checking for existing NagVis" "+" if [ -d $NAGVIS_PATH_OLD ]; then if [ -e $NAGVIS_PATH_OLD/nagvis/includes/defines/global.php ]; then NAGVIS_VER_OLD=`cat $NAGVIS_PATH_OLD/nagvis/includes/defines/global.php | grep CONST_VERSION | awk -F"'" '{ print $4 }'` elif [ -e $NAGVIS_PATH_OLD/share/nagvis/includes/defines/global.php ]; then NAGVIS_VER_OLD=`cat $NAGVIS_PATH_OLD/share/nagvis/includes/defines/global.php | grep CONST_VERSION | awk -F"'" '{ print $4 }'` elif [ -e $NAGVIS_PATH_OLD/share/server/core/defines/global.php ]; then NAGVIS_VER_OLD=`cat $NAGVIS_PATH_OLD/share/server/core/defines/global.php | grep CONST_VERSION | awk -F"'" '{ print $4 }'` else NAGVIS_VER_OLD="UNKNOWN" fi # Generate the version tag for old version if [ "$NAGVIS_VER_OLD" != "UNKNOWN" ]; then NAGVIS_TAG_OLD=`fmt_version "$NAGVIS_VER_OLD"` else NAGVIS_TAG_OLD=01000000 fi NAGVIS_PATH_BACKUP=$NAGVIS_PATH_OLD.old-$DATE log "NagVis $NAGVIS_VER_OLD" $NAGVIS_VER_OLD fi if [ "$INSTALLER_ACTION" = "update" ]; then if [ $INSTALLER_QUIET -ne 1 ]; then ask_user "INSTALLER_CONFIG_MOD" "$INSTALLER_CONFIG_MOD" 1 "check_confirm" \ "Do you want the installer to update your config files when possible?" ask_user "REMOVE" "$REMOVE" 1 "check_confirm" \ "Remove backup directory after successful installation?" fi fi text line "" text "| Summary" "|" line "" text "| NagVis home will be: $NAGVIS_PATH" "|" text "| Owner of NagVis files will be: $WEB_USER" "|" text "| Group of NagVis files will be: $WEB_GROUP" "|" text "| Path to Apache config dir is: $WEB_PATH" "|" if [ "$ACONF" = "y" -o "$ACONF" = "Y" ]; then text "| Apache config will be created: yes" "|" else text "| Apache config will be created: NO" "|" fi text if [ "$IGNORE_DEMO" != "" ]; then text "| demo files will NOT be copied" "|" text fi text "| Installation mode: $INSTALLER_ACTION" "|" if [ "$INSTALLER_ACTION" = "update" ]; then if [ $NAGVIS_PATH != $NAGVIS_PATH_OLD ]; then text "| Old NagVis home: $NAGVIS_PATH_OLD" "|" fi text "| Old version: $NAGVIS_VER_OLD" "|" text "| New version: $NAGVIS_VER" "|" text "| Backup directory: $NAGVIS_PATH_BACKUP" "|" text text "| Note: The current NagVis directory will be moved to the backup directory." "|" if [ "$REMOVE" = "y" ]; then text "| The backup directory will be removed after successful installation. " "|" else text "| The backup directory will be NOT removed after successful installation. " "|" fi if [ ! "$NAGVIS_VER_OLD" = "UNKNOWN" ]; then text "| Your configuration files will be copied." "|" if [ "$INSTALLER_CONFIG_MOD" = "y" ]; then text "| The configuration files will be updated if possible." "|" else text "| The configuration files will NOT be updated. Please check the " "|" text "| changelog for any changes which affect your configuration files." "|" fi else text text "| !!! UPDATE FROM VERSION \"$NAGVIS_VER_OLD\" IS NOT SUPPORTED !!!" "|" text "| You have to move your custom files manually from backup directory." "|" fi fi text if [ $INSTALLER_QUIET -ne 1 ]; then confirm "Do you really want to continue?" "y" if [ "$ANS" != "Y" ]; then text text "| Installer aborted, exiting..." "|" line "" exit 1 fi fi line "" text "| Starting installation" "|" line "" if [ "$INSTALLER_ACTION" = "update" ]; then DONE=`log "Moving old NagVis to $NAGVIS_PATH_BACKUP.." done` mv $NAGVIS_PATH_OLD $NAGVIS_PATH_BACKUP chk_rc "| Error moving old NagVis $NAGVIS_PATH_BACKUP" "$DONE" fi # in case of errors switch to old NagVis directory UNDO=1 # Create base path makedir "$NAGVIS_PATH" # Create non shared var directory when not exists makedir "$NAGVIS_PATH/var" makedir "$NAGVIS_PATH/var/tmpl/cache" makedir "$NAGVIS_PATH/var/tmpl/compile" # Create shared var directory when not exists makedir "$NAGVIS_PATH/share/var" # Copy all desired files LINE="Copying files to $NAGVIS_PATH..." copy "share" "$NAGVIS_PATH" copy "etc" "$NAGVIS_PATH" makedir "$NAGVIS_PATH/etc/conf.d" makedir "$NAGVIS_PATH/etc/profiles" copy "README" "$NAGVIS_PATH" copy "LICENCE" "$NAGVIS_PATH" copy "docs" "$NAGVIS_PATH/share/" "" "*/cleanup_new_notes.sh" cmp_js $NAGVIS_PATH/share/frontend/nagvis-js/js # Remove demo maps if desired if [ "$IGNORE_DEMO" != "" ]; then for i in $IGNORE_DEMO; do DONE=`log "Removing file(s) $i" done` find $NAGVIS_PATH -name "$i" -exec rm {} \; chk_rc "| Error removing $i" "$DONE" done fi # Create main configuration file from sample when no file exists if [ -f $NAGVIS_PATH/${NAGVIS_CONF}-sample ]; then NAGVIS_CFG=$NAGVIS_PATH/$NAGVIS_CONF DONE=`log "Creating main configuration file..." done` if [ -f $NAGVIS_CFG ]; then text "| *** $NAGVIS_CFG will NOT be overwritten !" "|" NAGVIS_CFG=$NAGVIS_PATH/$NAGVIS_CONF.inst text "| *** creating $NAGVIS_CFG instead" "|" fi cp -p $NAGVIS_PATH/${NAGVIS_CONF}-sample $NAGVIS_CFG chk_rc "| Error copying sample configuration" "$DONE" # add sesscookiepath grep ";sesscookiepath=\"$HTML_PATH\"" $NAGVIS_CFG >/dev/null if [ $? -eq 1 ]; then DONE=`log "adding sesscookie=$HTML_PATH" done` $SED -i "s#;\(sesscookiepath\)=\(.*\)#;\1=\2\n\1=\"$HTML_PATH\"#g" $NAGVIS_CFG chk_rc "| Error adding sesscookiepath" "$DONE" fi # add NagVis base grep ";base=\"$NAGVIS_PATH/\"" $NAGVIS_CFG >/dev/null if [ $? -eq 1 ]; then DONE=`log "adding base=\"$NAGVIS_PATH\"" done` $SED -i "s#;\(base\)=\(.*\)#;\1=\2\n\1=\"$NAGVIS_PATH/\"#g" $NAGVIS_CFG chk_rc "| Error adding base path" "$DONE" fi # add htmlbase grep ";htmlbase=\"$HTML_PATH\"" $NAGVIS_CFG >/dev/null if [ $? -eq 1 ]; then DONE=`log "adding htmlbase=\"$HTML_PATH\"" done` $SED -i "s#;\(htmlbase\)=\(.*\)#;\1=\2\n\1=\"$HTML_PATH\"#g" $NAGVIS_CFG chk_rc "| Error adding htmlbase" "$DONE" fi # add htmlcgi grep ";htmlcgi=\"/$SOURCE/cgi-bin\"" $NAGVIS_CFG >/dev/null if [ $? -eq 1 ]; then DONE=`log "adding htmlcgi=/$SOURCE/cgi-bin" done` $SED -i "s#;\(htmlcgi\)=\(.*\)#;\1=\2\n\1=\"/$SOURCE/cgi-bin\"#g" $NAGVIS_CFG chk_rc "| Error adding htmlcgi" "$DONE" fi # add dbname grep ";dbname=\"$SOURCE\"" $NAGVIS_CFG >/dev/null if [ $? -eq 1 ]; then DONE=`log "adding dbname=$SOURCE" done` $SED -i "s#;\(dbname\)=\(\"nagios\"\)#;\1=\2\n\1=\"$SOURCE\"#g" $NAGVIS_CFG chk_rc "| Error adding dbname" "$DONE" fi # add dbprefix grep ";dbprefix=\"${SOURCE}_\"" $NAGVIS_CFG >/dev/null if [ $? -eq 1 ]; then DONE=`log "adding dbprefix=${SOURCE}_" done` $SED -i "s#;\(dbprefix\)=\(\"nagios_\"\)#;\1=\2\n\1=\"${SOURCE}_\"#g" $NAGVIS_CFG chk_rc "| Error adding dbprefix" "$DONE" fi # Set the new default backend_id. Don't need to treat livestatus here because # it is the hardcoded default value in NagVis. echo $NAGVIS_BACKEND | grep "merlinmy" >/dev/null [ $? -eq 0 ]&&NEWBACK="merlinmy_1" echo $NAGVIS_BACKEND | grep "ido2db" >/dev/null [ $? -eq 0 ]&&NEWBACK="ndomy_1" echo $NAGVIS_BACKEND | grep "ndo2db" >/dev/null [ $? -eq 0 ]&&NEWBACK="ndomy_1" if [ ! -z "$NEWBACK" ]; then DONE=`log "setting backend to $NEWBACK" done` $SED -i "s#;\(backend\)=\(.*\)#;\1=\2\n\1=\"$NEWBACK\"#g" $NAGVIS_CFG chk_rc "| Error setting backend" "$DONE" fi # Add livestatus backend when configured to use MKLivestatus if [ ! -z "$LIVESTATUS_SOCK" ]; then DONE=`log " Adding MKLivestatus Backend..." done` $SED -i 's#;socket="unix:/usr/local/nagios/var/rw/live"#socket="'"$LIVESTATUS_SOCK"'"#g' $NAGVIS_CFG chk_rc "| Error adding MKLivstatus Backend" "$DONE" fi # Add the webservers group to use it with chgrp calls in NagVis DONE=`log " Adding webserver group to file_group..." done` $SED -i 's#;file_group=""#file_group="'"$WEB_GROUP"'"#g' $NAGVIS_CFG chk_rc "| Error adding file_group" "$DONE" fi # Create apache configuration file from sample when no file exists if [ -f $NAGVIS_PATH/$HTML_SAMPLE ]; then if [ "$ACONF" = "n" -o "$ACONF" = "N" ]; then text "| *** creation of $WEB_PATH/$HTML_CONF will be SKIPPED !" "|" else CHG='s/^//' if [ -s $WEB_PATH/$HTML_CONF ]; then text "| *** $WEB_PATH/$HTML_CONF will NOT be overwritten !" "|" HTML_CONF="$HTML_CONF.$DATE" text "| *** creating $WEB_PATH/$HTML_CONF instead (commented out config)" "|" CHG='s/^/#new /' fi DONE=`log "Creating web configuration file..." done` # Replace macros in sample configuration file cat $NAGVIS_PATH/$HTML_SAMPLE | $SED "s#@NAGIOS_PATH@#$NAGIOS_PATH#g;s#@NAGVIS_PATH@#$NAGVIS_PATH/share#g;s#@NAGVIS_WEB@#$HTML_PATH#g;$CHG" > $WEB_PATH/$HTML_CONF chk_rc "| Error creating web configuration" "$DONE" DONE=`log "Setting permissions for web configuration file..." done` chown $WEB_USER:$WEB_GROUP $WEB_PATH/$HTML_CONF chk_rc "| Error setting web conf permissions" "$DONE" fi fi text if [ "$INSTALLER_ACTION" = "update" -a "$NAGVIS_VER_OLD" != "UNKNOWN" ]; then NAGVIS_DIR="share/nagvis" USERFILES_DIR="share/userfiles" if [ $NAGVIS_TAG_OLD -ge 01050000 ]; then LINE="Restoring main configuration file(s)..." restore "$NAGVIS_CONF" "main configuration file" "" restore "etc/nagvis-site.ini.php" "site main configuration file" "" LINE="Restoring custom map configuration files..." restore "etc/maps/" "map configuration files" "/demo*.cfg" LINE="Restoring custom geomap source files..." restore "etc/geomap/" "geomap source files" "/demo*.csv" LINE="Restoring user configuration files..." if [ -d $NAGVIS_PATH_BACKUP/etc/profiles ]; then restore "etc/profiles/" "user configuration files" "" fi if [ -d $NAGVIS_PATH_BACKUP/etc/conf.d ]; then LINE="Restoring conf.d/ configuration files..." restore "etc/conf.d/" "conf.d configuration files" "" fi LINE="Restoring custom map images..." restore "$USERFILES_DIR/images/maps/" "map image files" "/demo*.png" LINE="Restoring custom gadget images..." restore "$USERFILES_DIR/images/gadgets/" "gadget image files" "" LINE="Restoring custom iconsets..." restore "$USERFILES_DIR/images/iconsets/" "iconset files" "/20x20.png /std_*_*.png /demo_*.png" LINE="Restoring custom shapes..." restore "$USERFILES_DIR/images/shapes/" "shapes" "*demo*png /std_*" LINE="Restoring custom templates..." restore "$USERFILES_DIR/templates/" "templates" "/default.*" LINE="Restoring custom template images..." restore "$USERFILES_DIR/images/templates/" "template images" "/default.*" LINE="Restoring custom gadgets..." restore "$USERFILES_DIR/gadgets/" "gadgets" "/gadgets_core.php /std_*.php" if [ -d $NAGVIS_PATH_BACKUP/$USERFILES_DIR/scripts/ ]; then LINE="Restoring custom scripts..." restore "$USERFILES_DIR/scripts/" "scripts" "/std_*.php" fi LINE="Restoring auth database file..." restore "$NAGVIS_AUTH_DB" "auth database file" "" restore "$AUTH_BACKUP" "auth backup file" "" LINE="Restoring custom stylesheets..." restore "$USERFILES_DIR/styles/" "stylesheets" "" else # This is a cross version update. For example from 1.4x to 1.5x LINE="Restoring main configuration file..." restore "$NAGVIS_CONF" "main configuration file" "" LINE="Restoring custom map configuration files..." copy_dir_xpath "\/(demo\.cfg|demo2\.cfg|demo-server\.cfg|demo-map\.cfg)$" "etc/maps" "etc/maps" "map configuration files" LINE="Restoring custom map images..." copy_dir_xpath "\/nagvis-demo\.png$" "nagvis/images/maps" "$USERFILES_DIR/images/maps" "map image files" LINE="Restoring custom gadget images..." copy_dir_xpath "" "nagvis/images/gadgets" "$USERFILES_DIR/images/gadgets" "gadget image files" LINE="Restoring custom iconsets..." copy_dir_xpath "\/(20x20\.png|std_(big|medium|small)\.png|demo_.+\.png)$" "nagvis/images/iconsets" "$USERFILES_DIR/images/iconsets" "iconset files" LINE="Restoring custom shapes..." copy_dir_xpath "" "nagvis/images/shapes" "$USERFILES_DIR/images/shapes" "shapes" LINE="Restoring custom templates..." copy_dir_xpath "\/tmpl\.default.+$" "nagvis/templates" "$USERFILES_DIR/templates" "hover templates" LINE="Renaming custom hover templates" rename_template_files "$USERFILES_DIR/templates/hover" "$USERFILES_DIR/templates" "hover" LINE="Renaming custom context templates" rename_template_files "$USERFILES_DIR/templates/context" "$USERFILES_DIR/templates" "context" LINE="Restoring custom gadgets..." copy_dir_xpath "\/(gadgets_core\.php|std_.+\.php)$" "nagvis/gadgets" "$USERFILES_DIR/gadgets" "gadgets" text "|" "|" text "| IMPORTANT: When upgrading from previous 1.5.0 to 1.5.x version you need" "|" text "| to migrate eventually custom templates by hand because the " "|" text "| template format has totally changed. The template images are" "|" text "| unhandled too." "|" fi fi text # Do some update tasks (Changing options, notify about deprecated options) if [ "$INSTALLER_ACTION" = "update" -a "$NAGVIS_VER_OLD" != "UNKNOWN" -a "$INSTALLER_CONFIG_MOD" = "y" ]; then line text "| Handling changed/removed options" "|" line # Only perform the actions below for NagVis 1.5.x or newer installations if [ $NAGVIS_TAG -ge 01050000 ]; then DONE=`log "Removing allowedforconfig option from main config..." done` sed -i '/^allowedforconfig=/d' $NAGVIS_PATH/etc/nagvis.ini.php chk_rc "| Error" "$DONE" DONE=`log "Removing autoupdatefreq option from main config..." done` sed -i '/^autoupdatefreq=/d' $NAGVIS_PATH/etc/nagvis.ini.php chk_rc "| Error" "$DONE" DONE=`log "Removing htmlwuijs option from main config..." done` sed -i '/^htmlwuijs=/d' $NAGVIS_PATH/etc/nagvis.ini.php chk_rc "| Error" "$DONE" DONE=`log "Removing wuijs option from main config..." done` sed -i '/^wuijs=/d' $NAGVIS_PATH/etc/nagvis.ini.php chk_rc "| Error" "$DONE" DONE=`log "Removing showautomaps option from main config..." done` sed -i '/^showautomaps=/d' $NAGVIS_PATH/etc/nagvis.ini.php chk_rc "| Error" "$DONE" # Remove base and htmlbase path from cross path updated main # configuration file if [ "$NAGVIS_PATH_OLD" != "$NAGVIS_PATH" ]; then DONE=`log "Uncommenting base path during cross-path update..." done` sed -i 's/^base=\(.*\)$/;base=\1/g' $NAGVIS_PATH/etc/nagvis.ini.php chk_rc "| Error" "$DONE" DONE=`log "Uncommenting htmlbase path during cross-path update..." done` sed -i 's/^htmlbase=\(.*\)$/;htmlbase=\1/g' $NAGVIS_PATH/etc/nagvis.ini.php chk_rc "| Error" "$DONE" DONE=`log "Uncommenting sesscookiepath during cross-path update..." done` sed -i 's/^sesscookiepath=\(.*\)$/;sesscookiepath=\1/g' $NAGVIS_PATH/etc/nagvis.ini.php chk_rc "| Error" "$DONE" fi DONE=`log "Removing usegdlibs option from main config..." done` sed -i '/^usegdlibs=/d' $NAGVIS_PATH/etc/nagvis.ini.php chk_rc "| Error" "$DONE" DONE=`log "Removing displayheader option from main config..." done` sed -i '/^displayheader=/d' $NAGVIS_PATH/etc/nagvis.ini.php chk_rc "| Error" "$DONE" DONE=`log "Removing hovertimeout option from main config..." done` sed -i '/^hovertimeout=/d' $NAGVIS_PATH/etc/nagvis.ini.php chk_rc "| Error" "$DONE" DONE=`log "Removing allowed_for_config option from map configs..." done` grep -r '^allowed_for_config=' $NAGVIS_PATH/etc/maps/*.cfg >> $NAGVIS_PATH/$AUTH_BACKUP sed -i '/^allowed_for_config=/d' $NAGVIS_PATH/etc/maps/*.cfg chk_rc "| Error" "$DONE" DONE=`log "Removing allowed_user from map configs..." done` grep -r '^allowed_user=' $NAGVIS_PATH/etc/maps/*.cfg >> $NAGVIS_PATH/$AUTH_BACKUP sed -i '/^allowed_user=/d' $NAGVIS_PATH/etc/maps/*.cfg chk_rc "| Error" "$DONE" DONE=`log "Removing hover_timeout from map configs..." done` sed -i '/^hover_timeout=/d' $NAGVIS_PATH/etc/maps/*.cfg chk_rc "| Error" "$DONE" DONE=`log "Removing usegdlibs from map configs..." done` sed -i '/^usegdlibs=/d' $NAGVIS_PATH/etc/maps/*.cfg chk_rc "| Error" "$DONE" line fi # Maybe this is useful in the future? => Updates for special versions #if [ $NAGVIS_TAG_OLD -ge 01030000 ] && [ $NAGVIS_TAG_OLD -lt 01050000 ]; then # text "| Version specific changes from 1.3.x or 1.4.x " "|" # text # line "Applying changes to main configuration file..." # text "| oops, no changes yet" "|" # chk_rc "| Error" "| done" # line "Applying changes to map configuration files..." # text "| oops, no changes yet" "|" # chk_rc "| Error" "| done" #fi text "| HINT: Please check the changelog or the documentation for changes which" "|" text "| affect your configuration files" "|" fi text line "Setting permissions..." "+" chown -R $WEB_USER:$WEB_GROUP $NAGVIS_PATH [ -f "$NAGVIS_PATH/$NAGVIS_CONF-sample" ]&&set_perm 664 "$NAGVIS_PATH/$NAGVIS_CONF-sample" set_perm 775 "$NAGVIS_PATH/etc" set_perm 775 "$NAGVIS_PATH/etc/maps" set_perm 664 "$NAGVIS_PATH/etc/maps/*" set_perm 775 "$NAGVIS_PATH/etc/geomap" set_perm 664 "$NAGVIS_PATH/etc/geomap/*" set_perm 775 "$NAGVIS_PATH/etc/profiles" set_perm 664 "$NAGVIS_PATH/etc/profiles/*" set_perm 775 "$NAGVIS_PATH/share/userfiles/images/maps" set_perm 664 "$NAGVIS_PATH/share/userfiles/images/maps/*" set_perm 775 "$NAGVIS_PATH/share/userfiles/images/shapes" set_perm 664 "$NAGVIS_PATH/share/userfiles/images/shapes/*" set_perm 775 "$NAGVIS_PATH/var" set_perm 664 "$NAGVIS_PATH/var/*" set_perm 775 "$NAGVIS_PATH/var/tmpl" set_perm 775 "$NAGVIS_PATH/var/tmpl/cache" set_perm 775 "$NAGVIS_PATH/var/tmpl/compile" set_perm 775 "$NAGVIS_PATH/share/var" set_perm 664 "$NAGVIS_PATH/share/var/*" text if [ "$INSTALLER_ACTION" = "update" -a "$REMOVE" = "y" ]; then DONE=`log "Removing backup directory" done` rm -rf $NAGVIS_PATH_BACKUP chk_rc "| Error removing directory user configuration" "$DONE" fi line text "| Installation complete" "|" text text "| You can safely remove this source directory." "|" text text "| For later update/upgrade you may use this command to have a faster update:" "|" text "| $CALL" text if [ "$INSTALLER_ACTION" = "update" ] && [ $NAGVIS_TAG_OLD -lt 01050000 ]; then text "| 1.4 to 1.6x upgrade: The map permissions have ben reset. Old permissions" "|" text "| have been backed up in nagvis/etc/auth-backup file. You need to migrate" "|" text "| these permissions manually using using the new user/role management GUI." "|" text fi text "| What to do next?" "|" text "| - Read the documentation" "|" text "| - Maybe you want to edit the main configuration file?" "|" text "| Its location is: $NAGVIS_PATH/$NAGVIS_CONF" "|" text "| - Configure NagVis via browser" "|" text "| " "|" text "| - Initial admin credentials:" "|" text "| Username: admin" "|" text "| Password: admin" "|" line } 2>&1 | tee $LOG exit 0 nagvis-1.7.10+dfsg1/install_lib000066400000000000000000000041421225466040700163150ustar00rootroot00000000000000# Holds common install function used e.g. by install.sh and omd_install.sh cmp() { cat $1 | sed 's#\(var\)\s*\(\S*\)\s*=\s*#\1 \2=#;s#^\s*##;s#\s*$##;s#\t+# #g' | awk ' BEGIN { OK=1; braces=0 } { # Remove /* */ one line comments sub(/\/\*[^@]*\*\//,""); # Remove // comments (line beginning) sub(/^\/\/.*/,""); # Count braces anz1 = gsub(/\{/,"{"); anz2 = gsub(/}/,"}"); if (OK == 1) { braces += anz1; braces -= anz2; } } /\/\*/ { c = gsub(/\/\*[^@]*$/,""); if(c > 0) { OK=0; } } /\*\/$/ { c = gsub(/^[^@]*\*\//,""); if(c > 0) { OK=1; } } { line = $0; #anz = gsub(/function/," function"); #ch = substr(line,length(line)); if (OK == 1) { if (length(line) > 0) { #if (ch == "}") { # if (braces == 0) { # if (length(line) > 0) { # print line # } # line = "" # } #} #line = line $0; print line; } } } ' >> $OUT } cmp_js() { pushd $1 >/dev/null OUT=NagVisCompressed.js >$OUT cmp ExtStacktrace.js cmp nagvis.js cmp edit.js cmp popupWindow.js cmp ExtBase.js cmp frontendMessage.js cmp frontendEventlog.js cmp frontendHover.js cmp hover.js cmp frontendContext.js cmp ajax.js cmp ajaxActions.js cmp dynfavicon.js cmp frontend.js cmp lines.js cmp NagVisObject.js cmp NagVisStatefulObject.js cmp NagVisStatelessObject.js cmp NagVisHost.js cmp NagVisService.js cmp NagVisHostgroup.js cmp NagVisServicegroup.js cmp NagVisMap.js cmp NagVisShape.js cmp NagVisLine.js cmp NagVisTextbox.js cmp NagVisContainer.js cmp NagVisRotation.js cmp ExtWzJsGraphics.js cmp ExtGenericResize.js cmp ExtJSColor.js popd >/dev/null } nagvis-1.7.10+dfsg1/nagvis-make-admin000077500000000000000000000043501225466040700173150ustar00rootroot00000000000000#!/bin/bash ############################################################################### # # nagvis-make-admin.sh - This script assigns the Administrators role to the # given user. # # Copyright (c) 2004-2011 NagVis Project (Contact: info@nagvis.org) # # Development: # Lars Michelsen # # License: # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # ############################################################################### if [ ! -f auth.db ]; then echo "auth.db not found. Please make sure you execute this script in the etc/ directory of NagVis." exit 1 fi if ! which sqlite3 >/dev/null 2>&1; then echo "Unable to find the sqlite3 binary in PATH. You need to install it to use this script." exit 1 fi USER=$1 if [ -z "$USER" ]; then echo "No username given. Please specify the username of an existing user as argument." exit 1 fi USER_ID=$(sqlite3 auth.db "SELECT userId FROM users WHERE name='$USER';") if [ -z "$USER_ID" ]; then echo "User does not exist in sqlite database." exit 1 fi RID=$(sqlite3 auth.db "SELECT roleId FROM roles WHERE name='Administrators';") if [ -z "$RID" ]; then echo "Could not find the Administrators roles. Did you remove it?" exit 1 fi echo $USER_ID echo $RID if [ $(sqlite3 auth.db "SELECT count(*) FROM users2roles WHERE userId=$USER_ID and roleId=$RID") = "1" ]; then echo "The user $USER is already Administrator. Nothing to do." exit 0 fi echo -n "Adding Administrators role to user $USER..." if sqlite3 auth.db "INSERT INTO users2roles (userId, roleId) VALUES ($USER_ID, $RID)"; then echo "done." exit 0 else echo "ERROR!" exit 1 fi nagvis-1.7.10+dfsg1/omd_install.sh000077500000000000000000000224001225466040700167370ustar00rootroot00000000000000#!/bin/bash # omd_install.sh - Installs NagVis to the local/ path of OMD sites # # Copyright (c) 2004-2011 NagVis Project (Contact: info@nagvis.org) # # Development: # Lars Michelsen # # License: # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. echo "+--------------------------------------------------------------------+" echo "| This script installs NagVis into the local/ path of your OMD site. |" echo "| The installation in the local/ path will then override the default |" echo "| NagVis installation included with OMD. |" echo "| |" echo "| When installed in local/ path NagVis will use the config and user |" echo "| files of the site. |" echo "| |" echo "| RECOMMENDED ONLY FOR TESTING |" echo "+--------------------------------------------------------------------+" if [ -z "$OMD_SITE" ] || [ -z "$OMD_ROOT" ]; then echo "ERROR: You are not running this inside an OMD site." echo " Check out http://omdistro.org/ for easy installable and manageable Nagios." exit 1 fi echo -n "Do you really want to continue? [y] " read OPT if [ ! -z "$OPT" ] && [ $OPT != "y" ]; then echo "Terminated by user." exit 1 fi CWD="$(cd "$(dirname "$0")" && pwd)" . $CWD/install_lib echo "Installing..." # 1.5 had the userfiles dir in $OMD_ROOT/var/nagvis/userfiles # Test if this is the first installation of NagVis 1.6x in this # site. If so: Copy the contents of the old userfiles dir to the # new location if [ ! -d $OMD_ROOT/local/share/nagvis/htdocs/userfiles ]; then mkdir -p $OMD_ROOT/local/share/nagvis/htdocs/userfiles cp -r $OMD_ROOT/var/nagvis/userfiles/* $OMD_ROOT/local/share/nagvis/htdocs/userfiles fi mkdir -p $OMD_ROOT/var/nagvis/profiles mkdir -p $OMD_ROOT/local/share/nagvis/htdocs cp -r $CWD/share/* $OMD_ROOT/local/share/nagvis/htdocs cp -r $CWD/docs $OMD_ROOT/local/share/nagvis/htdocs/ cmp_js $OMD_ROOT/local/share/nagvis/htdocs/frontend/nagvis-js/js # Update "old" (1.5) userfiles dir if [ -d $OMD_ROOT/var/nagvis/userfiles ]; then cp -r $CWD/share/userfiles/* $OMD_ROOT/var/nagvis/userfiles fi # Handle the old and new omd specific config file paths OMD_CFG=$OMD_ROOT/etc/nagvis/conf.d/omd.ini.php if [ ! -d $OMD_ROOT/etc/nagvis/conf.d ]; then mkdir $OMD_ROOT/etc/nagvis/conf.d if [ -f $OMD_ROOT/etc/nagvis/nagvis-omd.ini.php ]; then mv $OMD_ROOT/etc/nagvis/nagvis-omd.ini.php $OMD_ROOT/etc/nagvis/conf.d/omd.ini.php ln -s $OMD_ROOT/etc/nagvis/conf.d/omd.ini.php $OMD_ROOT/etc/nagvis/nagvis-omd.ini.php fi fi # Backup the omd.ini.php on first time using omd_install.sh if ! grep omd_install.sh $OMD_CFG >/dev/null 2>&1; then cp $OMD_CFG $OMD_CFG.bak fi # Update omd specific nagvis.ini.php file cat > $OMD_CFG < ; ----------------------------------------------------------------- ; Don't touch this file. It is under control of OMD. Modifying this ; file might break the update mechanism of OMD. ; ; If you want to customize your NagVis configuration please use the ; etc/nagvis/nagvis.ini.php file. ; ; Tainted by omd_install.sh for installation to local/ ; ----------------------------------------------------------------- [global] sesscookiepath="/$OMD_SITE/nagvis" [paths] base="$OMD_ROOT/local/share/nagvis/" cfg="$OMD_ROOT/etc/nagvis/" mapcfg="$OMD_ROOT/etc/nagvis/maps/" geomap="$OMD_ROOT/etc/nagvis/geomap/" var="$OMD_ROOT/tmp/nagvis/" sharedvar="$OMD_ROOT/tmp/nagvis/share/" profiles="$OMD_ROOT/var/nagvis/profiles/" htmlbase="/$OMD_SITE/nagvis" htmlcgi="/$OMD_SITE/nagios/cgi-bin" [defaults] backend="$OMD_SITE" [backend_$OMD_SITE] backendtype="mklivestatus" socket="unix:$OMD_ROOT/tmp/run/live" EOF # Backup the agvis.conf on first time using omd_install.sh if ! grep omd_install.sh $OMD_ROOT/etc/apache/conf.d/nagvis.conf >/dev/null 2>&1; then cp $OMD_ROOT/etc/apache/conf.d/nagvis.conf $OMD_ROOT/etc/apache/conf.d/nagvis.conf.bak fi cat > $OMD_ROOT/etc/apache/conf.d/nagvis.conf < Options FollowSymLinks AllowOverride None Options FollowSymLinks AllowOverride None # With installed and enabled mod_rewrite there are several redirections # available to fix deprecated and/or wrong urls. None of those rules is # mandatory to get NagVis working. RewriteEngine On RewriteBase /$OMD_SITE/nagvis # Use mod_rewrite for old url redirection even if there are php files which # redirect the queries itselfs. In some cases the mod_rewrite redirect # is better than the php redirect. #RewriteCond %{REQUEST_URI} ^/$OMD_SITE/nagvis(/config\.php|/index\.php|/|)(\?.*|)$ #RewriteRule ^(index\.php|)(\?.*|)$ /$OMD_SITE/nagvis/frontend/nagvis-js/\$1\$2 [R=301,L] # Redirect old regular map links RewriteCond %{REQUEST_URI} ^/$OMD_SITE/nagvis/frontend/(nagvis-js|wui) RewriteCond %{QUERY_STRING} map=(.*) RewriteRule ^(.*)$ /$OMD_SITE/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=%1 [R=301,L] # Without map= param RewriteCond %{REQUEST_URI} ^/$OMD_SITE/nagvis/frontend(/wui)?/?(index.php)?$ RewriteRule ^(.*)$ /$OMD_SITE/nagvis/frontend/nagvis-js/index.php [R=301,L] # Redirect old rotation calls RewriteCond %{REQUEST_URI} ^/$OMD_SITE/nagvis/frontend/nagvis-js RewriteCond %{QUERY_STRING} !mod RewriteCond %{QUERY_STRING} rotation=(.*) RewriteRule ^(.*)$ /$OMD_SITE/nagvis/frontend/nagvis-js/index.php?mod=Rotation&act=view&show=%1 [R=301,L] EOF patch -s $OMD_ROOT/local/share/nagvis/htdocs/server/core/defines/global.php < $ARCH echo "Output: $ARCH" nagvis-1.7.10+dfsg1/share/000077500000000000000000000000001225466040700151775ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/share/config.php000066400000000000000000000022271225466040700171600ustar00rootroot00000000000000 nagvis-1.7.10+dfsg1/share/frontend/000077500000000000000000000000001225466040700170165ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/000077500000000000000000000000001225466040700207175ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/classes/000077500000000000000000000000001225466040700223545ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/classes/FrontendMessage.php000066400000000000000000000066321225466040700261600ustar00rootroot00000000000000message = $message; $this->title = 'ERROR'; $this->type = 'error'; $this->pathHtmlBase = cfg('paths', 'htmlbase'); } /** * Build a message box for the user in HTML format * * @return String Returns the html code of this message * @access private * @author Michael Luebben * @author Lars Michelsen */ private function buildMessage() { $content = ''; $content .= ''."\n"; $content .= '
    '."\n"; $content .= ' '."\n"; $content .= ' '."\n"; $content .= ' '."\n"; $content .= ' '."\n"; $content .= ' '."\n"; $content .= ' '."\n"; $content .= ' '."\n"; $content .= ' '."\n"; $content .= ' '."\n"; $content .= ' '."\n"; $content .= '
    '."\n"; $content .= '
    '."\n"; $content .= ' '."\n"; $content .= ' '.$this->title.''."\n"; $content .= ' '."\n"; $content .= ' '."\n"; $content .= '
    '.$this->message.'
    '."\n"; $content .= '
    '."\n"; return $content; } /** * Print the message box * * return String HTML Code * @access private * @author Michael Luebben */ public function __toString () { return $this->buildMessage(); } } ?> nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/classes/FrontendModInfo.php000066400000000000000000000033351225466040700261240ustar00rootroot00000000000000 */ class FrontendModInfo extends FrontendModule { public function __construct($CORE) { $this->sName = 'Info'; $this->CORE = $CORE; $this->aActions = Array('view' => !REQUIRES_AUTHORISATION); $this->FHANDLER = new FrontendRequestHandler($_POST); } public function handleAction() { $sReturn = ''; if($this->offersAction($this->sAction)) { switch($this->sAction) { case 'view': $sReturn = $this->displayDialog(); break; } } return $sReturn; } private function displayDialog() { $VIEW = new NagVisInfoView($this->CORE); return $VIEW->parse(); } } ?>nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/classes/FrontendModLogonDialog.php000066400000000000000000000040201225466040700274170ustar00rootroot00000000000000 */ class FrontendModLogonDialog extends FrontendModule { protected $CORE; public function __construct($CORE) { $this->sName = 'LogonDialog'; $this->CORE = $CORE; $this->aActions = Array('view' => !REQUIRES_AUTHORISATION); } public function handleAction() { global $AUTH; $sReturn = ''; if($this->offersAction($this->sAction)) { switch($this->sAction) { case 'view': // Check if user is already authenticated if(!$AUTH->isAuthenticated()) { $VIEW = new NagVisLoginView($this->CORE); $sReturn = $VIEW->parse(); } else { // When the user is already authenticated redirect to start page (overview) Header('Location:'.CoreRequestHandler::getRequestUri(cfg('paths', 'htmlbase'))); } break; } } return $sReturn; } } ?> nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/classes/FrontendModMap.php000066400000000000000000000120341225466040700257420ustar00rootroot00000000000000 */ class FrontendModMap extends FrontendModule { private $name = ''; private $search = ''; private $rotation = ''; private $rotationStep = ''; private $perm = ''; public function __construct(GlobalCore $CORE) { $this->sName = 'Map'; $this->CORE = $CORE; // Parse the view specific options $aOpts = Array( 'show' => MATCH_MAP_NAME_EMPTY, 'search' => MATCH_STRING_NO_SPACE_EMPTY, 'rotation' => MATCH_ROTATION_NAME_EMPTY, 'rotationStep' => MATCH_INTEGER_EMPTY, 'perm' => MATCH_BOOLEAN_EMPTY, ); // There might be a default map when none is given $aDefaults = Array('show' => cfg('global', 'startshow')); // getCustomOptions fetches and validates the values $aVals = $this->getCustomOptions($aOpts, $aDefaults); $this->name = $aVals['show']; $this->search = $aVals['search']; $this->rotation = $aVals['rotation']; $this->rotationStep = $aVals['rotationStep']; $this->perm = $aVals['perm']; // Register valid actions $this->aActions = Array( 'view' => REQUIRES_AUTHORISATION, 'edit' => REQUIRES_AUTHORISATION, ); // Register valid objects $this->aObjects = $this->CORE->getAvailableMaps(null, SET_KEYS); // Set the requested object for later authorisation $this->setObject($this->name); } public function handleAction() { $sReturn = ''; if($this->offersAction($this->sAction)) { switch($this->sAction) { case 'edit': case 'view': // Show the view dialog to the user $sReturn = $this->showViewDialog(); break; } } return $sReturn; } private function showViewDialog() { global $AUTHORISATION; // Initialize map configuration $MAPCFG = new NagVisMapCfg($this->CORE, $this->name); // Read the map configuration file (Only global section!) $MAPCFG->readMapConfig(ONLY_GLOBAL); // Get all source parameters $opts = $MAPCFG->getSourceParams(); // Build index template $INDEX = new NagVisIndexView($this->CORE); // Need to load the custom stylesheet? $customStylesheet = $MAPCFG->getValue(0, 'stylesheet'); if($customStylesheet !== '') $INDEX->setCustomStylesheet($this->CORE->getMainCfg()->getPath('html', 'global', 'styles', $customStylesheet)); // Need to parse the header menu by config or url value? if(isset($opts['header_menu']) && $opts['header_menu']) { // Parse the header menu $HEADER = new NagVisHeaderMenu($this->CORE, $this->UHANDLER, $MAPCFG->getValue(0 ,'header_template'), $MAPCFG); // Put rotation information to header menu if($this->rotation != '') { $HEADER->setRotationEnabled(); } $INDEX->setHeaderMenu($HEADER->__toString()); } // Initialize map view $this->VIEW = new NagVisMapView($this->CORE, $this->name); $this->VIEW->setParams($opts); // The user is searching for an object $this->VIEW->setSearch($this->search); // Enable edit mode for all objects if($this->sAction == 'edit') $this->VIEW->setEditMode(); // Maybe it is needed to handle the requested rotation if($this->rotation != '') { // Only allow the rotation if the user is permitted to use it if($AUTHORISATION->isPermitted('Rotation', 'view', $this->rotation)) { $ROTATION = new FrontendRotation($this->CORE, $this->rotation); $ROTATION->setStep('map', $this->name, $this->rotationStep); $this->VIEW->setRotation($ROTATION->getRotationProperties()); } } $INDEX->setContent($this->VIEW->parse()); return $INDEX->parse(); } } ?> nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/classes/FrontendModOverview.php000066400000000000000000000061121225466040700270330ustar00rootroot00000000000000 */ class FrontendModOverview extends FrontendModule { private $rotation = ''; private $rotationStep = ''; public function __construct(GlobalCore $CORE) { $this->sName = 'Overview'; $this->CORE = $CORE; // Parse the view specific options $aOpts = Array('rotation' => MATCH_ROTATION_NAME_EMPTY, 'rotationStep' => MATCH_INTEGER_EMPTY); $aVals = $this->getCustomOptions($aOpts); $this->rotation = $aVals['rotation']; $this->rotationStep = $aVals['rotationStep']; $this->aActions = Array( 'view' => REQUIRES_AUTHORISATION ); } public function handleAction() { $sReturn = ''; if($this->offersAction($this->sAction)) { switch($this->sAction) { case 'view': // Show the view dialog to the user $sReturn = $this->showViewDialog(); break; } } return $sReturn; } private function showViewDialog() { // Build index template $INDEX = new NagVisIndexView($this->CORE); // Need to parse the header menu? if(cfg('index','headermenu')) { // Parse the header menu $HEADER = new NagVisHeaderMenu($this->CORE, $this->UHANDLER, cfg('index', 'headertemplate')); // Put rotation information to header menu if($this->rotation != '') { $HEADER->setRotationEnabled(); } $INDEX->setHeaderMenu($HEADER->__toString()); } // Initialize map view $this->VIEW = new NagVisOverviewView($this->CORE); // Maybe it is needed to handle the requested rotation if($this->rotation != '') { $ROTATION = new FrontendRotation($this->CORE, $this->rotation); $ROTATION->setStep('overview', '', $this->rotationStep); $this->VIEW->setRotation($ROTATION->getRotationProperties()); } $INDEX->setContent($this->VIEW->parse()); return $INDEX->parse(); } } ?> nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/classes/FrontendModRotation.php000066400000000000000000000061251225466040700270300ustar00rootroot00000000000000 */ class FrontendModRotation extends FrontendModule { private $name = ''; private $type = ''; private $step = ''; private $stepId = ''; public function __construct(GlobalCore $CORE) { $this->sName = 'Rotation'; $this->CORE = $CORE; // Parse the view specific options $aOpts = Array('show' => MATCH_ROTATION_NAME, 'type' => MATCH_ROTATION_STEP_TYPES_EMPTY, 'step' => MATCH_STRING_NO_SPACE_EMPTY, 'stepId' => MATCH_INTEGER_EMPTY); $aVals = $this->getCustomOptions($aOpts); $this->name = $aVals['show']; $this->type = $aVals['type']; $this->step = $aVals['step']; $this->stepId = $aVals['stepId']; // Register valid actions $this->aActions = Array( 'view' => REQUIRES_AUTHORISATION ); // Register valid objects $this->aObjects = $this->CORE->getDefinedRotationPools(); // Set the requested object for later authorisation $this->setObject($this->name); } public function handleAction() { $sReturn = ''; if($this->offersAction($this->sAction)) { switch($this->sAction) { case 'view': // Show the view dialog to the user $sReturn = $this->showViewDialog(); break; } } return $sReturn; } private function showViewDialog() { // Initialize rotation/refresh $ROTATION = new FrontendRotation($this->CORE, $this->name); // Set the requested step if($this->type != '' && $this->step != '') $ROTATION->setStep($this->type, $this->step, $this->stepId); switch($this->type) { case '': // If no step given redirect to first step header('Location: ' . $ROTATION->getStepUrlById(0)); break; case 'map': case 'url': header('Location: ' . $ROTATION->getCurrentStepUrl()); break; } } } ?> nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/classes/FrontendModUrl.php000066400000000000000000000065021225466040700257720ustar00rootroot00000000000000 */ class FrontendModUrl extends FrontendModule { private $url = ''; private $rotation = ''; private $rotationStep = ''; public function __construct(GlobalCore $CORE) { $this->CORE = $CORE; // Parse the view specific options $aOpts = Array('show' => MATCH_STRING_URL, 'rotation' => MATCH_ROTATION_NAME_EMPTY, 'rotationStep' => MATCH_INTEGER_EMPTY); $aVals = $this->getCustomOptions($aOpts); $this->url = $aVals['show']; $this->rotation = $aVals['rotation']; $this->rotationStep = $aVals['rotationStep']; // Register valid actions $this->aActions = Array( 'view' => REQUIRES_AUTHORISATION ); } public function handleAction() { $sReturn = ''; if($this->offersAction($this->sAction)) { switch($this->sAction) { case 'view': // Show the view dialog to the user $sReturn = $this->showViewDialog(); break; } } return $sReturn; } private function showViewDialog() { // Only show when map name given if(!isset($this->url) || $this->url == '') throw new NagVisException(l('No url given.')); // Build index template $INDEX = new NagVisIndexView($this->CORE); // Need to parse the header menu? if(cfg('index','headermenu')) { // Parse the header menu $HEADER = new NagVisHeaderMenu($this->CORE, $this->UHANDLER, cfg('index', 'headertemplate')); // Put rotation information to header menu if($this->rotation != '') { $HEADER->setRotationEnabled(); } $INDEX->setHeaderMenu($HEADER->__toString()); } // Initialize map view $this->VIEW = new NagVisUrlView($this->CORE, $this->url); // Maybe it is needed to handle the requested rotation if($this->rotation != '') { $ROTATION = new FrontendRotation($this->CORE, $this->rotation); $ROTATION->setStep('url', $this->url, $this->rotationStep); $this->VIEW->setRotation($ROTATION->getRotationProperties()); } $INDEX->setContent($this->VIEW->parse()); return $INDEX->parse(); } } ?> nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/classes/FrontendModule.php000066400000000000000000000021341225466040700260120ustar00rootroot00000000000000 */ abstract class FrontendModule extends CoreModule {} ?>nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/classes/FrontendModuleHandler.php000066400000000000000000000022651225466040700273150ustar00rootroot00000000000000 */ class FrontendModuleHandler extends CoreModuleHandler { public function __construct() { parent::__construct(); $this->sPrefix = 'FrontendMod'; } } ?>nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/classes/FrontendRequestHandler.php000066400000000000000000000023271225466040700275170ustar00rootroot00000000000000 */ class FrontendRequestHandler extends CoreRequestHandler { public function __construct($aOptions) { parent::__construct($aOptions); } } ?>nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/classes/FrontendRotation.php000066400000000000000000000020731225466040700263660ustar00rootroot00000000000000 */ class FrontendRotation extends CoreRotation {} ?>nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/classes/FrontendTemplateSystem.php000066400000000000000000000033301225466040700275440ustar00rootroot00000000000000 */ class FrontendTemplateSystem { private $TMPL; private $CORE; public function __construct($CORE) { $this->CORE = $CORE; // Load Dwoo. It is used as external library require_once(cfg('paths','base') .HTDOCS_DIR.'/frontend/nagvis-js/ext/dwoo-1.1.0/dwooAutoload.php'); $this->TMPL = new Dwoo(cfg('paths','var') .'tmpl/compile', cfg('paths','var').'tmpl/cache'); } public function getTmplSys() { return $this->TMPL; } public function getTmplFile($sTheme, $sTmpl) { return new Dwoo_Template_File($this->CORE->getMainCfg()->getPath('sys', '', 'templates', $sTheme.'.'.$sTmpl.'.html')); } } ?>nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/classes/NagVisHeaderMenu.php000066400000000000000000000343121225466040700262150ustar00rootroot00000000000000 */ class NagVisHeaderMenu { private $CORE; private $UHANDLER; private $OBJ; private $TMPL; private $TMPLSYS; private $templateName; private $pathHtmlBase; private $pathTemplateFile; private $aMacros = Array(); private $bRotation = false; /** * Class Constructor * * @param GlobalCore $CORE * @author Lars Michelsen */ public function __construct($CORE, CoreUriHandler $UHANDLER, $templateName, $OBJ = null) { $this->CORE = $CORE; $this->UHANDLER = $UHANDLER; $this->OBJ = $OBJ; $this->templateName = $templateName; $this->pathHtmlBase = cfg('paths','htmlbase'); $this->pathTemplateFile = $this->CORE->getMainCfg()->getPath('sys', '', 'templates', $this->templateName.'.header.html'); // Initialize template system $this->TMPL = New FrontendTemplateSystem($this->CORE); $this->TMPLSYS = $this->TMPL->getTmplSys(); // Read the contents of the template file $this->checkTemplateReadable(1); } /** * PUBLIC setRotationEnabled() * * Tells the header menu that the current view is rotating * * @author Lars Michelsen */ public function setRotationEnabled() { $this->bRotation = true; } /** * Print the HTML code * * return String HTML Code * @author Lars Michelsen */ public function __toString() { // Get all macros $this->getMacros(); // Build page based on the template file and the data array return $this->TMPLSYS->get($this->TMPL->getTmplFile($this->templateName, 'header'), $this->aMacros); } /** * Returns a list of available languages for the header menus macro list * * return Array * @author Lars Michelsen */ private function getLangList() { // Build language list $aLang = $this->CORE->getAvailableAndEnabledLanguages(); $numLang = count($aLang); foreach($aLang AS $lang) { $aLangs[$lang] = Array(); $aLangs[$lang]['language'] = $lang; // Get translated language name switch($lang) { case 'en_US': $languageLocated = l('en_US'); break; case 'de_DE': $languageLocated = l('de_DE'); break; case 'es_ES': $languageLocated = l('es_ES'); break; case 'fr_FR': $languageLocated = l('fr_FR'); break; case 'pt_BR': $languageLocated = l('pt_BR'); break; case 'ru_RU': $languageLocated = l('ru_RU'); break; default: $languageLocated = l($lang); break; } $aLangs[$lang]['langLanguageLocated'] = $languageLocated; } return $aLangs; } /** * Returns a list of maps for the header menus macro list * * return Array * @author Lars Michelsen */ private function getMapList($type, $maps) { global $AUTHORISATION; $permEditAnyMap = false; $aMaps = Array(); $childMaps = Array(); foreach($maps AS $mapName) { $map = Array(); $MAPCFG1 = new NagVisMapCfg($this->CORE, $mapName); try { $MAPCFG1->readMapConfig(ONLY_GLOBAL); } catch(MapCfgInvalid $e) { $map['configError'] = true; } // Only show maps which should be shown if($MAPCFG1->getValue(0, 'show_in_lists') != 1) continue; // Only proceed permited objects if($type == 'maps' && !$AUTHORISATION->isPermitted('Map', 'view', $mapName)) continue; $map['mapName'] = $MAPCFG1->getName(); $map['mapAlias'] = $MAPCFG1->getValue(0, 'alias'); $map['childs'] = Array(); if($type == 'maps') { $map['permittedEdit'] = $AUTHORISATION->isPermitted('Map', 'edit', $mapName); $permEditAnyMap |= $map['permittedEdit']; } // auto select current map and apply map specific optins to the header menu if($this->OBJ !== null && $this->aMacros['mod'] == 'Map' && $mapName == $this->OBJ->getName()) { $map['selected'] = True; // Override header fade option with map config $this->aMacros['bEnableFade'] = $MAPCFG1->getValue(0, 'header_fade'); } $map['parent'] = $MAPCFG1->getValue(0, 'parent_map'); if($map['parent'] === '') $aMaps[$map['mapName']] = $map; else { if(!isset($childMaps[$map['parent']])) $childMaps[$map['parent']] = Array(); $childMaps[$map['parent']][$map['mapName']] = $map; } } return Array($this->mapListToTree($aMaps, $childMaps), $permEditAnyMap); } private function mapListToTree($maps, $childMaps) { foreach($maps AS $map) { $freeParent = $map['mapName']; if(isset($childMaps[$freeParent])) { $maps[$freeParent]['childs'] = $this->mapListToTree($childMaps[$freeParent], $childMaps); } } usort($maps, Array('GlobalCore', 'cmpMapAlias')); return $maps; } /** * PRIVATE getMacros() * * Returns all macros for the header template * * @author Lars Michelsen */ private function getMacros() { global $AUTH, $AUTHORISATION; // First get all static macros $this->aMacros = $this->getStaticMacros(); // Save the page $this->aMacros['mod'] = $this->UHANDLER->get('mod'); $this->aMacros['act'] = $this->UHANDLER->get('act'); // In rotation? $this->aMacros['bRotation'] = $this->bRotation; $this->aMacros['permittedOverview'] = $AUTHORISATION->isPermitted('Overview', 'view', '*'); // Check if the user is permitted to edit the current map $this->aMacros['permittedView'] = $AUTHORISATION->isPermitted($this->aMacros['mod'], 'view', $this->UHANDLER->get('show')); $this->aMacros['permittedEdit'] = $AUTHORISATION->isPermitted($this->aMacros['mod'], 'edit', $this->UHANDLER->get('show')); // Permissions for the option menu $this->aMacros['permittedSearch'] = $AUTHORISATION->isPermitted('Search', 'view', '*'); $this->aMacros['permittedEditMainCfg'] = $AUTHORISATION->isPermitted('MainCfg', 'edit', '*'); $this->aMacros['permittedManageShapes'] = $AUTHORISATION->isPermitted('ManageShapes', 'manage', '*'); $this->aMacros['permittedManageBackgrounds'] = $AUTHORISATION->isPermitted('ManageBackgrounds', 'manage', '*'); $this->aMacros['permittedManageBackgrounds'] = $AUTHORISATION->isPermitted('ManageBackgrounds', 'manage', '*'); $this->aMacros['permittedManageMaps'] = $AUTHORISATION->isPermitted('Map', 'add', '*') && $AUTHORISATION->isPermitted('Map', 'edit', '*'); $this->aMacros['currentUser'] = $AUTH->getUser(); $this->aMacros['permittedChangePassword'] = $AUTHORISATION->isPermitted('ChangePassword', 'change', '*'); $this->aMacros['permittedLogout'] = $AUTH->logoutSupported() & $AUTHORISATION->isPermitted('Auth', 'logout', '*'); // Replace some special macros if($this->OBJ !== null && $this->aMacros['mod'] == 'Map') { $this->aMacros['currentMap'] = $this->OBJ->getName(); $this->aMacros['currentMapAlias'] = $this->OBJ->getValue(0, 'alias'); $this->aMacros['usesSources'] = count($this->OBJ->getValue(0, 'sources')) > 0; } else { $this->aMacros['currentMap'] = ''; $this->aMacros['currentMapAlias'] = ''; $this->aMacros['usesSources'] = false; } // Add permitted rotations $this->aMacros['rotations'] = array(); foreach($this->CORE->getDefinedRotationPools() AS $poolName) { if($AUTHORISATION->isPermitted('Rotation', 'view', $poolName)) { $this->aMacros['rotations'][] = $poolName; } } // Initialize the enable fade option. Is overridden by the current map or left as is $this->aMacros['bEnableFade'] = cfg('defaults', 'headerfade'); list($this->aMacros['maps'], $this->aMacros['permittedEditAnyMap']) = $this->getMapList('maps', $this->CORE->getAvailableMaps()); $this->aMacros['langs'] = $this->getLangList(); } /** * Checks if a documentation is available for the current language. * It either returns the language tag for the current language when a * documentation exists or en_US as fallback when no docs exist * * @author Lars Michelsen */ private function getDocLanguage() { if(in_array(curLang(), $this->CORE->getAvailableDocs())) return curLang(); else return 'en_US'; } /** * PRIVATE getStaticMacros() * * Get all static macros for the template code * * @author Lars Michelsen */ private function getStaticMacros() { global $SHANDLER, $AUTH, $AUTHORISATION; // Replace paths and language macros $aReturn = Array('pathBase' => $this->pathHtmlBase, 'currentUri' => preg_replace('/[&?]lang=[a-z]{2}_[A-Z]{2}/', '', $this->UHANDLER->getRequestUri()), 'pathImages' => cfg('paths','htmlimages'), 'pathHeaderJs' => $this->CORE->getMainCfg()->getPath('html', 'global', 'templates', $this->templateName.'.header.js'), 'pathTemplates' => $this->CORE->getMainCfg()->getPath('html', 'global', 'templates'), 'pathTemplateImages' => $this->CORE->getMainCfg()->getPath('html', 'global', 'templateimages'), 'langSearch' => l('Search'), 'langUserMgmt' => l('Manage Users'), 'langManageRoles' => l('Manage Roles'), 'currentLanguage' => curLang(), 'docLanguage' => $this->getDocLanguage(), 'langChooseLanguage' => l('Choose Language'), 'langUser' => l('User menu'), 'langActions' => l('Actions'), 'langLoggedIn' => l('Logged in'), 'langChangePassword' => l('Change password'), 'langOpen' => l('Open'), 'langMap' => l('Map'), 'langRotations' => l('Rotations'), 'langMapOptions' => l('Map Options'), 'langMapManageTmpl' => l('Manage Templates'), 'langMapAddIcon' => l('Add Icon'), 'langMapAddLine' => l('Add Line'), 'langLine' => l('Line'), 'langMapAddSpecial' => l('Add Special'), 'langHost' => l('host'), 'langService' => l('service'), 'langHostgroup' => l('hostgroup'), 'langServicegroup' => l('servicegroup'), 'langMapEdit' => l('Edit Map'), 'langMaps' => l('Maps'), 'langTextbox' => l('textbox'), 'langContainer' => l('Container'), 'langShape' => l('shape'), 'langStateless' => l('Stateless'), 'langSpecial' => l('special'), 'langLockUnlockAll' => l('Lock/Unlock all'), 'langViewMap' => l('View current map'), 'langOptions' => l('Options'), 'langEditMainCfg' => l('General Configuration'), 'langMgmtBackends' => l('Manage Backends'), 'langMgmtBackgrounds' => l('Manage Backgrounds'), 'langMgmtMaps' => l('Manage Maps'), 'langMgmtShapes' => l('Manage Shapes'), 'langNeedHelp' => l('needHelp'), 'langOnlineDoc' => l('onlineDoc'), 'langForum' => l('forum'), 'langSupportInfo' => l('supportInfo'), 'langOverview' => l('overview'), 'langInstance' => l('instance'), 'langLogout' => l('Logout'), 'langRotationStart' => l('rotationStart'), 'langRotationStop' => l('rotationStop'), 'langToggleGrid' => l('Show/Hide Grid'), 'langToStaticMap' => l('Export to static map'), 'langModifyParams' => l('Modify view'), // Supported by backend and not using trusted auth 'supportedChangePassword' => $AUTH->checkFeature('changePassword') && !$AUTH->authedTrusted(), 'permittedUserMgmt' => $AUTHORISATION->isPermitted('UserMgmt', 'manage'), 'permittedRoleMgmt' => $AUTHORISATION->isPermitted('RoleMgmt', 'manage')); return $aReturn; } /** * Checks for readable header template * * @param Boolean $printErr * @return Boolean Is Check Successful? * @author Lars Michelsen */ private function checkTemplateReadable($printErr) { return GlobalCore::getInstance()->checkReadable($this->pathTemplateFile, $printErr); } } ?> nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/classes/NagVisIndexView.php000066400000000000000000000063211225466040700261010ustar00rootroot00000000000000 */ class NagVisIndexView { private $CORE = null; private $sSubtitle = ''; private $sCustomStylesheet = ''; private $sHeaderMenu = ''; private $sContent = ''; /** * Class Constructor * * @param GlobalCore $CORE * @param String $NAME * @author Lars Michelsen */ public function __construct(GlobalCore $CORE) { $this->CORE = $CORE; } public function setSubtitle($s) { $this->sSubtitle = ' › ' . $s; } public function setCustomStylesheet($s) { $this->sCustomStylesheet = $s; } public function setHeaderMenu($s) { $this->sHeaderMenu = $s; } public function setContent($s) { $this->sContent = $s; } /** * Parses the map and the objects for the nagvis-js frontend * * @return String String with JS Code * @author Lars Michelsen */ public function parse() { // Initialize template system $TMPL = New FrontendTemplateSystem($this->CORE); $TMPLSYS = $TMPL->getTmplSys(); $aData = Array( 'pageTitle' => cfg('internal', 'title') . $this->sSubtitle, 'htmlBase' => cfg('paths', 'htmlbase'), 'htmlJs' => cfg('paths', 'htmljs'), 'htmlCss' => cfg('paths', 'htmlcss'), 'htmlTemplates' => $this->CORE->getMainCfg()->getPath('html', 'global', 'templates'), 'bUseCompressedJs' => $this->checkJsCompressed(), 'customStylesheet' => $this->sCustomStylesheet, 'headerMenu' => $this->sHeaderMenu, 'content' => $this->sContent ); // Build page based on the template file and the data array return $TMPLSYS->get($TMPL->getTmplFile(cfg('defaults', 'view_template'), 'index'), $aData); } /** * Checks if the compressed javascript file exists * * @return Boolean * @author Lars Michelsen */ private function checkJsCompressed() { return file_exists(cfg('paths', 'js').'NagVisCompressed.js'); } } ?> nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/classes/NagVisInfoView.php000066400000000000000000000106461225466040700257320ustar00rootroot00000000000000 */ class NagVisInfoView { private $CORE; /** * Class Constructor * * @param GlobalCore $CORE * @author Lars Michelsen */ public function __construct($CORE) { $this->CORE = $CORE; } /** * Parses the information in html format * * @return String String with Html Code * @author Lars Michelsen */ public function parse() { global $AUTH; // Initialize template system $TMPL = New FrontendTemplateSystem($this->CORE); $TMPLSYS = $TMPL->getTmplSys(); $AUTHORISATION = $this->CORE->getAuthorization(); $userName = $AUTH->getUser(); $userId = $AUTH->getUserId(); $userRoles = $AUTHORISATION->getUserRoles($userId); $userPerms = $AUTHORISATION->parsePermissions(); $aData = Array( 'pageTitle' => cfg('internal', 'title') . ' › '.l('supportInfo'), 'htmlBase' => cfg('paths', 'htmlbase'), 'htmlTemplates' => $this->CORE->getMainCfg()->getPath('html', 'global', 'templates'), 'nagvisVersion' => CONST_VERSION, 'phpVersion' => PHP_VERSION, 'mysqlVersion' => shell_exec('mysql --version'), 'os' => shell_exec('uname -a'), 'serverSoftware' => $_SERVER['SERVER_SOFTWARE'], 'scriptFilename' => $_SERVER['SCRIPT_FILENAME'], 'scriptName' => $_SERVER['SCRIPT_NAME'], 'requestTime' => $_SERVER['REQUEST_TIME'].' (gmdate(): '.gmdate('r',$_SERVER['REQUEST_TIME']).')', 'phpErrorReporting' => ini_get('error_reporting'), 'phpSafeMode' => (ini_get('safe_mode')?"yes":"no"), 'phpMaxExecTime' => ini_get('max_execution_time'), 'phpMemoryLimit' => ini_get('memory_limit'), 'phpLoadedExtensions' => implode(", ",get_loaded_extensions()), 'userAgent' => $_SERVER['HTTP_USER_AGENT'], // Auth details 'logonModule' => cfg('global', 'logonmodule'), 'authModule' => cfg('global', 'authmodule'), 'authorisationModule' => cfg('global', 'authorisationmodule'), 'logonEnvVar' => cfg('global', 'logonenvvar'), 'logonEnvVal' => (isset($_SERVER[cfg('global', 'logonenvvar')]) ? $_SERVER[cfg('global', 'logonenvvar')] : ''), 'logonEnvCreateUser' => cfg('global', 'logonenvcreateuser'), 'logonEnvCreateRole' => cfg('global', 'logonenvcreaterole'), 'loggedIn' => $userName.' ('.$userId.')', 'userRoles' => json_encode($userRoles), 'userPerms' => json_encode($userPerms), 'userAuthModule' => $AUTH->getAuthModule(), 'userLogonModule' => $AUTH->getLogonModule(), 'userAuthTrusted' => ($AUTH->authedTrusted() ? l("yes") : l("no")), 'compatJsonEncode' => (!COMPAT_JSON_ENCODE ? l("yes") : l("no (compat mode, may lead to performance problems)")), 'compatJsonDecode' => (!COMPAT_JSON_DECODE ? l("yes") : l("no (compat mode, may lead to performance problems)")), ); // Build page based on the template file and the data array return $TMPLSYS->get($TMPL->getTmplFile(cfg('defaults', 'view_template'), 'info'), $aData); } } ?> nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/classes/NagVisLoginView.php000066400000000000000000000065141225466040700261060ustar00rootroot00000000000000 */ class NagVisLoginView { private $CORE; /** * Class Constructor * * @param GlobalCore $CORE * @author Lars Michelsen */ public function __construct($CORE) { $this->CORE = $CORE; } /** * Parses the information in html format * * @return String String with Html Code * @author Lars Michelsen */ public function parse() { global $LOGIN_MSG; // Initialize template system $TMPL = New FrontendTemplateSystem($this->CORE); $TMPLSYS = $TMPL->getTmplSys(); $target = CoreRequestHandler::getRequestUri(''); // Add the language to the target url when the user requested a specific language if(isset($_GET['lang']) && $_GET['lang'] != '' && strpos($target, 'lang=') === false) { if(strpos($target, '?') === false) { $target .= '?lang='.$_GET['lang']; } else { $target .= '&lang='.$_GET['lang']; } } $aData = Array( 'generalProperties' => $this->CORE->getMainCfg()->parseGeneralProperties(), 'locales' => json_encode(Array()), 'pageTitle' => cfg('internal', 'title') . ' › Log In', 'htmlBase' => cfg('paths', 'htmlbase'), 'htmlJs' => cfg('paths', 'htmljs'), 'htmlCss' => cfg('paths', 'htmlcss'), 'formTarget' => $target, 'htmlTemplates' => $this->CORE->getMainCfg()->getPath('html', 'global', 'templates'), 'htmlImages' => cfg('paths', 'htmlimages'), 'maxPasswordLength' => AUTH_MAX_PASSWORD_LENGTH, 'maxUsernameLength' => AUTH_MAX_USERNAME_LENGTH, 'langName' => l('Name'), 'langPassword' => l('Password'), 'langLogin' => l('Login'), 'langTitleCookiesDisabled' => l('Cookies disabled'), 'langTextCookiesDisabled' => l('NagVis is unable to set a cookie in your browser. Please enable cookies for at least the NagVis host.'), 'loginMsg' => isset($LOGIN_MSG) && $LOGIN_MSG !== null ? $LOGIN_MSG->msg : '', ); // Build page based on the template file and the data array return $TMPLSYS->get($TMPL->getTmplFile(cfg('defaults', 'view_template'), 'login'), $aData); } } ?> nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/classes/NagVisMapView.php000066400000000000000000000141071225466040700255500ustar00rootroot00000000000000 */ class NagVisMapView { private $CORE = null; private $MAPCFG = null; private $name = ''; private $search = ''; private $aRotation = Array(); private $editMode = false; private $aParams = Array(); /** * Class Constructor * * @param GlobalCore $CORE * @param String $NAME * @author Lars Michelsen */ public function __construct(GlobalCore $CORE, $name) { $this->CORE = $CORE; $this->name = $name; } /** * Set the search value if the user searches for an object * * @param String Search string * @author Lars Michelsen */ public function setSearch($s) { $this->search = $s; } /** * Set the rotation properties if the user wants a rotation * * @param Array * @author Lars Michelsen */ public function setRotation($a) { $this->aRotation = $a; } /** * Set the url params */ public function setParams($a) { $this->aParams = $a; } public function setEditMode() { $this->editMode = true; } /** * Parses the map and the objects for the nagvis-js frontend * * @return String String with JS Code * @author Lars Michelsen */ public function parse() { // Initialize template system $TMPL = new FrontendTemplateSystem($this->CORE); $TMPLSYS = $TMPL->getTmplSys(); $USERCFG = new CoreUserCfg(); $this->MAPCFG = new NagVisMapCfg($this->CORE, $this->name); $this->MAPCFG->readMapConfig(ONLY_GLOBAL); $aData = Array( 'generalProperties' => $this->CORE->getMainCfg()->parseGeneralProperties(), 'workerProperties' => $this->CORE->getMainCfg()->parseWorkerProperties(), 'rotationProperties' => json_encode($this->aRotation), 'viewProperties' => $this->parseViewProperties(), 'stateProperties' => json_encode($this->CORE->getMainCfg()->getStateWeight()), 'userProperties' => $USERCFG->doGetAsJson(), 'mapName' => $this->name, 'fileAges' => json_encode(Array( 'maincfg' => $this->CORE->getMainCfg()->getConfigFileAge(), $this->name => $this->MAPCFG->getFileModificationTime(), )), 'locales' => json_encode(Array( // FIXME: Duplicated definitions in NagVisMapView.php and NagVisOverviewView.php 'more items...' => l('more items...'), 'Create Object' => l('Create Object'), )), ); // Build page based on the template file and the data array return $TMPLSYS->get($TMPL->getTmplFile(cfg('defaults', 'view_template'),'map'), $aData); } /** * Parses the view specific properties. In most cases this will be user * defined values which maybe given by url or session * * @return String JSON array * @author Lars Michelsen */ private function parseViewProperties() { $arr = Array(); $arr['search'] = $this->search; $arr['edit_mode'] = $this->editMode; $arr['grid_show'] = intval($this->MAPCFG->getValue(0, 'grid_show')); $arr['grid_color'] = $this->MAPCFG->getValue(0, 'grid_color'); $arr['grid_steps'] = intval($this->MAPCFG->getValue(0, 'grid_steps')); $arr['event_repeat_interval'] = intval($this->MAPCFG->getValue(0, 'event_repeat_interval')); $arr['event_repeat_duration'] = intval($this->MAPCFG->getValue(0, 'event_repeat_duration')); $arr['event_on_load'] = intval($this->MAPCFG->getValue(0, 'event_on_load')); $arr['permitted_edit'] = $this->CORE->getAuthorization() !== null && $this->CORE->getAuthorization()->isPermitted('Map', 'edit', $this->name); $arr['permitted_perform'] = $this->CORE->getAuthorization() !== null && $this->CORE->getAuthorization()->isPermitted('Action', 'perform', '*'); // hover_menu & context_menu have to be handled separated from the others // It is special for them that the object individual settings have to be // treated and only the user specified source params must be applied here // (no global, no hardcoded default) // FIXME: Recode to use the user_params $userParams = $this->MAPCFG->getSourceParams(true); if(isset($userParams['hover_menu'])) $arr['hover_menu'] = $userParams['hover_menu']; if(isset($userParams['context_menu'])) $arr['context_menu'] = $userParams['context_menu']; // This sets the user specific parameters $arr['user_params'] = $this->MAPCFG->getSourceParams(true, true); // This sets the final source parameters $arr['params'] = $this->MAPCFG->getSourceParams(); return json_encode($arr); } } ?> nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/classes/NagVisOverviewView.php000066400000000000000000000051021225466040700266340ustar00rootroot00000000000000 */ class NagVisOverviewView { private $CORE; /** * Class Constructor * * @param GlobalCore $CORE * @author Lars Michelsen */ public function __construct($CORE) { $this->CORE = $CORE; } /** * Parses the information for json * * @return String String with Html Code * @author Lars Michelsen */ public function parse() { // Initialize template system $TMPL = new FrontendTemplateSystem($this->CORE); $TMPLSYS = $TMPL->getTmplSys(); $USERCFG = new CoreUserCfg(); $aData = Array( 'generalProperties' => $this->CORE->getMainCfg()->parseGeneralProperties(), 'workerProperties' => $this->CORE->getMainCfg()->parseWorkerProperties(), 'stateProperties' => json_encode($this->CORE->getMainCfg()->getStateWeight()), 'userProperties' => $USERCFG->doGetAsJson(), 'fileAges' => json_encode(Array( 'maincfg' => $this->CORE->getMainCfg()->getConfigFileAge(), )), 'locales' => json_encode(Array( // FIXME: Duplicated definitions in NagVisMapView.php and NagVisOverviewView.php 'more items...' => l('more items...'), 'Create Object' => l('Create Object'), )), ); // Build page based on the template file and the data array return $TMPLSYS->get($TMPL->getTmplFile(cfg('defaults', 'view_template'), 'overview'), $aData); } } ?> nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/classes/NagVisUrlView.php000066400000000000000000000056231225466040700256000ustar00rootroot00000000000000 */ class NagVisUrlView { private $CORE = null; private $url = ''; private $content = ''; private $aRotation = Array(); /** * Class Constructor * * @param GlobalCore $CORE * @param String $NAME * @author Lars Michelsen */ public function __construct(GlobalCore $CORE, $url) { $this->CORE = $CORE; $this->url = $url; } /** * Set the page content * * @author Lars Michelsen */ public function setContent($s) { $this->content = $s; } /** * Set the rotation properties if the user wants a rotation * * @param Array * @author Lars Michelsen */ public function setRotation($a) { $this->aRotation = $a; } /** * Parses the url and the objects for the nagvis-js frontend * * @return String String with JS Code * @author Lars Michelsen */ public function parse() { // Initialize template system $TMPL = New FrontendTemplateSystem($this->CORE); $TMPLSYS = $TMPL->getTmplSys(); $aData = Array( 'generalProperties' => $this->CORE->getMainCfg()->parseGeneralProperties(), 'workerProperties' => $this->CORE->getMainCfg()->parseWorkerProperties(), 'rotationProperties' => json_encode($this->aRotation), 'url' => $this->url, 'fileAges' => json_encode(Array( 'maincfg' => $this->CORE->getMainCfg()->getConfigFileAge(), )), 'locales' => json_encode(Array()), ); // Build page based on the template file and the data array return $TMPLSYS->get($TMPL->getTmplFile(cfg('defaults', 'view_template'), 'url'), $aData); } } ?> nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/defines/000077500000000000000000000000001225466040700223345ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/defines/nagvis-js.php000066400000000000000000000022761225466040700247550ustar00rootroot00000000000000 */ /** * Set the path to look for included files */ set_include_path( get_include_path() .PATH_SEPARATOR.'../../frontend/nagvis-js/classes/' ); ?> nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/000077500000000000000000000000001225466040700215175ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/000077500000000000000000000000001225466040700231225ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/CHANGELOG000066400000000000000000000656721225466040700243540ustar00rootroot00000000000000[2009--] 1.1.0 ! BC Break: Dwoo::initGlobals() is only called once during the Dwoo object construction. If you had overriden it and need to update global data before each template is executed you should instead override Dwoo::initRuntimeVars() and push stuff in the globals array there. Also be aware that this means captured data, foreach values and so-on will persist from a parent template to an included one (but the include's changes will not be reflected on the parent), and from a template to the next if you render several in series. + Added {template} plugin that allows you to define sub-templates and then call them (works recursively too, good for menus and lists) + Added {load_templates} to load external sub-templates into your file + Allowed string concatenation assignments with {$foo.="bar"} + Allowed access of static properties as {Foo::$bar} + Plugins/Helpers that use a dynamic number of arguments through func_get_args are now working since the compiler lets any arguments in excess pass through + Adapters: CodeIgniter: the adapter by Stefan Verstege has been added to core and he will be its maintainer from now on + Adapters: CakePHP: this adapter is now added to core and is designed to work with CakePHP 1.2 * Adapters: Zend: Denis Arh is now appointed maintainer of that part and fixed a few things since 1.0.1 * The include_path isn't altered anymore, hopefully saving some stat calls * User classes extending Dwoo_Template_File are now supported better with regard to includes - Thanks to the Kayako.com team for the patch * Objects now act like arrays when you access non-existing properties on them (i.e. it outputs a notice only if it's output straight, and none when passed to a function) * For can now iterate backwards if you input numbers, it won't work with variables though * Slight performance improvement with big inheritance trees * No more double-slashes in template paths since this seemed to cause slight performance issues * Fixed a bug with parsing AND/OR keywords in conditionals when they were followed by round brackets * Fixed assignments not handling multi-line values correctly * Fixed parameter parsing issue when a plugin name was all uppercased * Fixed assignments failing with autoEscape enabled * Fixed parsing of vars with string keys that was too greedy * Fixed an optimization causing foreach/for/loop variables not being accessible when the foreach/.. name was set dynamically * Fixed parsing of comments that were on top of the file when there are spaces at the end of it * Dwoo_Template::$chmod is now enforced for directories as well (#18) * Many new unit tests to improve code coverage and a bunch of bug fixes that resulted, but I didn't really keep track of them [2008-12-24] 1.0.1 * Direct assignments like {$foo = 5} now allow spaces around the operator * Fixed a {foreach} bug with the implode argument * Fixed modulo operator in if statements * Fixed date_format handling of negative and small unix timestamps * Fixed a weird reference bug with ZF and includes.. whatever but thanks to Denis Arh for the patch [2008-10-23] 1.0.0 ! BC Break: Small one that probably won't affect anyone, but it makes the PluginProxy feature much stronger. Basically if you used a custom one you will get a fatal error and need to update it to conform to the new IPluginProxy interface, that's it + Compiler: the modifier syntax (|foo) can now be applied on functions and on complex variables i.e. {$obj->getStuff()|upper} or {lower('foo')|upper} + SmartyCompat: Added a {section} plugin but I strongly discourage using it, it was really made to support legacy templates, since {for} doesn't have to handle {section}-BC anymore, it has been cleaned up a lot and the last $skip parameter has been dropped * The core Dwoo class doesn't need writable compile/cache dirs in the constructor anymore so you can provide custom ones later through ->setCompile(/Cache)Dir - thanks to Denis Arh for the patch * Adapters: Zend: major overhaul thanks to Denis Arh, templates files should probably be moved in the scripts subfolder after this update though, and the settings array has changed a bit, you will get warnings if you don't update the code anyway * Plugins: improved the dump plugin, it now displays object's properties and optionally public methods (if the new show_methods arg is set to true) - thanks to Stephan Wentz for the patch * Adapters: Zend: Added parameters to provide a custom engine (extends Dwoo) or a custom data class (extends Dwoo_Data) - thanks to Maxime Merian for the patch * Compiler: added Dwoo_Compiler->setNestedCommentsHandling(true) to enable parsing of nested comments (i.e. {* {* *} *} becomes a valid comment, useful to comment out big chunks of code containing comments) * Lines containing only comments and whitespace are now entirely removed * Removed comments do not mess up the line count anymore (for error messages) * Fixed parsing bug in {func()->propertyOfReturnedObject} * Fixed file template class reading from the string compiler factory - thanks to MrOxiMoron for the patch * Fixed handling of variable variables that contained non standard characters * Fixed a 1.0.0beta regression that messed with custom plugin directories on Windows * SmartyCompat: Fixed a few bugs in the adapter and processor - thanks to Stefan Moonen for the patches [2008-09-08] 1.0.0beta ! Important note : Dwoo.php should not be included directly anymore, please read the UPGRADE_NOTES file for more infos on the matter, if you don't your Dwoo install will most likely break after the update anyway ! BC Break: {include} and {extends} now support the include path properly, which means that if you include "foo/bar.html" from _any_ template and you have an include path set on your template object, it will look in all those paths for foo/bar.html. If you use relative paths, for example if you include "../foo/bar.html" AND have an include path set, you will now have a problem, because you can't mix both approaches, otherwise you should be fine, so to fix this you should convert your relative includes/extends + Adapters: Added the Agavi interface for Dwoo (see /Dwoo/Adapters/Agavi/README) + API: Added Dwoo_Compilation_Exception methods getCompiler() and getTemplate() so you can catch the exception and use those to build a nicer error view with all the details you want + Plugins: Added a mode parameter to {strip} to allow stripping of javascript code blocks that use "// comments", because without this special mode the comments result in syntax errors * The Compiler now ensures that a template starting with get() is now stricter as to what it accepts as a "template", only Dwoo_ITemplate objects or valid filenames are accepted * Foreach and other similar plugins that support "else" now only count() their input before processing when an else block follows * Various optimizations * Fixed compiler bug that created a parse error when you had comments in an extended template * Fixed extends bug when extending files in other directories using relative paths * Fixed parsing bug with "|modifier:param|modifier2} with:colon after it" * Bug fixed with smarty functions called with no parameters (in compat mode) * Fixed Dwoo::isArray() check, objects implementing ArrayAccess are now valid (thanks to Daniel Cousineau for the patch) * Fixed compiler warning when doing {func()->method()} or {func()->property} * Fixed compiled/cached files being written in the wrong place when the path to the template contains "../"s * Fixed {if} failing with conditions using upper case operators (i.e. AND) [2008-08-03] 0.9.3 + Adapters: Added the ZendFramework interface for Dwoo (see /Dwoo/Adapters/ZendFramework/README) + Plugins: Added the {a} block plugin to generate tags + Syntax: Added the ";" token that allows to group multiple instructions in one single template tag, example: {if $foo; "> $foo";$bar;/} is equal to: {if $foo}> {$foo}{$bar}{/} - This also allow block operations such as: {a http://url.com; "Text" /} which equals to {a http://url.com}Text{/} + Syntax: Block plugins that you want to call without content can be self-closed just like XML tags (e.g. {a "http://url.com" /} ). Be careful not to close a non-block plugin like that however, since it will close it's parent block + Syntax: Static methods can be called using {Class::method()} + Syntax: It is now possible to use a plugin's result as an object and call a method or read a property from it, i.e. {fetchObject()->doStuff()} + API: Added Dwoo_Plugin::paramsToAttributes() utility function to help with the creation of compilable xml/html-related plugins + API: Added Dwoo->setPluginProxy() and Dwoo_IPluginProxy that allow you to hook into the compiler's plugin subsystem to provide your own plugin calls. Thanks to Denis Arh for the patch => http://forum.dwoo.org/viewtopic.php?id=70 + API: Dwoo->addPlugin() has a third parameter to mark a plugin as compilable + Compiler supports method calls into a method call's parameters * Dwoo_Compiler::implode_r is now public/static so it can be used in other places such as plugin proxies * Syntax: Math expressions in strings are now only allowed when the entire expression is delimited, e.g. {"/$foo/$bar"} evaluates as just that while {"/`$foo/$bar`"} will result in "/".($foo/$bar), therefore processing the / as a division, this is better since URLs using / are far more common than math in strings => http://forum.dwoo.org/viewtopic.php?id=50 * Compiler now allows the use of the right delimiter inside strings (e.g. {"}"}) * Fixed a bug preventing if blocks containing a {elseif} followed by {else} * Fixed the Dwoo_ILoader interface and implemented it in Dwoo_Loader now => http://forum.dwoo.org/viewtopic.php?id=70 * Fixed a compileId auto-generation creating conflicts * Include allows paths going in upper levels now such as : "../foo.html" * Some compiler fixes regarding custom plugins [2008-06-28] 0.9.2 ! BC Break: Renamed the {strip} modifier/function to {whitespace}, this does not affect the strip block, that has been moved off the compiler into a plugin. Which is why the name conflict had to be resolved. Please report any issue you might encounter when using the strip block ! BC Break: Changed the function signature of Dwoo_Block_Plugin::postProcessing it only affects you if you had any custom block plugins, see UPGRADE_NOTES for more details ! BC Break: Dwoo_ITemplate::cache() must now return the cached file name or false if caching failed, only affects you if you had a custom template class and implemented cache() yourself ! BC Break: Dwoo_Loader is not static anymore so anything you did on it directly will break. Use $dwoo->getLoader()->addDirectory() instead of Dwoo_Loader::addDirectory() for example ! BC Break: DWOO_COMPILE_DIRECTORY and DWOO_CACHE_DIRECTORY are gone, set those paths in Dwoo's constructor (i.e. new Dwoo('compiledir', 'cachedir')) if you need to override the default ones + Plugins: Added {dynamic} that allows cached templates to have dynamic (non-cached) parts, when rendering a cached page, the dynamic parts can still use the variables you provides + Plugins: Added {tif} that acts as a ternary if / allows you to use a ternary operator inside it + API: Added a Dwoo_ILoader interface if you want to provide a custom plugin loading solution (use $dwoo->setLoader($myLoader)) + Added line numbers in compilation errors and improved several error messages + Added magic object-access methods to Dwoo_Data, so you can assign values by doing $data->var = $val; instead of $data->assign('var', $val); + Added get()/unassign()/isAssigned() methods to read, remove and check for the presence of a var inside a Dwoo_Data object * Plugins: added a fifth 'string $implode' parameter to {foreach}, it prints whatever you provide it between each item of the foreach, just like implode() * Plugins: added a fourth 'bool $case_sensitive' parameter to {replace} * Plugins: added a fourth 'bool $trim' parameter to {capture} that trims the captured text * Made the dependency on the hash extension optional * Fixed compiler bug that prevented method calls combined with named parameters * Fixed compiler bug that prevented the % shortcut for constants to work within function calls (basically it only worked as {%CONST}) * Fixed compiler bug that prevented empty() to be called * Fixed several modifier parsing bugs => http://forum.dwoo.org/viewtopic.php?id=27 * Fixed empty string parsing in modifier applied to variables * Fixed compiler handling of {template_tag} where there was no ';' at the end of the php tag * Allowed method calls to work with named parameters * Removed checks for methods/properties being present on objects before calling them since these can be handled by __get() and __call() => http://forum.dwoo.org/viewtopic.php?id=22 * Calling {func (params)} (with the space between function and params) is now allowed => http://forum.dwoo.org/viewtopic.php?id=21 * The compiler now allows \r, \n and \t to be parameter splitters as well as "," and " ". You can therefore split complex function calls on multiple lines * Converted most of the code to follow PEAR Coding Standards, hopefully this didn't break anything that the tests missed * A few other minor or internal changes [2008-05-30] 0.9.1 + API: Added Dwoo_Compiler->setAutoEscape() and getAutoEscape() to modify the automatic html entity escaping setting. This is disabled by default, and when enabled can be overriden with the {safe $var} plugin or the {auto_escape disable} block plugin. The block plugin can also be used to enable this mode from within a template + Syntax: Mixing named and unnamed parameters is now allowed, as long as the unnamed ones appear first + Syntax: Added {/} shortcut that closes the last opened block * Optimized scope-handling functions, {loop} and {with} are now slightly faster * Fixed a bug in {date_format} that prevented anything but unix timestamps to work * {literal} and {strip} now follow the LooseOpeningsHandling setting * Fixed complex variables (i.e. {$_root[$c[$x.0]].0}) parsing bugs * Fixed $dwoo->addResource() breaking if the resource class was not loaded yet, autoload should now be called (thanks mike) * Fixed a block stack bug that messed up {textformat} and possibly usermade block plugins [2008-05-10] 0.9.0 ! BC Break: changed all class names to be PEAR compliant (aka use underscores to separate words/paths), sorry about that but I better do it now than in six months ! BC Break: $dwoo->output() and get() have been swapped internally, but it doesn't change anything for you unless you called output(*, *, *, true) directly to emulate get(). This was done to reduce some overhead ! BC Break: $dwoo->getTemplate() changed to $dwoo->templateFactory() and $dwoo->getCurrentTemplate() changed to $dwoo->getTemplate() for consistency among all classes and factory functions + Added a compiled version of Dwoo that loads faster (especially with opcode caches such as APC), include Dwoo.compiled.php instead of Dwoo.php on production but if you want to file a bug use Dwoo.php please as it allows you to get the proper file/line number where an error occurs. Do not remove all other files however since they are not all included in the compiled package + Plugins: Added {extends} and {block} to handle template inheritance, read more about it at http://wiki.dwoo.org/index.php/TemplateInheritance + Plugins: Added {loop} that combines {foreach} and {with}, see http://wiki.dwoo.org/index.php/Block:loop for details + Plugins: Added {do} that executes whatever you feed it whitout echoing the result, used internally for extends but you can use it if required + Plugins: Added {eol} that prints an end of line character (OS-specific) + Syntax: Added shortcut for {$dwoo.const.*} using '%', for example you can use {%FOO} instead of {$dwoo.const.FOO} + Syntax: When using named parameters, typing a parameter name without any value is the same as typing param=true, for example {foo name="test" bar} and {foo name="test" bar=true} are equals, can be useful for very complex plugins with huge amounts of parameters. + Syntax: Added support for {$foo+=5}, {$foo="a"}, {$foo++} and {$foo--} + Syntax: Added shortcut for $dwoo.*, you can now use {$.foreach.foo} instead of {$dwoo.foreach.foo} for example, applies to all $dwoo.* vars + Syntax: Added $ as a shortcut for current scope, $_ for $_parent and $__ for $_root + API: Added getSource(), getUid() and getResourceIdentifier() to Dwoo_ITemplate + API: Added setSecurityPolicy() too Dwoo_ICompiler and modified the arguments of its compile() method + API: Added a bunch of utility functions to Dwoo_Compiler, allowing compiled plugins to access more of the compiler internals + Both cache and compile IDs can now have slashes in them to create subfolders in the cache/compile dirs + Added a DWOO_CHMOD constant that, if set before you include Dwoo, allows you to define the file mode of all the file/directories Dwoo will write, defaults to 0777 + Added a 'data' argument to {include} to be able to feed data directly into it * The compiler now throws Dwoo_Compilation_Exception exceptions upon failure and security problems lead to a Dwoo_Security_Exception being thrown. Runtime plugin errors and such trigger simple php errors to allow the template execution to complete * Fixed a potential concurrency issue (thanks to Rasmus Schultz for the patch) * Moved all files to Dwoo/Class.php excepted for the core Dwoo.php file * Various performance improvements, including the removal of a lot of isset() calls. Doing {$foo} if foo is undefined will now display a PHP warning, but doing {foreach $foo}..{/foreach} will not however, that way you don't have to do {if isset($foo)} before the foreach, but automated isset() calls don't impact performance as much as they did before. * API: Dwoo_ITemplate->clearCache now requires a Dwoo instance as its first arg, should not affect you unless you built a custom template class from scratch * Reworked Dwoo template rendering to avoid variable conflicts with plugins * {include} now uses the current resource if none is provided instead of using file as it did before * Dwoo uses include path instead of absolute includes * Changed all line endings to Unix (line feed only) and all spaces left have been converted to tabs (tabspace 4) * TestFest happened early for Dwoo, lots of new tests and more code covered * Fixed a regression in the handling of custom class plugins * Fixed various bugs in the Adapter class and related smarty compatibility features * Fixed a classpath rebuilding bug that occured on some UNIX platforms due to glob() returning false sometimes for empty folders * Fixed a bug in Dwoo_Security_Policy->getAllowedDirectories(), no security issue though * Fixed a bug in Dwoo::setScope affecting {loop} and {with} * Fixed a parsing bug when doing {"string"|modifier:$var} [2008-04-09] 0.3.4 ! BC Break: DWOO_PATH constant changed to DWOO_DIRECTORY ! BC Break: Smarty's @ operator for modifiers is now reversed, for example $array|reverse will reverse the items of that array while $array|@reverse will reverse each item of the given array (as if you used array_map) + Syntax: Added support for method calls on objects i.e. {$foo->bar()} + Added support for smarty security features, see the DwooSecurityPolicy class and $dwoo->setSecurityPolicy() + API: Added a DwooCompiler->setLooseOpeningHandling() method that, if set to true, allows tags to contain spaces between the opening bracket and the content. Turned off by default as it allows to compile files containing css and javascript without the need to escape it through {literal} or \{ + Added DWOO_CACHE_DIRECTORY and DWOO_COMPILE_DIRECTORY constants that you can set before including Dwoo.php to override the defaults (although Dwoo->setCacheDir/setCompileDir() still work to change that if required) + Added the DwooException class + Smarty: Added partial support for register_object(), unregister_object() and get_registered_object(). All features can not be supported by the adapter though so you might get compatibility warnings * Fixed {elseif} bug that appeared when multiple elseif tags were used in a row * Syntax: Improved simple math support to work within variable variables (i.e. you can do {$array[$index+1]}) and within strings as well. To prevent this enclose the variables in backticks (i.e. {"$foo/$bar"} will do the math while {"`$foo`/$bar"} won't as $foo is properly delimited) * Changed DwooLoader::addDirectory() so that it writes the class paths cache into DWOO_COMPILE_DIRECTORY, that way you don't have to make your plugin directory writable * Made all the error triggering more consistent * Changed automatic cacheId generation in DwooTemplateFile/String to be faster [2008-03-19] 0.3.3 + Syntax: Added support for $dwoo.const.CONSTANT and $dwoo.const.Class::CONSTANT to read PHP constants from the template + Syntax: Added support for on/off/yes/no, that work as aliases for true/false + Syntax: Added the $dwoo.charset global variable + Plugins: Added {withelse} and made {with} compatible with {else} also + API: Added left/right delimiters customization, see DwooCompiler->setDelimiters() + API: Added DwooCompiler->triggerError() + API: Added Dwoo->clearCache() and DwooITemplate->clearCache() methods + Smarty: The smartyCompat prefilter converts {section} tags into {for} tags on the fly, however it's not guaranteed to work with *all* section tags, let me know if it breaks for you * {with} now skips the entire block if it's variable doesn't exist, so by itself it acts as if you would do {if $var}{with $var}{/with}{/if} * Each resource has a compiler factory function assigned to it, allowing you to easily provide a custom compiler without loading it on every page * OutputFilters are now simply called Filters (they still use DwooFilter) * Pre/PostFilters have become Pre/PostProcessors (they now use DwooProcessor) * Compiler: Fixed parsing bug that prevented function names of 1character * Compiler: Changed internal handling of variables to fix some errors being thrown with specific cases * Reorganized Dwoo/DwooCompiler and fully commented all the core classes and interfaces [2008-03-09] 0.3.2 + Added access to superglobals through $dwoo.get.value, $dwoo.post.value, etc. + Added outputFilters to Dwoo (use Dwoo->addOutputFilter and Dwoo->removeOutputFilter) + Added preFilters and postFilters to DwooCompiler (use DwooCompiler->addPreFilter, etc) + Added a html_format output filter that intends properly the html code, use it only on full page templates + Plugins: Added {for} and {forelse} which allow to loop over an array or to loop over a range of numbers + Plugins: Added {mailto}, {counter}, {eval}, {fetch} and {include} + Syntax : Enhanced support for implicit math operations, {$var+$var2*var3+5} now works. Operations are executed from left to right though, there is no operator priority. (i.e. 1+1*2 = (1+1)*2 = 4, not 3) + API: Added resources support through DwooITemplate implementations and Dwoo->addResource() + API: Added Dwoo->getTemplate() to get the currently running template object + API: Added DwooCompiler::getInstance() to use only one compiler object when rendering from the default compiler and to provide you with a singleton if it's easier, however the class is not a singleton in the sense that it can be instantiated separately + API: Added a factory method on DwooITemplate to support resources creation + Added a release tag so that all compiled templates are forced to recompile after an update, however it is recommended to cleanup your "compiled" directory now and then as each release uses new filenames + Added an abstract DwooFilter class that you can extend to build filters * PHP function calls are now case insensitive * Syntax: The compiler now parses expressions before modifiers, allowing for {$var/2|number_format} for example * DwooTemplateFile now extends DwooTemplateString instead of the other way around as it was before * {else} is now a general purpose plugin that can act as 'else' for foreach, for and if/elseif, foreachelse is still available though [2008-03-05] 0.3.1 + Added {cycle} function + Syntax : Enabled support for associative arrays using array(key="value", key2=5) for example, which you can assign or use in a foreach directly + Syntax : Added support for {$var +-/*% X} (i.e. {$var + 4}), useful for simple math operations without the math plugin + API : Added append/appendByRef to DwooData + Completely rebuilt DwooSmartyAdapter, it should "work" and fail silently if you use a non supported function now, however you can set $smarty->show_compat_errors=true; on it to receive notices about unsupported features that you use * Bug fixed in {literal} parsing * Bug fixed in smarty functions handling * API : Moved Plugin types constants to Dwoo so the compiler doesn't have to be loaded unles really required * API : Moved globals and var reinitialization in Dwoo into their own methods so that child classes can easily add globals * Some improvements in the compiler output * Some changes in the cache handling of DwooTemplateFile - Special thanks to Andrew Collins that found many of the bugs fixed in this release [2008-03-02] 0.3.0 + Full template cache support + DwooTemplateString class to load templates from a string + Dwoo::VERSION constant + {dump} plugin to print out variables + Unit tests (with PHPUnit) covering 73% of the codebase right now, which should help reducing regression bugs in the next versions. + Started commenting (with phpdocs) properly all the classes, should be complete for 0.4.0 * {capture} is now compilable and has a new boolean flag to append output into the target variable instead of overwriting * {foreach} supports direct input (instead of only variables), allowing constructs like {foreach array(a,b,c) val}{$val}{/foreach} for example that would output abc. * pre/postProcessing functions in block plugins now receive an array of named parameters instead of numbered * Major refactoring of DwooTemplateFile and DwooCompiler * Cleaned up members visibility in Dwoo/DwooCompiler * Fixes in the compiler parsing and general variables handling * Multiple bugfixes here and there thanks to the unit tests * Optimized {foreach} a lot [2008-02-19] 0.2.1 * Compiler fixes for argument parsing and handling of Smarty plugins [2008-02-14] 0.2.0 + Added support for plugins made for Smarty (that includes modifiers, functions and blocks). Not thoroughly tested. + Major API changes in the way Dwoo must be run, it's now much more flexible and should not change too much in the future. + Added support for custom plugins, filters should come in the next version although the API to register them is already in. [2008-02-08] 0.1.0 Initial releasenagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo.compiled.php000066400000000000000000001220571225466040700263450ustar00rootroot00000000000000 array ( 'class' => 'Dwoo_Template_File', 'compiler' => null ), 'string' => array ( 'class' => 'Dwoo_Template_String', 'compiler' => null ) ); protected $loader = null; protected $template = null; protected $runtimePlugins; protected $data; public $scope; protected $scopeTree; protected $stack; protected $curBlock; protected $buffer; protected $pluginProxy; public function __construct($compileDir = null, $cacheDir = null) { if ($compileDir !== null) { $this->setCompileDir($compileDir); } if ($cacheDir !== null) { $this->setCacheDir($cacheDir); } $this->initGlobals(); } public function __clone() { $this->template = null; unset($this->data); } public function output($tpl, $data = array(), Dwoo_ICompiler $compiler = null) { return $this->get($tpl, $data, $compiler, true); } public function get($_tpl, $data = array(), $_compiler = null, $_output = false) { if ($this->template instanceof Dwoo_ITemplate) { $proxy = clone $this; return $proxy->get($_tpl, $data, $_compiler, $_output); } if ($_tpl instanceof Dwoo_ITemplate) { } elseif (is_string($_tpl) && file_exists($_tpl)) { $_tpl = new Dwoo_Template_File($_tpl); } else { throw new Dwoo_Exception('Dwoo->get/Dwoo->output\'s first argument must be a Dwoo_ITemplate (i.e. Dwoo_Template_File) or a valid path to a template file', E_USER_NOTICE); } $this->template = $_tpl; if ($data instanceof Dwoo_IDataProvider) { $this->data = $data->getData(); } elseif (is_array($data)) { $this->data = $data; } else { throw new Dwoo_Exception('Dwoo->get/Dwoo->output\'s data argument must be a Dwoo_IDataProvider object (i.e. Dwoo_Data) or an associative array', E_USER_NOTICE); } $this->globals['template'] = $_tpl->getName(); $this->initRuntimeVars($_tpl); $file = $_tpl->getCachedTemplate($this); $doCache = $file === true; $cacheLoaded = is_string($file); if ($cacheLoaded === true) { if ($_output === true) { include $file; $this->template = null; } else { ob_start(); include $file; $this->template = null; return ob_get_clean(); } } else { if ($doCache === true) { $dynamicId = uniqid(); } $out = include $_tpl->getCompiledTemplate($this, $_compiler); if ($out === false) { $_tpl->forceCompilation(); $out = include $_tpl->getCompiledTemplate($this, $_compiler); } if ($doCache === true) { $out = preg_replace('/(<%|%>|<\?php|<\?|\?>)/', '', $out); if (!class_exists('Dwoo_plugin_dynamic', false)) { $this->getLoader()->loadPlugin('dynamic'); } $out = Dwoo_Plugin_dynamic::unescape($out, $dynamicId); } foreach ($this->filters as $filter) { if (is_array($filter) && $filter[0] instanceof Dwoo_Filter) { $out = call_user_func($filter, $out); } else { $out = call_user_func($filter, $this, $out); } } if ($doCache === true) { $file = $_tpl->cache($this, $out); if ($_output === true) { include $file; $this->template = null; } else { ob_start(); include $file; $this->template = null; return ob_get_clean(); } } else { $this->template = null; if ($_output === true) { echo $out; } else { return $out; } } } } protected function initGlobals() { $this->globals = array ( 'version' => self::VERSION, 'ad' => 'Powered by Dwoo', 'now' => $_SERVER['REQUEST_TIME'], 'charset' => $this->charset, ); } protected function initRuntimeVars(Dwoo_ITemplate $tpl) { $this->runtimePlugins = array(); $this->scope =& $this->data; $this->scopeTree = array(); $this->stack = array(); $this->curBlock = null; $this->buffer = ''; } public function addPlugin($name, $callback, $compilable = false) { $compilable = $compilable ? self::COMPILABLE_PLUGIN : 0; if (is_array($callback)) { if (is_subclass_of(is_object($callback[0]) ? get_class($callback[0]) : $callback[0], 'Dwoo_Block_Plugin')) { $this->plugins[$name] = array('type'=>self::BLOCK_PLUGIN | $compilable, 'callback'=>$callback, 'class'=>(is_object($callback[0]) ? get_class($callback[0]) : $callback[0])); } else { $this->plugins[$name] = array('type'=>self::CLASS_PLUGIN | $compilable, 'callback'=>$callback, 'class'=>(is_object($callback[0]) ? get_class($callback[0]) : $callback[0]), 'function'=>$callback[1]); } } elseif (class_exists($callback, false)) { if (is_subclass_of($callback, 'Dwoo_Block_Plugin')) { $this->plugins[$name] = array('type'=>self::BLOCK_PLUGIN | $compilable, 'callback'=>$callback, 'class'=>$callback); } else { $this->plugins[$name] = array('type'=>self::CLASS_PLUGIN | $compilable, 'callback'=>$callback, 'class'=>$callback, 'function'=>'process'); } } elseif (function_exists($callback)) { $this->plugins[$name] = array('type'=>self::FUNC_PLUGIN | $compilable, 'callback'=>$callback); } else { throw new Dwoo_Exception('Callback could not be processed correctly, please check that the function/class you used exists'); } } public function removePlugin($name) { if (isset($this->plugins[$name])) { unset($this->plugins[$name]); } } public function addFilter($callback, $autoload = false) { if ($autoload) { $class = 'Dwoo_Filter_'.$callback; if (!class_exists($class, false) && !function_exists($class)) { try { $this->getLoader()->loadPlugin($callback); } catch (Dwoo_Exception $e) { if (strstr($callback, 'Dwoo_Filter_')) { throw new Dwoo_Exception('Wrong filter name : '.$callback.', the "Dwoo_Filter_" prefix should not be used, please only use "'.str_replace('Dwoo_Filter_', '', $callback).'"'); } else { throw new Dwoo_Exception('Wrong filter name : '.$callback.', when using autoload the filter must be in one of your plugin dir as "name.php" containg a class or function named "Dwoo_Filter_name"'); } } } if (class_exists($class, false)) { $callback = array(new $class($this), 'process'); } elseif (function_exists($class)) { $callback = $class; } else { throw new Dwoo_Exception('Wrong filter name : '.$callback.', when using autoload the filter must be in one of your plugin dir as "name.php" containg a class or function named "Dwoo_Filter_name"'); } $this->filters[] = $callback; } else { $this->filters[] = $callback; } } public function removeFilter($callback) { if (($index = array_search('Dwoo_Filter_'.$callback, $this->filters, true)) !== false) { unset($this->filters[$index]); } elseif (($index = array_search($callback, $this->filters, true)) !== false) { unset($this->filters[$index]); } else { $class = 'Dwoo_Filter_' . $callback; foreach ($this->filters as $index=>$filter) { if (is_array($filter) && $filter[0] instanceof $class) { unset($this->filters[$index]); break; } } } } public function addResource($name, $class, $compilerFactory = null) { if (strlen($name) < 2) { throw new Dwoo_Exception('Resource names must be at least two-character long to avoid conflicts with Windows paths'); } if (!class_exists($class)) { throw new Dwoo_Exception('Resource class does not exist'); } $interfaces = class_implements($class); if (in_array('Dwoo_ITemplate', $interfaces) === false) { throw new Dwoo_Exception('Resource class must implement Dwoo_ITemplate'); } $this->resources[$name] = array('class'=>$class, 'compiler'=>$compilerFactory); } public function removeResource($name) { unset($this->resources[$name]); if ($name==='file') { $this->resources['file'] = array('class'=>'Dwoo_Template_File', 'compiler'=>null); } } public function setLoader(Dwoo_ILoader $loader) { $this->loader = $loader; } public function getLoader() { if ($this->loader === null) { $this->loader = new Dwoo_Loader($this->getCompileDir()); } return $this->loader; } public function getCustomPlugins() { return $this->plugins; } public function getCacheDir() { if ($this->cacheDir === null) { $this->setCacheDir(dirname(__FILE__).DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR); } return $this->cacheDir; } public function setCacheDir($dir) { $this->cacheDir = rtrim($dir, '/\\').DIRECTORY_SEPARATOR; if (is_writable($this->cacheDir) === false) { throw new Dwoo_Exception('The cache directory must be writable, chmod "'.$this->cacheDir.'" to make it writable'); } } public function getCompileDir() { if ($this->compileDir === null) { $this->setCompileDir(dirname(__FILE__).DIRECTORY_SEPARATOR.'compiled'.DIRECTORY_SEPARATOR); } return $this->compileDir; } public function setCompileDir($dir) { $this->compileDir = rtrim($dir, '/\\').DIRECTORY_SEPARATOR; if (is_writable($this->compileDir) === false) { throw new Dwoo_Exception('The compile directory must be writable, chmod "'.$this->compileDir.'" to make it writable'); } } public function getCacheTime() { return $this->cacheTime; } public function setCacheTime($seconds) { $this->cacheTime = (int) $seconds; } public function getCharset() { return $this->charset; } public function setCharset($charset) { $this->charset = strtolower((string) $charset); } public function getTemplate() { return $this->template; } public function setDefaultCompilerFactory($resourceName, $compilerFactory) { $this->resources[$resourceName]['compiler'] = $compilerFactory; } public function getDefaultCompilerFactory($resourceName) { return $this->resources[$resourceName]['compiler']; } public function setSecurityPolicy(Dwoo_Security_Policy $policy = null) { $this->securityPolicy = $policy; } public function getSecurityPolicy() { return $this->securityPolicy; } public function setPluginProxy(Dwoo_IPluginProxy $pluginProxy) { $this->pluginProxy = $pluginProxy; } public function getPluginProxy() { return $this->pluginProxy; } public function isCached(Dwoo_ITemplate $tpl) { return is_string($tpl->getCachedTemplate($this)); } public function clearCache($olderThan=-1) { $cacheDirs = new RecursiveDirectoryIterator($this->getCacheDir()); $cache = new RecursiveIteratorIterator($cacheDirs); $expired = time() - $olderThan; $count = 0; foreach ($cache as $file) { if ($cache->isDot() || $cache->isDir() || substr($file, -5) !== '.html') { continue; } if ($cache->getCTime() < $expired) { $count += unlink((string) $file) ? 1 : 0; } } return $count; } public function templateFactory($resourceName, $resourceId, $cacheTime = null, $cacheId = null, $compileId = null, Dwoo_ITemplate $parentTemplate = null) { if (isset($this->resources[$resourceName])) { return call_user_func(array($this->resources[$resourceName]['class'], 'templateFactory'), $this, $resourceId, $cacheTime, $cacheId, $compileId, $parentTemplate); } else { throw new Dwoo_Exception('Unknown resource type : '.$resourceName); } } public function isArray($value, $checkIsEmpty=false) { if (is_array($value) === true) { if ($checkIsEmpty === false) { return true; } else { return count($value) > 0; } } elseif ($value instanceof Iterator) { if ($checkIsEmpty === false) { return true; } elseif ($value instanceof Countable) { return count($value) > 0; } else { $value->rewind(); return $value->valid(); } } elseif ($value instanceof ArrayAccess) { if ($checkIsEmpty === false) { return true; } elseif ($value instanceof Countable) { return count($value) > 0; } else { return $value->offsetExists(0); } } return false; } public function triggerError($message, $level=E_USER_NOTICE) { if (!($tplIdentifier = $this->template->getResourceIdentifier())) { $tplIdentifier = $this->template->getResourceName(); } trigger_error('Dwoo error (in '.$tplIdentifier.') : '.$message, $level); } public function addStack($blockName, array $args=array()) { if (isset($this->plugins[$blockName])) { $class = $this->plugins[$blockName]['class']; } else { $class = 'Dwoo_Plugin_'.$blockName; } if ($this->curBlock !== null) { $this->curBlock->buffer(ob_get_contents()); ob_clean(); } else { $this->buffer .= ob_get_contents(); ob_clean(); } $block = new $class($this); $cnt = count($args); if ($cnt===0) { $block->init(); } elseif ($cnt===1) { $block->init($args[0]); } elseif ($cnt===2) { $block->init($args[0], $args[1]); } elseif ($cnt===3) { $block->init($args[0], $args[1], $args[2]); } elseif ($cnt===4) { $block->init($args[0], $args[1], $args[2], $args[3]); } else { call_user_func_array(array($block,'init'), $args); } $this->stack[] = $this->curBlock = $block; return $block; } public function delStack() { $args = func_get_args(); $this->curBlock->buffer(ob_get_contents()); ob_clean(); $cnt = count($args); if ($cnt===0) { $this->curBlock->end(); } elseif ($cnt===1) { $this->curBlock->end($args[0]); } elseif ($cnt===2) { $this->curBlock->end($args[0], $args[1]); } elseif ($cnt===3) { $this->curBlock->end($args[0], $args[1], $args[2]); } elseif ($cnt===4) { $this->curBlock->end($args[0], $args[1], $args[2], $args[3]); } else { call_user_func_array(array($this->curBlock, 'end'), $args); } $tmp = array_pop($this->stack); if (count($this->stack) > 0) { $this->curBlock = end($this->stack); $this->curBlock->buffer($tmp->process()); } else { $this->curBlock = null; echo $tmp->process(); } unset($tmp); } public function getParentBlock(Dwoo_Block_Plugin $block) { $index = array_search($block, $this->stack, true); if ($index !== false && $index > 0) { return $this->stack[$index-1]; } return false; } public function findBlock($type) { if (isset($this->plugins[$type])) { $type = $this->plugins[$type]['class']; } else { $type = 'Dwoo_Plugin_'.str_replace('Dwoo_Plugin_', '', $type); } $keys = array_keys($this->stack); while (($key = array_pop($keys)) !== false) { if ($this->stack[$key] instanceof $type) { return $this->stack[$key]; } } return false; } protected function getObjectPlugin($class) { if (isset($this->runtimePlugins[$class])) { return $this->runtimePlugins[$class]; } return $this->runtimePlugins[$class] = new $class($this); } public function classCall($plugName, array $params = array()) { $class = 'Dwoo_Plugin_'.$plugName; $plugin = $this->getObjectPlugin($class); $cnt = count($params); if ($cnt===0) { return $plugin->process(); } elseif ($cnt===1) { return $plugin->process($params[0]); } elseif ($cnt===2) { return $plugin->process($params[0], $params[1]); } elseif ($cnt===3) { return $plugin->process($params[0], $params[1], $params[2]); } elseif ($cnt===4) { return $plugin->process($params[0], $params[1], $params[2], $params[3]); } else { return call_user_func_array(array($plugin, 'process'), $params); } } public function arrayMap($callback, array $params) { if ($params[0] === $this) { $addThis = true; array_shift($params); } if ((is_array($params[0]) || ($params[0] instanceof Iterator && $params[0] instanceof ArrayAccess))) { if (empty($params[0])) { return $params[0]; } $out = array(); $cnt = count($params); if (isset($addThis)) { array_unshift($params, $this); $items = $params[1]; $keys = array_keys($items); if (is_string($callback) === false) { while (($i = array_shift($keys)) !== null) { $out[] = call_user_func_array($callback, array(1=>$items[$i]) + $params); } } elseif ($cnt===1) { while (($i = array_shift($keys)) !== null) { $out[] = $callback($this, $items[$i]); } } elseif ($cnt===2) { while (($i = array_shift($keys)) !== null) { $out[] = $callback($this, $items[$i], $params[2]); } } elseif ($cnt===3) { while (($i = array_shift($keys)) !== null) { $out[] = $callback($this, $items[$i], $params[2], $params[3]); } } else { while (($i = array_shift($keys)) !== null) { $out[] = call_user_func_array($callback, array(1=>$items[$i]) + $params); } } } else { $items = $params[0]; $keys = array_keys($items); if (is_string($callback) === false) { while (($i = array_shift($keys)) !== null) { $out[] = call_user_func_array($callback, array($items[$i]) + $params); } } elseif ($cnt===1) { while (($i = array_shift($keys)) !== null) { $out[] = $callback($items[$i]); } } elseif ($cnt===2) { while (($i = array_shift($keys)) !== null) { $out[] = $callback($items[$i], $params[1]); } } elseif ($cnt===3) { while (($i = array_shift($keys)) !== null) { $out[] = $callback($items[$i], $params[1], $params[2]); } } elseif ($cnt===4) { while (($i = array_shift($keys)) !== null) { $out[] = $callback($items[$i], $params[1], $params[2], $params[3]); } } else { while (($i = array_shift($keys)) !== null) { $out[] = call_user_func_array($callback, array($items[$i]) + $params); } } } return $out; } else { return $params[0]; } } public function readVarInto($varstr, $data, $safeRead = false) { if ($data === null) { return null; } if (is_array($varstr) === false) { preg_match_all('#(\[|->|\.)?([^.[\]-]+)\]?#i', $varstr, $m); } else { $m = $varstr; } unset($varstr); while (list($k, $sep) = each($m[1])) { if ($sep === '.' || $sep === '[' || $sep === '') { if ((is_array($data) || $data instanceof ArrayAccess) && ($safeRead === false || isset($data[$m[2][$k]]))) { $data = $data[$m[2][$k]]; } else { return null; } } else { if (is_object($data) && ($safeRead === false || isset($data->$m[2][$k]))) { $data = $data->$m[2][$k]; } else { return null; } } } return $data; } public function readParentVar($parentLevels, $varstr = null) { $tree = $this->scopeTree; $cur = $this->data; while ($parentLevels--!==0) { array_pop($tree); } while (($i = array_shift($tree)) !== null) { if (is_object($cur)) { $cur = $cur->$i; } else { $cur = $cur[$i]; } } if ($varstr!==null) { return $this->readVarInto($varstr, $cur); } else { return $cur; } } public function readVar($varstr) { if (is_array($varstr)===true) { $m = $varstr; unset($varstr); } else { if (strstr($varstr, '.') === false && strstr($varstr, '[') === false && strstr($varstr, '->') === false) { if ($varstr === 'dwoo') { return $this->globals; } elseif ($varstr === '__' || $varstr === '_root' ) { return $this->data; $varstr = substr($varstr, 6); } elseif ($varstr === '_' || $varstr === '_parent') { $varstr = '.'.$varstr; $tree = $this->scopeTree; $cur = $this->data; array_pop($tree); while (($i = array_shift($tree)) !== null) { if (is_object($cur)) { $cur = $cur->$i; } else { $cur = $cur[$i]; } } return $cur; } $cur = $this->scope; if (isset($cur[$varstr])) { return $cur[$varstr]; } else { return null; } } if (substr($varstr, 0, 1) === '.') { $varstr = 'dwoo'.$varstr; } preg_match_all('#(\[|->|\.)?([^.[\]-]+)\]?#i', $varstr, $m); } $i = $m[2][0]; if ($i === 'dwoo') { $cur = $this->globals; array_shift($m[2]); array_shift($m[1]); switch ($m[2][0]) { case 'get': $cur = $_GET; break; case 'post': $cur = $_POST; break; case 'session': $cur = $_SESSION; break; case 'cookies': case 'cookie': $cur = $_COOKIE; break; case 'server': $cur = $_SERVER; break; case 'env': $cur = $_ENV; break; case 'request': $cur = $_REQUEST; break; case 'const': array_shift($m[2]); if (defined($m[2][0])) { return constant($m[2][0]); } else { return null; } } if ($cur !== $this->globals) { array_shift($m[2]); array_shift($m[1]); } } elseif ($i === '__' || $i === '_root') { $cur = $this->data; array_shift($m[2]); array_shift($m[1]); } elseif ($i === '_' || $i === '_parent') { $tree = $this->scopeTree; $cur = $this->data; while (true) { array_pop($tree); array_shift($m[2]); array_shift($m[1]); if (current($m[2]) === '_' || current($m[2]) === '_parent') { continue; } while (($i = array_shift($tree)) !== null) { if (is_object($cur)) { $cur = $cur->$i; } else { $cur = $cur[$i]; } } break; } } else { $cur = $this->scope; } while (list($k, $sep) = each($m[1])) { if ($sep === '.' || $sep === '[' || $sep === '') { if ((is_array($cur) || $cur instanceof ArrayAccess) && isset($cur[$m[2][$k]])) { $cur = $cur[$m[2][$k]]; } else { return null; } } elseif ($sep === '->') { if (is_object($cur)) { $cur = $cur->$m[2][$k]; } else { return null; } } else { return null; } } return $cur; } public function assignInScope($value, $scope) { $tree =& $this->scopeTree; $data =& $this->data; if (!is_string($scope)) { return $this->triggerError('Assignments must be done into strings, ('.gettype($scope).') '.var_export($scope, true).' given', E_USER_ERROR); } if (strstr($scope, '.') === false && strstr($scope, '->') === false) { $this->scope[$scope] = $value; } else { preg_match_all('#(\[|->|\.)?([^.[\]-]+)\]?#i', $scope, $m); $cur =& $this->scope; $last = array(array_pop($m[1]), array_pop($m[2])); while (list($k, $sep) = each($m[1])) { if ($sep === '.' || $sep === '[' || $sep === '') { if (is_array($cur) === false) { $cur = array(); } $cur =& $cur[$m[2][$k]]; } elseif ($sep === '->') { if (is_object($cur) === false) { $cur = new stdClass; } $cur =& $cur->$m[2][$k]; } else { return false; } } if ($last[0] === '.' || $last[0] === '[' || $last[0] === '') { if (is_array($cur) === false) { $cur = array(); } $cur[$last[1]] = $value; } elseif ($last[0] === '->') { if (is_object($cur) === false) { $cur = new stdClass; } $cur->$last[1] = $value; } else { return false; } } } public function setScope($scope, $absolute = false) { $old = $this->scopeTree; if (is_string($scope)===true) { $scope = explode('.', $scope); } if ($absolute===true) { $this->scope =& $this->data; $this->scopeTree = array(); } while (($bit = array_shift($scope)) !== null) { if ($bit === '_' || $bit === '_parent') { array_pop($this->scopeTree); $this->scope =& $this->data; $cnt = count($this->scopeTree); for ($i=0;$i<$cnt;$i++) $this->scope =& $this->scope[$this->scopeTree[$i]]; } elseif ($bit === '__' || $bit === '_root') { $this->scope =& $this->data; $this->scopeTree = array(); } elseif (isset($this->scope[$bit])) { $this->scope =& $this->scope[$bit]; $this->scopeTree[] = $bit; } else { unset($this->scope); $this->scope = null; } } return $old; } public function getData() { return $this->data; } public function &getScope() { return $this->scope; } public function __call($method, $args) { return call_user_func_array($this->getPluginProxy()->getCallback($method), $args); } } interface Dwoo_IPluginProxy { public function handles($name); public function getCode($name, $params); public function getCallback($name); public function getLoader($name); } interface Dwoo_IElseable { } interface Dwoo_ILoader { public function loadPlugin($class, $forceRehash = true); } class Dwoo_Loader implements Dwoo_ILoader { protected $paths = array(); protected $classPath = array(); protected $cacheDir; protected $corePluginDir; public function __construct($cacheDir) { $this->corePluginDir = DWOO_DIRECTORY . 'plugins'; $this->cacheDir = rtrim($cacheDir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; $foo = @file_get_contents($this->cacheDir.'classpath.cache.d'.Dwoo::RELEASE_TAG.'.php'); if ($foo) { $this->classPath = unserialize($foo) + $this->classPath; } else { $this->rebuildClassPathCache($this->corePluginDir, $this->cacheDir.'classpath.cache.d'.Dwoo::RELEASE_TAG.'.php'); } } protected function rebuildClassPathCache($path, $cacheFile) { if ($cacheFile!==false) { $tmp = $this->classPath; $this->classPath = array(); } $list = glob(rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . '*'); if (is_array($list)) { foreach ($list as $f) { if (is_dir($f)) { $this->rebuildClassPathCache($f, false); } else { $this->classPath[str_replace(array('function.','block.','modifier.','outputfilter.','filter.','prefilter.','postfilter.','pre.','post.','output.','shared.','helper.'), '', basename($f, '.php'))] = $f; } } } if ($cacheFile!==false) { if (!file_put_contents($cacheFile, serialize($this->classPath))) { throw new Dwoo_Exception('Could not write into '.$cacheFile.', either because the folder is not there (create it) or because of the chmod configuration (please ensure this directory is writable by php), alternatively you can change the directory used with $dwoo->setCompileDir() or provide a custom loader object with $dwoo->setLoader()'); } $this->classPath += $tmp; } } public function loadPlugin($class, $forceRehash = true) { if (!isset($this->classPath[$class]) || !(include $this->classPath[$class])) { if ($forceRehash) { $this->rebuildClassPathCache($this->corePluginDir, $this->cacheDir . 'classpath.cache.d'.Dwoo::RELEASE_TAG.'.php'); foreach ($this->paths as $path=>$file) { $this->rebuildClassPathCache($path, $file); } if (isset($this->classPath[$class])) { include $this->classPath[$class]; } else { throw new Dwoo_Exception('Plugin '.$class.' can not be found, maybe you forgot to bind it if it\'s a custom plugin ?', E_USER_NOTICE); } } else { throw new Dwoo_Exception('Plugin '.$class.' can not be found, maybe you forgot to bind it if it\'s a custom plugin ?', E_USER_NOTICE); } } } public function addDirectory($pluginDirectory) { $pluginDir = realpath($pluginDirectory); if (!$pluginDir) { throw new Dwoo_Exception('Plugin directory does not exist or can not be read : '.$pluginDirectory); } $cacheFile = $this->cacheDir . 'classpath-'.substr(strtr($pluginDir, '/\\:'.PATH_SEPARATOR, '----'), strlen($pluginDir) > 80 ? -80 : 0).'.d'.Dwoo::RELEASE_TAG.'.php'; $this->paths[$pluginDir] = $cacheFile; $foo = @file_get_contents($cacheFile); if ($foo) { $this->classPath = unserialize($foo) + $this->classPath; } else { $this->rebuildClassPathCache($pluginDir, $cacheFile); } } } class Dwoo_Exception extends Exception { } class Dwoo_Security_Policy { const PHP_ENCODE = 1; const PHP_REMOVE = 2; const PHP_ALLOW = 3; const CONST_DISALLOW = false; const CONST_ALLOW = true; protected $allowedPhpFunctions = array ( 'str_repeat', 'number_format', 'htmlentities', 'htmlspecialchars', 'long2ip', 'strlen', 'list', 'empty', 'count', 'sizeof', 'in_array', 'is_array', ); protected $allowedDirectories = array(); protected $phpHandling = self::PHP_REMOVE; protected $constHandling = self::CONST_DISALLOW; public function allowPhpFunction($func) { if (is_array($func)) foreach ($func as $fname) $this->allowedPhpFunctions[strtolower($fname)] = true; else $this->allowedPhpFunctions[strtolower($func)] = true; } public function disallowPhpFunction($func) { if (is_array($func)) foreach ($func as $fname) unset($this->allowedPhpFunctions[strtolower($fname)]); else unset($this->allowedPhpFunctions[strtolower($func)]); } public function getAllowedPhpFunctions() { return $this->allowedPhpFunctions; } public function allowDirectory($path) { if (is_array($path)) foreach ($path as $dir) $this->allowedDirectories[realpath($dir)] = true; else $this->allowedDirectories[realpath($path)] = true; } public function disallowDirectory($path) { if (is_array($path)) foreach ($path as $dir) unset($this->allowedDirectories[realpath($dir)]); else unset($this->allowedDirectories[realpath($path)]); } public function getAllowedDirectories() { return $this->allowedDirectories; } public function setPhpHandling($level = self::PHP_REMOVE) { $this->phpHandling = $level; } public function getPhpHandling() { return $this->phpHandling; } public function setConstantHandling($level = self::CONST_DISALLOW) { $this->constHandling = $level; } public function getConstantHandling() { return $this->constHandling; } } class Dwoo_Security_Exception extends Dwoo_Exception { } interface Dwoo_ICompilable { } interface Dwoo_ICompiler { public function compile(Dwoo $dwoo, Dwoo_ITemplate $template); public function setCustomPlugins(array $customPlugins); public function setSecurityPolicy(Dwoo_Security_Policy $policy = null); } interface Dwoo_IDataProvider { public function getData(); } interface Dwoo_ITemplate { public function getCacheTime(); public function setCacheTime($seconds = null); public function getCachedTemplate(Dwoo $dwoo); public function cache(Dwoo $dwoo, $output); public function clearCache(Dwoo $dwoo, $olderThan = -1); public function getCompiledTemplate(Dwoo $dwoo, Dwoo_ICompiler $compiler = null); public function getName(); public function getResourceName(); public function getResourceIdentifier(); public function getSource(); public function getUid(); public function getCompiler(); public function getIsModifiedCode(); public static function templateFactory(Dwoo $dwoo, $resourceId, $cacheTime = null, $cacheId = null, $compileId = null, Dwoo_ITemplate $parentTemplate = null); } interface Dwoo_ICompilable_Block { } abstract class Dwoo_Plugin { protected $dwoo; public function __construct(Dwoo $dwoo) { $this->dwoo = $dwoo; } public static function paramsToAttributes(array $params, $delim = '\'') { if (isset($params['*'])) { $params = array_merge($params, $params['*']); unset($params['*']); } $out = ''; foreach ($params as $attr=>$val) { $out .= ' '.$attr.'='; if (trim($val, '"\'')=='' || $val=='null') { $out .= str_replace($delim, '\\'.$delim, '""'); } elseif (substr($val, 0, 1) === $delim && substr($val, -1) === $delim) { $out .= str_replace($delim, '\\'.$delim, '"'.substr($val, 1, -1).'"'); } else { $out .= str_replace($delim, '\\'.$delim, '"') . $delim . '.'.$val.'.' . $delim . str_replace($delim, '\\'.$delim, '"'); } } return ltrim($out); } } abstract class Dwoo_Block_Plugin extends Dwoo_Plugin { protected $buffer = ''; public function buffer($input) { $this->buffer .= $input; } public function end() { } public function process() { return $this->buffer; } public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type) { return Dwoo_Compiler::PHP_OPEN.$prepend.'$this->addStack("'.$type.'", array('.Dwoo_Compiler::implode_r($compiler->getCompiledParams($params)).'));'.$append.Dwoo_Compiler::PHP_CLOSE; } public static function postProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $content) { return $content . Dwoo_Compiler::PHP_OPEN.$prepend.'$this->delStack();'.$append.Dwoo_Compiler::PHP_CLOSE; } } abstract class Dwoo_Filter { protected $dwoo; public function __construct(Dwoo $dwoo) { $this->dwoo = $dwoo; } abstract public function process($input); } abstract class Dwoo_Processor { protected $compiler; public function __construct(Dwoo_Compiler $compiler) { $this->compiler = $compiler; } abstract public function process($input); } class Dwoo_Template_String implements Dwoo_ITemplate { protected $name; protected $compileId; protected $cacheId; protected $cacheTime; protected $compilationEnforced; protected static $cache = array('cached'=>array(), 'compiled'=>array()); protected $compiler; protected $chmod = 0777; public function __construct($templateString, $cacheTime = null, $cacheId = null, $compileId = null) { $this->template = $templateString; if (function_exists('hash')) { $this->name = hash('md4', $templateString); } else { $this->name = md5($templateString); } $this->cacheTime = $cacheTime; if ($compileId !== null) { $this->compileId = str_replace('../', '__', strtr($compileId, '\\%?=!:;'.PATH_SEPARATOR, '/-------')); } if ($cacheId !== null) { $this->cacheId = str_replace('../', '__', strtr($cacheId, '\\%?=!:;'.PATH_SEPARATOR, '/-------')); } } public function getCacheTime() { return $this->cacheTime; } public function setCacheTime($seconds = null) { $this->cacheTime = $seconds; } public function getChmod() { return $this->chmod; } public function setChmod($mask = null) { $this->chmod = $mask; } public function getName() { return $this->name; } public function getResourceName() { return 'string'; } public function getResourceIdentifier() { return false; } public function getSource() { return $this->template; } public function getUid() { return $this->name; } public function getCompiler() { return $this->compiler; } public function forceCompilation() { $this->compilationEnforced = true; } public function getCachedTemplate(Dwoo $dwoo) { if ($this->cacheTime !== null) { $cacheLength = $this->cacheTime; } else { $cacheLength = $dwoo->getCacheTime(); } if ($cacheLength === 0) { return false; } $cachedFile = $this->getCacheFilename($dwoo); if (isset(self::$cache['cached'][$this->cacheId]) === true && file_exists($cachedFile)) { return $cachedFile; } elseif ($this->compilationEnforced !== true && file_exists($cachedFile) && ($cacheLength === -1 || filemtime($cachedFile) > ($_SERVER['REQUEST_TIME'] - $cacheLength))) { self::$cache['cached'][$this->cacheId] = true; return $cachedFile; } else { return true; } } public function cache(Dwoo $dwoo, $output) { $cacheDir = $dwoo->getCacheDir(); $cachedFile = $this->getCacheFilename($dwoo); $temp = tempnam($cacheDir, 'temp'); if (!($file = @fopen($temp, 'wb'))) { $temp = $cacheDir . uniqid('temp'); if (!($file = @fopen($temp, 'wb'))) { trigger_error('Error writing temporary file \''.$temp.'\'', E_USER_WARNING); return false; } } fwrite($file, $output); fclose($file); $this->makeDirectory(dirname($cachedFile), $cacheDir); if (!@rename($temp, $cachedFile)) { @unlink($cachedFile); @rename($temp, $cachedFile); } if ($this->chmod !== null) { chmod($cachedFile, $this->chmod); } self::$cache['cached'][$this->cacheId] = true; return $cachedFile; } public function clearCache(Dwoo $dwoo, $olderThan = -1) { $cachedFile = $this->getCacheFilename($dwoo); return !file_exists($cachedFile) || (filectime($cachedFile) < (time() - $olderThan) && unlink($cachedFile)); } public function getCompiledTemplate(Dwoo $dwoo, Dwoo_ICompiler $compiler = null) { $compiledFile = $this->getCompiledFilename($dwoo); if ($this->compilationEnforced !== true && isset(self::$cache['compiled'][$this->compileId]) === true) { } elseif ($this->compilationEnforced !== true && $this->isValidCompiledFile($compiledFile)) { self::$cache['compiled'][$this->compileId] = true; } else { $this->compilationEnforced = false; if ($compiler === null) { $compiler = $dwoo->getDefaultCompilerFactory($this->getResourceName()); if ($compiler === null || $compiler === array('Dwoo_Compiler', 'compilerFactory')) { if (class_exists('Dwoo_Compiler', false) === false) { include DWOO_DIRECTORY . 'Dwoo/Compiler.php'; } $compiler = Dwoo_Compiler::compilerFactory(); } else { $compiler = call_user_func($compiler); } } $this->compiler = $compiler; $compiler->setCustomPlugins($dwoo->getCustomPlugins()); $compiler->setSecurityPolicy($dwoo->getSecurityPolicy()); $this->makeDirectory(dirname($compiledFile), $dwoo->getCompileDir()); file_put_contents($compiledFile, $compiler->compile($dwoo, $this)); if ($this->chmod !== null) { chmod($compiledFile, $this->chmod); } self::$cache['compiled'][$this->compileId] = true; } return $compiledFile; } protected function isValidCompiledFile($file) { return file_exists($file); } public static function templateFactory(Dwoo $dwoo, $resourceId, $cacheTime = null, $cacheId = null, $compileId = null, Dwoo_ITemplate $parentTemplate = null) { return new self($resourceId, $cacheTime, $cacheId, $compileId); } protected function getCompiledFilename(Dwoo $dwoo) { if ($this->compileId===null) { $this->compileId = $this->name; } return $dwoo->getCompileDir() . $this->compileId.'.d'.Dwoo::RELEASE_TAG.'.php'; } protected function getCacheFilename(Dwoo $dwoo) { if ($this->cacheId === null) { if (isset($_SERVER['REQUEST_URI']) === true) { $cacheId = $_SERVER['REQUEST_URI']; } elseif (isset($_SERVER['SCRIPT_FILENAME']) && isset($_SERVER['argv'])) { $cacheId = $_SERVER['SCRIPT_FILENAME'].'-'.implode('-', $_SERVER['argv']); } else { $cacheId = ''; } $this->getCompiledFilename($dwoo); $this->cacheId = str_replace('../', '__', $this->compileId . strtr($cacheId, '\\%?=!:;'.PATH_SEPARATOR, '/-------')); } return $dwoo->getCacheDir() . $this->cacheId.'.html'; } public function getIsModifiedCode() { return null; } protected function makeDirectory($path, $baseDir = null) { if (is_dir($path) === true) { return; } if ($this->chmod === null) { $chmod = 0777; } else { $chmod = $this->chmod; } mkdir($path, $chmod, true); if (strpos(PHP_OS, 'WIN') !== 0 && $baseDir !== null) { $path = strtr(str_replace($baseDir, '', $path), '\\', '/'); $folders = explode('/', trim($path, '/')); foreach ($folders as $folder) { $baseDir .= $folder . DIRECTORY_SEPARATOR; chmod($baseDir, $chmod); } } } } class Dwoo_Template_File extends Dwoo_Template_String { protected $file; protected $includePath = null; protected $resolvedPath = null; public function __construct($file, $cacheTime = null, $cacheId = null, $compileId = null, $includePath = null) { $this->file = $file; $this->name = basename($file); $this->cacheTime = $cacheTime; if ($compileId !== null) { $this->compileId = str_replace('../', '__', strtr($compileId, '\\%?=!:;'.PATH_SEPARATOR, '/-------')); } if ($cacheId !== null) { $this->cacheId = str_replace('../', '__', strtr($cacheId, '\\%?=!:;'.PATH_SEPARATOR, '/-------')); } if (is_string($includePath)) { $this->includePath = array($includePath); } elseif (is_array($includePath)) { $this->includePath = $includePath; } } public function setIncludePath($paths) { if (is_array($paths) === false) { $paths = array($paths); } $this->includePath = $paths; $this->resolvedPath = null; } public function getIncludePath() { return $this->includePath; } protected function isValidCompiledFile($file) { return parent::isValidCompiledFile($file) && (int)$this->getUid() <= filemtime($file); } public function getSource() { return file_get_contents($this->getResourceIdentifier()); } public function getResourceName() { return 'file'; } public function getResourceIdentifier() { if ($this->resolvedPath !== null) { return $this->resolvedPath; } elseif ($this->includePath === null) { return $this->file; } else { foreach ($this->includePath as $path) { $path = rtrim($path, DIRECTORY_SEPARATOR); if (file_exists($path.DIRECTORY_SEPARATOR.$this->file) === true) { $this->resolvedPath = $path . DIRECTORY_SEPARATOR . $this->file; return $this->resolvedPath; } } throw new Dwoo_Exception('Template "'.$this->file.'" could not be found in any of your include path(s)'); } } public function getUid() { return (string) filemtime($this->getResourceIdentifier()); } public static function templateFactory(Dwoo $dwoo, $resourceId, $cacheTime = null, $cacheId = null, $compileId = null, Dwoo_ITemplate $parentTemplate = null) { if (DIRECTORY_SEPARATOR === '\\') { $resourceId = str_replace(array("\t", "\n", "\r", "\f", "\v"), array('\\t', '\\n', '\\r', '\\f', '\\v'), $resourceId); } $resourceId = strtr($resourceId, '\\', '/'); $includePath = null; if (file_exists($resourceId) === false) { if ($parentTemplate === null) { $parentTemplate = $dwoo->getTemplate(); } if ($parentTemplate instanceof Dwoo_Template_File) { if ($includePath = $parentTemplate->getIncludePath()) { if (strstr($resourceId, '../')) { throw new Dwoo_Exception('When using an include path you can not reference a template into a parent directory (using ../)'); } } else { $resourceId = dirname($parentTemplate->getResourceIdentifier()).DIRECTORY_SEPARATOR.$resourceId; if (file_exists($resourceId) === false) { return null; } } } else { return null; } } if ($policy = $dwoo->getSecurityPolicy()) { while (true) { if (preg_match('{^([a-z]+?)://}i', $resourceId)) { throw new Dwoo_Security_Exception('The security policy prevents you to read files from external sources : '.$resourceId.'.'); } if ($includePath) { break; } $resourceId = realpath($resourceId); $dirs = $policy->getAllowedDirectories(); foreach ($dirs as $dir=>$dummy) { if (strpos($resourceId, $dir) === 0) { break 2; } } throw new Dwoo_Security_Exception('The security policy prevents you to read '.$resourceId.''); } } $class = 'Dwoo_Template_File'; if ($parentTemplate) { $class = get_class($parentTemplate); } return new $class($resourceId, $cacheTime, $cacheId, $compileId, $includePath); } protected function getCompiledFilename(Dwoo $dwoo) { if ($this->compileId===null) { $this->compileId = str_replace('../', '__', strtr($this->getResourceIdentifier(), '\\:', '/-')); } return $dwoo->getCompileDir() . $this->compileId.'.d'.Dwoo::RELEASE_TAG.'.php'; } public function getIsModifiedCode() { return '"'.$this->getUid().'" == filemtime('.var_export($this->getResourceIdentifier(), true).')'; } } class Dwoo_Data implements Dwoo_IDataProvider { protected $data = array(); public function getData() { return $this->data; } public function clear($name = null) { if ($name === null) { $this->data = array(); } elseif (is_array($name)) { foreach ($name as $index) unset($this->data[$index]); } else { unset($this->data[$name]); } } public function setData(array $data) { $this->data = $data; } public function mergeData(array $data) { $args = func_get_args(); while (list(,$v) = each($args)) { if (is_array($v)) { $this->data = array_merge($this->data, $v); } } } public function assign($name, $val = null) { if (is_array($name)) { reset($name); while (list($k,$v) = each($name)) $this->data[$k] = $v; } else { $this->data[$name] = $val; } } public function __set($name, $value) { $this->assign($name, $value); } public function assignByRef($name, &$val) { $this->data[$name] =& $val; } public function append($name, $val = null, $merge = false) { if (is_array($name)) { foreach ($name as $key=>$val) { if (isset($this->data[$key]) && !is_array($this->data[$key])) { settype($this->data[$key], 'array'); } if ($merge === true && is_array($val)) { $this->data[$key] = $val + $this->data[$key]; } else { $this->data[$key][] = $val; } } } elseif ($val !== null) { if (isset($this->data[$name]) && !is_array($this->data[$name])) { settype($this->data[$name], 'array'); } if ($merge === true && is_array($val)) { $this->data[$name] = $val + $this->data[$name]; } else { $this->data[$name][] = $val; } } } public function appendByRef($name, &$val, $merge = false) { if (isset($this->data[$name]) && !is_array($this->data[$name])) { settype($this->data[$name], 'array'); } if ($merge === true && is_array($val)) { foreach ($val as $key => &$val) { $this->data[$name][$key] =& $val; } } else { $this->data[$name][] =& $val; } } public function isAssigned($name) { return isset($this->data[$name]); } public function __isset($name) { return isset($this->data[$name]); } public function unassign($name) { unset($this->data[$name]); } public function __unset($name) { unset($this->data[$name]); } public function get($name) { return $this->__get($name); } public function __get($name) { if (isset($this->data[$name])) { return $this->data[$name]; } else { throw new Dwoo_Exception('Tried to read a value that was not assigned yet : "'.$name.'"'); } } } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo.php000066400000000000000000001211031225466040700245410ustar00rootroot00000000000000 * requirements : * php 5.2.0 or above (might work below, it's a rough estimate) * SPL and PCRE extensions (for php versions prior to 5.3.0) * mbstring extension for some string manipulation plugins (especially if you intend to use UTF-8) * recommended : * hash extension (for Dwoo_Template_String - minor performance boost) * * project created : * 2008-01-05 * * * This software is provided 'as-is', without any express or implied warranty. * In no event will the authors be held liable for any damages arising from the use of this software. * * @author Jordi Boggiano * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.1.0 * @date 2009-07-18 * @package Dwoo */ class Dwoo { /** * current version number * * @var string */ const VERSION = '1.1.0'; /** * unique number of this dwoo release * * this can be used by templates classes to check whether the compiled template * has been compiled before this release or not, so that old templates are * recompiled automatically when Dwoo is updated */ const RELEASE_TAG = 16; /**#@+ * constants that represents all plugin types * * these are bitwise-operation-safe values to allow multiple types * on a single plugin * * @var int */ const CLASS_PLUGIN = 1; const FUNC_PLUGIN = 2; const NATIVE_PLUGIN = 4; const BLOCK_PLUGIN = 8; const COMPILABLE_PLUGIN = 16; const CUSTOM_PLUGIN = 32; const SMARTY_MODIFIER = 64; const SMARTY_BLOCK = 128; const SMARTY_FUNCTION = 256; const PROXY_PLUGIN = 512; const TEMPLATE_PLUGIN = 1024; /**#@-*/ /** * character set of the template, used by string manipulation plugins * * it must be lowercase, but setCharset() will take care of that * * @see setCharset * @see getCharset * @var string */ protected $charset = 'utf-8'; /** * global variables that are accessible through $dwoo.* in the templates * * default values include: * * $dwoo.version - current version number * $dwoo.ad - a Powered by Dwoo link pointing to dwoo.org * $dwoo.now - the current time * $dwoo.template - the current template filename * $dwoo.charset - the character set used by the template * * on top of that, foreach and other plugins can store special values in there, * see their documentation for more details. * * @private * @var array */ public $globals; /** * directory where the compiled templates are stored * * defaults to DWOO_COMPILEDIR (= dwoo_dir/compiled by default) * * @var string */ protected $compileDir; /** * directory where the cached templates are stored * * defaults to DWOO_CACHEDIR (= dwoo_dir/cache by default) * * @var string */ protected $cacheDir; /** * defines how long (in seconds) the cached files must remain valid * * can be overriden on a per-template basis * * -1 = never delete * 0 = disabled * >0 = duration in seconds * * @var int */ protected $cacheTime = 0; /** * security policy object * * @var Dwoo_Security_Policy */ protected $securityPolicy = null; /** * stores the custom plugins callbacks * * @see addPlugin * @see removePlugin * @var array */ protected $plugins = array(); /** * stores the filter callbacks * * @see addFilter * @see removeFilter * @var array */ protected $filters = array(); /** * stores the resource types and associated * classes / compiler classes * * @var array */ protected $resources = array ( 'file' => array ( 'class' => 'Dwoo_Template_File', 'compiler' => null ), 'string' => array ( 'class' => 'Dwoo_Template_String', 'compiler' => null ) ); /** * the dwoo loader object used to load plugins by this dwoo instance * * @var Dwoo_ILoader */ protected $loader = null; /** * currently rendered template, set to null when not-rendering * * @var Dwoo_ITemplate */ protected $template = null; /** * stores the instances of the class plugins during template runtime * * @var array */ protected $runtimePlugins; /** * stores the data during template runtime * * @var array */ protected $data; /** * stores the current scope during template runtime * * this should ideally not be accessed directly from outside template code * * @var mixed * @private */ public $scope; /** * stores the scope tree during template runtime * * @var array */ protected $scopeTree; /** * stores the block plugins stack during template runtime * * @var array */ protected $stack; /** * stores the current block plugin at the top of the stack during template runtime * * @var Dwoo_Block_Plugin */ protected $curBlock; /** * stores the output buffer during template runtime * * @var string */ protected $buffer; /** * stores plugin proxy * * @var Dwoo_IPluginProxy */ protected $pluginProxy; /** * constructor, sets the cache and compile dir to the default values if not provided * * @param string $compileDir path to the compiled directory, defaults to lib/compiled * @param string $cacheDir path to the cache directory, defaults to lib/cache */ public function __construct($compileDir = null, $cacheDir = null) { if ($compileDir !== null) { $this->setCompileDir($compileDir); } if ($cacheDir !== null) { $this->setCacheDir($cacheDir); } $this->initGlobals(); } /** * resets some runtime variables to allow a cloned object to be used to render sub-templates */ public function __clone() { $this->template = null; unset($this->data); } /** * outputs the template instead of returning it, this is basically a shortcut for get(*, *, *, true) * * @see get * @param mixed $tpl template, can either be a Dwoo_ITemplate object (i.e. Dwoo_Template_File), a valid path to a template, or * a template as a string it is recommended to provide a Dwoo_ITemplate as it will probably make things faster, * especially if you render a template multiple times * @param mixed $data the data to use, can either be a Dwoo_IDataProvider object (i.e. Dwoo_Data) or an associative array. if you're * rendering the template from cache, it can be left null * @param Dwoo_ICompiler $compiler the compiler that must be used to compile the template, if left empty a default * Dwoo_Compiler will be used. * @return string nothing or the template output if $output is true */ public function output($tpl, $data = array(), Dwoo_ICompiler $compiler = null) { return $this->get($tpl, $data, $compiler, true); } /** * returns the given template rendered using the provided data and optional compiler * * @param mixed $tpl template, can either be a Dwoo_ITemplate object (i.e. Dwoo_Template_File), a valid path to a template, or * a template as a string it is recommended to provide a Dwoo_ITemplate as it will probably make things faster, * especially if you render a template multiple times * @param mixed $data the data to use, can either be a Dwoo_IDataProvider object (i.e. Dwoo_Data) or an associative array. if you're * rendering the template from cache, it can be left null * @param Dwoo_ICompiler $compiler the compiler that must be used to compile the template, if left empty a default * Dwoo_Compiler will be used. * @param bool $output flag that defines whether the function returns the output of the template (false, default) or echoes it directly (true) * @return string nothing or the template output if $output is true */ public function get($_tpl, $data = array(), $_compiler = null, $_output = false) { // a render call came from within a template, so we need a new dwoo instance in order to avoid breaking this one if ($this->template instanceof Dwoo_ITemplate) { $proxy = clone $this; return $proxy->get($_tpl, $data, $_compiler, $_output); } // auto-create template if required if ($_tpl instanceof Dwoo_ITemplate) { // valid, skip } elseif (is_string($_tpl) && file_exists($_tpl)) { $_tpl = new Dwoo_Template_File($_tpl); } else { throw new Dwoo_Exception('Dwoo->get/Dwoo->output\'s first argument must be a Dwoo_ITemplate (i.e. Dwoo_Template_File) or a valid path to a template file', E_USER_NOTICE); } // save the current template, enters render mode at the same time // if another rendering is requested it will be proxied to a new Dwoo instance $this->template = $_tpl; // load data if ($data instanceof Dwoo_IDataProvider) { $this->data = $data->getData(); } elseif (is_array($data)) { $this->data = $data; } else { throw new Dwoo_Exception('Dwoo->get/Dwoo->output\'s data argument must be a Dwoo_IDataProvider object (i.e. Dwoo_Data) or an associative array', E_USER_NOTICE); } $this->globals['template'] = $_tpl->getName(); $this->initRuntimeVars($_tpl); // try to get cached template $file = $_tpl->getCachedTemplate($this); $doCache = $file === true; $cacheLoaded = is_string($file); if ($cacheLoaded === true) { // cache is present, run it if ($_output === true) { include $file; $this->template = null; } else { ob_start(); include $file; $this->template = null; return ob_get_clean(); } } else { // no cache present if ($doCache === true) { $dynamicId = uniqid(); } // render template $out = include $_tpl->getCompiledTemplate($this, $_compiler); // template returned false so it needs to be recompiled if ($out === false) { $_tpl->forceCompilation(); $out = include $_tpl->getCompiledTemplate($this, $_compiler); } if ($doCache === true) { $out = preg_replace('/(<%|%>|<\?php|<\?|\?>)/', '', $out); if (!class_exists('Dwoo_plugin_dynamic', false)) { $this->getLoader()->loadPlugin('dynamic'); } $out = Dwoo_Plugin_dynamic::unescape($out, $dynamicId); } // process filters foreach ($this->filters as $filter) { if (is_array($filter) && $filter[0] instanceof Dwoo_Filter) { $out = call_user_func($filter, $out); } else { $out = call_user_func($filter, $this, $out); } } if ($doCache === true) { // building cache $file = $_tpl->cache($this, $out); // run it from the cache to be sure dynamics are rendered if ($_output === true) { include $file; // exit render mode $this->template = null; } else { ob_start(); include $file; // exit render mode $this->template = null; return ob_get_clean(); } } else { // no need to build cache // exit render mode $this->template = null; // output if ($_output === true) { echo $out; } else { return $out; } } } } /** * re-initializes the globals array before each template run * * this method is only callede once when the Dwoo object is created */ protected function initGlobals() { $this->globals = array ( 'version' => self::VERSION, 'ad' => 'Powered by Dwoo', 'now' => $_SERVER['REQUEST_TIME'], 'charset' => $this->charset, ); } /** * re-initializes the runtime variables before each template run * * override this method to inject data in the globals array if needed, this * method is called before each template execution * * @param Dwoo_ITemplate $tpl the template that is going to be rendered */ protected function initRuntimeVars(Dwoo_ITemplate $tpl) { $this->runtimePlugins = array(); $this->scope =& $this->data; $this->scopeTree = array(); $this->stack = array(); $this->curBlock = null; $this->buffer = ''; } /* * --------- settings functions --------- */ /** * adds a custom plugin that is not in one of the plugin directories * * @param string $name the plugin name to be used in the templates * @param callback $callback the plugin callback, either a function name, * a class name or an array containing an object * or class name and a method name * @param bool $compilable if set to true, the plugin is assumed to be compilable */ public function addPlugin($name, $callback, $compilable = false) { $compilable = $compilable ? self::COMPILABLE_PLUGIN : 0; if (is_array($callback)) { if (is_subclass_of(is_object($callback[0]) ? get_class($callback[0]) : $callback[0], 'Dwoo_Block_Plugin')) { $this->plugins[$name] = array('type'=>self::BLOCK_PLUGIN | $compilable, 'callback'=>$callback, 'class'=>(is_object($callback[0]) ? get_class($callback[0]) : $callback[0])); } else { $this->plugins[$name] = array('type'=>self::CLASS_PLUGIN | $compilable, 'callback'=>$callback, 'class'=>(is_object($callback[0]) ? get_class($callback[0]) : $callback[0]), 'function'=>$callback[1]); } } elseif (class_exists($callback, false)) { if (is_subclass_of($callback, 'Dwoo_Block_Plugin')) { $this->plugins[$name] = array('type'=>self::BLOCK_PLUGIN | $compilable, 'callback'=>$callback, 'class'=>$callback); } else { $this->plugins[$name] = array('type'=>self::CLASS_PLUGIN | $compilable, 'callback'=>$callback, 'class'=>$callback, 'function'=>'process'); } } elseif (function_exists($callback)) { $this->plugins[$name] = array('type'=>self::FUNC_PLUGIN | $compilable, 'callback'=>$callback); } else { throw new Dwoo_Exception('Callback could not be processed correctly, please check that the function/class you used exists'); } } /** * removes a custom plugin * * @param string $name the plugin name */ public function removePlugin($name) { if (isset($this->plugins[$name])) { unset($this->plugins[$name]); } } /** * adds a filter to this Dwoo instance, it will be used to filter the output of all the templates rendered by this instance * * @param mixed $callback a callback or a filter name if it is autoloaded from a plugin directory * @param bool $autoload if true, the first parameter must be a filter name from one of the plugin directories */ public function addFilter($callback, $autoload = false) { if ($autoload) { $class = 'Dwoo_Filter_'.$callback; if (!class_exists($class, false) && !function_exists($class)) { try { $this->getLoader()->loadPlugin($callback); } catch (Dwoo_Exception $e) { if (strstr($callback, 'Dwoo_Filter_')) { throw new Dwoo_Exception('Wrong filter name : '.$callback.', the "Dwoo_Filter_" prefix should not be used, please only use "'.str_replace('Dwoo_Filter_', '', $callback).'"'); } else { throw new Dwoo_Exception('Wrong filter name : '.$callback.', when using autoload the filter must be in one of your plugin dir as "name.php" containg a class or function named "Dwoo_Filter_name"'); } } } if (class_exists($class, false)) { $callback = array(new $class($this), 'process'); } elseif (function_exists($class)) { $callback = $class; } else { throw new Dwoo_Exception('Wrong filter name : '.$callback.', when using autoload the filter must be in one of your plugin dir as "name.php" containg a class or function named "Dwoo_Filter_name"'); } $this->filters[] = $callback; } else { $this->filters[] = $callback; } } /** * removes a filter * * @param mixed $callback callback or filter name if it was autoloaded */ public function removeFilter($callback) { if (($index = array_search('Dwoo_Filter_'.$callback, $this->filters, true)) !== false) { unset($this->filters[$index]); } elseif (($index = array_search($callback, $this->filters, true)) !== false) { unset($this->filters[$index]); } else { $class = 'Dwoo_Filter_' . $callback; foreach ($this->filters as $index=>$filter) { if (is_array($filter) && $filter[0] instanceof $class) { unset($this->filters[$index]); break; } } } } /** * adds a resource or overrides a default one * * @param string $name the resource name * @param string $class the resource class (which must implement Dwoo_ITemplate) * @param callback $compilerFactory the compiler factory callback, a function that must return a compiler instance used to compile this resource, if none is provided. by default it will produce a Dwoo_Compiler object */ public function addResource($name, $class, $compilerFactory = null) { if (strlen($name) < 2) { throw new Dwoo_Exception('Resource names must be at least two-character long to avoid conflicts with Windows paths'); } if (!class_exists($class)) { throw new Dwoo_Exception('Resource class does not exist'); } $interfaces = class_implements($class); if (in_array('Dwoo_ITemplate', $interfaces) === false) { throw new Dwoo_Exception('Resource class must implement Dwoo_ITemplate'); } $this->resources[$name] = array('class'=>$class, 'compiler'=>$compilerFactory); } /** * removes a custom resource * * @param string $name the resource name */ public function removeResource($name) { unset($this->resources[$name]); if ($name==='file') { $this->resources['file'] = array('class'=>'Dwoo_Template_File', 'compiler'=>null); } } /* * --------- getters and setters --------- */ /** * sets the loader object to use to load plugins * * @param Dwoo_ILoader $loader loader object */ public function setLoader(Dwoo_ILoader $loader) { $this->loader = $loader; } /** * returns the current loader object or a default one if none is currently found * * @param Dwoo_ILoader */ public function getLoader() { if ($this->loader === null) { $this->loader = new Dwoo_Loader($this->getCompileDir()); } return $this->loader; } /** * returns the custom plugins loaded * * used by the Dwoo_ITemplate classes to pass the custom plugins to their Dwoo_ICompiler instance * * @return array */ public function getCustomPlugins() { return $this->plugins; } /** * returns the cache directory with a trailing DIRECTORY_SEPARATOR * * @return string */ public function getCacheDir() { if ($this->cacheDir === null) { $this->setCacheDir(dirname(__FILE__).DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR); } return $this->cacheDir; } /** * sets the cache directory and automatically appends a DIRECTORY_SEPARATOR * * @param string $dir the cache directory */ public function setCacheDir($dir) { $this->cacheDir = rtrim($dir, '/\\').DIRECTORY_SEPARATOR; if (is_writable($this->cacheDir) === false) { throw new Dwoo_Exception('The cache directory must be writable, chmod "'.$this->cacheDir.'" to make it writable'); } } /** * returns the compile directory with a trailing DIRECTORY_SEPARATOR * * @return string */ public function getCompileDir() { if ($this->compileDir === null) { $this->setCompileDir(dirname(__FILE__).DIRECTORY_SEPARATOR.'compiled'.DIRECTORY_SEPARATOR); } return $this->compileDir; } /** * sets the compile directory and automatically appends a DIRECTORY_SEPARATOR * * @param string $dir the compile directory */ public function setCompileDir($dir) { $this->compileDir = rtrim($dir, '/\\').DIRECTORY_SEPARATOR; if (is_writable($this->compileDir) === false) { throw new Dwoo_Exception('The compile directory must be writable, chmod "'.$this->compileDir.'" to make it writable'); } } /** * returns the default cache time that is used with templates that do not have a cache time set * * @return int the duration in seconds */ public function getCacheTime() { return $this->cacheTime; } /** * sets the default cache time to use with templates that do not have a cache time set * * @param int $seconds the duration in seconds */ public function setCacheTime($seconds) { $this->cacheTime = (int) $seconds; } /** * returns the character set used by the string manipulation plugins * * the charset is automatically lowercased * * @return string */ public function getCharset() { return $this->charset; } /** * sets the character set used by the string manipulation plugins * * the charset will be automatically lowercased * * @param string $charset the character set */ public function setCharset($charset) { $this->charset = strtolower((string) $charset); } /** * returns the current template being rendered, when applicable, or null * * @return Dwoo_ITemplate|null */ public function getTemplate() { return $this->template; } /** * sets the default compiler factory function for the given resource name * * a compiler factory must return a Dwoo_ICompiler object pre-configured to fit your needs * * @param string $resourceName the resource name (i.e. file, string) * @param callback $compilerFactory the compiler factory callback */ public function setDefaultCompilerFactory($resourceName, $compilerFactory) { $this->resources[$resourceName]['compiler'] = $compilerFactory; } /** * returns the default compiler factory function for the given resource name * * @param string $resourceName the resource name * @return callback the compiler factory callback */ public function getDefaultCompilerFactory($resourceName) { return $this->resources[$resourceName]['compiler']; } /** * sets the security policy object to enforce some php security settings * * use this if untrusted persons can modify templates * * @param Dwoo_Security_Policy $policy the security policy object */ public function setSecurityPolicy(Dwoo_Security_Policy $policy = null) { $this->securityPolicy = $policy; } /** * returns the current security policy object or null by default * * @return Dwoo_Security_Policy|null the security policy object if any */ public function getSecurityPolicy() { return $this->securityPolicy; } /** * sets the object that must be used as a plugin proxy when plugin can't be found * by dwoo's loader * * @param Dwoo_IPluginProxy $pluginProxy the proxy object */ public function setPluginProxy(Dwoo_IPluginProxy $pluginProxy) { $this->pluginProxy = $pluginProxy; } /** * returns the current plugin proxy object or null by default * * @param Dwoo_IPluginProxy|null the proxy object if any */ public function getPluginProxy() { return $this->pluginProxy; } /* * --------- util functions --------- */ /** * [util function] checks whether the given template is cached or not * * @param Dwoo_ITemplate $tpl the template object * @return bool */ public function isCached(Dwoo_ITemplate $tpl) { return is_string($tpl->getCachedTemplate($this)); } /** * [util function] clears the cached templates if they are older than the given time * * @param int $olderThan minimum time (in seconds) required for a cached template to be cleared * @return int the amount of templates cleared */ public function clearCache($olderThan=-1) { $cacheDirs = new RecursiveDirectoryIterator($this->getCacheDir()); $cache = new RecursiveIteratorIterator($cacheDirs); $expired = time() - $olderThan; $count = 0; foreach ($cache as $file) { if ($cache->isDot() || $cache->isDir() || substr($file, -5) !== '.html') { continue; } if ($cache->getCTime() < $expired) { $count += unlink((string) $file) ? 1 : 0; } } return $count; } /** * [util function] fetches a template object of the given resource * * @param string $resourceName the resource name (i.e. file, string) * @param string $resourceId the resource identifier (i.e. file path) * @param int $cacheTime the cache time setting for this resource * @param string $cacheId the unique cache identifier * @param string $compileId the unique compiler identifier * @return Dwoo_ITemplate */ public function templateFactory($resourceName, $resourceId, $cacheTime = null, $cacheId = null, $compileId = null, Dwoo_ITemplate $parentTemplate = null) { if (isset($this->resources[$resourceName])) { // TODO could be changed to $this->resources[$resourceName]['class']::templateFactory(..) in 5.3 maybe return call_user_func(array($this->resources[$resourceName]['class'], 'templateFactory'), $this, $resourceId, $cacheTime, $cacheId, $compileId, $parentTemplate); } else { throw new Dwoo_Exception('Unknown resource type : '.$resourceName); } } /** * [util function] checks if the input is an array or an iterator object, optionally it can also check if it's empty * * @param mixed $value the variable to check * @param bool $checkIsEmpty if true, the function will also check if the array is empty, * and return true only if it's not empty * @return bool true if it's an array (and not empty) or false if it's not an array (or if it's empty) */ public function isArray($value, $checkIsEmpty=false) { if (is_array($value) === true) { if ($checkIsEmpty === false) { return true; } else { return count($value) > 0; } } elseif ($value instanceof Iterator) { if ($checkIsEmpty === false) { return true; } elseif ($value instanceof Countable) { return count($value) > 0; } else { $value->rewind(); return $value->valid(); } } elseif ($value instanceof ArrayAccess) { if ($checkIsEmpty === false) { return true; } elseif ($value instanceof Countable) { return count($value) > 0; } else { return $value->offsetExists(0); } } return false; } /** * [util function] triggers a dwoo error * * @param string $message the error message * @param int $level the error level, one of the PHP's E_* constants */ public function triggerError($message, $level=E_USER_NOTICE) { if (!($tplIdentifier = $this->template->getResourceIdentifier())) { $tplIdentifier = $this->template->getResourceName(); } trigger_error('Dwoo error (in '.$tplIdentifier.') : '.$message, $level); } /* * --------- runtime functions --------- */ /** * [runtime function] adds a block to the block stack * * @param string $blockName the block name (without Dwoo_Plugin_ prefix) * @param array $args the arguments to be passed to the block's init() function * @return Dwoo_Block_Plugin the newly created block */ public function addStack($blockName, array $args=array()) { if (isset($this->plugins[$blockName])) { $class = $this->plugins[$blockName]['class']; } else { $class = 'Dwoo_Plugin_'.$blockName; } if ($this->curBlock !== null) { $this->curBlock->buffer(ob_get_contents()); ob_clean(); } else { $this->buffer .= ob_get_contents(); ob_clean(); } $block = new $class($this); $cnt = count($args); if ($cnt===0) { $block->init(); } elseif ($cnt===1) { $block->init($args[0]); } elseif ($cnt===2) { $block->init($args[0], $args[1]); } elseif ($cnt===3) { $block->init($args[0], $args[1], $args[2]); } elseif ($cnt===4) { $block->init($args[0], $args[1], $args[2], $args[3]); } else { call_user_func_array(array($block,'init'), $args); } $this->stack[] = $this->curBlock = $block; return $block; } /** * [runtime function] removes the plugin at the top of the block stack * * calls the block buffer() function, followed by a call to end() * and finally a call to process() */ public function delStack() { $args = func_get_args(); $this->curBlock->buffer(ob_get_contents()); ob_clean(); $cnt = count($args); if ($cnt===0) { $this->curBlock->end(); } elseif ($cnt===1) { $this->curBlock->end($args[0]); } elseif ($cnt===2) { $this->curBlock->end($args[0], $args[1]); } elseif ($cnt===3) { $this->curBlock->end($args[0], $args[1], $args[2]); } elseif ($cnt===4) { $this->curBlock->end($args[0], $args[1], $args[2], $args[3]); } else { call_user_func_array(array($this->curBlock, 'end'), $args); } $tmp = array_pop($this->stack); if (count($this->stack) > 0) { $this->curBlock = end($this->stack); $this->curBlock->buffer($tmp->process()); } else { $this->curBlock = null; echo $tmp->process(); } unset($tmp); } /** * [runtime function] returns the parent block of the given block * * @param Dwoo_Block_Plugin $block * @return Dwoo_Block_Plugin or false if the given block isn't in the stack */ public function getParentBlock(Dwoo_Block_Plugin $block) { $index = array_search($block, $this->stack, true); if ($index !== false && $index > 0) { return $this->stack[$index-1]; } return false; } /** * [runtime function] finds the closest block of the given type, starting at the top of the stack * * @param string $type the type of plugin you want to find * @return Dwoo_Block_Plugin or false if no plugin of such type is in the stack */ public function findBlock($type) { if (isset($this->plugins[$type])) { $type = $this->plugins[$type]['class']; } else { $type = 'Dwoo_Plugin_'.str_replace('Dwoo_Plugin_', '', $type); } $keys = array_keys($this->stack); while (($key = array_pop($keys)) !== false) { if ($this->stack[$key] instanceof $type) { return $this->stack[$key]; } } return false; } /** * [runtime function] returns a Dwoo_Plugin of the given class * * this is so a single instance of every class plugin is created at each template run, * allowing class plugins to have "per-template-run" static variables * * @param string $class the class name * @return mixed an object of the given class */ protected function getObjectPlugin($class) { if (isset($this->runtimePlugins[$class])) { return $this->runtimePlugins[$class]; } return $this->runtimePlugins[$class] = new $class($this); } /** * [runtime function] calls the process() method of the given class-plugin name * * @param string $plugName the class plugin name (without Dwoo_Plugin_ prefix) * @param array $params an array of parameters to send to the process() method * @return string the process() return value */ public function classCall($plugName, array $params = array()) { $class = 'Dwoo_Plugin_'.$plugName; $plugin = $this->getObjectPlugin($class); $cnt = count($params); if ($cnt===0) { return $plugin->process(); } elseif ($cnt===1) { return $plugin->process($params[0]); } elseif ($cnt===2) { return $plugin->process($params[0], $params[1]); } elseif ($cnt===3) { return $plugin->process($params[0], $params[1], $params[2]); } elseif ($cnt===4) { return $plugin->process($params[0], $params[1], $params[2], $params[3]); } else { return call_user_func_array(array($plugin, 'process'), $params); } } /** * [runtime function] calls a php function * * @param string $callback the function to call * @param array $params an array of parameters to send to the function * @return mixed the return value of the called function */ public function arrayMap($callback, array $params) { if ($params[0] === $this) { $addThis = true; array_shift($params); } if ((is_array($params[0]) || ($params[0] instanceof Iterator && $params[0] instanceof ArrayAccess))) { if (empty($params[0])) { return $params[0]; } // array map $out = array(); $cnt = count($params); if (isset($addThis)) { array_unshift($params, $this); $items = $params[1]; $keys = array_keys($items); if (is_string($callback) === false) { while (($i = array_shift($keys)) !== null) { $out[] = call_user_func_array($callback, array(1=>$items[$i]) + $params); } } elseif ($cnt===1) { while (($i = array_shift($keys)) !== null) { $out[] = $callback($this, $items[$i]); } } elseif ($cnt===2) { while (($i = array_shift($keys)) !== null) { $out[] = $callback($this, $items[$i], $params[2]); } } elseif ($cnt===3) { while (($i = array_shift($keys)) !== null) { $out[] = $callback($this, $items[$i], $params[2], $params[3]); } } else { while (($i = array_shift($keys)) !== null) { $out[] = call_user_func_array($callback, array(1=>$items[$i]) + $params); } } } else { $items = $params[0]; $keys = array_keys($items); if (is_string($callback) === false) { while (($i = array_shift($keys)) !== null) { $out[] = call_user_func_array($callback, array($items[$i]) + $params); } } elseif ($cnt===1) { while (($i = array_shift($keys)) !== null) { $out[] = $callback($items[$i]); } } elseif ($cnt===2) { while (($i = array_shift($keys)) !== null) { $out[] = $callback($items[$i], $params[1]); } } elseif ($cnt===3) { while (($i = array_shift($keys)) !== null) { $out[] = $callback($items[$i], $params[1], $params[2]); } } elseif ($cnt===4) { while (($i = array_shift($keys)) !== null) { $out[] = $callback($items[$i], $params[1], $params[2], $params[3]); } } else { while (($i = array_shift($keys)) !== null) { $out[] = call_user_func_array($callback, array($items[$i]) + $params); } } } return $out; } else { return $params[0]; } } /** * [runtime function] reads a variable into the given data array * * @param string $varstr the variable string, using dwoo variable syntax (i.e. "var.subvar[subsubvar]->property") * @param mixed $data the data array or object to read from * @param bool $safeRead if true, the function will check whether the index exists to prevent any notices from being output * @return mixed */ public function readVarInto($varstr, $data, $safeRead = false) { if ($data === null) { return null; } if (is_array($varstr) === false) { preg_match_all('#(\[|->|\.)?([^.[\]-]+)\]?#i', $varstr, $m); } else { $m = $varstr; } unset($varstr); while (list($k, $sep) = each($m[1])) { if ($sep === '.' || $sep === '[' || $sep === '') { if ((is_array($data) || $data instanceof ArrayAccess) && ($safeRead === false || isset($data[$m[2][$k]]))) { $data = $data[$m[2][$k]]; } else { return null; } } else { if (is_object($data) && ($safeRead === false || isset($data->$m[2][$k]))) { $data = $data->$m[2][$k]; } else { return null; } } } return $data; } /** * [runtime function] reads a variable into the parent scope * * @param int $parentLevels the amount of parent levels to go from the current scope * @param string $varstr the variable string, using dwoo variable syntax (i.e. "var.subvar[subsubvar]->property") * @return mixed */ public function readParentVar($parentLevels, $varstr = null) { $tree = $this->scopeTree; $cur = $this->data; while ($parentLevels--!==0) { array_pop($tree); } while (($i = array_shift($tree)) !== null) { if (is_object($cur)) { $cur = $cur->$i; } else { $cur = $cur[$i]; } } if ($varstr!==null) { return $this->readVarInto($varstr, $cur); } else { return $cur; } } /** * [runtime function] reads a variable into the current scope * * @param string $varstr the variable string, using dwoo variable syntax (i.e. "var.subvar[subsubvar]->property") * @return mixed */ public function readVar($varstr) { if (is_array($varstr)===true) { $m = $varstr; unset($varstr); } else { if (strstr($varstr, '.') === false && strstr($varstr, '[') === false && strstr($varstr, '->') === false) { if ($varstr === 'dwoo') { return $this->globals; } elseif ($varstr === '__' || $varstr === '_root' ) { return $this->data; $varstr = substr($varstr, 6); } elseif ($varstr === '_' || $varstr === '_parent') { $varstr = '.'.$varstr; $tree = $this->scopeTree; $cur = $this->data; array_pop($tree); while (($i = array_shift($tree)) !== null) { if (is_object($cur)) { $cur = $cur->$i; } else { $cur = $cur[$i]; } } return $cur; } $cur = $this->scope; if (isset($cur[$varstr])) { return $cur[$varstr]; } else { return null; } } if (substr($varstr, 0, 1) === '.') { $varstr = 'dwoo'.$varstr; } preg_match_all('#(\[|->|\.)?([^.[\]-]+)\]?#i', $varstr, $m); } $i = $m[2][0]; if ($i === 'dwoo') { $cur = $this->globals; array_shift($m[2]); array_shift($m[1]); switch ($m[2][0]) { case 'get': $cur = $_GET; break; case 'post': $cur = $_POST; break; case 'session': $cur = $_SESSION; break; case 'cookies': case 'cookie': $cur = $_COOKIE; break; case 'server': $cur = $_SERVER; break; case 'env': $cur = $_ENV; break; case 'request': $cur = $_REQUEST; break; case 'const': array_shift($m[2]); if (defined($m[2][0])) { return constant($m[2][0]); } else { return null; } } if ($cur !== $this->globals) { array_shift($m[2]); array_shift($m[1]); } } elseif ($i === '__' || $i === '_root') { $cur = $this->data; array_shift($m[2]); array_shift($m[1]); } elseif ($i === '_' || $i === '_parent') { $tree = $this->scopeTree; $cur = $this->data; while (true) { array_pop($tree); array_shift($m[2]); array_shift($m[1]); if (current($m[2]) === '_' || current($m[2]) === '_parent') { continue; } while (($i = array_shift($tree)) !== null) { if (is_object($cur)) { $cur = $cur->$i; } else { $cur = $cur[$i]; } } break; } } else { $cur = $this->scope; } while (list($k, $sep) = each($m[1])) { if ($sep === '.' || $sep === '[' || $sep === '') { if ((is_array($cur) || $cur instanceof ArrayAccess) && isset($cur[$m[2][$k]])) { $cur = $cur[$m[2][$k]]; } else { return null; } } elseif ($sep === '->') { if (is_object($cur)) { $cur = $cur->$m[2][$k]; } else { return null; } } else { return null; } } return $cur; } /** * [runtime function] assign the value to the given variable * * @param mixed $value the value to assign * @param string $scope the variable string, using dwoo variable syntax (i.e. "var.subvar[subsubvar]->property") * @return bool true if assigned correctly or false if a problem occured while parsing the var string */ public function assignInScope($value, $scope) { $tree =& $this->scopeTree; $data =& $this->data; if (!is_string($scope)) { return $this->triggerError('Assignments must be done into strings, ('.gettype($scope).') '.var_export($scope, true).' given', E_USER_ERROR); } if (strstr($scope, '.') === false && strstr($scope, '->') === false) { $this->scope[$scope] = $value; } else { // TODO handle _root/_parent scopes ? preg_match_all('#(\[|->|\.)?([^.[\]-]+)\]?#i', $scope, $m); $cur =& $this->scope; $last = array(array_pop($m[1]), array_pop($m[2])); while (list($k, $sep) = each($m[1])) { if ($sep === '.' || $sep === '[' || $sep === '') { if (is_array($cur) === false) { $cur = array(); } $cur =& $cur[$m[2][$k]]; } elseif ($sep === '->') { if (is_object($cur) === false) { $cur = new stdClass; } $cur =& $cur->$m[2][$k]; } else { return false; } } if ($last[0] === '.' || $last[0] === '[' || $last[0] === '') { if (is_array($cur) === false) { $cur = array(); } $cur[$last[1]] = $value; } elseif ($last[0] === '->') { if (is_object($cur) === false) { $cur = new stdClass; } $cur->$last[1] = $value; } else { return false; } } } /** * [runtime function] sets the scope to the given scope string or array * * @param mixed $scope a string i.e. "level1.level2" or an array i.e. array("level1", "level2") * @param bool $absolute if true, the scope is set from the top level scope and not from the current scope * @return array the current scope tree */ public function setScope($scope, $absolute = false) { $old = $this->scopeTree; if (is_string($scope)===true) { $scope = explode('.', $scope); } if ($absolute===true) { $this->scope =& $this->data; $this->scopeTree = array(); } while (($bit = array_shift($scope)) !== null) { if ($bit === '_' || $bit === '_parent') { array_pop($this->scopeTree); $this->scope =& $this->data; $cnt = count($this->scopeTree); for ($i=0;$i<$cnt;$i++) $this->scope =& $this->scope[$this->scopeTree[$i]]; } elseif ($bit === '__' || $bit === '_root') { $this->scope =& $this->data; $this->scopeTree = array(); } elseif (isset($this->scope[$bit])) { $this->scope =& $this->scope[$bit]; $this->scopeTree[] = $bit; } else { unset($this->scope); $this->scope = null; } } return $old; } /** * [runtime function] returns the entire data array * * @return array */ public function getData() { return $this->data; } /** * [runtime function] returns a reference to the current scope * * @return &mixed */ public function &getScope() { return $this->scope; } /** * Redirects all calls to unexisting to plugin proxy. * * @param string Method name * @param array List of arguments * @return mixed */ public function __call($method, $args) { return call_user_func_array($this->getPluginProxy()->getCallback($method), $args); } } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/000077500000000000000000000000001225466040700240325ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Adapters/000077500000000000000000000000001225466040700255755ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Adapters/Agavi/000077500000000000000000000000001225466040700266245ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Adapters/Agavi/DwooRenderer.php000066400000000000000000000135501225466040700317400ustar00rootroot00000000000000 * * ro * rq * ct * us * tm * rd * * true * %core.lib_dir%/dwoo_plugins * * * - add dwoo's directory to your include path or include dwooAutoload.php yourself * either through agavi's autoload.xml (with name="Dwoo") or through your index.php * * Notes: * - you can copy the /Dwoo/Adapters/Agavi/dwoo_plugins directory to your agavi app's * lib directory, or change the plugin_dir parameter in the output_types.xml file. * these plugins are agavi-specific helpers that shortens the syntax to call common * agavi helpers (i18n, routing, ..) * * This software is provided 'as-is', without any express or implied warranty. * In no event will the authors be held liable for any damages arising from the * use of this software. * * @author Jordi Boggiano * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.1.0 * @date 2009-07-18 * @package Dwoo */ class DwooRenderer extends AgaviRenderer implements AgaviIReusableRenderer { /** * @constant string The directory inside the cache dir where templates will * be stored in compiled form. */ const COMPILE_DIR = 'templates'; /** * @constant string The subdirectory inside the compile dir where templates * will be stored in compiled form. */ const COMPILE_SUBDIR = 'dwoo'; /** * @constant string The directory inside the cache dir where cached content * will be stored. */ const CACHE_DIR = 'dwoo'; /** * @var Dwoo Dwoo template engine. */ protected $dwoo = null; /** * @var string A string with the default template file extension, * including the dot. */ protected $defaultExtension = '.html'; /** * stores the (optional) plugin directory to add to the Dwoo_Loader */ protected $plugin_dir = null; /** * Pre-serialization callback. * * Excludes the Dwoo instance to prevent excessive serialization load. */ public function __sleep() { $keys = parent::__sleep(); unset($keys[array_search('dwoo', $keys)]); return $keys; } /** * Initialize this Renderer. * * @param AgaviContext The current application context. * @param array An associative array of initialization parameters. */ public function initialize(AgaviContext $context, array $parameters = array()) { parent::initialize($context, $parameters); $this->plugin_dir = $this->getParameter('plugin_dir', $this->plugin_dir); } /** * provides a custom compiler to the dwoo renderer with optional settings * you can set in the agavi output_types.xml config file * * @return Dwoo_Compiler */ public function compilerFactory() { if (class_exists('Dwoo_Compiler', false) === false) { include DWOO_DIRECTORY . 'Dwoo/Compiler.php'; } $compiler = Dwoo_Compiler::compilerFactory(); $compiler->setAutoEscape((bool) $this->getParameter('auto_escape', false)); return $compiler; } /** * Grab a cleaned up dwoo instance. * * @return Dwoo A Dwoo instance. */ protected function getEngine() { if($this->dwoo) { return $this->dwoo; } if(!class_exists('Dwoo')) { if (file_exists(dirname(__FILE__).'/../../../dwooAutoload.php')) { // file was dropped with the entire dwoo package require dirname(__FILE__).'/../../../dwooAutoload.php'; } else { // assume the dwoo package is in the include path require 'dwooAutoload.php'; } } $parentMode = fileperms(AgaviConfig::get('core.cache_dir')); $compileDir = AgaviConfig::get('core.cache_dir') . DIRECTORY_SEPARATOR . self::COMPILE_DIR . DIRECTORY_SEPARATOR . self::COMPILE_SUBDIR; AgaviToolkit::mkdir($compileDir, $parentMode, true); $cacheDir = AgaviConfig::get('core.cache_dir') . DIRECTORY_SEPARATOR . self::CACHE_DIR; AgaviToolkit::mkdir($cacheDir, $parentMode, true); $this->dwoo = new Dwoo($compileDir, $cacheDir); if (!empty($this->plugin_dir)) { $this->dwoo->getLoader()->addDirectory($this->plugin_dir); } $this->dwoo->setDefaultCompilerFactory('file', array($this, 'compilerFactory')); return $this->dwoo; } /** * Render the presentation and return the result. * * @param AgaviTemplateLayer The template layer to render. * @param array The template variables. * @param array The slots. * @param array Associative array of additional assigns. * * @return string A rendered result. */ public function render(AgaviTemplateLayer $layer, array &$attributes = array(), array &$slots = array(), array &$moreAssigns = array()) { $engine = $this->getEngine(); $data = array(); if($this->extractVars) { $data = $attributes; } else { $data[$this->varName] = &$attributes; } $data[$this->slotsVarName] =& $slots; foreach($this->assigns as $key => $getter) { $data[$key] = $this->context->$getter(); } foreach($moreAssigns as $key => &$value) { if(isset($this->moreAssignNames[$key])) { $key = $this->moreAssignNames[$key]; } $data[$key] =& $value; } return $engine->get($layer->getResourceStreamIdentifier(), $data); } }nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Adapters/Agavi/README000066400000000000000000000023151225466040700275050ustar00rootroot00000000000000// ------------------------ // Install notes : // ------------------------ - drop dwoo's directory in app/lib/renderer (create if needed) - add a renderer to app/config/output_types.xml as such : ro rq ct us tm rd true %core.lib_dir%/dwoo_plugins - add the renderer to app/config/autoload.xml as such : %core.lib_dir%/renderer/dwoo/Dwoo/Adapter/Agavi/DwooRenderer.php - you can copy the /Dwoo/Adapters/Agavi/dwoo_plugins directory to your agavi app's lib directory, or change the plugin_dir parameter in the output_types.xml file. these plugins are agavi-specific helpers that shortens the syntax to call common agavi helpers (i18n, routing, ..) nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Adapters/Agavi/dwoo_plugins/000077500000000000000000000000001225466040700313355ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Adapters/Agavi/dwoo_plugins/t.php000066400000000000000000000014441225466040700323140ustar00rootroot00000000000000Agavi specific plugin * * uses AgaviTranslationManager to localize a string * *
     *  * string : the string to localize
     * 
    * * Examples: * * {t "Hello"} * {t $header} * * * This software is provided 'as-is', without any express or implied warranty. * In no event will the authors be held liable for any damages arising from the use of this software. * * @author Jordi Boggiano * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ function Dwoo_Plugin_t_compile(Dwoo_Compiler $compiler, $string) { return '$this->data[\'tm\']->_('.$string.')'; }nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Adapters/Agavi/dwoo_plugins/url.php000066400000000000000000000033101225466040700326450ustar00rootroot00000000000000Agavi specific plugin * * uses AgaviRouting to create an url * *
     *  * route : the route name, optional (by default the current url is returned)
     *  * params : an array with variables to build the route, optional
     *  * options : an array of options to pass to the routing object, optional
     *  * rest : for convenience, you can just pass named parameters that will be used as
     *           the params array, but you must not provide the params array in this case
     * 
    * * Examples: * * {a url("route.name" array(param="Value", param2=$otherVal))}Here is a link{/a} *
    {* without any parameter it just returns the current url *} * * * This software is provided 'as-is', without any express or implied warranty. * In no event will the authors be held liable for any damages arising from the use of this software. * * @author Jordi Boggiano * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ function Dwoo_Plugin_url_compile(Dwoo_Compiler $compiler, $route = null, $params = null, $options = null, array $rest = array()) { if ($params == 'null') { if (count($rest)) { $params = array(); foreach ($rest as $k=>$v) { if (is_numeric($k)) { $params[] = $k.'=>'.$v; } else { $params[] = '"'.$k.'"=>'.$v; } } $params = 'array('.implode(', ', $params).')'; } else { $params = 'array()'; } } if ($options == 'null') { $options = 'array()'; } return '$this->data[\'ro\']->gen('.$route.', '.$params.', '.$options.')'; }nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Adapters/CakePHP/000077500000000000000000000000001225466040700270105ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Adapters/CakePHP/README000066400000000000000000000021221225466040700276650ustar00rootroot00000000000000// CakePHP Dwoo bridge - v0.2 // ------------------------ // Installation : // ------------------------ // 1. Download and install the dwoo library, preferably on the // 'vendors' directory of CakePHP. However you can place it // anywhere you want; if you do, make sure to change the App::import // line in dwoo.php to include the dwoo library properly. // // 2. Place this file in the app/views directory, or on cake/libs/view. // // 3. Create the app/tmp/dwoo/cache and app/tmp/dwoo/compile directories // and make sure they are writable. // ------------------------ // Usage example : // ------------------------ // In your controller class you need to change the view property to // use Dwoo at some point in the execution using : $this->view = 'Dwoo'; // Or you can also override the view property in your AppController class as such : class AppController extends Controller { public $view = 'Dwoo'; } // If you want another template extension (default is .tpl) you must // edit the dwoo.php file at line 44 and change it to : $this->ext = ".html"; //{include $templatedir."index.tpl"}nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Adapters/CakePHP/dwoo.php000066400000000000000000000074671225466040700305070ustar00rootroot00000000000000 'dwoo/dwooAutoload.php')); /** * Dwoo adapter for CakePHP * * Based on SmartyView by Mark John S. Buenconsejo * * This software is provided 'as-is', without any express or implied warranty. * In no event will the authors be held liable for any damages arising from the use of this software. * * This file is released under the LGPL * "GNU Lesser General Public License" * More information can be found here: * {@link http://www.gnu.org/copyleft/lesser.html} * * @author Mark John S. Buenconsejo * @author Giangi * @author Jordi Boggiano * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License * @link http://dwoo.org/ * @version 1.1.0 * @date 2009-07-18 * @package Dwoo */ class DwooView extends View { protected $_sv_template_dir; protected $_sv_layout_dir; protected $_sv_compile_dir; protected $_sv_cache_dir; protected $_sv_compile_id; protected $_dwoo; public $sv_processedTpl; public function __construct(&$controller) { parent::__construct($controller); $this->ext = '.tpl'; $this->_sv_template_dir = array ( VIEWS . $this->viewPath . DS . $this->subDir, VIEWS . $this->viewPath, VIEWS ); $this->_sv_layout_dir = array ( LAYOUTS . $this->subDir, VIEWS ); $this->_sv_compile_dir = TMP . 'dwoo' . DS . 'compile'; $this->_sv_cache_dir = TMP . 'dwoo' . DS . 'cache'; $this->_dwoo = new Dwoo($this->_sv_compile_dir, $this->_sv_cache_dir); $this->_sv_compile_id = $controller->name; $this->_dwoo->sv_this = $this; $this->_dwoo->setSecurityPolicy(); return; } /** * changes the template directory */ public function setTemplateDir($path = VIEW) { $old = $this->_sv_template_dir; $this->_sv_template_dir = $path; return $old; } public function getTemplateDir() { return $this->_sv_template_dir ; } public function _render($___viewFn, $___data_for_view, $___play_safe = true, $loadHelpers = true) { // let's determine if this is a layout call or a template call // and change the template dir accordingly $layout = false; if(isset($___data_for_view['content_for_layout'])) { $this->_sv_template_dir = $this->_sv_layout_dir; $layout = true; } $tpl = new Dwoo_Template_File($___viewFn); $data = $___data_for_view; $data['view'] = $this; if ($this->helpers != false && $loadHelpers === true) { $loadedHelpers = array(); $loadedHelpers = $this->_loadHelpers($loadedHelpers, $this->helpers); foreach (array_keys($loadedHelpers) as $helper) { $camelBackedHelper = strtolower(substr($helper, 0, 1)) . substr($helper, 1); ${$camelBackedHelper} = $loadedHelpers[$helper]; if (is_array(${$camelBackedHelper}->helpers) && !empty(${$camelBackedHelper}->helpers)) { $subHelpers = ${$camelBackedHelper}->helpers; foreach ($subHelpers as $subHelper) { ${$camelBackedHelper}->{$subHelper} = $loadedHelpers[$subHelper]; } } if(isset($this->passedArgs)) { ${$camelBackedHelper}->passedArgs = $this->passedArgs; } $this->loaded[$camelBackedHelper] = ${$camelBackedHelper}; $data[$camelBackedHelper] = ${$camelBackedHelper}; } } if ($this->helpers != false && $loadHelpers === true) { foreach ($loadedHelpers as $helper) { if (is_object($helper)) { if (is_subclass_of($helper, 'Helper') || is_subclass_of($helper, 'helper')) { $helper->beforeRender(); } } } } return $this->_dwoo->get($tpl, $data); } public function get(){ return $this->_dwoo; } }nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Adapters/CodeIgniter/000077500000000000000000000000001225466040700277715ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Adapters/CodeIgniter/README000066400000000000000000000025251225466040700306550ustar00rootroot00000000000000CodeIgniter/Dwoo adapater ------------------------- Integration of Dwoo into Codeigniter (1.7.0 >) Links: Dwoo - http://dwoo.org CodeIgniter - http://codeigniter.com Installation: 1) Extract package into your application directory (i.e. $webroot/application or $webroot/system/application) 2) Change the parameters in config/dwootemplate.php 3) Create the compile and cache directory you set in your config file in step 2 and give it the correct rights (chmod 777 when on *nix) 4) Extract/copy the Dwoo package into application/libraries/dwoo 5) Browse to : http://[yoururl]/dwoowelcome Version info 1.0.2 [11-03-2009] Fixed a problem with $data attribute (which Dwoo also used) 1.0.1 [12-11-2008] Removed some & in the dwootemplate Changed licencse Changed 'output' in 'get' in the dwootemplate (line 122) 1.0.0 [11-11-2008] Initial release Questions/Remarks? mail to: stefan.verstege@newmedia.nl IM me on GTALK: verstege@gmail.com Contact me on the Dwoo forums: stefanv ---------[ copyright notice ]----------------------------------------------------------------------- This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. License http://dwoo.org/LICENSE Modified BSD Licensenagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Adapters/CodeIgniter/config/000077500000000000000000000000001225466040700312365ustar00rootroot00000000000000dwootemplate.php000066400000000000000000000010141225466040700343700ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Adapters/CodeIgniter/configload->library('Dwootemplate'); $this->dwootemplate->assign('itshowlate', date('H:i:s')); $this->dwootemplate->display('dwoowelcome.tpl'); } }nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Adapters/CodeIgniter/libraries/000077500000000000000000000000001225466040700317455ustar00rootroot00000000000000Dwootemplate.php000066400000000000000000000111261225466040700350440ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Adapters/CodeIgniter/libraries * @copyright Copyright (c) 2008, Stefan Verstege * @license http://dwoo.org/LICENSE Modified BSD License * @link http://www.newmedia.nl/ * @version 1.1.0 * @date 2009-07-18 * @package Dwoo * * @uses the dwoo package from http://dwoo.org */ class Dwootemplate extends Dwoo { protected $dwoo_data = array(); /** * Constructor for the DwooTemplate engine * */ public function __construct() { // Call parents constructor parent::__construct(); // Set the config settings $this->initialize(); // Assign some defaults to dwoo $CI = get_instance(); $this->dwoo_data = new Dwoo_Data(); $this->dwoo_data->js_files = array(); $this->dwoo_data->css_files = array(); $this->dwoo_data->CI = $CI; $this->dwoo_data->site_url = $CI->config->site_url(); // so we can get the full path to CI easily $this->dwoo_data->uniqid = uniqid(); $this->dwoo_data->timestamp = mktime(); log_message('debug', "Dwoo Template Class Initialized"); } /** * Assign data to dwoo data object * * @param string $key * @param mixed $value */ public function assign($key, $value) { $this->dwoo_data->$key = $value; } /** * Add Javascript files to template * * @param string $js */ public function add_js($js) { $current = $this->dwoo_data->js_files; $current[] = $js; $this->dwoo_data->js_files = $current; } /** * Add Css stylesheets to template * * @param string $css */ public function add_css($css) { $current = $this->dwoo_data->css_files; $current[] = $css; $this->dwoo_data->css_files = $current; } /** * Display or return the compiled template * Since we assign the results to the standard CI output module * you can also use the helper from CI in your templates!! * * @param string $sTemplate * @param boolean $return * @return mixed */ public function display($sTemplate, $return = FALSE) { // Start benchmark $CI = get_instance(); $CI->benchmark->mark('dwoo_parse_start'); // Check if file exists if ( !file_exists($this->template_dir . $sTemplate ) ) { $message = sprintf('Template file \'%s\' not found.', $sTemplate); show_error($message); log_message('error', $message); } // Create new template $tpl = new Dwoo_Template_File($this->template_dir . $sTemplate); // render the template $template = $this->get($tpl, $this->dwoo_data); // Finish benchmark $CI->benchmark->mark('dwoo_parse_end'); // Return results or not ? if ($return == FALSE) { $CI->output->final_output = $template; } else { return $template; } } /** * Toggle Codeigniter profiler on/off * */ public function enable_profiler($toggle = TRUE) { $CI = get_instance(); $CI->output->enable_profiler($toggle); } /** * Set http header * * @example $this->output->set_header("HTTP/1.1 200 OK"); * @example $this->output->set_header('Last-Modified: '.gmdate('D, d M Y H:i:s', $last_update).' GMT'); * @param string $header */ public function set_header($header) { $CI = get_instance(); $CI->output->set_header($header); } /** * Set status header * * @example $this->output->set_status_header('401'); * @example // Sets the header as: Unauthorized * @param string $header */ public function set_status_header($header) { $CI = get_instance(); $CI->output->set_status_header($header); } /** * Assign the dwootemplate config items to the instance * */ private function initialize() { $CI = get_instance(); $CI->config->load('dwootemplate', TRUE); $config = $CI->config->item('dwootemplate'); foreach ($config as $key => $val) { $this->$key = $val; } } }nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Adapters/CodeIgniter/views/000077500000000000000000000000001225466040700311265ustar00rootroot00000000000000dwoowelcome.tpl000066400000000000000000000022351225466040700341160ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Adapters/CodeIgniter/views{extends "page.tpl"} {block "title"} Welcome to Dwoo-ed CodeIgniter {/block} {block "content"}

    Welcome to Dwoo-ed CodeIgniter!

    The page you are looking at is being generated dynamically by CodeIgniter in combination with the 'Smarty-killer' Dwoo template engine. The page is rendered at {$itshowlate} by the Dwoo_compiler.

    If you would like to edit this page you'll find it located at:

    application/views/dwoowelcome.tpl

    The corresponding controller for this page is found at:

    application/controllers/dwoowelcome.php

    The library for Dwoo integration can be found at:

    application/libraries/Dwootemplate.php

    If you are exploring Dwoo for the very first time, you should start by reading the {anchor uri='http://dwoo.org/' title='Dwoo website'}.

    If you are exploring CodeIgniter for the very first time, you should start by reading the {anchor uri='http://codeigniter.com/user_guide/' title='User Guide'}.

    Usage:
    $this->load->library('Dwootemplate');
    $this->dwootemplate->assign('test', 'test');
    $this->dwootemplate->display('dwoowelcome.tpl');
    
    {/block}nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Adapters/CodeIgniter/views/page.tpl000066400000000000000000000017511225466040700325670ustar00rootroot00000000000000 {block "title"}Here come the title{/block} {block "content"}Here comes the content{/block} nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Adapters/ZendFramework/000077500000000000000000000000001225466040700303535ustar00rootroot00000000000000PluginProxy.php000066400000000000000000000051131225466040700333050ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Adapters/ZendFramework * @author Jordi Boggiano * @copyright Copyright (c) 2008, Denis Arh, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ class Dwoo_Adapters_ZendFramework_PluginProxy implements Dwoo_IPluginProxy { /** * reference to the zend view owning this proxy * * @var Zend_View_Interface */ public $view; /** * Dwoo_Adapters_ZendFramework_PluginProxy's constructor. * * @param Zend_View_Interface $view */ public function __construct(Zend_View_Interface $view) { $this->view = $view; } /** * Called from Dwoo_Compiler to check if the requested plugin is available * * @param string $name * @return bool */ public function handles($name) { try { $this->view->getHelper($name); } catch (Zend_Loader_PluginLoader_Exception $e) { return false; } return true; } /** * returns the code (as a string) to call the plugin * (this will be executed at runtime inside the Dwoo class) * * @param string $name the plugin name * @param array $params a parameter array, array key "*" is the rest array * @return string */ public function getCode($name, $params) { return '$this->getPluginProxy()->view->'. $name .'('.Dwoo_Compiler::implode_r($params).')'; } /** * returns a callback to the plugin, this is used with the reflection API to * find out about the plugin's parameter names etc. * * should you need a rest array (i.e. for ZendFramework helpers) without the * possibility to edit the plugin's code, you can provide a callback to some * other function with the correct parameter signature, i.e. : * * return array($this, "callbackHelper"); * // and callbackHelper would be as such: * public function callbackHelper(array $rest=array()){} * * * @param string $name the plugin name * @return callback */ public function getCallback($name) { return array($this->view->getHelper($name), $name); } /** * returns some code that will check if the plugin is loaded and if not load it * this is optional, if your plugins are autoloaded or whatever, just return an * empty string * * @param string $name the plugin name * @return string */ public function getLoader($name) { return ''; } }nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Adapters/ZendFramework/README000066400000000000000000000021401225466040700312300ustar00rootroot00000000000000// ------------------------ // Usage example : // ------------------------ // Note that you might need to manually include 'lib/Dwoo.php', // 'lib/Dwoo/Adapters/ZendFramework/View.php' and // 'lib/Dwoo/Adapters/ZendFramework/PluginProxy.php' for this to // work as expected, depending on your ZF setup // // If anyone writes a more advanced how-to please let me know // ------------------------ $view = new Dwoo_Adapters_ZendFramework_View(array( 'compileDir' => 'path/to/compile_dir' // set to null or remove this line to use defaults 'cacheDir' => 'path/to/cache_dir' // set to null or remove this line to use defaults )); // This allows you to use ZF's helpers as if they were Dwoo plugins (i.e. {doctype} will call the doctype helper) $view->setPluginProxy(new Dwoo_Adapters_ZendFramework_PluginProxy(new Zend_View())); // 1. example - used with the Zend Controller $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer($view); Zend_Controller_Action_HelperBroker::addHelper($viewRenderer); // 2. example - used manually $view->assign('foo', 'bar'); $view->display('foobar.phtml');nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Adapters/ZendFramework/View.php000066400000000000000000000266731225466040700320140ustar00rootroot00000000000000 * @author Stephan Wentz * @author Jordi Boggiano * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.1.0 * @date 2009-07-18 * @package Dwoo */ class Dwoo_Adapters_ZendFramework_View extends Zend_View_Abstract { /** * @var Dwoo */ protected $_engine = null; /** * @var Dwoo_Data */ protected $_dataProvider = null; /** * @var Dwoo_Compiler */ protected $_compiler = null; /** * Changing Filter's scope to play nicely * * @var array */ protected $_filter = array(); /** * @var string */ protected $_templateFileClass = 'Dwoo_Template_File'; /** * @var array */ protected $_templateFileSettings = array(); /** * @var Dwoo_IPluginProxy */ protected $_pluginProxy = null; /** * Constructor method. * See setOptions for $opt details * * @see setOptions * @param array|Zend_Config List of options or Zend_Config instance */ public function __construct($opt = array()) { if (is_array($opt)) { $this->setOptions($opt); } elseif ($opt instanceof Zend_Config) { $this->setConfig($opt); } $this->init(); } /** * Set object state from options array * - engine = engine class name|engine object|array of options for engine * - dataProvider = data provider class name|data provider object|array of options for data provider * - compiler = compiler class name|compiler object|array of options for compiler * - templateFile = * * Array of options: * - type class name or object for engine, dataProvider or compiler * - any set* method (compileDir for setCompileDir ...) * * @param array $options * @return Dwoo_Adapters_ZendFramework_View */ public function setOptions(array $opt = array()) { // BC checks // TODO remove in 1.1 if (isset($opt['compileDir']) || isset($opt['compile_dir'])) { trigger_error('Dwoo ZF Adapter: the compile dir should be set in the $options[\'engine\'][\'compileDir\'] value the adapter settings', E_USER_WARNING); } if (isset($opt['cacheDir']) || isset($opt['cache_dir'])) { trigger_error('Dwoo ZF Adapter: the cache dir should be set in the $options[\'engine\'][\'cacheDir\'] value the adapter settings', E_USER_WARNING); } // end BC // Making sure that everything is loaded. $classes = array('engine', 'dataProvider', 'compiler'); // Setting options to Dwoo objects... foreach ($opt as $type => $settings) { if (!method_exists($this, 'set' . $type)) { throw new Dwoo_Exception("Unknown type $type"); } if (is_string($settings) || is_object($settings)) { call_user_func(array($this, 'set' . $type), $settings); } elseif (is_array($settings)) { // Set requested class if (array_key_exists('type', $settings)) { call_user_func(array($this, 'set' . $type), $settings['type']); } if (in_array($type, $classes)) { // Call get so that the class is initialized $rel = call_user_func(array($this, 'get' . $type)); // Call set*() methods so that all the settings are set. foreach ($settings as $method => $value) { if (method_exists($rel, 'set' . $method)) { call_user_func(array($rel, 'set' . $method), $value); } } } elseif ('templateFile' == $type) { // Remember the settings for the templateFile $this->_templateFileSettings = $settings; } } } } /** * Set object state from Zend_Config object * * @param Zend_Config $config * @return Dwoo_Adapters_ZendFramework_View */ public function setConfig(Zend_Config $config) { return $this->setOptions($config->toArray()); } /** * Called before template rendering * * Binds plugin proxy to the Dwoo. * * @see Dwoo_Adapters_ZendFramework_View::getPluginProxy(); * @see Dwoo::setPluginProxy(); */ protected function preRender() { $this->getEngine()->setPluginProxy($this->getPluginProxy()); } /** * Wraper for Dwoo_Data::__set() * allows to assign variables using the object syntax * * @see Dwoo_Data::__set() * @param string $name the variable name * @param string $value the value to assign to it */ public function __set($name, $value) { $this->getDataProvider()->__set($name, $value); } /** * Sraper for Dwoo_Data::__get() allows to read variables using the object * syntax * * @see Dwoo_Data::__get() * @param string $name the variable name * @return mixed */ public function __get($name) { return $this->getDataProvider()->__get($name); } /** * Wraper for Dwoo_Data::__isset() * supports calls to isset($dwooData->var) * * @see Dwoo_Data::__isset() * @param string $name the variable name */ public function __isset($name) { return $this->getDataProvider()->__isset($name); } /** * Wraper for Dwoo_Data::_unset() * supports unsetting variables using the object syntax * * @see Dwoo_Data::__unset() * @param string $name the variable name */ public function __unset($name) { $this->getDataProvider()->__unset($name); } /** * Catches clone request and clones data provider */ public function __clone() { $this->setDataProvider(clone $this->getDataProvider()); } /** * Returns plugin proxy interface * * @return Dwoo_IPluginProxy */ public function getPluginProxy() { if (!$this->_pluginProxy) { $this->_pluginProxy = new Dwoo_Adapters_ZendFramework_PluginProxy($this); } return $this->_pluginProxy; } /** * Sets plugin proxy * * @param Dwoo_IPluginProxy * @return Dwoo_Adapters_ZendFramework_View */ public function setPluginProxy(Dwoo_IPluginProxy $pluginProxy) { $this->_pluginProxy = $pluginProxy; return $this; } /** * Sets template engine * * @param string|Dwoo Object or name of the class */ public function setEngine($engine) { // if param given as an object if ($engine instanceof Dwoo) { $this->_engine = $engine; } // elseif (is_subclass_of($engine, 'Dwoo') || 'Dwoo' === $engine) { $this->_engine = new $engine(); } else { throw new Dwoo_Exception("Custom engine must be a subclass of Dwoo"); } } /** * Return the Dwoo template engine object * * @return Dwoo */ public function getEngine() { if (null === $this->_engine) { $this->_engine = new Dwoo(); } return $this->_engine; } /** * Sets Dwoo data object * * @param string|Dwoo_Data Object or name of the class */ public function setDataProvider($data) { if ($data instanceof Dwoo_IDataProvider) { $this->_dataProvider = $data; } elseif (is_subclass_of($data, 'Dwoo_Data') || 'Dwoo_Data' == $data) { $this->_dataProvider = new $data(); } else { throw new Dwoo_Exception("Custom data provider must be a subclass of Dwoo_Data or instance of Dwoo_IDataProvider"); } } /** * Return the Dwoo data object * * @return Dwoo_Data */ public function getDataProvider() { if (null === $this->_dataProvider) { $this->_dataProvider = new Dwoo_Data; } return $this->_dataProvider; } /** * Sets Dwoo compiler * * @param string|Dwoo_Compiler Object or name of the class */ public function setCompiler($compiler) { // if param given as an object if ($compiler instanceof Dwoo_ICompiler) { $this->_compiler = $compiler; } // if param given as a string elseif (is_subclass_of($compiler, 'Dwoo_Compiler') || 'Dwoo_Compiler' == $compiler) { $this->_compiler = new $compiler; } else { throw new Dwoo_Exception("Custom compiler must be a subclass of Dwoo_Compiler or instance of Dwoo_ICompiler"); } } /** * Return the Dwoo compiler object * * @return Dwoo_Data */ public function getCompiler() { if (null === $this->_compiler) { $this->_compiler = Dwoo_Compiler::compilerFactory(); } return $this->_compiler; } /** * Initializes Dwoo_ITemplate type of class and sets properties from _templateFileSettings * * @param string Template location * @return Dwoo_ITemplate */ public function getTemplateFile($template) { $templateFileClass = $this->_templateFileClass; $dwooTemplateFile = new $templateFileClass($template); if (!($dwooTemplateFile instanceof Dwoo_ITemplate)) { throw new Dwoo_Exception("Custom templateFile class must be a subclass of Dwoo_ITemplate"); } foreach ($this->_templateFileSettings as $method => $value) { if (method_exists($dwooTemplateFile, 'set' . $method)) { call_user_func(array($dwooTemplateFile, 'set' . $method), $value); } } return $dwooTemplateFile; } /** * Dwoo_ITemplate type of class * * @param string Name of the class * @return void */ public function setTemplateFile($tempateFileClass) { $this->_templateFileClass = $tempateFileClass; } /** * Passes data to Dwoo_Data object * * @see Dwoo_Data::assign() * @param array|string $name * @param mixed $val * @return Dwoo_Adapters_ZendFramework_View */ public function assign($name, $val = null) { $this->getDataProvider()->assign($name, $val); return $this; } /** * Return list of all assigned variables * * @return array */ public function getVars() { return $this->_dataProvider->getData(); } /** * Clear all assigned variables * * Clears all variables assigned to Zend_View either via {@link assign()} or * property overloading ({@link __get()}/{@link __set()}). * * @return void * @return Dwoo_Adapters_ZendFramework_View */ public function clearVars() { $this->getDataProvider()->clear(); return $this; } /** * Wraper for parent's render method so preRender method * can be called (that will bind the plugin proxy to the * engine. * * @see Zend_View_Abstract::render * @return string The script output. */ public function render($name) { $this->preRender(); return parent::render($name); } /** * Processes a view script and outputs it. Output is then * passed through filters. * * @param string $name The script script name to process. * @return string The script output. */ public function _run() { echo $this->_engine->get( $this->getTemplateFile(func_get_arg(0)), $this->getDataProvider(), $this->getCompiler() ); } /** * Add plugin path * * @param string $dir Directory * @return Dwoo_Adapters_ZendFramework_View */ public function addPluginDir($dir) { $this->getEngine()->getLoader()->addDirectory($dir); return $this; } /** * Set compile path * * @param string $dir Directory * @return Dwoo_Adapters_ZendFramework_View */ public function setCompileDir($dir) { $this->getEngine()->setCompileDir($dir); return $this; } /** * Set cache path * * @param string $dir Directory * @return Dwoo_Adapters_ZendFramework_View */ public function setCacheDir($dir) { $this->getEngine()->setCacheDir($dir); return $this; } /** * Set cache lifetime * * @param string $seconds Lifetime in seconds * @return Dwoo_Adapters_ZendFramework_View */ public function setCacheLifetime($seconds) { $this->getEngine()->setCacheTime($seconds); return $this; } /** * Set charset * * @param string $charset * @return Dwoo_Adapters_ZendFramework_View */ public function setCharset($charset) { $this->_engine->setCharset($charset); return $this; } }nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Block/000077500000000000000000000000001225466040700250645ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Block/Plugin.php000066400000000000000000000075151225466040700270430ustar00rootroot00000000000000init() method, it will receive the parameters that * are in the template code and is called when the block starts * * This software is provided 'as-is', without any express or implied warranty. * In no event will the authors be held liable for any damages arising from the use of this software. * * @author Jordi Boggiano * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ abstract class Dwoo_Block_Plugin extends Dwoo_Plugin { /** * stores the contents of the block while it runs * * @var string */ protected $buffer = ''; /** * buffers input, override only if necessary * * @var string $input the content that must be buffered */ public function buffer($input) { $this->buffer .= $input; } // initialization code, receives the parameters from {block param1 param2} // public function init($arg, $arg, ...); /** * called when the block ends, this is most of the time followed right away by a call * of process() but not always, so this should be used to do any shutdown operations on the * block object, if required. */ public function end() { } /** * called when the block output is required by a parent block * * this must read $this->buffer and return it processed * * @return string */ public function process() { return $this->buffer; } /** * called at compile time to define what the block should output in the compiled template code, happens when the block is declared * * basically this will replace the {block arg arg arg} tag in the template * * @param Dwoo_Compiler $compiler the compiler instance that calls this function * @param array $params an array containing original and compiled parameters * @param string $prepend that is just meant to allow a child class to call * parent::postProcessing($compiler, $params, "foo();") to add a command before the * default commands are executed * @param string $append that is just meant to allow a child class to call * parent::postProcessing($compiler, $params, null, "foo();") to add a command after the * default commands are executed * @param string $type the type is the plugin class name used */ public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type) { return Dwoo_Compiler::PHP_OPEN.$prepend.'$this->addStack("'.$type.'", array('.Dwoo_Compiler::implode_r($compiler->getCompiledParams($params)).'));'.$append.Dwoo_Compiler::PHP_CLOSE; } /** * called at compile time to define what the block should output in the compiled template code, happens when the block is ended * * basically this will replace the {/block} tag in the template * * @see preProcessing * @param Dwoo_Compiler $compiler the compiler instance that calls this function * @param array $params an array containing original and compiled parameters, see preProcessing() for more details * @param string $prepend that is just meant to allow a child class to call * parent::postProcessing($compiler, $params, "foo();") to add a command before the * default commands are executed * @param string $append that is just meant to allow a child class to call * parent::postProcessing($compiler, $params, null, "foo();") to add a command after the * default commands are executed * @param string $content the entire content of the block being closed */ public static function postProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $content) { return $content . Dwoo_Compiler::PHP_OPEN.$prepend.'$this->delStack();'.$append.Dwoo_Compiler::PHP_CLOSE; } } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Compilation/000077500000000000000000000000001225466040700263105ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Compilation/Exception.php000066400000000000000000000020551225466040700307610ustar00rootroot00000000000000 * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ class Dwoo_Compilation_Exception extends Dwoo_Exception { protected $compiler; protected $template; public function __construct(Dwoo_Compiler $compiler, $message) { $this->compiler = $compiler; $this->template = $compiler->getDwoo()->getTemplate(); parent::__construct('Compilation error at line '.$compiler->getLine().' in "'.$this->template->getResourceName().':'.$this->template->getResourceIdentifier().'" : '.$message); } public function getCompiler() { return $this->compiler; } public function getTemplate() { return $this->template; } } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Compiler.php000066400000000000000000003132211225466040700263170ustar00rootroot00000000000000 * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.1.0 * @date 2009-07-18 * @package Dwoo */ class Dwoo_Compiler implements Dwoo_ICompiler { /** * constant that represents a php opening tag * * use it in case it needs to be adjusted * * @var string */ const PHP_OPEN = ""; /** * boolean flag to enable or disable debugging output * * @var bool */ public $debug = false; /** * left script delimiter * * @var string */ protected $ld = '{'; /** * left script delimiter with escaped regex meta characters * * @var string */ protected $ldr = '\\{'; /** * right script delimiter * * @var string */ protected $rd = '}'; /** * right script delimiter with escaped regex meta characters * * @var string */ protected $rdr = '\\}'; /** * defines whether the nested comments should be parsed as nested or not * * defaults to false (classic block comment parsing as in all languages) * * @var bool */ protected $allowNestedComments = false; /** * defines whether opening and closing tags can contain spaces before valid data or not * * turn to true if you want to be sloppy with the syntax, but when set to false it allows * to skip javascript and css tags as long as they are in the form "{ something", which is * nice. default is false. * * @var bool */ protected $allowLooseOpenings = false; /** * defines whether the compiler will automatically html-escape variables or not * * default is false * * @var bool */ protected $autoEscape = false; /** * security policy object * * @var Dwoo_Security_Policy */ protected $securityPolicy; /** * stores the custom plugins registered with this compiler * * @var array */ protected $customPlugins = array(); /** * stores the template plugins registered with this compiler * * @var array */ protected $templatePlugins = array(); /** * stores the pre- and post-processors callbacks * * @var array */ protected $processors = array('pre'=>array(), 'post'=>array()); /** * stores a list of plugins that are used in the currently compiled * template, and that are not compilable. these plugins will be loaded * during the template's runtime if required. * * it is a 1D array formatted as key:pluginName value:pluginType * * @var array */ protected $usedPlugins; /** * stores the template undergoing compilation * * @var string */ protected $template; /** * stores the current pointer position inside the template * * @var int */ protected $pointer; /** * stores the current line count inside the template for debugging purposes * * @var int */ protected $line; /** * stores the current template source while compiling it * * @var string */ protected $templateSource; /** * stores the data within which the scope moves * * @var array */ protected $data; /** * variable scope of the compiler, set to null if * it can not be resolved to a static string (i.e. if some * plugin defines a new scope based on a variable array key) * * @var mixed */ protected $scope; /** * variable scope tree, that allows to rebuild the current * scope if required, i.e. when going to a parent level * * @var array */ protected $scopeTree; /** * block plugins stack, accessible through some methods * * @see findBlock * @see getCurrentBlock * @see addBlock * @see addCustomBlock * @see injectBlock * @see removeBlock * @see removeTopBlock * * @var array */ protected $stack = array(); /** * current block at the top of the block plugins stack, * accessible through getCurrentBlock * * @see getCurrentBlock * * @var Dwoo_Block_Plugin */ protected $curBlock; /** * current dwoo object that uses this compiler, or null * * @var Dwoo */ protected $dwoo; /** * holds an instance of this class, used by getInstance when you don't * provide a custom compiler in order to save resources * * @var Dwoo_Compiler */ protected static $instance; /** * sets the delimiters to use in the templates * * delimiters can be multi-character strings but should not be one of those as they will * make it very hard to work with templates or might even break the compiler entirely : "\", "$", "|", ":" and finally "#" only if you intend to use config-vars with the #var# syntax. * * @param string $left left delimiter * @param string $right right delimiter */ public function setDelimiters($left, $right) { $this->ld = $left; $this->rd = $right; $this->ldr = preg_quote($left, '/'); $this->rdr = preg_quote($right, '/'); } /** * returns the left and right template delimiters * * @return array containing the left and the right delimiters */ public function getDelimiters() { return array($this->ld, $this->rd); } /** * sets the way to handle nested comments, if set to true * {* foo {* some other *} comment *} will be stripped correctly. * * if false it will remove {* foo {* some other *} and leave "comment *}" alone, * this is the default behavior * * @param bool $allow allow nested comments or not, defaults to true (but the default internal value is false) */ public function setNestedCommentsHandling($allow = true) { $this->allowNestedComments = (bool) $allow; } /** * returns the nested comments handling setting * * @see setNestedCommentsHandling * @return bool true if nested comments are allowed */ public function getNestedCommentsHandling() { return $this->allowNestedComments; } /** * sets the tag openings handling strictness, if set to true, template tags can * contain spaces before the first function/string/variable such as { $foo} is valid. * * if set to false (default setting), { $foo} is invalid but that is however a good thing * as it allows css (i.e. #foo { color:red; }) to be parsed silently without triggering * an error, same goes for javascript. * * @param bool $allow true to allow loose handling, false to restore default setting */ public function setLooseOpeningHandling($allow = false) { $this->allowLooseOpenings = (bool) $allow; } /** * returns the tag openings handling strictness setting * * @see setLooseOpeningHandling * @return bool true if loose tags are allowed */ public function getLooseOpeningHandling() { return $this->allowLooseOpenings; } /** * changes the auto escape setting * * if enabled, the compiler will automatically html-escape variables, * unless they are passed through the safe function such as {$var|safe} * or {safe $var} * * default setting is disabled/false * * @param bool $enabled set to true to enable, false to disable */ public function setAutoEscape($enabled) { $this->autoEscape = (bool) $enabled; } /** * returns the auto escape setting * * default setting is disabled/false * * @return bool */ public function getAutoEscape() { return $this->autoEscape; } /** * adds a preprocessor to the compiler, it will be called * before the template is compiled * * @param mixed $callback either a valid callback to the preprocessor or a simple name if the autoload is set to true * @param bool $autoload if set to true, the preprocessor is auto-loaded from one of the plugin directories, else you must provide a valid callback */ public function addPreProcessor($callback, $autoload = false) { if ($autoload) { $name = str_replace('Dwoo_Processor_', '', $callback); $class = 'Dwoo_Processor_'.$name; if (class_exists($class, false)) { $callback = array(new $class($this), 'process'); } elseif (function_exists($class)) { $callback = $class; } else { $callback = array('autoload'=>true, 'class'=>$class, 'name'=>$name); } $this->processors['pre'][] = $callback; } else { $this->processors['pre'][] = $callback; } } /** * removes a preprocessor from the compiler * * @param mixed $callback either a valid callback to the preprocessor or a simple name if it was autoloaded */ public function removePreProcessor($callback) { if (($index = array_search($callback, $this->processors['pre'], true)) !== false) { unset($this->processors['pre'][$index]); } elseif (($index = array_search('Dwoo_Processor_'.str_replace('Dwoo_Processor_', '', $callback), $this->processors['pre'], true)) !== false) { unset($this->processors['pre'][$index]); } else { $class = 'Dwoo_Processor_' . str_replace('Dwoo_Processor_', '', $callback); foreach ($this->processors['pre'] as $index=>$proc) { if (is_array($proc) && ($proc[0] instanceof $class) || (isset($proc['class']) && $proc['class'] == $class)) { unset($this->processors['pre'][$index]); break; } } } } /** * adds a postprocessor to the compiler, it will be called * before the template is compiled * * @param mixed $callback either a valid callback to the postprocessor or a simple name if the autoload is set to true * @param bool $autoload if set to true, the postprocessor is auto-loaded from one of the plugin directories, else you must provide a valid callback */ public function addPostProcessor($callback, $autoload = false) { if ($autoload) { $name = str_replace('Dwoo_Processor_', '', $callback); $class = 'Dwoo_Processor_'.$name; if (class_exists($class, false)) { $callback = array(new $class($this), 'process'); } elseif (function_exists($class)) { $callback = $class; } else { $callback = array('autoload'=>true, 'class'=>$class, 'name'=>$name); } $this->processors['post'][] = $callback; } else { $this->processors['post'][] = $callback; } } /** * removes a postprocessor from the compiler * * @param mixed $callback either a valid callback to the postprocessor or a simple name if it was autoloaded */ public function removePostProcessor($callback) { if (($index = array_search($callback, $this->processors['post'], true)) !== false) { unset($this->processors['post'][$index]); } elseif (($index = array_search('Dwoo_Processor_'.str_replace('Dwoo_Processor_', '', $callback), $this->processors['post'], true)) !== false) { unset($this->processors['post'][$index]); } else { $class = 'Dwoo_Processor_' . str_replace('Dwoo_Processor_', '', $callback); foreach ($this->processors['post'] as $index=>$proc) { if (is_array($proc) && ($proc[0] instanceof $class) || (isset($proc['class']) && $proc['class'] == $class)) { unset($this->processors['post'][$index]); break; } } } } /** * internal function to autoload processors at runtime if required * * @param string $class the class/function name * @param string $name the plugin name (without Dwoo_Plugin_ prefix) */ protected function loadProcessor($class, $name) { if (!class_exists($class, false) && !function_exists($class)) { try { $this->dwoo->getLoader()->loadPlugin($name); } catch (Dwoo_Exception $e) { throw new Dwoo_Exception('Processor '.$name.' could not be found in your plugin directories, please ensure it is in a file named '.$name.'.php in the plugin directory'); } } if (class_exists($class, false)) { return array(new $class($this), 'process'); } if (function_exists($class)) { return $class; } throw new Dwoo_Exception('Wrong processor name, when using autoload the processor must be in one of your plugin dir as "name.php" containg a class or function named "Dwoo_Processor_name"'); } /** * adds a template plugin, this is reserved for use by the {function} plugin * * this is required because the template functions are not declared yet * during compilation, so we must have a way of validating their argument * signature without using the reflection api * * @private * @param string $name function name * @param array $params parameter array to help validate the function call * @param string $uuid unique id of the function * @param string $body function php code */ public function addTemplatePlugin($name, array $params, $uuid, $body = null) { $this->templatePlugins[$name] = array('params'=> $params, 'body' => $body, 'uuid' => $uuid); } /** * returns all the parsed sub-templates * * @private * @return array the parsed sub-templates */ public function getTemplatePlugins() { return $this->templatePlugins; } /** * marks a template plugin as being called, which means its source must be included in the compiled template * * @param string $name function name */ public function useTemplatePlugin($name) { $this->templatePlugins[$name]['called'] = true; } /** * adds the custom plugins loaded into Dwoo to the compiler so it can load them * * @see Dwoo::addPlugin * @param array $customPlugins an array of custom plugins */ public function setCustomPlugins(array $customPlugins) { $this->customPlugins = $customPlugins; } /** * sets the security policy object to enforce some php security settings * * use this if untrusted persons can modify templates, * set it on the Dwoo object as it will be passed onto the compiler automatically * * @param Dwoo_Security_Policy $policy the security policy object */ public function setSecurityPolicy(Dwoo_Security_Policy $policy = null) { $this->securityPolicy = $policy; } /** * returns the current security policy object or null by default * * @return Dwoo_Security_Policy|null the security policy object if any */ public function getSecurityPolicy() { return $this->securityPolicy; } /** * sets the pointer position * * @param int $position the new pointer position * @param bool $isOffset if set to true, the position acts as an offset and not an absolute position */ public function setPointer($position, $isOffset = false) { if ($isOffset) { $this->pointer += $position; } else { $this->pointer = $position; } } /** * returns the current pointer position, only available during compilation of a template * * @return int */ public function getPointer() { return $this->pointer; } /** * sets the line number * * @param int $number the new line number * @param bool $isOffset if set to true, the position acts as an offset and not an absolute position */ public function setLine($number, $isOffset = false) { if ($isOffset) { $this->line += $number; } else { $this->line = $number; } } /** * returns the current line number, only available during compilation of a template * * @return int */ public function getLine() { return $this->line; } /** * returns the dwoo object that initiated this template compilation, only available during compilation of a template * * @return Dwoo */ public function getDwoo() { return $this->dwoo; } /** * overwrites the template that is being compiled * * @param string $newSource the template source that must replace the current one * @param bool $fromPointer if set to true, only the source from the current pointer position is replaced * @return string the template or partial template */ public function setTemplateSource($newSource, $fromPointer = false) { if ($fromPointer === true) { $this->templateSource = substr($this->templateSource, 0, $this->pointer) . $newSource; } else { $this->templateSource = $newSource; } } /** * returns the template that is being compiled * * @param mixed $fromPointer if set to true, only the source from the current pointer * position is returned, if a number is given it overrides the current pointer * @return string the template or partial template */ public function getTemplateSource($fromPointer = false) { if ($fromPointer === true) { return substr($this->templateSource, $this->pointer); } elseif (is_numeric($fromPointer)) { return substr($this->templateSource, $fromPointer); } else { return $this->templateSource; } } /** * resets the compilation pointer, effectively restarting the compilation process * * this is useful if a plugin modifies the template source since it might need to be recompiled */ public function recompile() { $this->setPointer(0); } /** * compiles the provided string down to php code * * @param string $tpl the template to compile * @return string a compiled php string */ public function compile(Dwoo $dwoo, Dwoo_ITemplate $template) { // init vars $tpl = $template->getSource(); $ptr = 0; $this->dwoo = $dwoo; $this->template = $template; $this->templateSource =& $tpl; $this->pointer =& $ptr; while (true) { // if pointer is at the beginning, reset everything, that allows a plugin to externally reset the compiler if everything must be reparsed if ($ptr===0) { // resets variables $this->usedPlugins = array(); $this->data = array(); $this->scope =& $this->data; $this->scopeTree = array(); $this->stack = array(); $this->line = 1; $this->templatePlugins = array(); // add top level block $compiled = $this->addBlock('topLevelBlock', array(), 0); $this->stack[0]['buffer'] = ''; if ($this->debug) echo 'COMPILER INIT
    '; if ($this->debug) echo 'PROCESSING PREPROCESSORS ('.count($this->processors['pre']).')
    '; // runs preprocessors foreach ($this->processors['pre'] as $preProc) { if (is_array($preProc) && isset($preProc['autoload'])) { $preProc = $this->loadProcessor($preProc['class'], $preProc['name']); } if (is_array($preProc) && $preProc[0] instanceof Dwoo_Processor) { $tpl = call_user_func($preProc, $tpl); } else { $tpl = call_user_func($preProc, $this, $tpl); } } unset($preProc); // show template source if debug if ($this->debug) echo '
    '.print_r(htmlentities($tpl), true).'

    '; // strips php tags if required by the security policy if ($this->securityPolicy !== null) { $search = array('{<\?php.*?\?>}'); if (ini_get('short_open_tags')) { $search = array('{<\?.*?\?>}', '{<%.*?%>}'); } switch($this->securityPolicy->getPhpHandling()) { case Dwoo_Security_Policy::PHP_ALLOW: break; case Dwoo_Security_Policy::PHP_ENCODE: $tpl = preg_replace_callback($search, array($this, 'phpTagEncodingHelper'), $tpl); break; case Dwoo_Security_Policy::PHP_REMOVE: $tpl = preg_replace($search, '', $tpl); } } } $pos = strpos($tpl, $this->ld, $ptr); if ($pos === false) { $this->push(substr($tpl, $ptr), 0); break; } elseif (substr($tpl, $pos-1, 1) === '\\' && substr($tpl, $pos-2, 1) !== '\\') { $this->push(substr($tpl, $ptr, $pos-$ptr-1) . $this->ld); $ptr = $pos+strlen($this->ld); } elseif (preg_match('/^'.$this->ldr . ($this->allowLooseOpenings ? '\s*' : '') . 'literal' . ($this->allowLooseOpenings ? '\s*' : '') . $this->rdr.'/s', substr($tpl, $pos), $litOpen)) { if (!preg_match('/'.$this->ldr . ($this->allowLooseOpenings ? '\s*' : '') . '\/literal' . ($this->allowLooseOpenings ? '\s*' : '') . $this->rdr.'/s', $tpl, $litClose, PREG_OFFSET_CAPTURE, $pos)) { throw new Dwoo_Compilation_Exception($this, 'The {literal} blocks must be closed explicitly with {/literal}'); } $endpos = $litClose[0][1]; $this->push(substr($tpl, $ptr, $pos-$ptr) . substr($tpl, $pos + strlen($litOpen[0]), $endpos-$pos-strlen($litOpen[0]))); $ptr = $endpos+strlen($litClose[0][0]); } else { if (substr($tpl, $pos-2, 1) === '\\' && substr($tpl, $pos-1, 1) === '\\') { $this->push(substr($tpl, $ptr, $pos-$ptr-1)); $ptr = $pos; } $this->push(substr($tpl, $ptr, $pos-$ptr)); $ptr = $pos; $pos += strlen($this->ld); if ($this->allowLooseOpenings) { while (substr($tpl, $pos, 1) === ' ') { $pos+=1; } } else { if (substr($tpl, $pos, 1) === ' ' || substr($tpl, $pos, 1) === "\r" || substr($tpl, $pos, 1) === "\n" || substr($tpl, $pos, 1) === "\t") { $ptr = $pos; $this->push($this->ld); continue; } } // check that there is an end tag present if (strpos($tpl, $this->rd, $pos) === false) { throw new Dwoo_Compilation_Exception($this, 'A template tag was not closed, started with "'.substr($tpl, $ptr, 30).'"'); } $ptr += strlen($this->ld); $subptr = $ptr; while (true) { $parsed = $this->parse($tpl, $subptr, null, false, 'root', $subptr); // reload loop if the compiler was reset if ($ptr === 0) { continue 2; } $len = $subptr - $ptr; $this->push($parsed, substr_count(substr($tpl, $ptr, $len), "\n")); $ptr += $len; if ($parsed === false) { break; } } // adds additional line breaks between php closing and opening tags because the php parser removes those if there is just a single line break if (substr($this->curBlock['buffer'], -2) === '?>' && preg_match('{^(([\r\n])([\r\n]?))}', substr($tpl, $ptr, 3), $m)) { if ($m[3] === '') { $ptr+=1; $this->push($m[1].$m[1], 1); } else { $ptr+=2; $this->push($m[1]."\n", 2); } } } } $compiled .= $this->removeBlock('topLevelBlock'); if ($this->debug) echo 'PROCESSING POSTPROCESSORS
    '; foreach ($this->processors['post'] as $postProc) { if (is_array($postProc) && isset($postProc['autoload'])) { $postProc = $this->loadProcessor($postProc['class'], $postProc['name']); } if (is_array($postProc) && $postProc[0] instanceof Dwoo_Processor) { $compiled = call_user_func($postProc, $compiled); } else { $compiled = call_user_func($postProc, $this, $compiled); } } unset($postProc); if ($this->debug) echo 'COMPILATION COMPLETE : MEM USAGE : '.memory_get_usage().'
    '; $output = "usedPlugins as $plugin=>$type) { if ($type & Dwoo::CUSTOM_PLUGIN) { continue; } switch($type) { case Dwoo::BLOCK_PLUGIN: case Dwoo::CLASS_PLUGIN: $output .= "if (class_exists('Dwoo_Plugin_$plugin', false)===false)\n\t\$this->getLoader()->loadPlugin('$plugin');\n"; break; case Dwoo::FUNC_PLUGIN: $output .= "if (function_exists('Dwoo_Plugin_$plugin')===false)\n\t\$this->getLoader()->loadPlugin('$plugin');\n"; break; case Dwoo::SMARTY_MODIFIER: $output .= "if (function_exists('smarty_modifier_$plugin')===false)\n\t\$this->getLoader()->loadPlugin('$plugin');\n"; break; case Dwoo::SMARTY_FUNCTION: $output .= "if (function_exists('smarty_function_$plugin')===false)\n\t\$this->getLoader()->loadPlugin('$plugin');\n"; break; case Dwoo::SMARTY_BLOCK: $output .= "if (function_exists('smarty_block_$plugin')===false)\n\t\$this->getLoader()->loadPlugin('$plugin');\n"; break; case Dwoo::PROXY_PLUGIN: $output .= $this->getDwoo()->getPluginProxy()->getPreloader($plugin); break; default: throw new Dwoo_Compilation_Exception($this, 'Type error for '.$plugin.' with type'.$type); } } foreach ($this->templatePlugins as $function => $attr) { if (isset($attr['called']) && $attr['called'] === true && !isset($attr['checked'])) { $this->resolveSubTemplateDependencies($function); } } foreach ($this->templatePlugins as $function) { if (isset($function['called']) && $function['called'] === true) { $output .= $function['body'].PHP_EOL; } } $output .= $compiled."\n?>"; $output = preg_replace('/(?\s*)<\?xml#is', '$1', $output); if ($this->debug) { echo '
    ';
    			$lines = preg_split('{\r\n|\n|
    }', highlight_string(($output), true)); array_shift($lines); foreach ($lines as $i=>$line) { echo ($i+1).'. '.$line."\r\n"; } } if ($this->debug) echo '
    '; $this->template = $this->dwoo = null; $tpl = null; return $output; } /** * checks what sub-templates are used in every sub-template so that we're sure they are all compiled * * @param string $function the sub-template name */ protected function resolveSubTemplateDependencies($function) { $body = $this->templatePlugins[$function]['body']; foreach ($this->templatePlugins as $func => $attr) { if ($func !== $function && !isset($attr['called']) && strpos($body, 'Dwoo_Plugin_'.$func) !== false) { $this->templatePlugins[$func]['called'] = true; $this->resolveSubTemplateDependencies($func); } } $this->templatePlugins[$function]['checked'] = true; } /** * adds compiled content to the current block * * @param string $content the content to push * @param int $lineCount newlines count in content, optional */ public function push($content, $lineCount = null) { if ($lineCount === null) { $lineCount = substr_count($content, "\n"); } if ($this->curBlock['buffer'] === null && count($this->stack) > 1) { // buffer is not initialized yet (the block has just been created) $this->stack[count($this->stack)-2]['buffer'] .= (string) $content; $this->curBlock['buffer'] = ''; } else { if (!isset($this->curBlock['buffer'])) { throw new Dwoo_Compilation_Exception($this, 'The template has been closed too early, you probably have an extra block-closing tag somewhere'); } // append current content to current block's buffer $this->curBlock['buffer'] .= (string) $content; } $this->line += $lineCount; } /** * sets the scope * * set to null if the scope becomes "unstable" (i.e. too variable or unknown) so that * variables are compiled in a more evaluative way than just $this->scope['key'] * * @param mixed $scope a string i.e. "level1.level2" or an array i.e. array("level1", "level2") * @param bool $absolute if true, the scope is set from the top level scope and not from the current scope * @return array the current scope tree */ public function setScope($scope, $absolute = false) { $old = $this->scopeTree; if ($scope===null) { unset($this->scope); $this->scope = null; } if (is_array($scope)===false) { $scope = explode('.', $scope); } if ($absolute===true) { $this->scope =& $this->data; $this->scopeTree = array(); } while (($bit = array_shift($scope)) !== null) { if ($bit === '_parent' || $bit === '_') { array_pop($this->scopeTree); reset($this->scopeTree); $this->scope =& $this->data; $cnt = count($this->scopeTree); for ($i=0;$i<$cnt;$i++) $this->scope =& $this->scope[$this->scopeTree[$i]]; } elseif ($bit === '_root' || $bit === '__') { $this->scope =& $this->data; $this->scopeTree = array(); } elseif (isset($this->scope[$bit])) { $this->scope =& $this->scope[$bit]; $this->scopeTree[] = $bit; } else { $this->scope[$bit] = array(); $this->scope =& $this->scope[$bit]; $this->scopeTree[] = $bit; } } return $old; } /** * adds a block to the top of the block stack * * @param string $type block type (name) * @param array $params the parameters array * @param int $paramtype the parameters type (see mapParams), 0, 1 or 2 * @return string the preProcessing() method's output */ public function addBlock($type, array $params, $paramtype) { $class = 'Dwoo_Plugin_'.$type; if (class_exists($class, false) === false) { $this->dwoo->getLoader()->loadPlugin($type); } $params = $this->mapParams($params, array($class, 'init'), $paramtype); $this->stack[] = array('type' => $type, 'params' => $params, 'custom' => false, 'class' => $class, 'buffer' => null); $this->curBlock =& $this->stack[count($this->stack)-1]; return call_user_func(array($class,'preProcessing'), $this, $params, '', '', $type); } /** * adds a custom block to the top of the block stack * * @param string $type block type (name) * @param array $params the parameters array * @param int $paramtype the parameters type (see mapParams), 0, 1 or 2 * @return string the preProcessing() method's output */ public function addCustomBlock($type, array $params, $paramtype) { $callback = $this->customPlugins[$type]['callback']; if (is_array($callback)) { $class = is_object($callback[0]) ? get_class($callback[0]) : $callback[0]; } else { $class = $callback; } $params = $this->mapParams($params, array($class, 'init'), $paramtype); $this->stack[] = array('type' => $type, 'params' => $params, 'custom' => true, 'class' => $class, 'buffer' => null); $this->curBlock =& $this->stack[count($this->stack)-1]; return call_user_func(array($class,'preProcessing'), $this, $params, '', '', $type); } /** * injects a block at the top of the plugin stack without calling its preProcessing method * * used by {else} blocks to re-add themselves after having closed everything up to their parent * * @param string $type block type (name) * @param array $params parameters array */ public function injectBlock($type, array $params) { $class = 'Dwoo_Plugin_'.$type; if (class_exists($class, false) === false) { $this->dwoo->getLoader()->loadPlugin($type); } $this->stack[] = array('type' => $type, 'params' => $params, 'custom' => false, 'class' => $class, 'buffer' => null); $this->curBlock =& $this->stack[count($this->stack)-1]; } /** * removes the closest-to-top block of the given type and all other * blocks encountered while going down the block stack * * @param string $type block type (name) * @return string the output of all postProcessing() method's return values of the closed blocks */ public function removeBlock($type) { $output = ''; $pluginType = $this->getPluginType($type); if ($pluginType & Dwoo::SMARTY_BLOCK) { $type = 'smartyinterface'; } while (true) { while ($top = array_pop($this->stack)) { if ($top['custom']) { $class = $top['class']; } else { $class = 'Dwoo_Plugin_'.$top['type']; } if (count($this->stack)) { $this->curBlock =& $this->stack[count($this->stack)-1]; $this->push(call_user_func(array($class, 'postProcessing'), $this, $top['params'], '', '', $top['buffer']), 0); } else { $null = null; $this->curBlock =& $null; $output = call_user_func(array($class, 'postProcessing'), $this, $top['params'], '', '', $top['buffer']); } if ($top['type'] === $type) { break 2; } } throw new Dwoo_Compilation_Exception($this, 'Syntax malformation, a block of type "'.$type.'" was closed but was not opened'); break; } return $output; } /** * returns a reference to the first block of the given type encountered and * optionally closes all blocks until it finds it * * this is mainly used by {else} plugins to close everything that was opened * between their parent and themselves * * @param string $type the block type (name) * @param bool $closeAlong whether to close all blocks encountered while going down the block stack or not * @return &array the array is as such: array('type'=>pluginName, 'params'=>parameter array, * 'custom'=>bool defining whether it's a custom plugin or not, for internal use) */ public function &findBlock($type, $closeAlong = false) { if ($closeAlong===true) { while ($b = end($this->stack)) { if ($b['type']===$type) { return $this->stack[key($this->stack)]; } $this->push($this->removeTopBlock(), 0); } } else { end($this->stack); while ($b = current($this->stack)) { if ($b['type']===$type) { return $this->stack[key($this->stack)]; } prev($this->stack); } } throw new Dwoo_Compilation_Exception($this, 'A parent block of type "'.$type.'" is required and can not be found'); } /** * returns a reference to the current block array * * @return &array the array is as such: array('type'=>pluginName, 'params'=>parameter array, * 'custom'=>bool defining whether it's a custom plugin or not, for internal use) */ public function &getCurrentBlock() { return $this->curBlock; } /** * removes the block at the top of the stack and calls its postProcessing() method * * @return string the postProcessing() method's output */ public function removeTopBlock() { $o = array_pop($this->stack); if ($o === null) { throw new Dwoo_Compilation_Exception($this, 'Syntax malformation, a block of unknown type was closed but was not opened.'); } if ($o['custom']) { $class = $o['class']; } else { $class = 'Dwoo_Plugin_'.$o['type']; } $this->curBlock =& $this->stack[count($this->stack)-1]; return call_user_func(array($class, 'postProcessing'), $this, $o['params'], '', '', $o['buffer']); } /** * returns the compiled parameters (for example a variable's compiled parameter will be "$this->scope['key']") out of the given parameter array * * @param array $params parameter array * @return array filtered parameters */ public function getCompiledParams(array $params) { foreach ($params as $k=>$p) { if (is_array($p)) { $params[$k] = $p[0]; } } return $params; } /** * returns the real parameters (for example a variable's real parameter will be its key, etc) out of the given parameter array * * @param array $params parameter array * @return array filtered parameters */ public function getRealParams(array $params) { foreach ($params as $k=>$p) { if (is_array($p)) { $params[$k] = $p[1]; } } return $params; } /** * entry point of the parser, it redirects calls to other parse* functions * * @param string $in the string within which we must parse something * @param int $from the starting offset of the parsed area * @param int $to the ending offset of the parsed area * @param mixed $parsingParams must be an array if we are parsing a function or modifier's parameters, or false by default * @param string $curBlock the current parser-block being processed * @param mixed $pointer a reference to a pointer that will be increased by the amount of characters parsed, or null by default * @return string parsed values */ protected function parse($in, $from, $to, $parsingParams = false, $curBlock='', &$pointer = null) { if ($to === null) { $to = strlen($in); } $first = substr($in, $from, 1); if ($first === false) { throw new Dwoo_Compilation_Exception($this, 'Unexpected EOF, a template tag was not closed'); } while ($first===" " || $first==="\n" || $first==="\t" || $first==="\r") { if ($curBlock === 'root' && substr($in, $from, strlen($this->rd)) === $this->rd) { // end template tag $pointer += strlen($this->rd); if ($this->debug) echo 'TEMPLATE PARSING ENDED
    '; return false; } $from++; if ($pointer !== null) { $pointer++; } if ($from >= $to) { if (is_array($parsingParams)) { return $parsingParams; } else { return ''; } } $first = $in[$from]; } $substr = substr($in, $from, $to-$from); if ($this->debug) echo '
    PARSE CALL : PARSING "'.htmlentities(substr($in, $from, min($to-$from, 50))).(($to-$from) > 50 ? '...':'').'" @ '.$from.':'.$to.' in '.$curBlock.' : pointer='.$pointer.'
    '; $parsed = ""; if ($curBlock === 'root' && $first === '*') { $src = $this->getTemplateSource(); $startpos = $this->getPointer() - strlen($this->ld); if (substr($src, $startpos, strlen($this->ld)) === $this->ld) { if ($startpos > 0) { do { $char = substr($src, --$startpos, 1); if ($char == "\n") { $startpos++; $whitespaceStart = true; break; } } while ($startpos > 0 && ($char == ' ' || $char == "\t")); } if (!isset($whitespaceStart)) { $startpos = $this->getPointer(); } else { $pointer -= $this->getPointer() - $startpos; } if ($this->allowNestedComments && strpos($src, $this->ld.'*', $this->getPointer()) !== false) { $comOpen = $this->ld.'*'; $comClose = '*'.$this->rd; $level = 1; $start = $startpos; $ptr = $this->getPointer() + '*'; while ($level > 0 && $ptr < strlen($src)) { $open = strpos($src, $comOpen, $ptr); $close = strpos($src, $comClose, $ptr); if ($open !== false && $close !== false) { if ($open < $close) { $ptr = $open + strlen($comOpen); $level++; } else { $ptr = $close + strlen($comClose); $level--; } } elseif ($open !== false) { $ptr = $open + strlen($comOpen); $level++; } elseif ($close !== false) { $ptr = $close + strlen($comClose); $level--; } else { $ptr = strlen($src); } } $endpos = $ptr - strlen('*'.$this->rd); } else { $endpos = strpos($src, '*'.$this->rd, $startpos); if ($endpos == false) { throw new Dwoo_Compilation_Exception($this, 'Un-ended comment'); } } $pointer += $endpos - $startpos + strlen('*'.$this->rd); if (isset($whitespaceStart) && preg_match('#^[\t ]*\r?\n#', substr($src, $endpos+strlen('*'.$this->rd)), $m)) { $pointer += strlen($m[0]); $this->curBlock['buffer'] = substr($this->curBlock['buffer'], 0, strlen($this->curBlock['buffer']) - ($this->getPointer() - $startpos - strlen($this->ld))); } return false; } } if ($first==='$') { // var $out = $this->parseVar($in, $from, $to, $parsingParams, $curBlock, $pointer); $parsed = 'var'; } elseif ($first==='%' && preg_match('#^%[a-z]#i', $substr)) { // const $out = $this->parseConst($in, $from, $to, $parsingParams, $curBlock, $pointer); } elseif ($first==='"' || $first==="'") { // string $out = $this->parseString($in, $from, $to, $parsingParams, $curBlock, $pointer); } elseif (preg_match('/^[a-z][a-z0-9_]*(?:::[a-z][a-z0-9_]*)?('.(is_array($parsingParams)||$curBlock!='root'?'':'\s+[^(]|').'\s*\(|\s*'.$this->rdr.'|\s*;)/i', $substr)) { // func $out = $this->parseFunction($in, $from, $to, $parsingParams, $curBlock, $pointer); $parsed = 'func'; } elseif ($first === ';') { // instruction end if ($this->debug) echo 'END OF INSTRUCTION
    '; if ($pointer !== null) { $pointer++; } return $this->parse($in, $from+1, $to, false, 'root', $pointer); } elseif ($curBlock === 'root' && preg_match('#^/([a-z][a-z0-9_]*)?#i', $substr, $match)) { // close block if (!empty($match[1]) && $match[1] == 'else') { throw new Dwoo_Compilation_Exception($this, 'Else blocks must not be closed explicitly, they are automatically closed when their parent block is closed'); } if (!empty($match[1]) && $match[1] == 'elseif') { throw new Dwoo_Compilation_Exception($this, 'Elseif blocks must not be closed explicitly, they are automatically closed when their parent block is closed or a new else/elseif block is declared after them'); } if ($pointer !== null) { $pointer += strlen($match[0]); } if (empty($match[1])) { if ($this->curBlock['type'] == 'else' || $this->curBlock['type'] == 'elseif') { $pointer -= strlen($match[0]); } if ($this->debug) echo 'TOP BLOCK CLOSED
    '; return $this->removeTopBlock(); } else { if ($this->debug) echo 'BLOCK OF TYPE '.$match[1].' CLOSED
    '; return $this->removeBlock($match[1]); } } elseif ($curBlock === 'root' && substr($substr, 0, strlen($this->rd)) === $this->rd) { // end template tag if ($this->debug) echo 'TAG PARSING ENDED
    '; $pointer += strlen($this->rd); return false; } elseif (is_array($parsingParams) && preg_match('#^([a-z0-9_]+\s*=)(?:\s+|[^=]).*#i', $substr, $match)) { // named parameter if ($this->debug) echo 'NAMED PARAM FOUND
    '; $len = strlen($match[1]); while (substr($in, $from+$len, 1)===' ') { $len++; } if ($pointer !== null) { $pointer += $len; } $output = array(trim(substr(trim($match[1]), 0, -1)), $this->parse($in, $from+$len, $to, false, 'namedparam', $pointer)); $parsingParams[] = $output; return $parsingParams; } elseif (preg_match('#^([a-z0-9_]+::\$[a-z0-9_]+)#i', $substr, $match)) { // static member access $parsed = 'var'; if (is_array($parsingParams)) { $parsingParams[] = array($match[1], $match[1]); $out = $parsingParams; } else { $out = $match[1]; } $pointer += strlen($match[1]); } elseif ($substr!=='' && (is_array($parsingParams) || $curBlock === 'namedparam' || $curBlock === 'condition' || $curBlock === 'expression')) { // unquoted string, bool or number $out = $this->parseOthers($in, $from, $to, $parsingParams, $curBlock, $pointer); } else { // parse error throw new Dwoo_Compilation_Exception($this, 'Parse error in "'.substr($in, $from, $to-$from).'"'); } if (empty($out)) { return ''; } $substr = substr($in, $pointer, $to-$pointer); // var parsed, check if any var-extension applies if ($parsed==='var') { if (preg_match('#^\s*([/%+*-])\s*([a-z0-9]|\$)#i', $substr, $match)) { if($this->debug) echo 'PARSING POST-VAR EXPRESSION '.$substr.'
    '; // parse expressions $pointer += strlen($match[0]) - 1; if (is_array($parsingParams)) { if ($match[2] == '$') { $expr = $this->parseVar($in, $pointer, $to, array(), $curBlock, $pointer); } else { $expr = $this->parse($in, $pointer, $to, array(), 'expression', $pointer); } $out[count($out)-1][0] .= $match[1] . $expr[0][0]; $out[count($out)-1][1] .= $match[1] . $expr[0][1]; } else { if ($match[2] == '$') { $expr = $this->parseVar($in, $pointer, $to, false, $curBlock, $pointer); } else { $expr = $this->parse($in, $pointer, $to, false, 'expression', $pointer); } if (is_array($out) && is_array($expr)) { $out[0] .= $match[1] . $expr[0]; $out[1] .= $match[1] . $expr[1]; } elseif (is_array($out)) { $out[0] .= $match[1] . $expr; $out[1] .= $match[1] . $expr; } elseif (is_array($expr)) { $out .= $match[1] . $expr[0]; } else { $out .= $match[1] . $expr; } } } else if ($curBlock === 'root' && preg_match('#^(\s*(?:[+/*%-.]=|=|\+\+|--)\s*)(.*)#s', $substr, $match)) { if($this->debug) echo 'PARSING POST-VAR ASSIGNMENT '.$substr.'
    '; // parse assignment $value = $match[2]; $operator = trim($match[1]); if (substr($value, 0, 1) == '=') { throw new Dwoo_Compilation_Exception($this, 'Unexpected "=" in '.$substr.''); } if ($pointer !== null) { $pointer += strlen($match[1]); } if ($operator !== '++' && $operator !== '--') { $parts = array(); $ptr = 0; $parts = $this->parse($value, 0, strlen($value), $parts, 'condition', $ptr); $pointer += $ptr; // load if plugin try { $this->getPluginType('if'); } catch (Dwoo_Exception $e) { throw new Dwoo_Compilation_Exception($this, 'Assignments require the "if" plugin to be accessible'); } $parts = $this->mapParams($parts, array('Dwoo_Plugin_if', 'init'), 1); $parts = $this->getCompiledParams($parts); $value = Dwoo_Plugin_if::replaceKeywords($parts['*'], $this); $echo = ''; } else { $value = array(); $echo = 'echo '; } if ($this->autoEscape) { $out = preg_replace('#\(is_string\(\$tmp=(.+?)\) \? htmlspecialchars\(\$tmp, ENT_QUOTES, \$this->charset\) : \$tmp\)#', '$1', $out); } $out = Dwoo_Compiler::PHP_OPEN. $echo . $out . $operator . implode(' ', $value) . Dwoo_Compiler::PHP_CLOSE; } } if ($curBlock !== 'modifier' && ($parsed === 'func' || $parsed === 'var') && preg_match('#^\|@?[a-z0-9_]+(:.*)?#i', $substr, $match)) { // parse modifier on funcs or vars $srcPointer = $pointer; if (is_array($parsingParams)) { $tmp = $this->replaceModifiers(array(null, null, $out[count($out)-1][0], $match[0]), 'var', $pointer); $out[count($out)-1][0] = $tmp; $out[count($out)-1][1] .= substr($substr, $srcPointer, $srcPointer - $pointer); } else { $out = $this->replaceModifiers(array(null, null, $out, $match[0]), 'var', $pointer); } } // func parsed, check if any func-extension applies if ($parsed==='func' && preg_match('#^->[a-z0-9_]+(\s*\(.+|->[a-z].*)?#is', $substr, $match)) { // parse method call or property read $ptr = 0; if (is_array($parsingParams)) { $output = $this->parseMethodCall($out[count($out)-1][1], $match[0], $curBlock, $ptr); $out[count($out)-1][0] .= substr($match[0], 0, $ptr); $out[count($out)-1][1] .= $output; } else { $out = $this->parseMethodCall($out, $match[0], $curBlock, $ptr); } $pointer += $ptr; } if ($curBlock === 'root' && substr($out, 0, strlen(self::PHP_OPEN)) !== self::PHP_OPEN) { return self::PHP_OPEN .'echo '.$out.';'. self::PHP_CLOSE; } else { return $out; } } /** * parses a function call * * @param string $in the string within which we must parse something * @param int $from the starting offset of the parsed area * @param int $to the ending offset of the parsed area * @param mixed $parsingParams must be an array if we are parsing a function or modifier's parameters, or false by default * @param string $curBlock the current parser-block being processed * @param mixed $pointer a reference to a pointer that will be increased by the amount of characters parsed, or null by default * @return string parsed values */ protected function parseFunction($in, $from, $to, $parsingParams = false, $curBlock='', &$pointer = null) { $cmdstr = substr($in, $from, $to-$from); preg_match('/^([a-z][a-z0-9_]*(?:::[a-z][a-z0-9_]*)?)(\s*'.$this->rdr.'|\s*;)?/i', $cmdstr, $match); if (empty($match[1])) { throw new Dwoo_Compilation_Exception($this, 'Parse error, invalid function name : '.substr($cmdstr, 0, 15)); } $func = $match[1]; if (!empty($match[2])) { $cmdstr = $match[1]; } if ($this->debug) echo 'FUNC FOUND ('.$func.')
    '; $paramsep = ''; if (is_array($parsingParams) || $curBlock != 'root') { $paramspos = strpos($cmdstr, '('); $paramsep = ')'; } elseif(preg_match_all('#[a-z0-9_]+(\s*\(|\s+[^(])#i', $cmdstr, $match, PREG_OFFSET_CAPTURE)) { $paramspos = $match[1][0][1]; $paramsep = substr($match[1][0][0], -1) === '(' ? ')':''; if($paramsep === ')') { $paramspos += strlen($match[1][0][0]) - 1; if(substr($cmdstr, 0, 2) === 'if' || substr($cmdstr, 0, 6) === 'elseif') { $paramsep = ''; if(strlen($match[1][0][0]) > 1) { $paramspos--; } } } } else { $paramspos = false; } $state = 0; if ($paramspos === false) { $params = array(); if ($curBlock !== 'root') { return $this->parseOthers($in, $from, $to, $parsingParams, $curBlock, $pointer); } } else { if ($curBlock === 'condition') { // load if plugin $this->getPluginType('if'); if (Dwoo_Plugin_if::replaceKeywords(array($func), $this) !== array($func)) { return $this->parseOthers($in, $from, $to, $parsingParams, $curBlock, $pointer); } } $whitespace = strlen(substr($cmdstr, strlen($func), $paramspos-strlen($func))); $paramstr = substr($cmdstr, $paramspos+1); if (substr($paramstr, -1, 1) === $paramsep) { $paramstr = substr($paramstr, 0, -1); } if (strlen($paramstr)===0) { $params = array(); $paramstr = ''; } else { $ptr = 0; $params = array(); if ($func === 'empty') { $params = $this->parseVar($paramstr, $ptr, strlen($paramstr), $params, 'root', $ptr); } else { while ($ptr < strlen($paramstr)) { while (true) { if ($ptr >= strlen($paramstr)) { break 2; } if ($func !== 'if' && $func !== 'elseif' && $paramstr[$ptr] === ')') { if ($this->debug) echo 'PARAM PARSING ENDED, ")" FOUND, POINTER AT '.$ptr.'
    '; break 2; } elseif ($paramstr[$ptr] === ';') { $ptr++; if ($this->debug) echo 'PARAM PARSING ENDED, ";" FOUND, POINTER AT '.$ptr.'
    '; break 2; } elseif ($func !== 'if' && $func !== 'elseif' && $paramstr[$ptr] === '/') { if ($this->debug) echo 'PARAM PARSING ENDED, "/" FOUND, POINTER AT '.$ptr.'
    '; break 2; } elseif (substr($paramstr, $ptr, strlen($this->rd)) === $this->rd) { if ($this->debug) echo 'PARAM PARSING ENDED, RIGHT DELIMITER FOUND, POINTER AT '.$ptr.'
    '; break 2; } if ($paramstr[$ptr] === ' ' || $paramstr[$ptr] === ',' || $paramstr[$ptr] === "\r" || $paramstr[$ptr] === "\n" || $paramstr[$ptr] === "\t") { $ptr++; } else { break; } } if ($this->debug) echo 'FUNC START PARAM PARSING WITH POINTER AT '.$ptr.'
    '; if ($func === 'if' || $func === 'elseif' || $func === 'tif') { $params = $this->parse($paramstr, $ptr, strlen($paramstr), $params, 'condition', $ptr); } else { $params = $this->parse($paramstr, $ptr, strlen($paramstr), $params, 'function', $ptr); } if ($this->debug) echo 'PARAM PARSED, POINTER AT '.$ptr.' ('.substr($paramstr, $ptr-1, 3).')
    '; } } $paramstr = substr($paramstr, 0, $ptr); $state = 0; foreach ($params as $k=>$p) { if (is_array($p) && is_array($p[1])) { $state |= 2; } else { if (($state & 2) && preg_match('#^(["\'])(.+?)\1$#', $p[0], $m)) { $params[$k] = array($m[2], array('true', 'true')); } else { if ($state & 2) { throw new Dwoo_Compilation_Exception($this, 'You can not use an unnamed parameter after a named one'); } $state |= 1; } } } } } if ($pointer !== null) { $pointer += (isset($paramstr) ? strlen($paramstr) : 0) + (')' === $paramsep ? 2 : ($paramspos === false ? 0 : 1)) + strlen($func) + (isset($whitespace) ? $whitespace : 0); if ($this->debug) echo 'FUNC ADDS '.((isset($paramstr) ? strlen($paramstr) : 0) + (')' === $paramsep ? 2 : ($paramspos === false ? 0 : 1)) + strlen($func)).' TO POINTER
    '; } if ($curBlock === 'method' || $func === 'do' || strstr($func, '::') !== false) { $pluginType = Dwoo::NATIVE_PLUGIN; } else { $pluginType = $this->getPluginType($func); } // blocks if ($pluginType & Dwoo::BLOCK_PLUGIN) { if ($curBlock !== 'root' || is_array($parsingParams)) { throw new Dwoo_Compilation_Exception($this, 'Block plugins can not be used as other plugin\'s arguments'); } if ($pluginType & Dwoo::CUSTOM_PLUGIN) { return $this->addCustomBlock($func, $params, $state); } else { return $this->addBlock($func, $params, $state); } } elseif ($pluginType & Dwoo::SMARTY_BLOCK) { if ($curBlock !== 'root' || is_array($parsingParams)) { throw new Dwoo_Compilation_Exception($this, 'Block plugins can not be used as other plugin\'s arguments'); } if ($state & 2) { array_unshift($params, array('__functype', array($pluginType, $pluginType))); array_unshift($params, array('__funcname', array($func, $func))); } else { array_unshift($params, array($pluginType, $pluginType)); array_unshift($params, array($func, $func)); } return $this->addBlock('smartyinterface', $params, $state); } // funcs if ($pluginType & Dwoo::NATIVE_PLUGIN || $pluginType & Dwoo::SMARTY_FUNCTION || $pluginType & Dwoo::SMARTY_BLOCK) { $params = $this->mapParams($params, null, $state); } elseif ($pluginType & Dwoo::CLASS_PLUGIN) { if ($pluginType & Dwoo::CUSTOM_PLUGIN) { $params = $this->mapParams($params, array($this->customPlugins[$func]['class'], $this->customPlugins[$func]['function']), $state); } else { $params = $this->mapParams($params, array('Dwoo_Plugin_'.$func, ($pluginType & Dwoo::COMPILABLE_PLUGIN) ? 'compile' : 'process'), $state); } } elseif ($pluginType & Dwoo::FUNC_PLUGIN) { if ($pluginType & Dwoo::CUSTOM_PLUGIN) { $params = $this->mapParams($params, $this->customPlugins[$func]['callback'], $state); } else { $params = $this->mapParams($params, 'Dwoo_Plugin_'.$func.(($pluginType & Dwoo::COMPILABLE_PLUGIN) ? '_compile' : ''), $state); } } elseif ($pluginType & Dwoo::SMARTY_MODIFIER) { $output = 'smarty_modifier_'.$func.'('.implode(', ', $params).')'; } elseif ($pluginType & Dwoo::PROXY_PLUGIN) { $params = $this->mapParams($params, $this->getDwoo()->getPluginProxy()->getCallback($func), $state); } elseif ($pluginType & Dwoo::TEMPLATE_PLUGIN) { // transforms the parameter array from (x=>array('paramname'=>array(values))) to (paramname=>array(values)) $map = array(); foreach ($this->templatePlugins[$func]['params'] as $param=>$defValue) { if ($param == 'rest') { $param = '*'; } $hasDefault = $defValue !== null; if ($defValue === 'null') { $defValue = null; } elseif ($defValue === 'false') { $defValue = false; } elseif ($defValue === 'true') { $defValue = true; } elseif (preg_match('#^([\'"]).*?\1$#', $defValue)) { $defValue = substr($defValue, 1, -1); } $map[] = array($param, $hasDefault, $defValue); } $params = $this->mapParams($params, null, $state, $map); } // only keep php-syntax-safe values for non-block plugins foreach ($params as &$p) { $p = $p[0]; } if ($pluginType & Dwoo::NATIVE_PLUGIN) { if ($func === 'do') { if (isset($params['*'])) { $output = implode(';', $params['*']).';'; } else { $output = ''; } if (is_array($parsingParams) || $curBlock !== 'root') { throw new Dwoo_Compilation_Exception($this, 'Do can not be used inside another function or block'); } else { return self::PHP_OPEN.$output.self::PHP_CLOSE; } } else { if (isset($params['*'])) { $output = $func.'('.implode(', ', $params['*']).')'; } else { $output = $func.'()'; } } } elseif ($pluginType & Dwoo::FUNC_PLUGIN) { if ($pluginType & Dwoo::COMPILABLE_PLUGIN) { if ($pluginType & Dwoo::CUSTOM_PLUGIN) { $funcCompiler = $this->customPlugins[$func]['callback']; } else { $funcCompiler = 'Dwoo_Plugin_'.$func.'_compile'; } array_unshift($params, $this); $output = call_user_func_array($funcCompiler, $params); } else { array_unshift($params, '$this'); $params = self::implode_r($params); if ($pluginType & Dwoo::CUSTOM_PLUGIN) { $callback = $this->customPlugins[$func]['callback']; $output = 'call_user_func(\''.$callback.'\', '.$params.')'; } else { $output = 'Dwoo_Plugin_'.$func.'('.$params.')'; } } } elseif ($pluginType & Dwoo::CLASS_PLUGIN) { if ($pluginType & Dwoo::COMPILABLE_PLUGIN) { if ($pluginType & Dwoo::CUSTOM_PLUGIN) { $callback = $this->customPlugins[$func]['callback']; if (!is_array($callback)) { if (!method_exists($callback, 'compile')) { throw new Dwoo_Exception('Custom plugin '.$func.' must implement the "compile" method to be compilable, or you should provide a full callback to the method to use'); } if (($ref = new ReflectionMethod($callback, 'compile')) && $ref->isStatic()) { $funcCompiler = array($callback, 'compile'); } else { $funcCompiler = array(new $callback, 'compile'); } } else { $funcCompiler = $callback; } } else { $funcCompiler = array('Dwoo_Plugin_'.$func, 'compile'); array_unshift($params, $this); } $output = call_user_func_array($funcCompiler, $params); } else { $params = self::implode_r($params); if ($pluginType & Dwoo::CUSTOM_PLUGIN) { $callback = $this->customPlugins[$func]['callback']; if (!is_array($callback)) { if (!method_exists($callback, 'process')) { throw new Dwoo_Exception('Custom plugin '.$func.' must implement the "process" method to be usable, or you should provide a full callback to the method to use'); } if (($ref = new ReflectionMethod($callback, 'process')) && $ref->isStatic()) { $output = 'call_user_func(array(\''.$callback.'\', \'process\'), '.$params.')'; } else { $output = 'call_user_func(array($this->getObjectPlugin(\''.$callback.'\'), \'process\'), '.$params.')'; } } elseif (is_object($callback[0])) { $output = 'call_user_func(array($this->plugins[\''.$func.'\'][\'callback\'][0], \''.$callback[1].'\'), '.$params.')'; } elseif (($ref = new ReflectionMethod($callback[0], $callback[1])) && $ref->isStatic()) { $output = 'call_user_func(array(\''.$callback[0].'\', \''.$callback[1].'\'), '.$params.')'; } else { $output = 'call_user_func(array($this->getObjectPlugin(\''.$callback[0].'\'), \''.$callback[1].'\'), '.$params.')'; } if (empty($params)) { $output = substr($output, 0, -3).')'; } } else { $output = '$this->classCall(\''.$func.'\', array('.$params.'))'; } } } elseif ($pluginType & Dwoo::PROXY_PLUGIN) { $output = call_user_func(array($this->dwoo->getPluginProxy(), 'getCode'), $func, $params); } elseif ($pluginType & Dwoo::SMARTY_FUNCTION) { if (isset($params['*'])) { $params = self::implode_r($params['*'], true); } else { $params = ''; } if ($pluginType & Dwoo::CUSTOM_PLUGIN) { $callback = $this->customPlugins[$func]['callback']; if (is_array($callback)) { if (is_object($callback[0])) { $output = 'call_user_func_array(array($this->plugins[\''.$func.'\'][\'callback\'][0], \''.$callback[1].'\'), array(array('.$params.'), $this))'; } else { $output = 'call_user_func_array(array(\''.$callback[0].'\', \''.$callback[1].'\'), array(array('.$params.'), $this))'; } } else { $output = $callback.'(array('.$params.'), $this)'; } } else { $output = 'smarty_function_'.$func.'(array('.$params.'), $this)'; } } elseif ($pluginType & Dwoo::TEMPLATE_PLUGIN) { array_unshift($params, '$this'); $params = self::implode_r($params); $output = 'Dwoo_Plugin_'.$func.'_'.$this->templatePlugins[$func]['uuid'].'('.$params.')'; $this->templatePlugins[$func]['called'] = true; } if (is_array($parsingParams)) { $parsingParams[] = array($output, $output); return $parsingParams; } elseif ($curBlock === 'namedparam') { return array($output, $output); } else { return $output; } } /** * parses a string * * @param string $in the string within which we must parse something * @param int $from the starting offset of the parsed area * @param int $to the ending offset of the parsed area * @param mixed $parsingParams must be an array if we are parsing a function or modifier's parameters, or false by default * @param string $curBlock the current parser-block being processed * @param mixed $pointer a reference to a pointer that will be increased by the amount of characters parsed, or null by default * @return string parsed values */ protected function parseString($in, $from, $to, $parsingParams = false, $curBlock='', &$pointer = null) { $substr = substr($in, $from, $to-$from); $first = $substr[0]; if ($this->debug) echo 'STRING FOUND (in '.htmlentities(substr($in, $from, min($to-$from, 50))).(($to-$from) > 50 ? '...':'').')
    '; $strend = false; $o = $from+1; while ($strend === false) { $strend = strpos($in, $first, $o); if ($strend === false) { throw new Dwoo_Compilation_Exception($this, 'Unfinished string, started with '.substr($in, $from, $to-$from)); } if (substr($in, $strend-1, 1) === '\\') { $o = $strend+1; $strend = false; } } if ($this->debug) echo 'STRING DELIMITED: '.substr($in, $from, $strend+1-$from).'
    '; $srcOutput = substr($in, $from, $strend+1-$from); if ($pointer !== null) { $pointer += strlen($srcOutput); } $output = $this->replaceStringVars($srcOutput, $first); // handle modifiers if ($curBlock !== 'modifier' && preg_match('#^((?:\|(?:@?[a-z0-9_]+(?::.*)*))+)#i', substr($substr, $strend+1-$from), $match)) { $modstr = $match[1]; if ($curBlock === 'root' && substr($modstr, -1) === '}') { $modstr = substr($modstr, 0, -1); } $modstr = str_replace('\\'.$first, $first, $modstr); $ptr = 0; $output = $this->replaceModifiers(array(null, null, $output, $modstr), 'string', $ptr); $strend += $ptr; if ($pointer !== null) { $pointer += $ptr; } $srcOutput .= substr($substr, $strend+1-$from, $ptr); } if (is_array($parsingParams)) { $parsingParams[] = array($output, substr($srcOutput, 1, -1)); return $parsingParams; } elseif ($curBlock === 'namedparam') { return array($output, substr($srcOutput, 1, -1)); } else { return $output; } } /** * parses a constant * * @param string $in the string within which we must parse something * @param int $from the starting offset of the parsed area * @param int $to the ending offset of the parsed area * @param mixed $parsingParams must be an array if we are parsing a function or modifier's parameters, or false by default * @param string $curBlock the current parser-block being processed * @param mixed $pointer a reference to a pointer that will be increased by the amount of characters parsed, or null by default * @return string parsed values */ protected function parseConst($in, $from, $to, $parsingParams = false, $curBlock='', &$pointer = null) { $substr = substr($in, $from, $to-$from); if ($this->debug) { echo 'CONST FOUND : '.$substr.'
    '; } if (!preg_match('#^%([a-z0-9_:]+)#i', $substr, $m)) { throw new Dwoo_Compilation_Exception($this, 'Invalid constant'); } if ($pointer !== null) { $pointer += strlen($m[0]); } $output = $this->parseConstKey($m[1], $curBlock); if (is_array($parsingParams)) { $parsingParams[] = array($output, $m[1]); return $parsingParams; } elseif ($curBlock === 'namedparam') { return array($output, $m[1]); } else { return $output; } } /** * parses a constant * * @param string $key the constant to parse * @param string $curBlock the current parser-block being processed * @return string parsed constant */ protected function parseConstKey($key, $curBlock) { if ($this->securityPolicy !== null && $this->securityPolicy->getConstantHandling() === Dwoo_Security_Policy::CONST_DISALLOW) { return 'null'; } if ($curBlock !== 'root') { $output = '(defined("'.$key.'") ? '.$key.' : null)'; } else { $output = $key; } return $output; } /** * parses a variable * * @param string $in the string within which we must parse something * @param int $from the starting offset of the parsed area * @param int $to the ending offset of the parsed area * @param mixed $parsingParams must be an array if we are parsing a function or modifier's parameters, or false by default * @param string $curBlock the current parser-block being processed * @param mixed $pointer a reference to a pointer that will be increased by the amount of characters parsed, or null by default * @return string parsed values */ protected function parseVar($in, $from, $to, $parsingParams = false, $curBlock='', &$pointer = null) { $substr = substr($in, $from, $to-$from); if (preg_match('#(\$?\.?[a-z0-9_:]*(?:(?:(?:\.|->)(?:[a-z0-9_:]+|(?R))|\[(?:[a-z0-9_:]+|(?R)|(["\'])[^\2]*?\2)\]))*)' . // var key ($curBlock==='root' || $curBlock==='function' || $curBlock==='namedparam' || $curBlock==='condition' || $curBlock==='variable' || $curBlock==='expression' ? '(\(.*)?' : '()') . // method call ($curBlock==='root' || $curBlock==='function' || $curBlock==='namedparam' || $curBlock==='condition' || $curBlock==='variable' || $curBlock==='delimited_string' ? '((?:(?:[+/*%=-])(?:(?_:-]+(?:\([^)]*\))?|(?'))); $key = substr($match[1], 1, strrpos($match[1], '->')-1); $methodCall = substr($match[1], strrpos($match[1], '->')) . $match[3]; } if ($hasModifiers) { $matchedLength -= strlen($match[5]); } if ($pointer !== null) { $pointer += $matchedLength; } // replace useless brackets by dot accessed vars $key = preg_replace('#\[([^$%\[.>-]+)\]#', '.$1', $key); // prevent $foo->$bar calls because it doesn't seem worth the trouble if (strpos($key, '->$') !== false) { throw new Dwoo_Compilation_Exception($this, 'You can not access an object\'s property using a variable name.'); } if ($this->debug) { if ($hasMethodCall) { echo 'METHOD CALL FOUND : $'.$key.substr($methodCall, 0, 30).'
    '; } else { echo 'VAR FOUND : $'.$key.'
    '; } } $key = str_replace('"', '\\"', $key); $cnt=substr_count($key, '$'); if ($cnt > 0) { $uid = 0; $parsed = array($uid => ''); $current =& $parsed; $curTxt =& $parsed[$uid++]; $tree = array(); $chars = str_split($key, 1); $inSplittedVar = false; $bracketCount = 0; while (($char = array_shift($chars)) !== null) { if ($char === '[') { if (count($tree) > 0) { $bracketCount++; } else { $tree[] =& $current; $current[$uid] = array($uid+1 => ''); $current =& $current[$uid++]; $curTxt =& $current[$uid++]; continue; } } elseif ($char === ']') { if ($bracketCount > 0) { $bracketCount--; } else { $current =& $tree[count($tree)-1]; array_pop($tree); if (current($chars) !== '[' && current($chars) !== false && current($chars) !== ']') { $current[$uid] = ''; $curTxt =& $current[$uid++]; } continue; } } elseif ($char === '$') { if (count($tree) == 0) { $curTxt =& $current[$uid++]; $inSplittedVar = true; } } elseif (($char === '.' || $char === '-') && count($tree) == 0 && $inSplittedVar) { $curTxt =& $current[$uid++]; $inSplittedVar = false; } $curTxt .= $char; } unset($uid, $current, $curTxt, $tree, $chars); if ($this->debug) echo 'RECURSIVE VAR REPLACEMENT : '.$key.'
    '; $key = $this->flattenVarTree($parsed); if ($this->debug) echo 'RECURSIVE VAR REPLACEMENT DONE : '.$key.'
    '; $output = preg_replace('#(^""\.|""\.|\.""$|(\()""\.|\.""(\)))#', '$2$3', '$this->readVar("'.$key.'")'); } else { $output = $this->parseVarKey($key, $hasModifiers ? 'modifier' : $curBlock); } // methods if ($hasMethodCall) { $ptr = 0; $output = $this->parseMethodCall($output, $methodCall, $curBlock, $ptr); if ($pointer !== null) { $pointer += $ptr; } $matchedLength += $ptr; } if ($hasExpression) { // expressions preg_match_all('#(?:([+/*%=-])(=?-?[%$][a-z0-9.[\]>_:-]+(?:\([^)]*\))?|=?-?[0-9.,]+|\1))#i', $match[4], $expMatch); foreach ($expMatch[1] as $k=>$operator) { if (substr($expMatch[2][$k], 0, 1)==='=') { $assign = true; if ($operator === '=') { throw new Dwoo_Compilation_Exception($this, 'Invalid expression '.$substr.', can not use "==" in expressions'); } if ($curBlock !== 'root') { throw new Dwoo_Compilation_Exception($this, 'Invalid expression '.$substr.', assignments can only be used in top level expressions like {$foo+=3} or {$foo="bar"}'); } $operator .= '='; $expMatch[2][$k] = substr($expMatch[2][$k], 1); } if (substr($expMatch[2][$k], 0, 1)==='-' && strlen($expMatch[2][$k]) > 1) { $operator .= '-'; $expMatch[2][$k] = substr($expMatch[2][$k], 1); } if (($operator==='+'||$operator==='-') && $expMatch[2][$k]===$operator) { $output = '('.$output.$operator.$operator.')'; break; } elseif (substr($expMatch[2][$k], 0, 1) === '$') { $output = '('.$output.' '.$operator.' '.$this->parseVar($expMatch[2][$k], 0, strlen($expMatch[2][$k]), false, 'expression').')'; } elseif (substr($expMatch[2][$k], 0, 1) === '%') { $output = '('.$output.' '.$operator.' '.$this->parseConst($expMatch[2][$k], 0, strlen($expMatch[2][$k]), false, 'expression').')'; } elseif (!empty($expMatch[2][$k])) { $output = '('.$output.' '.$operator.' '.str_replace(',', '.', $expMatch[2][$k]).')'; } else { throw new Dwoo_Compilation_Exception($this, 'Unfinished expression '.$substr.', missing var or number after math operator'); } } } if ($this->autoEscape === true) { $output = '(is_string($tmp='.$output.') ? htmlspecialchars($tmp, ENT_QUOTES, $this->charset) : $tmp)'; } // handle modifiers if ($curBlock !== 'modifier' && $hasModifiers) { $ptr = 0; $output = $this->replaceModifiers(array(null, null, $output, $match[5]), 'var', $ptr); if ($pointer !== null) { $pointer += $ptr; } $matchedLength += $ptr; } if (is_array($parsingParams)) { $parsingParams[] = array($output, $key); return $parsingParams; } elseif ($curBlock === 'namedparam') { return array($output, $key); } elseif ($curBlock === 'string' || $curBlock === 'delimited_string') { return array($matchedLength, $output); } elseif ($curBlock === 'expression' || $curBlock === 'variable') { return $output; } elseif (isset($assign)) { return self::PHP_OPEN.$output.';'.self::PHP_CLOSE; } else { return $output; } } else { if ($curBlock === 'string' || $curBlock === 'delimited_string') { return array(0, ''); } else { throw new Dwoo_Compilation_Exception($this, 'Invalid variable name '.$substr.''); } } } /** * parses any number of chained method calls/property reads * * @param string $output the variable or whatever upon which the method are called * @param string $methodCall method call source, starting at "->" * @param string $curBlock the current parser-block being processed * @param int $pointer a reference to a pointer that will be increased by the amount of characters parsed * @return string parsed call(s)/read(s) */ protected function parseMethodCall($output, $methodCall, $curBlock, &$pointer) { $ptr = 0; $len = strlen($methodCall); while ($ptr < $len) { if (strpos($methodCall, '->', $ptr) === $ptr) { $ptr += 2; } if (in_array($methodCall[$ptr], array(';', '/', ' ', "\t", "\r", "\n", ')', '+', '*', '%', '=', '-', '|')) || substr($methodCall, $ptr, strlen($this->rd)) === $this->rd) { // break char found break; } if(!preg_match('/^([a-z0-9_]+)(\(.*?\))?/i', substr($methodCall, $ptr), $methMatch)) { throw new Dwoo_Compilation_Exception($this, 'Invalid method name : '.substr($methodCall, $ptr, 20)); } if (empty($methMatch[2])) { // property if ($curBlock === 'root') { $output .= '->'.$methMatch[1]; } else { $output = '(($tmp = '.$output.') ? $tmp->'.$methMatch[1].' : null)'; } $ptr += strlen($methMatch[1]); } else { // method if (substr($methMatch[2], 0, 2) === '()') { $parsedCall = '->'.$methMatch[1].'()'; $ptr += strlen($methMatch[1]) + 2; } else { $parsedCall = '->'.$this->parseFunction($methodCall, $ptr, strlen($methodCall), false, 'method', $ptr); } if ($curBlock === 'root') { $output .= $parsedCall; } else { $output = '(($tmp = '.$output.') ? $tmp'.$parsedCall.' : null)'; } } } $pointer += $ptr; return $output; } /** * parses a constant variable (a variable that doesn't contain another variable) and preprocesses it to save runtime processing time * * @param string $key the variable to parse * @param string $curBlock the current parser-block being processed * @return string parsed variable */ protected function parseVarKey($key, $curBlock) { if ($key === '') { return '$this->scope'; } if (substr($key, 0, 1) === '.') { $key = 'dwoo'.$key; } if (preg_match('#dwoo\.(get|post|server|cookies|session|env|request)((?:\.[a-z0-9_-]+)+)#i', $key, $m)) { $global = strtoupper($m[1]); if ($global === 'COOKIES') { $global = 'COOKIE'; } $key = '$_'.$global; foreach (explode('.', ltrim($m[2], '.')) as $part) $key .= '['.var_export($part, true).']'; if ($curBlock === 'root') { $output = $key; } else { $output = '(isset('.$key.')?'.$key.':null)'; } } elseif (preg_match('#dwoo\.const\.([a-z0-9_:]+)#i', $key, $m)) { return $this->parseConstKey($m[1], $curBlock); } elseif ($this->scope !== null) { if (strstr($key, '.') === false && strstr($key, '[') === false && strstr($key, '->') === false) { if ($key === 'dwoo') { $output = '$this->globals'; } elseif ($key === '_root' || $key === '__') { $output = '$this->data'; } elseif ($key === '_parent' || $key === '_') { $output = '$this->readParentVar(1)'; } elseif ($key === '_key') { $output = '$tmp_key'; } else { if ($curBlock === 'root') { $output = '$this->scope["'.$key.'"]'; } else { $output = '(isset($this->scope["'.$key.'"]) ? $this->scope["'.$key.'"] : null)'; } } } else { preg_match_all('#(\[|->|\.)?([a-z0-9_]+|(\\\?[\'"])[^\3]*?\3)\]?#i', $key, $m); $i = $m[2][0]; if ($i === '_parent' || $i === '_') { $parentCnt = 0; while (true) { $parentCnt++; array_shift($m[2]); array_shift($m[1]); if (current($m[2]) === '_parent') { continue; } break; } $output = '$this->readParentVar('.$parentCnt.')'; } else { if ($i === 'dwoo') { $output = '$this->globals'; array_shift($m[2]); array_shift($m[1]); } elseif ($i === '_root' || $i === '__') { $output = '$this->data'; array_shift($m[2]); array_shift($m[1]); } elseif ($i === '_key') { $output = '$tmp_key'; } else { $output = '$this->scope'; } while (count($m[1]) && $m[1][0] !== '->') { $m[2][0] = preg_replace('/(^\\\([\'"])|\\\([\'"])$)/x', '$2$3', $m[2][0]); if(substr($m[2][0], 0, 1) == '"' || substr($m[2][0], 0, 1) == "'") { $output .= '['.$m[2][0].']'; } else { $output .= '["'.$m[2][0].'"]'; } array_shift($m[2]); array_shift($m[1]); } if ($curBlock !== 'root') { $output = '(isset('.$output.') ? '.$output.':null)'; } } if (count($m[2])) { unset($m[0]); $output = '$this->readVarInto('.str_replace("\n", '', var_export($m, true)).', '.$output.', '.($curBlock == 'root' ? 'false': 'true').')'; } } } else { preg_match_all('#(\[|->|\.)?([a-z0-9_]+)\]?#i', $key, $m); unset($m[0]); $output = '$this->readVar('.str_replace("\n", '', var_export($m, true)).')'; } return $output; } /** * flattens a variable tree, this helps in parsing very complex variables such as $var.foo[$foo.bar->baz].baz, * it computes the contents of the brackets first and works out from there * * @param array $tree the variable tree parsed by he parseVar() method that must be flattened * @param bool $recursed leave that to false by default, it is only for internal use * @return string flattened tree */ protected function flattenVarTree(array $tree, $recursed=false) { $out = $recursed ? '".$this->readVarInto(' : ''; foreach ($tree as $bit) { if (is_array($bit)) { $out.='.'.$this->flattenVarTree($bit, false); } else { $key = str_replace('"', '\\"', $bit); if (substr($key, 0, 1)==='$') { $out .= '".'.$this->parseVar($key, 0, strlen($key), false, 'variable').'."'; } else { $cnt = substr_count($key, '$'); if ($this->debug) echo 'PARSING SUBVARS IN : '.$key.'
    '; if ($cnt > 0) { while (--$cnt >= 0) { if (isset($last)) { $last = strrpos($key, '$', - (strlen($key) - $last + 1)); } else { $last = strrpos($key, '$'); } preg_match('#\$[a-z0-9_]+((?:(?:\.|->)(?:[a-z0-9_]+|(?R))|\[(?:[a-z0-9_]+|(?R))\]))*'. '((?:(?:[+/*%-])(?:\$[a-z0-9.[\]>_:-]+(?:\([^)]*\))?|[0-9.,]*))*)#i', substr($key, $last), $submatch); $len = strlen($submatch[0]); $key = substr_replace( $key, preg_replace_callback( '#(\$[a-z0-9_]+((?:(?:\.|->)(?:[a-z0-9_]+|(?R))|\[(?:[a-z0-9_]+|(?R))\]))*)'. '((?:(?:[+/*%-])(?:\$[a-z0-9.[\]>_:-]+(?:\([^)]*\))?|[0-9.,]*))*)#i', array($this, 'replaceVarKeyHelper'), substr($key, $last, $len) ), $last, $len ); if ($this->debug) echo 'RECURSIVE VAR REPLACEMENT DONE : '.$key.'
    '; } unset($last); $out .= $key; } else { $out .= $key; } } } } $out .= $recursed ? ', true)."' : ''; return $out; } /** * helper function that parses a variable * * @param array $match the matched variable, array(1=>"string match") * @return string parsed variable */ protected function replaceVarKeyHelper($match) { return '".'.$this->parseVar($match[0], 0, strlen($match[0]), false, 'variable').'."'; } /** * parses various constants, operators or non-quoted strings * * @param string $in the string within which we must parse something * @param int $from the starting offset of the parsed area * @param int $to the ending offset of the parsed area * @param mixed $parsingParams must be an array if we are parsing a function or modifier's parameters, or false by default * @param string $curBlock the current parser-block being processed * @param mixed $pointer a reference to a pointer that will be increased by the amount of characters parsed, or null by default * @return string parsed values */ protected function parseOthers($in, $from, $to, $parsingParams = false, $curBlock='', &$pointer = null) { $first = $in[$from]; $substr = substr($in, $from, $to-$from); $end = strlen($substr); if ($curBlock === 'condition') { $breakChars = array('(', ')', ' ', '||', '&&', '|', '&', '>=', '<=', '===', '==', '=', '!==', '!=', '<<', '<', '>>', '>', '^', '~', ',', '+', '-', '*', '/', '%', '!', '?', ':', $this->rd, ';'); } elseif ($curBlock === 'modifier') { $breakChars = array(' ', ',', ')', ':', '|', "\r", "\n", "\t", ";", $this->rd); } elseif ($curBlock === 'expression') { $breakChars = array('/', '%', '+', '-', '*', ' ', ',', ')', "\r", "\n", "\t", ";", $this->rd); } else { $breakChars = array(' ', ',', ')', "\r", "\n", "\t", ";", $this->rd); } $breaker = false; while (list($k,$char) = each($breakChars)) { $test = strpos($substr, $char); if ($test !== false && $test < $end) { $end = $test; $breaker = $k; } } if ($curBlock === 'condition') { if ($end === 0 && $breaker !== false) { $end = strlen($breakChars[$breaker]); } } if ($end !== false) { $substr = substr($substr, 0, $end); } if ($pointer !== null) { $pointer += strlen($substr); } $src = $substr; if (strtolower($substr) === 'false' || strtolower($substr) === 'no' || strtolower($substr) === 'off') { if ($this->debug) echo 'BOOLEAN(FALSE) PARSED
    '; $substr = 'false'; } elseif (strtolower($substr) === 'true' || strtolower($substr) === 'yes' || strtolower($substr) === 'on') { if ($this->debug) echo 'BOOLEAN(TRUE) PARSED
    '; $substr = 'true'; } elseif ($substr === 'null' || $substr === 'NULL') { if ($this->debug) echo 'NULL PARSED
    '; $substr = 'null'; } elseif (is_numeric($substr)) { $substr = (float) $substr; if ((int) $substr == $substr) { $substr = (int) $substr; } if ($this->debug) echo 'NUMBER ('.$substr.') PARSED
    '; } elseif (preg_match('{^-?(\d+|\d*(\.\d+))\s*([/*%+-]\s*-?(\d+|\d*(\.\d+)))+$}', $substr)) { if ($this->debug) echo 'SIMPLE MATH PARSED
    '; $substr = '('.$substr.')'; } elseif ($curBlock === 'condition' && array_search($substr, $breakChars, true) !== false) { if ($this->debug) echo 'BREAKCHAR ('.$substr.') PARSED
    '; //$substr = '"'.$substr.'"'; } else { $substr = $this->replaceStringVars('\''.str_replace('\'', '\\\'', $substr).'\'', '\'', $curBlock); if ($this->debug) echo 'BLABBER ('.$substr.') CASTED AS STRING
    '; } if (is_array($parsingParams)) { $parsingParams[] = array($substr, $src); return $parsingParams; } elseif ($curBlock === 'namedparam') { return array($substr, $src); } elseif ($curBlock === 'expression') { return $substr; } else { throw new Exception('Something went wrong'); } } /** * replaces variables within a parsed string * * @param string $string the parsed string * @param string $first the first character parsed in the string, which is the string delimiter (' or ") * @param string $curBlock the current parser-block being processed * @return string the original string with variables replaced */ protected function replaceStringVars($string, $first, $curBlock='') { $pos = 0; if ($this->debug) echo 'STRING VAR REPLACEMENT : '.$string.'
    '; // replace vars while (($pos = strpos($string, '$', $pos)) !== false) { $prev = substr($string, $pos-1, 1); if ($prev === '\\') { $pos++; continue; } $var = $this->parse($string, $pos, null, false, ($curBlock === 'modifier' ? 'modifier' : ($prev === '`' ? 'delimited_string':'string'))); $len = $var[0]; $var = $this->parse(str_replace('\\'.$first, $first, $string), $pos, null, false, ($curBlock === 'modifier' ? 'modifier' : ($prev === '`' ? 'delimited_string':'string'))); if ($prev === '`' && substr($string, $pos+$len, 1) === '`') { $string = substr_replace($string, $first.'.'.$var[1].'.'.$first, $pos-1, $len+2); } else { $string = substr_replace($string, $first.'.'.$var[1].'.'.$first, $pos, $len); } $pos += strlen($var[1]) + 2; if ($this->debug) echo 'STRING VAR REPLACEMENT DONE : '.$string.'
    '; } // handle modifiers // TODO Obsolete? $string = preg_replace_callback('#("|\')\.(.+?)\.\1((?:\|(?:@?[a-z0-9_]+(?:(?::("|\').+?\4|:[^`]*))*))+)#i', array($this, 'replaceModifiers'), $string); // replace escaped dollar operators by unescaped ones if required if ($first==="'") { $string = str_replace('\\$', '$', $string); } return $string; } /** * replaces the modifiers applied to a string or a variable * * @param array $m the regex matches that must be array(1=>"double or single quotes enclosing a string, when applicable", 2=>"the string or var", 3=>"the modifiers matched") * @param string $curBlock the current parser-block being processed * @return string the input enclosed with various function calls according to the modifiers found */ protected function replaceModifiers(array $m, $curBlock = null, &$pointer = null) { if ($this->debug) echo 'PARSING MODIFIERS : '.$m[3].'
    '; if ($pointer !== null) { $pointer += strlen($m[3]); } // remove first pipe $cmdstrsrc = substr($m[3], 1); // remove last quote if present if (substr($cmdstrsrc, -1, 1) === $m[1]) { $cmdstrsrc = substr($cmdstrsrc, 0, -1); $add = $m[1]; } $output = $m[2]; $continue = true; while (strlen($cmdstrsrc) > 0 && $continue) { if ($cmdstrsrc[0] === '|') { $cmdstrsrc = substr($cmdstrsrc, 1); continue; } if ($cmdstrsrc[0] === ' ' || $cmdstrsrc[0] === ';' || substr($cmdstrsrc, 0, strlen($this->rd)) === $this->rd) { if ($this->debug) echo 'MODIFIER PARSING ENDED, RIGHT DELIMITER or ";" FOUND
    '; $continue = false; if ($pointer !== null) { $pointer -= strlen($cmdstrsrc); } break; } $cmdstr = $cmdstrsrc; $paramsep = ':'; if (!preg_match('/^(@{0,2}[a-z][a-z0-9_]*)(:)?/i', $cmdstr, $match)) { throw new Dwoo_Compilation_Exception($this, 'Invalid modifier name, started with : '.substr($cmdstr, 0, 10)); } $paramspos = !empty($match[2]) ? strlen($match[1]) : false; $func = $match[1]; $state = 0; if ($paramspos === false) { $cmdstrsrc = substr($cmdstrsrc, strlen($func)); $params = array(); if ($this->debug) echo 'MODIFIER ('.$func.') CALLED WITH NO PARAMS
    '; } else { $paramstr = substr($cmdstr, $paramspos+1); if (substr($paramstr, -1, 1) === $paramsep) { $paramstr = substr($paramstr, 0, -1); } $ptr = 0; $params = array(); while ($ptr < strlen($paramstr)) { if ($this->debug) echo 'MODIFIER ('.$func.') START PARAM PARSING WITH POINTER AT '.$ptr.'
    '; if ($this->debug) echo $paramstr.'--'.$ptr.'--'.strlen($paramstr).'--modifier
    '; $params = $this->parse($paramstr, $ptr, strlen($paramstr), $params, 'modifier', $ptr); if ($this->debug) echo 'PARAM PARSED, POINTER AT '.$ptr.'
    '; if ($ptr >= strlen($paramstr)) { if ($this->debug) echo 'PARAM PARSING ENDED, PARAM STRING CONSUMED
    '; break; } if ($paramstr[$ptr] === ' ' || $paramstr[$ptr] === '|' || $paramstr[$ptr] === ';' || substr($paramstr, $ptr, strlen($this->rd)) === $this->rd) { if ($this->debug) echo 'PARAM PARSING ENDED, " ", "|", RIGHT DELIMITER or ";" FOUND, POINTER AT '.$ptr.'
    '; if ($paramstr[$ptr] !== '|') { $continue = false; if ($pointer !== null) { $pointer -= strlen($paramstr) - $ptr; } } $ptr++; break; } if ($ptr < strlen($paramstr) && $paramstr[$ptr] === ':') { $ptr++; } } $cmdstrsrc = substr($cmdstrsrc, strlen($func)+1+$ptr); $paramstr = substr($paramstr, 0, $ptr); foreach ($params as $k=>$p) { if (is_array($p) && is_array($p[1])) { $state |= 2; } else { if (($state & 2) && preg_match('#^(["\'])(.+?)\1$#', $p[0], $m)) { $params[$k] = array($m[2], array('true', 'true')); } else { if ($state & 2) { throw new Dwoo_Compilation_Exception($this, 'You can not use an unnamed parameter after a named one'); } $state |= 1; } } } } // check if we must use array_map with this plugin or not $mapped = false; if (substr($func, 0, 1) === '@') { $func = substr($func, 1); $mapped = true; } $pluginType = $this->getPluginType($func); if ($state & 2) { array_unshift($params, array('value', array($output, $output))); } else { array_unshift($params, array($output, $output)); } if ($pluginType & Dwoo::NATIVE_PLUGIN) { $params = $this->mapParams($params, null, $state); $params = $params['*'][0]; $params = self::implode_r($params); if ($mapped) { $output = '$this->arrayMap(\''.$func.'\', array('.$params.'))'; } else { $output = $func.'('.$params.')'; } } elseif ($pluginType & Dwoo::PROXY_PLUGIN) { $params = $this->mapParams($params, $this->getDwoo()->getPluginProxy()->getCallback($func), $state); foreach ($params as &$p) $p = $p[0]; $output = call_user_func(array($this->dwoo->getPluginProxy(), 'getCode'), $func, $params); } elseif ($pluginType & Dwoo::SMARTY_MODIFIER) { $params = $this->mapParams($params, null, $state); $params = $params['*'][0]; $params = self::implode_r($params); if ($pluginType & Dwoo::CUSTOM_PLUGIN) { $callback = $this->customPlugins[$func]['callback']; if (is_array($callback)) { if (is_object($callback[0])) { $output = ($mapped ? '$this->arrayMap' : 'call_user_func_array').'(array($this->plugins[\''.$func.'\'][\'callback\'][0], \''.$callback[1].'\'), array('.$params.'))'; } else { $output = ($mapped ? '$this->arrayMap' : 'call_user_func_array').'(array(\''.$callback[0].'\', \''.$callback[1].'\'), array('.$params.'))'; } } elseif ($mapped) { $output = '$this->arrayMap(\''.$callback.'\', array('.$params.'))'; } else { $output = $callback.'('.$params.')'; } } elseif ($mapped) { $output = '$this->arrayMap(\'smarty_modifier_'.$func.'\', array('.$params.'))'; } else { $output = 'smarty_modifier_'.$func.'('.$params.')'; } } else { if ($pluginType & Dwoo::CUSTOM_PLUGIN) { $callback = $this->customPlugins[$func]['callback']; $pluginName = $callback; } else { $pluginName = 'Dwoo_Plugin_'.$func; if ($pluginType & Dwoo::CLASS_PLUGIN) { $callback = array($pluginName, ($pluginType & Dwoo::COMPILABLE_PLUGIN) ? 'compile' : 'process'); } else { $callback = $pluginName . (($pluginType & Dwoo::COMPILABLE_PLUGIN) ? '_compile' : ''); } } $params = $this->mapParams($params, $callback, $state); foreach ($params as &$p) $p = $p[0]; if ($pluginType & Dwoo::FUNC_PLUGIN) { if ($pluginType & Dwoo::COMPILABLE_PLUGIN) { if ($mapped) { throw new Dwoo_Compilation_Exception($this, 'The @ operator can not be used on compiled plugins.'); } if ($pluginType & Dwoo::CUSTOM_PLUGIN) { $funcCompiler = $this->customPlugins[$func]['callback']; } else { $funcCompiler = 'Dwoo_Plugin_'.$func.'_compile'; } array_unshift($params, $this); $output = call_user_func_array($funcCompiler, $params); } else { array_unshift($params, '$this'); $params = self::implode_r($params); if ($mapped) { $output = '$this->arrayMap(\''.$pluginName.'\', array('.$params.'))'; } else { $output = $pluginName.'('.$params.')'; } } } else { if ($pluginType & Dwoo::COMPILABLE_PLUGIN) { if ($mapped) { throw new Dwoo_Compilation_Exception($this, 'The @ operator can not be used on compiled plugins.'); } if ($pluginType & Dwoo::CUSTOM_PLUGIN) { $callback = $this->customPlugins[$func]['callback']; if (!is_array($callback)) { if (!method_exists($callback, 'compile')) { throw new Dwoo_Exception('Custom plugin '.$func.' must implement the "compile" method to be compilable, or you should provide a full callback to the method to use'); } if (($ref = new ReflectionMethod($callback, 'compile')) && $ref->isStatic()) { $funcCompiler = array($callback, 'compile'); } else { $funcCompiler = array(new $callback, 'compile'); } } else { $funcCompiler = $callback; } } else { $funcCompiler = array('Dwoo_Plugin_'.$func, 'compile'); array_unshift($params, $this); } $output = call_user_func_array($funcCompiler, $params); } else { $params = self::implode_r($params); if ($pluginType & Dwoo::CUSTOM_PLUGIN) { if (is_object($callback[0])) { $output = ($mapped ? '$this->arrayMap' : 'call_user_func_array').'(array($this->plugins[\''.$func.'\'][\'callback\'][0], \''.$callback[1].'\'), array('.$params.'))'; } else { $output = ($mapped ? '$this->arrayMap' : 'call_user_func_array').'(array(\''.$callback[0].'\', \''.$callback[1].'\'), array('.$params.'))'; } } elseif ($mapped) { $output = '$this->arrayMap(array($this->getObjectPlugin(\'Dwoo_Plugin_'.$func.'\'), \'process\'), array('.$params.'))'; } else { $output = '$this->classCall(\''.$func.'\', array('.$params.'))'; } } } } } if ($curBlock === 'var' || $m[1] === null) { return $output; } elseif ($curBlock === 'string' || $curBlock === 'root') { return $m[1].'.'.$output.'.'.$m[1].(isset($add)?$add:null); } } /** * recursively implodes an array in a similar manner as var_export() does but with some tweaks * to handle pre-compiled values and the fact that we do not need to enclose everything with * "array" and do not require top-level keys to be displayed * * @param array $params the array to implode * @param bool $recursiveCall if set to true, the function outputs key names for the top level * @return string the imploded array */ public static function implode_r(array $params, $recursiveCall = false) { $out = ''; foreach ($params as $k=>$p) { if (is_array($p)) { $out2 = 'array('; foreach ($p as $k2=>$v) $out2 .= var_export($k2, true).' => '.(is_array($v) ? 'array('.self::implode_r($v, true).')' : $v).', '; $p = rtrim($out2, ', ').')'; } if ($recursiveCall) { $out .= var_export($k, true).' => '.$p.', '; } else { $out .= $p.', '; } } return rtrim($out, ', '); } /** * returns the plugin type of a plugin and adds it to the used plugins array if required * * @param string $name plugin name, as found in the template * @return int type as a multi bit flag composed of the Dwoo plugin types constants */ protected function getPluginType($name) { $pluginType = -1; if (($this->securityPolicy === null && (function_exists($name) || strtolower($name) === 'isset' || strtolower($name) === 'empty')) || ($this->securityPolicy !== null && in_array(strtolower($name), $this->securityPolicy->getAllowedPhpFunctions()) !== false)) { $phpFunc = true; } while ($pluginType <= 0) { if (isset($this->templatePlugins[$name])) { $pluginType = Dwoo::TEMPLATE_PLUGIN | Dwoo::COMPILABLE_PLUGIN; } elseif (isset($this->customPlugins[$name])) { $pluginType = $this->customPlugins[$name]['type'] | Dwoo::CUSTOM_PLUGIN; } elseif (class_exists('Dwoo_Plugin_'.$name, false) !== false) { if (is_subclass_of('Dwoo_Plugin_'.$name, 'Dwoo_Block_Plugin')) { $pluginType = Dwoo::BLOCK_PLUGIN; } else { $pluginType = Dwoo::CLASS_PLUGIN; } $interfaces = class_implements('Dwoo_Plugin_'.$name, false); if (in_array('Dwoo_ICompilable', $interfaces) !== false || in_array('Dwoo_ICompilable_Block', $interfaces) !== false) { $pluginType |= Dwoo::COMPILABLE_PLUGIN; } } elseif (function_exists('Dwoo_Plugin_'.$name) !== false) { $pluginType = Dwoo::FUNC_PLUGIN; } elseif (function_exists('Dwoo_Plugin_'.$name.'_compile')) { $pluginType = Dwoo::FUNC_PLUGIN | Dwoo::COMPILABLE_PLUGIN; } elseif (function_exists('smarty_modifier_'.$name) !== false) { $pluginType = Dwoo::SMARTY_MODIFIER; } elseif (function_exists('smarty_function_'.$name) !== false) { $pluginType = Dwoo::SMARTY_FUNCTION; } elseif (function_exists('smarty_block_'.$name) !== false) { $pluginType = Dwoo::SMARTY_BLOCK; } else { if ($pluginType===-1) { try { $this->dwoo->getLoader()->loadPlugin($name, isset($phpFunc)===false); } catch (Exception $e) { if (isset($phpFunc)) { $pluginType = Dwoo::NATIVE_PLUGIN; } elseif (is_object($this->dwoo->getPluginProxy()) && $this->dwoo->getPluginProxy()->handles($name)) { $pluginType = Dwoo::PROXY_PLUGIN; break; } else { throw $e; } } } else { throw new Dwoo_Exception('Plugin "'.$name.'" could not be found'); } $pluginType++; } } if (($pluginType & Dwoo::COMPILABLE_PLUGIN) === 0 && ($pluginType & Dwoo::NATIVE_PLUGIN) === 0 && ($pluginType & Dwoo::PROXY_PLUGIN) === 0) { $this->usedPlugins[$name] = $pluginType; } return $pluginType; } /** * allows a plugin to load another one at compile time, this will also mark * it as used by this template so it will be loaded at runtime (which can be * useful for compiled plugins that rely on another plugin when their compiled * code runs) * * @param string $name the plugin name */ public function loadPlugin($name) { $this->getPluginType($name); } /** * runs htmlentities over the matched blocks when the security policy enforces that * * @param array $match matched php block * @return string the htmlentities-converted string */ protected function phpTagEncodingHelper($match) { return htmlspecialchars($match[0]); } /** * maps the parameters received from the template onto the parameters required by the given callback * * @param array $params the array of parameters * @param callback $callback the function or method to reflect on to find out the required parameters * @param int $callType the type of call in the template, 0 = no params, 1 = php-style call, 2 = named parameters call * @param array $map the parameter map to use, if not provided it will be built from the callback * @return array parameters sorted in the correct order with missing optional parameters filled */ protected function mapParams(array $params, $callback, $callType=2, $map = null) { if (!$map) { $map = $this->getParamMap($callback); } $paramlist = array(); // transforms the parameter array from (x=>array('paramname'=>array(values))) to (paramname=>array(values)) $ps = array(); foreach ($params as $p) { if (is_array($p[1])) { $ps[$p[0]] = $p[1]; } else { $ps[] = $p; } } // loops over the param map and assigns values from the template or default value for unset optional params while (list($k,$v) = each($map)) { if ($v[0] === '*') { // "rest" array parameter, fill every remaining params in it and then break if (count($ps) === 0) { if ($v[1]===false) { throw new Dwoo_Compilation_Exception($this, 'Rest argument missing for '.str_replace(array('Dwoo_Plugin_', '_compile'), '', (is_array($callback) ? $callback[0] : $callback))); } else { break; } } $tmp = array(); $tmp2 = array(); foreach ($ps as $i=>$p) { $tmp[$i] = $p[0]; $tmp2[$i] = $p[1]; unset($ps[$i]); } $paramlist[$v[0]] = array($tmp, $tmp2); unset($tmp, $tmp2, $i, $p); break; } elseif (isset($ps[$v[0]])) { // parameter is defined as named param $paramlist[$v[0]] = $ps[$v[0]]; unset($ps[$v[0]]); } elseif (isset($ps[$k])) { // parameter is defined as ordered param $paramlist[$v[0]] = $ps[$k]; unset($ps[$k]); } elseif ($v[1]===false) { // parameter is not defined and not optional, throw error throw new Dwoo_Compilation_Exception($this, 'Argument '.$k.'/'.$v[0].' missing for '.str_replace(array('Dwoo_Plugin_', '_compile'), '', (is_array($callback) ? $callback[0] : $callback))); } elseif ($v[2]===null) { // enforce lowercased null if default value is null (php outputs NULL with var export) $paramlist[$v[0]] = array('null', null); } else { // outputs default value with var_export $paramlist[$v[0]] = array(var_export($v[2], true), $v[2]); } } if (count($ps)) { foreach ($ps as $i=>$p) { array_push($paramlist, $p); } } return $paramlist; } /** * returns the parameter map of the given callback, it filters out entries typed as Dwoo and Dwoo_Compiler and turns the rest parameter into a "*" * * @param callback $callback the function/method to reflect on * @return array processed parameter map */ protected function getParamMap($callback) { if (is_null($callback)) { return array(array('*', true)); } if (is_array($callback)) { $ref = new ReflectionMethod($callback[0], $callback[1]); } else { $ref = new ReflectionFunction($callback); } $out = array(); foreach ($ref->getParameters() as $param) { if (($class = $param->getClass()) !== null && $class->name === 'Dwoo') { continue; } if (($class = $param->getClass()) !== null && $class->name === 'Dwoo_Compiler') { continue; } if ($param->getName() === 'rest' && $param->isArray() === true) { $out[] = array('*', $param->isOptional(), null); } $out[] = array($param->getName(), $param->isOptional(), $param->isOptional() ? $param->getDefaultValue() : null); } return $out; } /** * returns a default instance of this compiler, used by default by all Dwoo templates that do not have a * specific compiler assigned and when you do not override the default compiler factory function * * @see Dwoo::setDefaultCompilerFactory() * @return Dwoo_Compiler */ public static function compilerFactory() { if (self::$instance === null) { self::$instance = new self; } return self::$instance; } } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Data.php000066400000000000000000000144231225466040700254200ustar00rootroot00000000000000 * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ class Dwoo_Data implements Dwoo_IDataProvider { /** * data array * * @var array */ protected $data = array(); /** * returns the data array * * @return array */ public function getData() { return $this->data; } /** * clears a the entire data or only the given key * * @param array|string $name clears only one value if you give a name, multiple values if * you give an array of names, or the entire data if left null */ public function clear($name = null) { if ($name === null) { $this->data = array(); } elseif (is_array($name)) { foreach ($name as $index) unset($this->data[$index]); } else { unset($this->data[$name]); } } /** * overwrites the entire data with the given array * * @param array $data the new data array to use */ public function setData(array $data) { $this->data = $data; } /** * merges the given array(s) with the current data with array_merge * * @param array $data the array to merge * @param array $data2 $data3 ... other arrays to merge, optional, etc. */ public function mergeData(array $data) { $args = func_get_args(); while (list(,$v) = each($args)) { if (is_array($v)) { $this->data = array_merge($this->data, $v); } } } /** * assigns a value or an array of values to the data object * * @param array|string $name an associative array of multiple (index=>value) or a string * that is the index to use, i.e. a value assigned to "foo" will be * accessible in the template through {$foo} * @param mixed $val the value to assign, or null if $name was an array */ public function assign($name, $val = null) { if (is_array($name)) { reset($name); while (list($k,$v) = each($name)) $this->data[$k] = $v; } else { $this->data[$name] = $val; } } /** * allows to assign variables using the object syntax * * @param string $name the variable name * @param string $value the value to assign to it */ public function __set($name, $value) { $this->assign($name, $value); } /** * assigns a value by reference to the data object * * @param string $name the index to use, i.e. a value assigned to "foo" will be * accessible in the template through {$foo} * @param mixed $val the value to assign by reference */ public function assignByRef($name, &$val) { $this->data[$name] =& $val; } /** * appends values or an array of values to the data object * * @param array|string $name an associative array of multiple (index=>value) or a string * that is the index to use, i.e. a value assigned to "foo" will be * accessible in the template through {$foo} * @param mixed $val the value to assign, or null if $name was an array * @param bool $merge true to merge data or false to append, defaults to false */ public function append($name, $val = null, $merge = false) { if (is_array($name)) { foreach ($name as $key=>$val) { if (isset($this->data[$key]) && !is_array($this->data[$key])) { settype($this->data[$key], 'array'); } if ($merge === true && is_array($val)) { $this->data[$key] = $val + $this->data[$key]; } else { $this->data[$key][] = $val; } } } elseif ($val !== null) { if (isset($this->data[$name]) && !is_array($this->data[$name])) { settype($this->data[$name], 'array'); } if ($merge === true && is_array($val)) { $this->data[$name] = $val + $this->data[$name]; } else { $this->data[$name][] = $val; } } } /** * appends a value by reference to the data object * * @param string $name the index to use, i.e. a value assigned to "foo" will be * accessible in the template through {$foo} * @param mixed $val the value to append by reference * @param bool $merge true to merge data or false to append, defaults to false */ public function appendByRef($name, &$val, $merge = false) { if (isset($this->data[$name]) && !is_array($this->data[$name])) { settype($this->data[$name], 'array'); } if ($merge === true && is_array($val)) { foreach ($val as $key => &$val) { $this->data[$name][$key] =& $val; } } else { $this->data[$name][] =& $val; } } /** * returns true if the variable has been assigned already, false otherwise * * @param string $name the variable name * @return bool */ public function isAssigned($name) { return isset($this->data[$name]); } /** * supports calls to isset($dwooData->var) * * @param string $name the variable name */ public function __isset($name) { return isset($this->data[$name]); } /** * unassigns/removes a variable * * @param string $name the variable name */ public function unassign($name) { unset($this->data[$name]); } /** * supports unsetting variables using the object syntax * * @param string $name the variable name */ public function __unset($name) { unset($this->data[$name]); } /** * returns a variable if it was assigned * * @param string $name the variable name * @return mixed */ public function get($name) { return $this->__get($name); } /** * allows to read variables using the object syntax * * @param string $name the variable name * @return mixed */ public function __get($name) { if (isset($this->data[$name])) { return $this->data[$name]; } else { throw new Dwoo_Exception('Tried to read a value that was not assigned yet : "'.$name.'"'); } } } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Exception.php000066400000000000000000000010301225466040700264730ustar00rootroot00000000000000 * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ class Dwoo_Exception extends Exception { } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Filter.php000066400000000000000000000020421225466040700257660ustar00rootroot00000000000000 * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ abstract class Dwoo_Filter { /** * the dwoo instance that runs this filter * * @var Dwoo */ protected $dwoo; /** * constructor, if you override it, call parent::__construct($dwoo); or assign * the dwoo instance yourself if you need it * * @param Dwoo $dwoo the dwoo instance that runs this plugin */ public function __construct(Dwoo $dwoo) { $this->dwoo = $dwoo; } /** * processes the input and returns it filtered * * @param string $input the template to process * @return string */ abstract public function process($input); } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/ICompilable.php000066400000000000000000000017621225466040700267310ustar00rootroot00000000000000public static function compile(Dwoo_Compiler $compiler, $arg, $arg, ...), * which replaces the process() method (that means compile() should have all arguments it requires). * * This software is provided 'as-is', without any express or implied warranty. * In no event will the authors be held liable for any damages arising from the use of this software. * * @author Jordi Boggiano * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ interface Dwoo_ICompilable { // this replaces the process function //public static function compile(Dwoo_Compiler $compiler, $arg, $arg, ...); } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/ICompilable/000077500000000000000000000000001225466040700262125ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/ICompilable/Block.php000066400000000000000000000012201225466040700277500ustar00rootroot00000000000000 * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ interface Dwoo_ICompilable_Block { } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/ICompiler.php000066400000000000000000000032321225466040700264260ustar00rootroot00000000000000 * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ interface Dwoo_ICompiler { /** * compiles the provided string down to php code * * @param string $templateStr the template to compile * @return string a compiled php code string */ public function compile(Dwoo $dwoo, Dwoo_ITemplate $template); /** * adds the custom plugins loaded into Dwoo to the compiler so it can load them * * @see Dwoo::addPlugin * @param array $customPlugins an array of custom plugins */ public function setCustomPlugins(array $customPlugins); /** * sets the security policy object to enforce some php security settings * * use this if untrusted persons can modify templates, * set it on the Dwoo object as it will be passed onto the compiler automatically * * @param Dwoo_Security_Policy $policy the security policy object */ public function setSecurityPolicy(Dwoo_Security_Policy $policy = null); } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/IDataProvider.php000066400000000000000000000012541225466040700272420ustar00rootroot00000000000000 * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ interface Dwoo_IDataProvider { /** * returns the data as an associative array that will be used in the template * * @return array */ public function getData(); } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/IElseable.php000066400000000000000000000015251225466040700263730ustar00rootroot00000000000000 * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ interface Dwoo_IElseable { } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/ILoader.php000066400000000000000000000021361225466040700260640ustar00rootroot00000000000000 * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ interface Dwoo_ILoader { /** * loads a plugin file * * the second parameter is used to avoid permanent rehashing when using php functions, * however this means that if you have add a plugin that overrides a php function you have * to delete the classpath.cache file(s) by hand to force a rehash of the plugins * * @param string $class the plugin name, without the Dwoo_Plugin_ prefix * @param bool $forceRehash if true, the class path caches will be rebuilt if the plugin is not found, in case it has just been added, defaults to true */ public function loadPlugin($class, $forceRehash = true); } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/IPluginProxy.php000066400000000000000000000037731225466040700271660ustar00rootroot00000000000000 * @author Jordi Boggiano * @copyright Copyright (c) 2008, Denis Arh, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ interface Dwoo_IPluginProxy { /** * returns true or false to say whether the given plugin is handled by this proxy or not * * @param string $name the plugin name * @return bool true if the plugin is known and usable, otherwise false */ public function handles($name); /** * returns the code (as a string) to call the plugin * (this will be executed at runtime inside the Dwoo class) * * @param string $name the plugin name * @param array $params a parameter array, array key "*" is the rest array * @return string */ public function getCode($name, $params); /** * returns a callback to the plugin, this is used with the reflection API to * find out about the plugin's parameter names etc. * * should you need a rest array without the possibility to edit the * plugin's code, you can provide a callback to some * other function with the correct parameter signature, i.e. : * * return array($this, "callbackHelper"); * // and callbackHelper would be as such: * public function callbackHelper(array $rest=array()){} * * * @param string $name the plugin name * @return callback */ public function getCallback($name); /** * returns some code that will check if the plugin is loaded and if not load it * this is optional, if your plugins are autoloaded or whatever, just return an * empty string * * @param string $name the plugin name * @return string */ public function getLoader($name); }nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/ITemplate.php000066400000000000000000000114271225466040700264340ustar00rootroot00000000000000 * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.1.0 * @date 2009-07-18 * @package Dwoo */ interface Dwoo_ITemplate { /** * returns the cache duration for this template * * defaults to null if it was not provided * * @return int|null */ public function getCacheTime(); /** * sets the cache duration for this template * * can be used to set it after the object is created if you did not provide * it in the constructor * * @param int $seconds duration of the cache validity for this template, if * null it defaults to the Dwoo instance's cache time. 0 = disable and * -1 = infinite cache */ public function setCacheTime($seconds = null); /** * returns the cached template output file name, true if it's cache-able but not cached * or false if it's not cached * * @param Dwoo $dwoo the dwoo instance that requests it * @return string|bool */ public function getCachedTemplate(Dwoo $dwoo); /** * caches the provided output into the cache file * * @param Dwoo $dwoo the dwoo instance that requests it * @param string $output the template output * @return mixed full path of the cached file or false upon failure */ public function cache(Dwoo $dwoo, $output); /** * clears the cached template if it's older than the given time * * @param Dwoo $dwoo the dwoo instance that was used to cache that template * @param int $olderThan minimum time (in seconds) required for the cache to be cleared * @return bool true if the cache was not present or if it was deleted, false if it remains there */ public function clearCache(Dwoo $dwoo, $olderThan = -1); /** * returns the compiled template file name * * @param Dwoo $dwoo the dwoo instance that requests it * @param Dwoo_ICompiler $compiler the compiler that must be used * @return string */ public function getCompiledTemplate(Dwoo $dwoo, Dwoo_ICompiler $compiler = null); /** * returns the template name * * @return string */ public function getName(); /** * returns the resource name for this template class * * @return string */ public function getResourceName(); /** * returns the resource identifier for this template or false if it has no identifier * * @return string|false */ public function getResourceIdentifier(); /** * returns the template source of this template * * @return string */ public function getSource(); /** * returns an unique string identifying the current version of this template, * for example a timestamp of the last modified date or a hash of the template source * * @return string */ public function getUid(); /** * returns the compiler used by this template, if it was just compiled, or null * * @return Dwoo_ICompiler */ public function getCompiler(); /** * returns some php code that will check if this template has been modified or not * * if the function returns null, the template will be instanciated and then the Uid checked * * @return string */ public function getIsModifiedCode(); /** * returns a new template object from the given resource identifier, null if no include is * possible (resource not found), or false if include is not permitted by this resource type * * this method should also check if $dwoo->getSecurityPolicy() is null or not and do the * necessary permission checks if required, if the security policy prevents the template * generation it should throw a new Dwoo_Security_Exception with a relevant message * * @param mixed $resourceId the resource identifier * @param int $cacheTime duration of the cache validity for this template, * if null it defaults to the Dwoo instance that will * render this template * @param string $cacheId the unique cache identifier of this page or anything else that * makes this template's content unique, if null it defaults * to the current url * @param string $compileId the unique compiled identifier, which is used to distinguish this * template from others, if null it defaults to the filename+bits of the path * @param Dwoo_ITemplate $parentTemplate the template that is requesting a new template object (through * an include, extends or any other plugin) * @return Dwoo_ITemplate|null|false */ public static function templateFactory(Dwoo $dwoo, $resourceId, $cacheTime = null, $cacheId = null, $compileId = null, Dwoo_ITemplate $parentTemplate = null); } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Loader.php000066400000000000000000000124471225466040700257610ustar00rootroot00000000000000 * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.1.0 * @date 2009-07-18 * @package Dwoo */ class Dwoo_Loader implements Dwoo_ILoader { /** * stores the plugin directories * * @see addDirectory * @var array */ protected $paths = array(); /** * stores the plugins names/paths relationships * don't edit this on your own, use addDirectory * * @see addDirectory * @var array */ protected $classPath = array(); /** * path where class paths cache files are written * * @var string */ protected $cacheDir; protected $corePluginDir; public function __construct($cacheDir) { $this->corePluginDir = DWOO_DIRECTORY . 'plugins'; $this->cacheDir = rtrim($cacheDir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; // include class paths or rebuild paths if the cache file isn't there if(file_exists($this->cacheDir.'classpath.cache.d'.Dwoo::RELEASE_TAG.'.php')) { $foo = @file_get_contents($this->cacheDir.'classpath.cache.d'.Dwoo::RELEASE_TAG.'.php'); $this->classPath = unserialize($foo) + $this->classPath; } else { $this->rebuildClassPathCache($this->corePluginDir, $this->cacheDir.'classpath.cache.d'.Dwoo::RELEASE_TAG.'.php'); } } /** * rebuilds class paths, scans the given directory recursively and saves all paths in the given file * * @param string $path the plugin path to scan * @param string $cacheFile the file where to store the plugin paths cache, it will be overwritten */ protected function rebuildClassPathCache($path, $cacheFile) { if ($cacheFile!==false) { $tmp = $this->classPath; $this->classPath = array(); } // iterates over all files/folders $list = glob(rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . '*'); if (is_array($list)) { foreach ($list as $f) { if (is_dir($f)) { $this->rebuildClassPathCache($f, false); } else { $this->classPath[str_replace(array('function.','block.','modifier.','outputfilter.','filter.','prefilter.','postfilter.','pre.','post.','output.','shared.','helper.'), '', basename($f, '.php'))] = $f; } } } // save in file if it's the first call (not recursed) if ($cacheFile!==false) { if (!file_put_contents($cacheFile, serialize($this->classPath))) { throw new Dwoo_Exception('Could not write into '.$cacheFile.', either because the folder is not there (create it) or because of the chmod configuration (please ensure this directory is writable by php), alternatively you can change the directory used with $dwoo->setCompileDir() or provide a custom loader object with $dwoo->setLoader()'); } $this->classPath += $tmp; } } /** * loads a plugin file * * @param string $class the plugin name, without the Dwoo_Plugin_ prefix * @param bool $forceRehash if true, the class path caches will be rebuilt if the plugin is not found, in case it has just been added, defaults to true */ public function loadPlugin($class, $forceRehash = true) { // a new class was added or the include failed so we rebuild the cache if (!isset($this->classPath[$class]) || !(include $this->classPath[$class])) { if ($forceRehash) { $this->rebuildClassPathCache($this->corePluginDir, $this->cacheDir . 'classpath.cache.d'.Dwoo::RELEASE_TAG.'.php'); foreach ($this->paths as $path=>$file) { $this->rebuildClassPathCache($path, $file); } if (isset($this->classPath[$class])) { include $this->classPath[$class]; } else { throw new Dwoo_Exception('Plugin '.$class.' can not be found, maybe you forgot to bind it if it\'s a custom plugin ?', E_USER_NOTICE); } } else { throw new Dwoo_Exception('Plugin '.$class.' can not be found, maybe you forgot to bind it if it\'s a custom plugin ?', E_USER_NOTICE); } } } /** * adds a plugin directory, the plugins found in the new plugin directory * will take precedence over the other directories (including the default * dwoo plugin directory), you can use this for example to override plugins * in a specific directory for a specific application while keeping all your * usual plugins in the same place for all applications. * * TOCOM don't forget that php functions overrides are not rehashed so you * need to clear the classpath caches by hand when adding those * * @param string $pluginDirectory the plugin path to scan */ public function addDirectory($pluginDirectory) { $pluginDir = realpath($pluginDirectory); if (!$pluginDir) { throw new Dwoo_Exception('Plugin directory does not exist or can not be read : '.$pluginDirectory); } $cacheFile = $this->cacheDir . 'classpath-'.substr(strtr($pluginDir, '/\\:'.PATH_SEPARATOR, '----'), strlen($pluginDir) > 80 ? -80 : 0).'.d'.Dwoo::RELEASE_TAG.'.php'; $this->paths[$pluginDir] = $cacheFile; $foo = @file_get_contents($cacheFile); if ($foo) { $this->classPath = unserialize($foo) + $this->classPath; } else { $this->rebuildClassPathCache($pluginDir, $cacheFile); } } } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Plugin.php000066400000000000000000000053201225466040700260010ustar00rootroot00000000000000process() method, it will receive the parameters that * are in the template code * * This software is provided 'as-is', without any express or implied warranty. * In no event will the authors be held liable for any damages arising from the use of this software. * * @author Jordi Boggiano * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ abstract class Dwoo_Plugin { /** * the dwoo instance that runs this plugin * * @var Dwoo */ protected $dwoo; /** * constructor, if you override it, call parent::__construct($dwoo); or assign * the dwoo instance yourself if you need it * * @param Dwoo $dwoo the dwoo instance that runs this plugin */ public function __construct(Dwoo $dwoo) { $this->dwoo = $dwoo; } // plugins should always implement : // public function process($arg, $arg, ...) // or for block plugins : // public function init($arg, $arg, ...) // this could be enforced with : // abstract public function process(...); // if my feature request gets enough interest one day // see => http://bugs.php.net/bug.php?id=44043 /** * utility function that converts an array of compiled parameters (or rest array) to a string of xml/html tag attributes * * this is to be used in preProcessing or postProcessing functions, example : * $p = $compiler->getCompiledParams($params); * // get only the rest array as attributes * $attributes = Dwoo_Plugin::paramsToAttributes($p['*']); * // get all the parameters as attributes (if there is a rest array, it will be included) * $attributes = Dwoo_Plugin::paramsToAttributes($p); * * @param array $params an array of attributeName=>value items that will be compiled to be ready for inclusion in a php string * @param string $delim the string delimiter you want to use (defaults to ') * @return string */ public static function paramsToAttributes(array $params, $delim = '\'') { if (isset($params['*'])) { $params = array_merge($params, $params['*']); unset($params['*']); } $out = ''; foreach ($params as $attr=>$val) { $out .= ' '.$attr.'='; if (trim($val, '"\'')=='' || $val=='null') { $out .= str_replace($delim, '\\'.$delim, '""'); } elseif (substr($val, 0, 1) === $delim && substr($val, -1) === $delim) { $out .= str_replace($delim, '\\'.$delim, '"'.substr($val, 1, -1).'"'); } else { $out .= str_replace($delim, '\\'.$delim, '"') . $delim . '.'.$val.'.' . $delim . str_replace($delim, '\\'.$delim, '"'); } } return ltrim($out); } } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Processor.php000066400000000000000000000021101225466040700265140ustar00rootroot00000000000000 * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ abstract class Dwoo_Processor { /** * the compiler instance that runs this processor * * @var Dwoo */ protected $compiler; /** * constructor, if you override it, call parent::__construct($dwoo); or assign * the dwoo instance yourself if you need it * * @param Dwoo $dwoo the dwoo instance that runs this plugin */ public function __construct(Dwoo_Compiler $compiler) { $this->compiler = $compiler; } /** * processes the input and returns it filtered * * @param string $input the template to process * @return string */ abstract public function process($input); } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Security/000077500000000000000000000000001225466040700256415ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Security/Exception.php000066400000000000000000000010521225466040700303060ustar00rootroot00000000000000 * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ class Dwoo_Security_Exception extends Dwoo_Exception { } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Security/Policy.php000066400000000000000000000114471225466040700276200ustar00rootroot00000000000000 * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ class Dwoo_Security_Policy { /**#@+ * php handling constants, defaults to PHP_REMOVE * * PHP_REMOVE : remove all (+ short tags if your short tags option is on) from the input template * PHP_ALLOW : leave them as they are * PHP_ENCODE : run htmlentities over them * * @var int */ const PHP_ENCODE = 1; const PHP_REMOVE = 2; const PHP_ALLOW = 3; /**#@-*/ /**#@+ * constant handling constants, defaults to CONST_DISALLOW * * CONST_DISALLOW : throw an error if {$dwoo.const.*} is used in the template * CONST_ALLOW : allow {$dwoo.const.*} calls */ const CONST_DISALLOW = false; const CONST_ALLOW = true; /**#@-*/ /** * php functions that are allowed to be used within the template * * @var array */ protected $allowedPhpFunctions = array ( 'str_repeat', 'number_format', 'htmlentities', 'htmlspecialchars', 'long2ip', 'strlen', 'list', 'empty', 'count', 'sizeof', 'in_array', 'is_array', ); /** * paths that are safe to use with include or other file-access plugins * * @var array */ protected $allowedDirectories = array(); /** * stores the php handling level * * defaults to Dwoo_Security_Policy::PHP_REMOVE * * @var int */ protected $phpHandling = self::PHP_REMOVE; /** * stores the constant handling level * * defaults to Dwoo_Security_Policy::CONST_DISALLOW * * @var bool */ protected $constHandling = self::CONST_DISALLOW; /** * adds a php function to the allowed list * * @param mixed $func function name or array of function names */ public function allowPhpFunction($func) { if (is_array($func)) foreach ($func as $fname) $this->allowedPhpFunctions[strtolower($fname)] = true; else $this->allowedPhpFunctions[strtolower($func)] = true; } /** * removes a php function from the allowed list * * @param mixed $func function name or array of function names */ public function disallowPhpFunction($func) { if (is_array($func)) foreach ($func as $fname) unset($this->allowedPhpFunctions[strtolower($fname)]); else unset($this->allowedPhpFunctions[strtolower($func)]); } /** * returns the list of php functions allowed to run, note that the function names * are stored in the array keys and not values * * @return array */ public function getAllowedPhpFunctions() { return $this->allowedPhpFunctions; } /** * adds a directory to the safelist for includes and other file-access plugins * * note that all the includePath directories you provide to the Dwoo_Template_File class * are automatically marked as safe * * @param mixed $path a path name or an array of paths */ public function allowDirectory($path) { if (is_array($path)) foreach ($path as $dir) $this->allowedDirectories[realpath($dir)] = true; else $this->allowedDirectories[realpath($path)] = true; } /** * removes a directory from the safelist * * @param mixed $path a path name or an array of paths */ public function disallowDirectory($path) { if (is_array($path)) foreach ($path as $dir) unset($this->allowedDirectories[realpath($dir)]); else unset($this->allowedDirectories[realpath($path)]); } /** * returns the list of safe paths, note that the paths are stored in the array * keys and not values * * @return array */ public function getAllowedDirectories() { return $this->allowedDirectories; } /** * sets the php handling level, defaults to REMOVE * * @param int $level one of the Dwoo_Security_Policy::PHP_* constants */ public function setPhpHandling($level = self::PHP_REMOVE) { $this->phpHandling = $level; } /** * returns the php handling level * * @return int the current level, one of the Dwoo_Security_Policy::PHP_* constants */ public function getPhpHandling() { return $this->phpHandling; } /** * sets the constant handling level, defaults to CONST_DISALLOW * * @param bool $level one of the Dwoo_Security_Policy::CONST_* constants */ public function setConstantHandling($level = self::CONST_DISALLOW) { $this->constHandling = $level; } /** * returns the constant handling level * * @return bool the current level, one of the Dwoo_Security_Policy::CONST_* constants */ public function getConstantHandling() { return $this->constHandling; } } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Smarty/000077500000000000000000000000001225466040700253115ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Smarty/Adapter.php000066400000000000000000000362611225466040700274120ustar00rootroot00000000000000 * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.1.0 * @date 2009-07-18 * @package Dwoo */ class Dwoo_Smarty__Adapter extends Dwoo { // magic get/set/call functions that handle unsupported features public function __set($p, $v) { if ($p==='scope') { $this->scope = $v; return; } if ($p==='data') { $this->data = $v; return; } if (array_key_exists($p, $this->compat['properties']) !== false) { if ($this->show_compat_errors) { $this->triggerError('Property '.$p.' is not available in the Dwoo_Smarty_Adapter, however it might be implemented in the future, check out http://wiki.dwoo.org/index.php/SmartySupport for more details.', E_USER_NOTICE); } $this->compat['properties'][$p] = $v; } else { if ($this->show_compat_errors) { $this->triggerError('Property '.$p.' is not available in the Dwoo_Smarty_Adapter, but it is not listed as such, so you might want to tell me about it at j.boggiano@seld.be', E_USER_NOTICE); } } } public function __get($p) { if (array_key_exists($p, $this->compat['properties']) !== false) { if ($this->show_compat_errors) { $this->triggerError('Property '.$p.' is not available in the Dwoo_Smarty_Adapter, however it might be implemented in the future, check out http://wiki.dwoo.org/index.php/SmartySupport for more details.', E_USER_NOTICE); } return $this->compat['properties'][$p]; } else { if ($this->show_compat_errors) { $this->triggerError('Property '.$p.' is not available in the Dwoo_Smarty_Adapter, but it is not listed as such, so you might want to tell me about it at j.boggiano@seld.be', E_USER_NOTICE); } } } public function __call($m, $a) { if (method_exists($this->dataProvider, $m)) { call_user_func_array(array($this->dataProvider, $m), $a); } elseif ($this->show_compat_errors) { if (array_search($m, $this->compat['methods']) !== false) { $this->triggerError('Method '.$m.' is not available in the Dwoo_Smarty_Adapter, however it might be implemented in the future, check out http://wiki.dwoo.org/index.php/SmartySupport for more details.', E_USER_NOTICE); } else { $this->triggerError('Method '.$m.' is not available in the Dwoo_Smarty_Adapter, but it is not listed as such, so you might want to tell me about it at j.boggiano@seld.be', E_USER_NOTICE); } } } // list of unsupported properties and methods protected $compat = array ( 'methods' => array ( 'register_resource', 'unregister_resource', 'load_filter', 'clear_compiled_tpl', 'clear_config', 'get_config_vars', 'config_load' ), 'properties' => array ( 'cache_handler_func' => null, 'debugging' => false, 'error_reporting' => null, 'debugging_ctrl' => 'NONE', 'request_vars_order' => 'EGPCS', 'request_use_auto_globals' => true, 'use_sub_dirs' => false, 'autoload_filters' => array(), 'default_template_handler_func' => '', 'debug_tpl' => '', 'cache_modified_check' => false, 'default_modifiers' => array(), 'default_resource_type' => 'file', 'config_overwrite' => true, 'config_booleanize' => true, 'config_read_hidden' => false, 'config_fix_newlines' => true, 'config_class' => 'Config_File', ), ); // security vars public $security = false; public $trusted_dir = array(); public $secure_dir = array(); public $php_handling = SMARTY_PHP_PASSTHRU; public $security_settings = array ( 'PHP_HANDLING' => false, 'IF_FUNCS' => array ( 'list', 'empty', 'count', 'sizeof', 'in_array', 'is_array', ), 'INCLUDE_ANY' => false, 'PHP_TAGS' => false, 'MODIFIER_FUNCS' => array(), 'ALLOW_CONSTANTS' => false ); // paths public $template_dir = 'templates'; public $compile_dir = 'templates_c'; public $config_dir = 'configs'; public $cache_dir = 'cache'; public $plugins_dir = array(); // misc options public $left_delimiter = '{'; public $right_delimiter = '}'; public $compile_check = true; public $force_compile = false; public $caching = 0; public $cache_lifetime = 3600; public $compile_id = null; public $compiler_file = null; public $compiler_class = null; // dwoo/smarty compat layer public $show_compat_errors = false; protected $dataProvider; protected $_filters = array('pre'=>array(), 'post'=>array(), 'output'=>array()); protected static $tplCache = array(); protected $compiler = null; public function __construct() { parent::__construct(); $this->charset = 'iso-8859-1'; $this->dataProvider = new Dwoo_Data(); $this->compiler = new Dwoo_Compiler(); } public function display($filename, $cacheId=null, $compileId=null) { $this->fetch($filename, $cacheId, $compileId, true); } public function fetch($filename, $cacheId=null, $compileId=null, $display=false) { $this->setCacheDir($this->cache_dir); $this->setCompileDir($this->compile_dir); if ($this->security) { $policy = new Dwoo_Security_Policy(); $policy->addPhpFunction(array_merge($this->security_settings['IF_FUNCS'], $this->security_settings['MODIFIER_FUNCS'])); $phpTags = $this->security_settings['PHP_HANDLING'] ? SMARTY_PHP_ALLOW : $this->php_handling; if ($this->security_settings['PHP_TAGS']) { $phpTags = SMARTY_PHP_ALLOW; } switch($phpTags) { case SMARTY_PHP_ALLOW: case SMARTY_PHP_PASSTHRU: $phpTags = Dwoo_Security_Policy::PHP_ALLOW; break; case SMARTY_PHP_QUOTE: $phpTags = Dwoo_Security_Policy::PHP_ENCODE; break; case SMARTY_PHP_REMOVE: default: $phpTags = Dwoo_Security_Policy::PHP_REMOVE; break; } $policy->setPhpHandling($phpTags); $policy->setConstantHandling($this->security_settings['ALLOW_CONSTANTS']); if ($this->security_settings['INCLUDE_ANY']) { $policy->allowDirectory(preg_replace('{^((?:[a-z]:)?[\\\\/]).*}i', '$1', __FILE__)); } else { $policy->allowDirectory($this->secure_dir); } $this->setSecurityPolicy($policy); } if (!empty($this->plugins_dir)) { foreach ($this->plugins_dir as $dir) { $this->getLoader()->addDirectory(rtrim($dir, '\\/')); } } $tpl = $this->makeTemplate($filename, $cacheId, $compileId); if ($this->force_compile) { $tpl->forceCompilation(); } if ($this->caching > 0) { $this->cacheTime = $this->cache_lifetime; } else { $this->cacheTime = 0; } if ($this->compiler_class !== null) { if ($this->compiler_file !== null && !class_exists($this->compiler_class, false)) { include $this->compiler_file; } $this->compiler = new $this->compiler_class; } else { $this->compiler->addPreProcessor('smarty_compat', true); $this->compiler->setLooseOpeningHandling(true); } $this->compiler->setDelimiters($this->left_delimiter, $this->right_delimiter); return $this->get($tpl, $this->dataProvider, $this->compiler, $display===true); } public function get($_tpl, $data = array(), $_compiler = null, $_output = false) { if ($_compiler === null) { $_compiler = $this->compiler; } return parent::get($_tpl, $data, $_compiler, $_output); } public function register_function($name, $callback, $cacheable=true, $cache_attrs=null) { if (isset($this->plugins[$name]) && $this->plugins[$name][0] !== self::SMARTY_FUNCTION) { throw new Dwoo_Exception('Multiple plugins of different types can not share the same name'); } $this->plugins[$name] = array('type'=>self::SMARTY_FUNCTION, 'callback'=>$callback); } public function unregister_function($name) { unset($this->plugins[$name]); } public function register_block($name, $callback, $cacheable=true, $cache_attrs=null) { if (isset($this->plugins[$name]) && $this->plugins[$name][0] !== self::SMARTY_BLOCK) { throw new Dwoo_Exception('Multiple plugins of different types can not share the same name'); } $this->plugins[$name] = array('type'=>self::SMARTY_BLOCK, 'callback'=>$callback); } public function unregister_block($name) { unset($this->plugins[$name]); } public function register_modifier($name, $callback) { if (isset($this->plugins[$name]) && $this->plugins[$name][0] !== self::SMARTY_MODIFIER) { throw new Dwoo_Exception('Multiple plugins of different types can not share the same name'); } $this->plugins[$name] = array('type'=>self::SMARTY_MODIFIER, 'callback'=>$callback); } public function unregister_modifier($name) { unset($this->plugins[$name]); } public function register_prefilter($callback) { $processor = new Dwoo_SmartyProcessorAdapter($this->compiler); $processor->registerCallback($callback); $this->_filters['pre'][] = $processor; $this->compiler->addPreProcessor($processor); } public function unregister_prefilter($callback) { foreach ($this->_filters['pre'] as $index => $processor) if ($processor->callback === $callback) { $this->compiler->removePostProcessor($processor); unset($this->_filters['pre'][$index]); } } public function register_postfilter($callback) { $processor = new Dwoo_SmartyProcessorAdapter($this->compiler); $processor->registerCallback($callback); $this->_filters['post'][] = $processor; $this->compiler->addPostProcessor($processor); } public function unregister_postfilter($callback) { foreach ($this->_filters['post'] as $index => $processor) if ($processor->callback === $callback) { $this->compiler->removePostProcessor($processor); unset($this->_filters['post'][$index]); } } public function register_outputfilter($callback) { $filter = new Dwoo_SmartyFilterAdapter($this); $filter->registerCallback($callback); $this->_filters['output'][] = $filter; $this->addFilter($filter); } public function unregister_outputfilter($callback) { foreach ($this->_filters['output'] as $index => $filter) if ($filter->callback === $callback) { $this->removeOutputFilter($filter); unset($this->_filters['output'][$index]); } } function register_object($object, $object_impl, $allowed = array(), $smarty_args = false, $block_methods = array()) { settype($allowed, 'array'); settype($block_methods, 'array'); settype($smarty_args, 'boolean'); if (!empty($allowed) && $this->show_compat_errors) { $this->triggerError('You can register objects but can not restrict the method/properties used, this is PHP5, you have proper OOP access restrictions so use them.', E_USER_NOTICE); } if ($smarty_args) { $this->triggerError('You can register objects but methods will be called using method($arg1, $arg2, $arg3), not as an argument array like smarty did.', E_USER_NOTICE); } if (!empty($block_methods)) { $this->triggerError('You can register objects but can not use methods as being block methods, you have to build a plugin for that.', E_USER_NOTICE); } $this->dataProvider->assign($object, $object_impl); } function unregister_object($object) { $this->dataProvider->clear($object); } function get_registered_object($name) { $data = $this->dataProvider->getData(); if (isset($data[$name]) && is_object($data[$name])) { return $data[$name]; } else { trigger_error('Dwoo_Compiler: object "'.$name.'" was not registered or is not an object', E_USER_ERROR); } } public function template_exists($filename) { if (!is_array($this->template_dir)) { return file_exists($this->template_dir.DIRECTORY_SEPARATOR.$filename); } else { foreach ($this->template_dir as $tpl_dir) { if (file_exists($tpl_dir.DIRECTORY_SEPARATOR.$filename)) { return true; } } return false; } } public function is_cached($tpl, $cacheId = null, $compileId = null) { return $this->isCached($this->makeTemplate($tpl, $cacheId, $compileId)); } public function append_by_ref($var, &$value, $merge=false) { $this->dataProvider->appendByRef($var, $value, $merge); } public function assign_by_ref($name, &$val) { $this->dataProvider->assignByRef($name, $val); } public function clear_assign($var) { $this->dataProvider->clear($var); } public function clear_all_assign() { $this->dataProvider->clear(); } public function get_template_vars($name=null) { if ($this->show_compat_errors) { trigger_error('get_template_vars does not return values by reference, if you try to modify the data that way you should modify your code.', E_USER_NOTICE); } $data = $this->dataProvider->getData(); if ($name === null) return $data; elseif (isset($data[$name])) return $data[$name]; return null; } public function clear_all_cache($olderThan = 0) { $this->clearCache($olderThan); } public function clear_cache($template, $cacheId = null, $compileId = null, $olderThan = 0) { $this->makeTemplate($template, $cacheId, $compileId)->clearCache($olderThan); } public function trigger_error($error_msg, $error_type = E_USER_WARNING) { $this->triggerError($error_msg, $error_type); } protected function initGlobals() { parent::initGlobals(); $this->globals['ldelim'] = '{'; $this->globals['rdelim'] = '}'; } protected function makeTemplate($file, $cacheId, $compileId) { if ($compileId === null) $compileId = $this->compile_id; $hash = bin2hex(md5($file.$cacheId.$compileId, true)); if (!isset(self::$tplCache[$hash])) { // abs path if (substr($file, 0, 1) === '/' || substr($file, 1, 1) === ':') { self::$tplCache[$hash] = new Dwoo_Template_File($file, null, $cacheId, $compileId); } elseif (is_string($this->template_dir) || is_array($this->template_dir)) { self::$tplCache[$hash] = new Dwoo_Template_File($file, null, $cacheId, $compileId, $this->template_dir); } else { throw new Exception('Unable to load "'.$file.'", check the template_dir'); } } return self::$tplCache[$hash]; } public function triggerError($message, $level=E_USER_NOTICE) { if (is_object($this->template)) { return parent::triggerError($message, $level); } trigger_error('Dwoo error : '.$message, $level); } } class Dwoo_Smarty_Filter_Adapter extends Dwoo_Filter { public $callback; public function process($input) { return call_user_func($this->callback, $input); } public function registerCallback($callback) { $this->callback = $callback; } } class Dwoo_Smarty_Processor_Adapter extends Dwoo_Processor { public $callback; public function process($input) { return call_user_func($this->callback, $input); } public function registerCallback($callback) { $this->callback = $callback; } } // cloaks the adapter if possible with the smarty name to fool type-hinted plugins if (class_exists('Smarty', false) === false) { interface Smarty {} class Dwoo_Smarty_Adapter extends Dwoo_Smarty__Adapter implements Smarty {} } else { class Dwoo_Smarty_Adapter extends Dwoo_Smarty__Adapter {} } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Template/000077500000000000000000000000001225466040700256055ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Template/File.php000066400000000000000000000203121225466040700271730ustar00rootroot00000000000000 * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.1.0 * @date 2009-07-18 * @package Dwoo */ class Dwoo_Template_File extends Dwoo_Template_String { /** * template filename * * @var string */ protected $file; /** * include path(s) to look into to find this template * * @var array */ protected $includePath = null; /** * resolved path cache when looking for a file in multiple include paths * * this is reset when the include path is changed * * @var string */ protected $resolvedPath = null; /** * creates a template from a file * * @param string $file the path to the template file, make sure it exists * @param int $cacheTime duration of the cache validity for this template, * if null it defaults to the Dwoo instance that will * render this template * @param string $cacheId the unique cache identifier of this page or anything else that * makes this template's content unique, if null it defaults * to the current url * @param string $compileId the unique compiled identifier, which is used to distinguish this * template from others, if null it defaults to the filename+bits of the path * @param mixed $includePath a string for a single path to look into for the given file, or an array of paths */ public function __construct($file, $cacheTime = null, $cacheId = null, $compileId = null, $includePath = null) { $this->file = $file; $this->name = basename($file); $this->cacheTime = $cacheTime; if ($compileId !== null) { $this->compileId = str_replace('../', '__', strtr($compileId, '\\%?=!:;'.PATH_SEPARATOR, '/-------')); } if ($cacheId !== null) { $this->cacheId = str_replace('../', '__', strtr($cacheId, '\\%?=!:;'.PATH_SEPARATOR, '/-------')); } if (is_string($includePath)) { $this->includePath = array($includePath); } elseif (is_array($includePath)) { $this->includePath = $includePath; } } /** * sets the include path(s) to where the given template filename must be looked up * * @param mixed $paths the path to look into, can be string for a single path or an array of paths */ public function setIncludePath($paths) { if (is_array($paths) === false) { $paths = array($paths); } $this->includePath = $paths; $this->resolvedPath = null; } /** * return the current include path(s) * * @return array */ public function getIncludePath() { return $this->includePath; } /** * Checks if compiled file is valid (exists and it's the modification is greater or * equal to the modification time of the template file) * * @param string file * @return boolean True cache file existance and it's modification time */ protected function isValidCompiledFile($file) { return parent::isValidCompiledFile($file) && (int)$this->getUid() <= filemtime($file); } /** * returns the template source of this template * * @return string */ public function getSource() { return file_get_contents($this->getResourceIdentifier()); } /** * returns the resource name for this template class * * @return string */ public function getResourceName() { return 'file'; } /** * returns this template's source filename * * @return string */ public function getResourceIdentifier() { if ($this->resolvedPath !== null) { return $this->resolvedPath; } elseif ($this->includePath === null) { return $this->file; } else { foreach ($this->includePath as $path) { $path = rtrim($path, DIRECTORY_SEPARATOR); if (file_exists($path.DIRECTORY_SEPARATOR.$this->file) === true) { $this->resolvedPath = $path . DIRECTORY_SEPARATOR . $this->file; return $this->resolvedPath; } } throw new Dwoo_Exception('Template "'.$this->file.'" could not be found in any of your include path(s)'); } } /** * returns an unique value identifying the current version of this template, * in this case it's the unix timestamp of the last modification * * @return string */ public function getUid() { return (string) filemtime($this->getResourceIdentifier()); } /** * returns a new template object from the given include name, null if no include is * possible (resource not found), or false if include is not permitted by this resource type * * @param Dwoo $dwoo the dwoo instance requiring it * @param mixed $resourceId the filename (relative to this template's dir) of the template to include * @param int $cacheTime duration of the cache validity for this template, * if null it defaults to the Dwoo instance that will * render this template * @param string $cacheId the unique cache identifier of this page or anything else that * makes this template's content unique, if null it defaults * to the current url * @param string $compileId the unique compiled identifier, which is used to distinguish this * template from others, if null it defaults to the filename+bits of the path * @param Dwoo_ITemplate $parentTemplate the template that is requesting a new template object (through * an include, extends or any other plugin) * @return Dwoo_Template_File|null */ public static function templateFactory(Dwoo $dwoo, $resourceId, $cacheTime = null, $cacheId = null, $compileId = null, Dwoo_ITemplate $parentTemplate = null) { if (DIRECTORY_SEPARATOR === '\\') { $resourceId = str_replace(array("\t", "\n", "\r", "\f", "\v"), array('\\t', '\\n', '\\r', '\\f', '\\v'), $resourceId); } $resourceId = strtr($resourceId, '\\', '/'); $includePath = null; if (file_exists($resourceId) === false) { if ($parentTemplate === null) { $parentTemplate = $dwoo->getTemplate(); } if ($parentTemplate instanceof Dwoo_Template_File) { if ($includePath = $parentTemplate->getIncludePath()) { if (strstr($resourceId, '../')) { throw new Dwoo_Exception('When using an include path you can not reference a template into a parent directory (using ../)'); } } else { $resourceId = dirname($parentTemplate->getResourceIdentifier()).DIRECTORY_SEPARATOR.$resourceId; if (file_exists($resourceId) === false) { return null; } } } else { return null; } } if ($policy = $dwoo->getSecurityPolicy()) { while (true) { if (preg_match('{^([a-z]+?)://}i', $resourceId)) { throw new Dwoo_Security_Exception('The security policy prevents you to read files from external sources : '.$resourceId.'.'); } if ($includePath) { break; } $resourceId = realpath($resourceId); $dirs = $policy->getAllowedDirectories(); foreach ($dirs as $dir=>$dummy) { if (strpos($resourceId, $dir) === 0) { break 2; } } throw new Dwoo_Security_Exception('The security policy prevents you to read '.$resourceId.''); } } $class = 'Dwoo_Template_File'; if ($parentTemplate) { $class = get_class($parentTemplate); } return new $class($resourceId, $cacheTime, $cacheId, $compileId, $includePath); } /** * returns the full compiled file name and assigns a default value to it if * required * * @param Dwoo $dwoo the dwoo instance that requests the file name * @return string the full path to the compiled file */ protected function getCompiledFilename(Dwoo $dwoo) { // no compile id was provided, set default if ($this->compileId===null) { $this->compileId = str_replace('../', '__', strtr($this->getResourceIdentifier(), '\\:', '/-')); } return $dwoo->getCompileDir() . $this->compileId.'.d'.Dwoo::RELEASE_TAG.'.php'; } /** * returns some php code that will check if this template has been modified or not * * if the function returns null, the template will be instanciated and then the Uid checked * * @return string */ public function getIsModifiedCode() { return '"'.$this->getUid().'" == filemtime('.var_export($this->getResourceIdentifier(), true).')'; } } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Template/String.php000066400000000000000000000335561225466040700276000ustar00rootroot00000000000000 * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.1.0 * @date 2009-07-18 * @package Dwoo */ class Dwoo_Template_String implements Dwoo_ITemplate { /** * template name * * @var string */ protected $name; /** * template compilation id * * @var string */ protected $compileId; /** * template cache id, if not provided in the constructor, it is set to * the md4 hash of the request_uri. it is however highly recommended to * provide one that will fit your needs. * * in all cases, the compilation id is prepended to the cache id to separate * templates with similar cache ids from one another * * @var string */ protected $cacheId; /** * validity duration of the generated cache file (in seconds) * * set to -1 for infinite cache, 0 to disable and null to inherit the Dwoo instance's cache time * * @var int */ protected $cacheTime; /** * boolean flag that defines whether the compilation should be enforced (once) or * not use this if you have issues with the compiled templates not being updated * but if you do need this it's most likely that you should file a bug report * * @var bool */ protected $compilationEnforced; /** * caches the results of the file checks to save some time when the same * templates is rendered several times * * @var array */ protected static $cache = array('cached'=>array(), 'compiled'=>array()); /** * holds the compiler that built this template * * @var Dwoo_ICompiler */ protected $compiler; /** * chmod value for all files written (cached or compiled ones) * * set to null if you don't want any chmod operation to happen * * @var int */ protected $chmod = 0777; /** * creates a template from a string * * @param string $templateString the template to use * @param int $cacheTime duration of the cache validity for this template, * if null it defaults to the Dwoo instance that will * render this template, set to -1 for infinite cache or 0 to disable * @param string $cacheId the unique cache identifier of this page or anything else that * makes this template's content unique, if null it defaults * to the current url * @param string $compileId the unique compiled identifier, which is used to distinguish this * template from others, if null it defaults to the md4 hash of the template */ public function __construct($templateString, $cacheTime = null, $cacheId = null, $compileId = null) { $this->template = $templateString; if (function_exists('hash')) { $this->name = hash('md4', $templateString); } else { $this->name = md5($templateString); } $this->cacheTime = $cacheTime; if ($compileId !== null) { $this->compileId = str_replace('../', '__', strtr($compileId, '\\%?=!:;'.PATH_SEPARATOR, '/-------')); } if ($cacheId !== null) { $this->cacheId = str_replace('../', '__', strtr($cacheId, '\\%?=!:;'.PATH_SEPARATOR, '/-------')); } } /** * returns the cache duration for this template * * defaults to null if it was not provided * * @return int|null */ public function getCacheTime() { return $this->cacheTime; } /** * sets the cache duration for this template * * can be used to set it after the object is created if you did not provide * it in the constructor * * @param int $seconds duration of the cache validity for this template, if * null it defaults to the Dwoo instance's cache time. 0 = disable and * -1 = infinite cache */ public function setCacheTime($seconds = null) { $this->cacheTime = $seconds; } /** * returns the chmod value for all files written (cached or compiled ones) * * defaults to 0777 * * @return int|null */ public function getChmod() { return $this->chmod; } /** * set the chmod value for all files written (cached or compiled ones) * * set to null if you don't want to do any chmod() operation * * @param int $mask new bitmask to use for all files */ public function setChmod($mask = null) { $this->chmod = $mask; } /** * returns the template name * * @return string */ public function getName() { return $this->name; } /** * returns the resource name for this template class * * @return string */ public function getResourceName() { return 'string'; } /** * returns the resource identifier for this template, false here as strings don't have identifiers * * @return false */ public function getResourceIdentifier() { return false; } /** * returns the template source of this template * * @return string */ public function getSource() { return $this->template; } /** * returns an unique value identifying the current version of this template, * in this case it's the md4 hash of the content * * @return string */ public function getUid() { return $this->name; } /** * returns the compiler used by this template, if it was just compiled, or null * * @return Dwoo_ICompiler */ public function getCompiler() { return $this->compiler; } /** * marks this template as compile-forced, which means it will be recompiled even if it * was already saved and wasn't modified since the last compilation. do not use this in production, * it's only meant to be used in development (and the development of dwoo particularly) */ public function forceCompilation() { $this->compilationEnforced = true; } /** * returns the cached template output file name, true if it's cache-able but not cached * or false if it's not cached * * @param Dwoo $dwoo the dwoo instance that requests it * @return string|bool */ public function getCachedTemplate(Dwoo $dwoo) { if ($this->cacheTime !== null) { $cacheLength = $this->cacheTime; } else { $cacheLength = $dwoo->getCacheTime(); } // file is not cacheable if ($cacheLength === 0) { return false; } $cachedFile = $this->getCacheFilename($dwoo); if (isset(self::$cache['cached'][$this->cacheId]) === true && file_exists($cachedFile)) { // already checked, return cache file return $cachedFile; } elseif ($this->compilationEnforced !== true && file_exists($cachedFile) && ($cacheLength === -1 || filemtime($cachedFile) > ($_SERVER['REQUEST_TIME'] - $cacheLength))) { // cache is still valid and can be loaded self::$cache['cached'][$this->cacheId] = true; return $cachedFile; } else { // file is cacheable return true; } } /** * caches the provided output into the cache file * * @param Dwoo $dwoo the dwoo instance that requests it * @param string $output the template output * @return mixed full path of the cached file or false upon failure */ public function cache(Dwoo $dwoo, $output) { $cacheDir = $dwoo->getCacheDir(); $cachedFile = $this->getCacheFilename($dwoo); // the code below is courtesy of Rasmus Schultz, // thanks for his help on avoiding concurency issues $temp = tempnam($cacheDir, 'temp'); if (!($file = @fopen($temp, 'wb'))) { $temp = $cacheDir . uniqid('temp'); if (!($file = @fopen($temp, 'wb'))) { trigger_error('Error writing temporary file \''.$temp.'\'', E_USER_WARNING); return false; } } fwrite($file, $output); fclose($file); $this->makeDirectory(dirname($cachedFile), $cacheDir); if (!@rename($temp, $cachedFile)) { @unlink($cachedFile); @rename($temp, $cachedFile); } if ($this->chmod !== null) { chmod($cachedFile, $this->chmod); } self::$cache['cached'][$this->cacheId] = true; return $cachedFile; } /** * clears the cached template if it's older than the given time * * @param Dwoo $dwoo the dwoo instance that was used to cache that template * @param int $olderThan minimum time (in seconds) required for the cache to be cleared * @return bool true if the cache was not present or if it was deleted, false if it remains there */ public function clearCache(Dwoo $dwoo, $olderThan = -1) { $cachedFile = $this->getCacheFilename($dwoo); return !file_exists($cachedFile) || (filectime($cachedFile) < (time() - $olderThan) && unlink($cachedFile)); } /** * returns the compiled template file name * * @param Dwoo $dwoo the dwoo instance that requests it * @param Dwoo_ICompiler $compiler the compiler that must be used * @return string */ public function getCompiledTemplate(Dwoo $dwoo, Dwoo_ICompiler $compiler = null) { $compiledFile = $this->getCompiledFilename($dwoo); if ($this->compilationEnforced !== true && isset(self::$cache['compiled'][$this->compileId]) === true) { // already checked, return compiled file } elseif ($this->compilationEnforced !== true && $this->isValidCompiledFile($compiledFile)) { // template is compiled self::$cache['compiled'][$this->compileId] = true; } else { // compiles the template $this->compilationEnforced = false; if ($compiler === null) { $compiler = $dwoo->getDefaultCompilerFactory($this->getResourceName()); if ($compiler === null || $compiler === array('Dwoo_Compiler', 'compilerFactory')) { if (class_exists('Dwoo_Compiler', false) === false) { include DWOO_DIRECTORY . 'Dwoo/Compiler.php'; } $compiler = Dwoo_Compiler::compilerFactory(); } else { $compiler = call_user_func($compiler); } } $this->compiler = $compiler; $compiler->setCustomPlugins($dwoo->getCustomPlugins()); $compiler->setSecurityPolicy($dwoo->getSecurityPolicy()); $this->makeDirectory(dirname($compiledFile), $dwoo->getCompileDir()); file_put_contents($compiledFile, $compiler->compile($dwoo, $this)); if ($this->chmod !== null) { chmod($compiledFile, $this->chmod); } self::$cache['compiled'][$this->compileId] = true; } return $compiledFile; } /** * Checks if compiled file is valid (it exists) * * @param string file * @return boolean True cache file existance */ protected function isValidCompiledFile($file) { return file_exists($file); } /** * returns a new template string object with the resource id being the template source code * * @param Dwoo $dwoo the dwoo instance requiring it * @param mixed $resourceId the filename (relative to this template's dir) of the template to include * @param int $cacheTime duration of the cache validity for this template, * if null it defaults to the Dwoo instance that will * render this template * @param string $cacheId the unique cache identifier of this page or anything else that * makes this template's content unique, if null it defaults * to the current url * @param string $compileId the unique compiled identifier, which is used to distinguish this * template from others, if null it defaults to the filename+bits of the path * @param Dwoo_ITemplate $parentTemplate the template that is requesting a new template object (through * an include, extends or any other plugin) * @return Dwoo_Template_String */ public static function templateFactory(Dwoo $dwoo, $resourceId, $cacheTime = null, $cacheId = null, $compileId = null, Dwoo_ITemplate $parentTemplate = null) { return new self($resourceId, $cacheTime, $cacheId, $compileId); } /** * returns the full compiled file name and assigns a default value to it if * required * * @param Dwoo $dwoo the dwoo instance that requests the file name * @return string the full path to the compiled file */ protected function getCompiledFilename(Dwoo $dwoo) { // no compile id was provided, set default if ($this->compileId===null) { $this->compileId = $this->name; } return $dwoo->getCompileDir() . $this->compileId.'.d'.Dwoo::RELEASE_TAG.'.php'; } /** * returns the full cached file name and assigns a default value to it if * required * * @param Dwoo $dwoo the dwoo instance that requests the file name * @return string the full path to the cached file */ protected function getCacheFilename(Dwoo $dwoo) { // no cache id provided, use request_uri as default if ($this->cacheId === null) { if (isset($_SERVER['REQUEST_URI']) === true) { $cacheId = $_SERVER['REQUEST_URI']; } elseif (isset($_SERVER['SCRIPT_FILENAME']) && isset($_SERVER['argv'])) { $cacheId = $_SERVER['SCRIPT_FILENAME'].'-'.implode('-', $_SERVER['argv']); } else { $cacheId = ''; } // force compiled id generation $this->getCompiledFilename($dwoo); $this->cacheId = str_replace('../', '__', $this->compileId . strtr($cacheId, '\\%?=!:;'.PATH_SEPARATOR, '/-------')); } return $dwoo->getCacheDir() . $this->cacheId.'.html'; } /** * returns some php code that will check if this template has been modified or not * * if the function returns null, the template will be instanciated and then the Uid checked * * @return string */ public function getIsModifiedCode() { return null; } /** * ensures the given path exists * * @param string $path any path * @param string $baseDir the base directory where the directory is created * ($path must still contain the full path, $baseDir * is only used for unix permissions) */ protected function makeDirectory($path, $baseDir = null) { if (is_dir($path) === true) { return; } if ($this->chmod === null) { $chmod = 0777; } else { $chmod = $this->chmod; } mkdir($path, $chmod, true); // enforce the correct mode for all directories created if (strpos(PHP_OS, 'WIN') !== 0 && $baseDir !== null) { $path = strtr(str_replace($baseDir, '', $path), '\\', '/'); $folders = explode('/', trim($path, '/')); foreach ($folders as $folder) { $baseDir .= $folder . DIRECTORY_SEPARATOR; chmod($baseDir, $chmod); } } } } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/LICENSE000066400000000000000000000026561225466040700241400ustar00rootroot00000000000000Copyright (c) 2008, Dwoo / Jordi Boggiano All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Dwoo nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY JORDI BOGGIANO ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JORDI BOGGIANO BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/README000066400000000000000000000063451225466040700240120ustar00rootroot00000000000000----------------------------------------------------------------------------- -- WHAT IS DWOO? readme - version 1.0.0 ----------------------------------------------------------------------------- Dwoo is a PHP5 Template Engine that was started in early 2008. The idea came from the fact that Smarty, a well known template engine, is getting older and older. It carries the weight of it's age, having old features that are inconsistent compared to newer ones, being written for PHP4 its Object Oriented aspect doesn't take advantage of PHP5's more advanced features in the area, etc. Hence Dwoo was born, hoping to provide a more up to date and stronger engine. So far it has proven to be faster than Smarty in many areas, and it provides a compatibility layer to allow developers that have been using Smarty for years to switch their application over to Dwoo progressively. ----------------------------------------------------------------------------- -- DOCUMENTATION ----------------------------------------------------------------------------- Dwoo's website to get the latest version is at http://dwoo.org/ The wiki/documentation pages are available at http://wiki.dwoo.org/ ----------------------------------------------------------------------------- -- LICENSE ----------------------------------------------------------------------------- Dwoo is released under the Modified BSD license. See the LICENSE file included in the archive or go to the URL below to obtain a copy. http://dwoo.org/LICENSE ----------------------------------------------------------------------------- -- QUICK START - RUNNING DWOO ----------------------------------------------------------------------------- /***************************** Basic Example *******************************/ // Include the main class (it should handle the rest on its own) include 'path/to/dwooAutoload.php'; // Create the controller, this is reusable $dwoo = new Dwoo(); // Load a template file (name it as you please), this is reusable // if you want to render multiple times the same template with different data $tpl = new Dwoo_Template_File('path/to/index.tpl'); // Create a data set, if you don't like this you can directly input an // associative array in $dwoo->output() $data = new Dwoo_Data(); // Fill it with some data $data->assign('foo', 'BAR'); $data->assign('bar', 'BAZ'); // Outputs the result ... $dwoo->output($tpl, $data); // ... or get it to use it somewhere else $dwoo->get($tpl, $data); /***************************** Loop Example *******************************/ // To loop over multiple articles of a blog for instance, if you have a // template file representing an article, you could do the following : include 'path/to/dwooAutoload.php'; $dwoo = new Dwoo(); $tpl = new Dwoo_Template_File('path/to/article.tpl'); $pageContent = ''; // Loop over articles that have been retrieved from the DB foreach($articles as $article) { // Either associate variables one by one $data = new Dwoo_Data(); $data->assign('title', $article['title']; $data->assign('content', $article['content']); $pageContent .= $dwoo->get($tpl, $data); // Or use the article directly (which is a lot easier in this case) $pageContent .= $dwoo->get($tpl, $article); }nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/UPGRADE_NOTES000066400000000000000000000055531225466040700251140ustar00rootroot00000000000000----------------------------------------------------------------------------- -- Upgrading to Dwoo v1.0.0beta ----------------------------------------------------------------------------- 1. Dwoo classes loading ----------------------- While everything was previously included by Dwoo.php, this version introduces an autoload function (dwooAutoload) that handles this automatically. This means your choices are now : a) change your : include 'path/to/Dwoo.php'; into : include 'path/to/dwooAutoload.php'; this is the recommended setting, especially during development, so that if you are seeing a Dwoo error and want to report a bug, you get proper line numbers with the error and not just "error in Dwoo.compiled.php at line 2" b) use the compiled version of Dwoo, this is "experimental" and seems to provide better performances mostly under windows, with a linux server it might imrpove performances slightly if you have an opcode cache (APC, xcache, ..) : include 'path/to/Dwoo.compiled.php'; c) load Dwoo classes yourself somehow, as part of your autoload function or whatever suits you best ----------------------------------------------------------------------------- -- Upgrading to Dwoo v0.9.2 ----------------------------------------------------------------------------- 1. Block plugins ---------------- This version introduced a backward compatibility break with block plugins, this was needed to allow compile-time access to the block's (parsed) content, be very careful if you manipulate this content since it is php code and should remain so if you don't want syntax errors (which are fatal) during template run. Error message : Strict Standards: Declaration of Dwoo_Plugin_*::postProcessing() should be compatible with that of Dwoo_Block_Plugin::postProcessing() Solution : * Change your block plugins postProcessing method declaration to the following : public static function postProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $content) * Then add "$content" to the beginning of your return value, or modify it if required 2. Strip modifier ----------------- The strip modifier had the same name as the strip block, this worked when the block was hard coded within the compiler, but with the API change (see above) I was able to move it to a plugin. Since both plugins don't have the same purpose, there was a real problem and I had to rename it. The renaming will be handled by the smarty compatibility layer, but if you used it without smarty compatibility, you should edit your templates. 3. DWOO_COMPILE_DIRECTORY and DWOO_CACHE_DIRECTORY constants ------------------------------------------------------------ If you used those before, you will now get an exception when loading Dwoo. This is done on purpose to help people to make the transition to the new method of doing it : $dwoo = new Dwoo('myCompileDir', 'myCacheDir');nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/dwooAutoload.php000066400000000000000000000004071225466040700262750ustar00rootroot00000000000000 * * href : the target URI where the link must point * * rest : any other attributes you want to add to the tag can be added as named parameters * * * Example : * * * {* Create a simple link out of an url variable and add a special class attribute: *} * * {a $url class="external" /} * * {* Mark a link as active depending on some other variable : *} * * {a $link.url class=tif($link.active "active"); $link.title /} * * {* This is similar to: {$link.title} *} * * * This software is provided 'as-is', without any express or implied warranty. * In no event will the authors be held liable for any damages arising from the use of this software. * * @author Jordi Boggiano * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ class Dwoo_Plugin_a extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block { public function init($href, array $rest=array()) { } public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type) { $p = $compiler->getCompiledParams($params); $out = Dwoo_Compiler::PHP_OPEN . 'echo \'\';' . Dwoo_Compiler::PHP_CLOSE; } public static function postProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $content) { $p = $compiler->getCompiledParams($params); // no content was provided so use the url as display text if ($content == "") { // merge into the href if href is a string if (substr($p['href'], -1) === '"' || substr($p['href'], -1) === '\'') { return Dwoo_Compiler::PHP_OPEN . 'echo '.substr($p['href'], 0, -1).''.substr($p['href'], -1).';'.Dwoo_Compiler::PHP_CLOSE; } // otherwise append return Dwoo_Compiler::PHP_OPEN . 'echo '.$p['href'].'.\'\';'.Dwoo_Compiler::PHP_CLOSE; } // return content return $content . ''; } } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/plugins/builtin/blocks/auto_escape.php000066400000000000000000000033701225466040700325320ustar00rootroot00000000000000 * * enabled : if set to "on", "enable", true or 1 then the compiler autoescaping is enabled inside this block. set to "off", "disable", false or 0 to disable it * * This software is provided 'as-is', without any express or implied warranty. * In no event will the authors be held liable for any damages arising from the use of this software. * * @author Jordi Boggiano * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ class Dwoo_Plugin_auto_escape extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block { protected static $stack = array(); public function init($enabled) { } public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type) { $params = $compiler->getCompiledParams($params); switch(strtolower(trim((string) $params['enabled'], '"\''))) { case 'on': case 'true': case 'enabled': case 'enable': case '1': $enable = true; break; case 'off': case 'false': case 'disabled': case 'disable': case '0': $enable = false; break; default: throw new Dwoo_Compilation_Exception($compiler, 'Auto_Escape : Invalid parameter ('.$params['enabled'].'), valid parameters are "enable"/true or "disable"/false'); } self::$stack[] = $compiler->getAutoEscape(); $compiler->setAutoEscape($enable); return ''; } public static function postProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $content) { $compiler->setAutoEscape(array_pop(self::$stack)); return $content; } } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/plugins/builtin/blocks/block.php000066400000000000000000000021541225466040700313330ustar00rootroot00000000000000 * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ class Dwoo_Plugin_block extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block { public function init($name='') { } public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type) { return ''; } public static function postProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $content) { return $content; } } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/plugins/builtin/blocks/capture.php000066400000000000000000000042631225466040700317070ustar00rootroot00000000000000 * * name : capture name, used to read the value afterwards * * assign : if set, the value is also saved in the given variable * * cat : if true, the value is appended to the previous one (if any) instead of overwriting it * * If the cat parameter is true, the content * will be appended to the existing content * * Example : * * * {capture "foo"} * Anything in here won't show, it will be saved for later use.. * {/capture} * Output was : {$.capture.foo} * * * This software is provided 'as-is', without any express or implied warranty. * In no event will the authors be held liable for any damages arising from the use of this software. * * @author Jordi Boggiano * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ class Dwoo_Plugin_capture extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block { public function init($name = 'default', $assign = null, $cat = false, $trim = false) { } public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type) { return Dwoo_Compiler::PHP_OPEN.$prepend.'ob_start();'.$append.Dwoo_Compiler::PHP_CLOSE; } public static function postProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $content) { $params = $compiler->getCompiledParams($params); $out = $content . Dwoo_Compiler::PHP_OPEN.$prepend."\n".'$tmp = ob_get_clean();'; if ($params['trim'] !== 'false' && $params['trim'] !== 0) { $out .= "\n".'$tmp = trim($tmp);'; } if ($params['cat'] === 'true' || $params['cat'] === 1) { $out .= "\n".'$tmp = $this->readVar(\'dwoo.capture.\'.'.$params['name'].') . $tmp;'; } if ($params['assign'] !== 'null') { $out .= "\n".'$this->scope['.$params['assign'].'] = $tmp;'; } return $out . "\n".'$this->globals[\'capture\']['.$params['name'].'] = $tmp;'.$append.Dwoo_Compiler::PHP_CLOSE; } } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/plugins/builtin/blocks/dynamic.php000066400000000000000000000037161225466040700316720ustar00rootroot00000000000000 * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ class Dwoo_Plugin_dynamic extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block { public function init() { } public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type) { return ''; } public static function postProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $content) { $output = Dwoo_Compiler::PHP_OPEN . 'if($doCache) {'."\n\t". 'echo \''. str_replace('\'', '\\\'', $content) . '\';'. "\n} else {\n\t"; if(substr($content, 0, strlen(Dwoo_Compiler::PHP_OPEN)) == Dwoo_Compiler::PHP_OPEN) { $output .= substr($content, strlen(Dwoo_Compiler::PHP_OPEN)); } else { $output .= Dwoo_Compiler::PHP_CLOSE . $content; } if(substr($output, -strlen(Dwoo_Compiler::PHP_CLOSE)) == Dwoo_Compiler::PHP_CLOSE) { $output = substr($output, 0, -strlen(Dwoo_Compiler::PHP_CLOSE)); } else { $output .= Dwoo_Compiler::PHP_OPEN; } $output .= "\n}". Dwoo_Compiler::PHP_CLOSE; return $output; } public static function unescape($output, $dynamicId) { return preg_replace_callback('/(.+?)<\/dwoo:dynamic_'.$dynamicId.'>/', array('self', 'unescapePhp'), $output); } public static function unescapePhp($match) { return preg_replace('{<\?php /\*'.$match[1].'\*/ echo \'(.+?)\'; \?>}', '$1', $match[2]); } } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/plugins/builtin/blocks/else.php000066400000000000000000000036541225466040700311770ustar00rootroot00000000000000 * {foreach $array val} * $array is not empty so we display it's values : {$val} * {else} * if this shows, it means that $array is empty or doesn't exist. * {/foreach} * * * This software is provided 'as-is', without any express or implied warranty. * In no event will the authors be held liable for any damages arising from the use of this software. * * @author Jordi Boggiano * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ class Dwoo_Plugin_else extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block { public function init() { } public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type) { $preContent = ''; while (true) { $preContent .= $compiler->removeTopBlock(); $block =& $compiler->getCurrentBlock(); $interfaces = class_implements($block['class'], false); if (in_array('Dwoo_IElseable', $interfaces) !== false) { break; } } $params['initialized'] = true; $compiler->injectBlock($type, $params); return $preContent; } public static function postProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $content) { if (!isset($params['initialized'])) { return ''; } $block =& $compiler->getCurrentBlock(); $block['params']['hasElse'] = Dwoo_Compiler::PHP_OPEN."else {\n".Dwoo_Compiler::PHP_CLOSE . $content . Dwoo_Compiler::PHP_OPEN."\n}".Dwoo_Compiler::PHP_CLOSE; return ''; } } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/plugins/builtin/blocks/elseif.php000066400000000000000000000034711225466040700315130ustar00rootroot00000000000000 * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ class Dwoo_Plugin_elseif extends Dwoo_Plugin_if implements Dwoo_ICompilable_Block, Dwoo_IElseable { public function init(array $rest) { } public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type) { $preContent = ''; while (true) { $preContent .= $compiler->removeTopBlock(); $block =& $compiler->getCurrentBlock(); $interfaces = class_implements($block['class'], false); if (in_array('Dwoo_IElseable', $interfaces) !== false) { break; } } $params['initialized'] = true; $compiler->injectBlock($type, $params); return $preContent; } public static function postProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $content) { if (!isset($params['initialized'])) { return ''; } $params = $compiler->getCompiledParams($params); $pre = Dwoo_Compiler::PHP_OPEN."elseif (".implode(' ', self::replaceKeywords($params['*'], $compiler)).") {\n" . Dwoo_Compiler::PHP_CLOSE; $post = Dwoo_Compiler::PHP_OPEN."\n}".Dwoo_Compiler::PHP_CLOSE; if (isset($params['hasElse'])) { $post .= $params['hasElse']; } $block =& $compiler->getCurrentBlock(); $block['params']['hasElse'] = $pre . $content . $post; return ''; } } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/plugins/builtin/blocks/for.php000066400000000000000000000144171225466040700310340ustar00rootroot00000000000000 * * name : for name to access it's iterator variables through {$.for.name.var} see {@link http://wiki.dwoo.org/index.php/IteratorVariables} for details * * from : array to iterate from (which equals 0) or a number as a start value * * to : value to stop iterating at (equals count($array) by default if you set an array in from) * * step : defines the incrementation of the pointer at each iteration * * This software is provided 'as-is', without any express or implied warranty. * In no event will the authors be held liable for any damages arising from the use of this software. * * @author Jordi Boggiano * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.1.0 * @date 2009-07-18 * @package Dwoo */ class Dwoo_Plugin_for extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block, Dwoo_IElseable { public static $cnt=0; public function init($name, $from, $to=null, $step=1, $skip=0) { } public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type) { // get block params and save the current template pointer to use it in the postProcessing method $currentBlock =& $compiler->getCurrentBlock(); $currentBlock['params']['tplPointer'] = $compiler->getPointer(); return ''; } public static function postProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $content) { $params = $compiler->getCompiledParams($params); $tpl = $compiler->getTemplateSource($params['tplPointer']); // assigns params $from = $params['from']; $name = $params['name']; $step = $params['step']; $to = $params['to']; // evaluates which global variables have to be computed $varName = '$dwoo.for.'.trim($name, '"\'').'.'; $shortVarName = '$.for.'.trim($name, '"\'').'.'; $usesAny = strpos($tpl, $varName) !== false || strpos($tpl, $shortVarName) !== false; $usesFirst = strpos($tpl, $varName.'first') !== false || strpos($tpl, $shortVarName.'first') !== false; $usesLast = strpos($tpl, $varName.'last') !== false || strpos($tpl, $shortVarName.'last') !== false; $usesIndex = strpos($tpl, $varName.'index') !== false || strpos($tpl, $shortVarName.'index') !== false; $usesIteration = $usesFirst || $usesLast || strpos($tpl, $varName.'iteration') !== false || strpos($tpl, $shortVarName.'iteration') !== false; $usesShow = strpos($tpl, $varName.'show') !== false || strpos($tpl, $shortVarName.'show') !== false; $usesTotal = $usesLast || strpos($tpl, $varName.'total') !== false || strpos($tpl, $shortVarName.'total') !== false; if (strpos($name, '$this->scope[') !== false) { $usesAny = $usesFirst = $usesLast = $usesIndex = $usesIteration = $usesShow = $usesTotal = true; } // gets foreach id $cnt = self::$cnt++; // builds pre processing output for $out = Dwoo_Compiler::PHP_OPEN . "\n".'$_for'.$cnt.'_from = '.$from.';'. "\n".'$_for'.$cnt.'_to = '.$to.';'. "\n".'$_for'.$cnt.'_step = abs('.$step.');'. "\n".'if (is_numeric($_for'.$cnt.'_from) && !is_numeric($_for'.$cnt.'_to)) { $this->triggerError(\'For requires the to parameter when using a numerical from\'); }'. "\n".'$tmp_shows = $this->isArray($_for'.$cnt.'_from, true) || (is_numeric($_for'.$cnt.'_from) && (abs(($_for'.$cnt.'_from - $_for'.$cnt.'_to)/$_for'.$cnt.'_step) !== 0 || $_for'.$cnt.'_from == $_for'.$cnt.'_to));'; // adds foreach properties if ($usesAny) { $out .= "\n".'$this->globals["for"]['.$name.'] = array'."\n("; if ($usesIndex) $out .="\n\t".'"index" => 0,'; if ($usesIteration) $out .="\n\t".'"iteration" => 1,'; if ($usesFirst) $out .="\n\t".'"first" => null,'; if ($usesLast) $out .="\n\t".'"last" => null,'; if ($usesShow) $out .="\n\t".'"show" => $tmp_shows,'; if ($usesTotal) $out .="\n\t".'"total" => $this->isArray($_for'.$cnt.'_from) ? floor(count($_for'.$cnt.'_from) / $_for'.$cnt.'_step) : (is_numeric($_for'.$cnt.'_from) ? abs(($_for'.$cnt.'_to + 1 - $_for'.$cnt.'_from)/$_for'.$cnt.'_step) : 0),'; $out.="\n);\n".'$_for'.$cnt.'_glob =& $this->globals["for"]['.$name.'];'; } // checks if for must be looped $out .= "\n".'if ($tmp_shows)'."\n{"; // set from/to to correct values if an array was given $out .= "\n\t".'if ($this->isArray($_for'.$cnt.'_from, true)) { $_for'.$cnt.'_to = is_numeric($_for'.$cnt.'_to) ? $_for'.$cnt.'_to - $_for'.$cnt.'_step : count($_for'.$cnt.'_from) - 1; $_for'.$cnt.'_from = 0; }'; // if input are pure numbers it shouldn't reorder them, if it's variables it gets too messy though so in that case a counter should be used $reverse = false; $condition = '<='; $incrementer = '+'; if (preg_match('{^(["\']?)([0-9]+)\1$}', $from, $mN1) && preg_match('{^(["\']?)([0-9]+)\1$}', $to, $mN2)) { $from = (int) $mN1[2]; $to = (int) $mN2[2]; if ($from > $to) { $reverse = true; $condition = '>='; $incrementer = '-'; } } // reverse from and to if needed if (!$reverse) { $out .= "\n\t".'if ($_for'.$cnt.'_from > $_for'.$cnt.'_to) { $tmp = $_for'.$cnt.'_from; $_for'.$cnt.'_from = $_for'.$cnt.'_to; $_for'.$cnt.'_to = $tmp; }'; } $out .= ' for ($this->scope['.$name.'] = $_for'.$cnt.'_from; $this->scope['.$name.'] '.$condition.' $_for'.$cnt.'_to; $this->scope['.$name.'] '.$incrementer.'= $_for'.$cnt.'_step)'."\n\t{"; // updates properties if ($usesIndex) { $out .="\n\t\t".'$_for'.$cnt.'_glob["index"] = $this->scope['.$name.'];'; } if ($usesFirst) { $out .= "\n\t\t".'$_for'.$cnt.'_glob["first"] = (string) ($_for'.$cnt.'_glob["iteration"] === 1);'; } if ($usesLast) { $out .= "\n\t\t".'$_for'.$cnt.'_glob["last"] = (string) ($_for'.$cnt.'_glob["iteration"] === $_for'.$cnt.'_glob["total"]);'; } $out .= "\n/* -- for start output */\n".Dwoo_Compiler::PHP_CLOSE; // build post processing output and cache it $postOut = Dwoo_Compiler::PHP_OPEN . '/* -- for end output */'; // update properties if ($usesIteration) { $postOut .= "\n\t\t".'$_for'.$cnt.'_glob["iteration"]+=1;'; } // end loop $postOut .= "\n\t}\n}\n".Dwoo_Compiler::PHP_CLOSE; if (isset($params['hasElse'])) { $postOut .= $params['hasElse']; } return $out . $content . $postOut; } } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/plugins/builtin/blocks/foreach.php000066400000000000000000000135101225466040700316460ustar00rootroot00000000000000 * * from : the array that you want to iterate over * * key : variable name for the key (or for the item if item is not defined) * * item : variable name for each item * * name : foreach name to access it's iterator variables through {$.foreach.name.var} see {@link http://wiki.dwoo.org/index.php/IteratorVariables} for details * * Example : * * * {foreach $array val} * {$val.something} * {/foreach} * * * This software is provided 'as-is', without any express or implied warranty. * In no event will the authors be held liable for any damages arising from the use of this software. * * @author Jordi Boggiano * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.1.0 * @date 2009-07-18 * @package Dwoo */ class Dwoo_Plugin_foreach extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block, Dwoo_IElseable { public static $cnt=0; public function init($from, $key=null, $item=null, $name='default', $implode=null) { } public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type) { // get block params and save the current template pointer to use it in the postProcessing method $currentBlock =& $compiler->getCurrentBlock(); $currentBlock['params']['tplPointer'] = $compiler->getPointer(); return ''; } public static function postProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $content) { $params = $compiler->getCompiledParams($params); $tpl = $compiler->getTemplateSource($params['tplPointer']); // assigns params $src = $params['from']; if ($params['item'] !== 'null') { if ($params['key'] !== 'null') { $key = $params['key']; } $val = $params['item']; } elseif ($params['key'] !== 'null') { $val = $params['key']; } else { throw new Dwoo_Compilation_Exception($compiler, 'Foreach item parameter missing'); } $name = $params['name']; if (substr($val, 0, 1) !== '"' && substr($val, 0, 1) !== '\'') { throw new Dwoo_Compilation_Exception($compiler, 'Foreach item parameter must be of type string'); } if (isset($key) && substr($val, 0, 1) !== '"' && substr($val, 0, 1) !== '\'') { throw new Dwoo_Compilation_Exception($compiler, 'Foreach key parameter must be of type string'); } // evaluates which global variables have to be computed $varName = '$dwoo.foreach.'.trim($name, '"\'').'.'; $shortVarName = '$.foreach.'.trim($name, '"\'').'.'; $usesAny = strpos($tpl, $varName) !== false || strpos($tpl, $shortVarName) !== false; $usesFirst = strpos($tpl, $varName.'first') !== false || strpos($tpl, $shortVarName.'first') !== false; $usesLast = strpos($tpl, $varName.'last') !== false || strpos($tpl, $shortVarName.'last') !== false; $usesIndex = $usesFirst || strpos($tpl, $varName.'index') !== false || strpos($tpl, $shortVarName.'index') !== false; $usesIteration = $usesLast || strpos($tpl, $varName.'iteration') !== false || strpos($tpl, $shortVarName.'iteration') !== false; $usesShow = strpos($tpl, $varName.'show') !== false || strpos($tpl, $shortVarName.'show') !== false; $usesTotal = $usesLast || strpos($tpl, $varName.'total') !== false || strpos($tpl, $shortVarName.'total') !== false; if (strpos($name, '$this->scope[') !== false) { $usesAny = $usesFirst = $usesLast = $usesIndex = $usesIteration = $usesShow = $usesTotal = true; } // override globals vars if implode is used if ($params['implode'] !== 'null') { $implode = $params['implode']; $usesAny = true; $usesLast = true; $usesIteration = true; $usesTotal = true; } // gets foreach id $cnt = self::$cnt++; // build pre content output $pre = Dwoo_Compiler::PHP_OPEN . "\n".'$_fh'.$cnt.'_data = '.$src.';'; // adds foreach properties if ($usesAny) { $pre .= "\n".'$this->globals["foreach"]['.$name.'] = array'."\n("; if ($usesIndex) $pre .="\n\t".'"index" => 0,'; if ($usesIteration) $pre .="\n\t".'"iteration" => 1,'; if ($usesFirst) $pre .="\n\t".'"first" => null,'; if ($usesLast) $pre .="\n\t".'"last" => null,'; if ($usesShow) $pre .="\n\t".'"show" => $this->isArray($_fh'.$cnt.'_data, true),'; if ($usesTotal) $pre .="\n\t".'"total" => $this->isArray($_fh'.$cnt.'_data) ? count($_fh'.$cnt.'_data) : 0,'; $pre.="\n);\n".'$_fh'.$cnt.'_glob =& $this->globals["foreach"]['.$name.'];'; } // checks if foreach must be looped $pre .= "\n".'if ($this->isArray($_fh'.$cnt.'_data'.(isset($params['hasElse']) ? ', true' : '').') === true)'."\n{"; // iterates over keys $pre .= "\n\t".'foreach ($_fh'.$cnt.'_data as '.(isset($key)?'$this->scope['.$key.']=>':'').'$this->scope['.$val.'])'."\n\t{"; // updates properties if ($usesFirst) { $pre .= "\n\t\t".'$_fh'.$cnt.'_glob["first"] = (string) ($_fh'.$cnt.'_glob["index"] === 0);'; } if ($usesLast) { $pre .= "\n\t\t".'$_fh'.$cnt.'_glob["last"] = (string) ($_fh'.$cnt.'_glob["iteration"] === $_fh'.$cnt.'_glob["total"]);'; } $pre .= "\n/* -- foreach start output */\n".Dwoo_Compiler::PHP_CLOSE; // build post content output $post = Dwoo_Compiler::PHP_OPEN . "\n"; if (isset($implode)) { $post .= '/* -- implode */'."\n".'if (!$_fh'.$cnt.'_glob["last"]) {'. "\n\t".'echo '.$implode.";\n}\n"; } $post .= '/* -- foreach end output */'; // update properties if ($usesIndex) { $post.="\n\t\t".'$_fh'.$cnt.'_glob["index"]+=1;'; } if ($usesIteration) { $post.="\n\t\t".'$_fh'.$cnt.'_glob["iteration"]+=1;'; } // end loop $post .= "\n\t}\n}".Dwoo_Compiler::PHP_CLOSE; if (isset($params['hasElse'])) { $post .= $params['hasElse']; } return $pre . $content . $post; } } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/plugins/builtin/blocks/foreachelse.php000066400000000000000000000024341225466040700325220ustar00rootroot00000000000000 * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ class Dwoo_Plugin_foreachelse extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block { public function init() { } public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type) { $with =& $compiler->findBlock('foreach', true); $params['initialized'] = true; $compiler->injectBlock($type, $params); return ''; } public static function postProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $content) { if (!isset($params['initialized'])) { return ''; } $block =& $compiler->getCurrentBlock(); $block['params']['hasElse'] = Dwoo_Compiler::PHP_OPEN."else {\n".Dwoo_Compiler::PHP_CLOSE . $content . Dwoo_Compiler::PHP_OPEN."\n}".Dwoo_Compiler::PHP_CLOSE; return ''; } } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/plugins/builtin/blocks/forelse.php000066400000000000000000000024201225466040700316740ustar00rootroot00000000000000 * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ class Dwoo_Plugin_forelse extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block { public function init() { } public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type) { $with =& $compiler->findBlock('for', true); $params['initialized'] = true; $compiler->injectBlock($type, $params); return ''; } public static function postProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $content) { if (!isset($params['initialized'])) { return ''; } $block =& $compiler->getCurrentBlock(); $block['params']['hasElse'] = Dwoo_Compiler::PHP_OPEN."else {\n".Dwoo_Compiler::PHP_CLOSE . $content . Dwoo_Compiler::PHP_OPEN."\n}".Dwoo_Compiler::PHP_CLOSE; return ''; } } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/plugins/builtin/blocks/if.php000066400000000000000000000107461225466040700306450ustar00rootroot00000000000000 == * neq or ne -> != * gte or ge -> >= * lte or le -> <= * gt -> > * lt -> < * mod -> % * not -> ! * X is [not] div by Y -> (X % Y) == 0 * X is [not] even [by Y] -> (X % 2) == 0 or ((X/Y) % 2) == 0 * X is [not] odd [by Y] -> (X % 2) != 0 or ((X/Y) % 2) != 0 * * This software is provided 'as-is', without any express or implied warranty. * In no event will the authors be held liable for any damages arising from the use of this software. * * @author Jordi Boggiano * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ class Dwoo_Plugin_if extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block, Dwoo_IElseable { public function init(array $rest) { } public static function replaceKeywords(array $params, Dwoo_Compiler $compiler) { $p = array(); reset($params); while (list($k,$v) = each($params)) { $v = (string) $v; if(substr($v, 0, 1) === '"' || substr($v, 0, 1) === '\'') { $vmod = strtolower(substr($v, 1, -1)); } else { $vmod = strtolower($v); } switch($vmod) { case 'and': $p[] = '&&'; break; case 'or': $p[] = '||'; break; case '==': case 'eq': $p[] = '=='; break; case '<>': case '!=': case 'ne': case 'neq': $p[] = '!='; break; case '>=': case 'gte': case 'ge': $p[] = '>='; break; case '<=': case 'lte': case 'le': $p[] = '<='; break; case '>': case 'gt': $p[] = '>'; break; case '<': case 'lt': $p[] = '<'; break; case '===': $p[] = '==='; break; case '!==': $p[] = '!=='; break; case 'is': if (isset($params[$k+1]) && strtolower(trim($params[$k+1], '"\'')) === 'not') { $negate = true; next($params); } else { $negate = false; } $ptr = 1+(int)$negate; if (!isset($params[$k+$ptr])) { $params[$k+$ptr] = ''; } else { $params[$k+$ptr] = trim($params[$k+$ptr], '"\''); } switch($params[$k+$ptr]) { case 'div': if (isset($params[$k+$ptr+1]) && strtolower(trim($params[$k+$ptr+1], '"\'')) === 'by') { $p[] = ' % '.$params[$k+$ptr+2].' '.($negate?'!':'=').'== 0'; next($params); next($params); next($params); } else { throw new Dwoo_Compilation_Exception($compiler, 'If : Syntax error : syntax should be "if $a is [not] div by $b", found '.$params[$k-1].' is '.($negate?'not ':'').'div '.$params[$k+$ptr+1].' '.$params[$k+$ptr+2]); } break; case 'even': $a = array_pop($p); if (isset($params[$k+$ptr+1]) && strtolower(trim($params[$k+$ptr+1], '"\'')) === 'by') { $b = $params[$k+$ptr+2]; $p[] = '('.$a .' / '.$b.') % 2 '.($negate?'!':'=').'== 0'; next($params); next($params); } else { $p[] = $a.' % 2 '.($negate?'!':'=').'== 0'; } next($params); break; case 'odd': $a = array_pop($p); if (isset($params[$k+$ptr+1]) && strtolower(trim($params[$k+$ptr+1], '"\'')) === 'by') { $b = $params[$k+$ptr+2]; $p[] = '('.$a .' / '.$b.') % 2 '.($negate?'=':'!').'== 0'; next($params); next($params); } else { $p[] = $a.' % 2 '.($negate?'=':'!').'== 0'; } next($params); break; default: throw new Dwoo_Compilation_Exception($compiler, 'If : Syntax error : syntax should be "if $a is [not] (div|even|odd) [by $b]", found '.$params[$k-1].' is '.$params[$k+$ptr+1]); } break; case '%': case 'mod': $p[] = '%'; break; case '!': case 'not': $p[] = '!'; break; default: $p[] = $v; } } return $p; } public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type) { return ''; } public static function postProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $content) { $params = $compiler->getCompiledParams($params); $pre = Dwoo_Compiler::PHP_OPEN.'if ('.implode(' ', self::replaceKeywords($params['*'], $compiler)).") {\n".Dwoo_Compiler::PHP_CLOSE; $post = Dwoo_Compiler::PHP_OPEN."\n}".Dwoo_Compiler::PHP_CLOSE; if (isset($params['hasElse'])) { $post .= $params['hasElse']; } return $pre . $content . $post; } } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/plugins/builtin/blocks/loop.php000066400000000000000000000117661225466040700312230ustar00rootroot00000000000000 * * from : the array that you want to iterate over * * name : loop name to access it's iterator variables through {$.loop.name.var} see {@link http://wiki.dwoo.org/index.php/IteratorVariables} for details * * Example : * * instead of a foreach block such as : * * * {foreach $variable value} * {$value.foo} {$value.bar} * {/foreach} * * * you can do : * * * {loop $variable} * {$foo} {$bar} * {/loop} * * * This software is provided 'as-is', without any express or implied warranty. * In no event will the authors be held liable for any damages arising from the use of this software. * * @author Jordi Boggiano * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.1.0 * @date 2009-07-18 * @package Dwoo */ class Dwoo_Plugin_loop extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block, Dwoo_IElseable { public static $cnt=0; public function init($from, $name='default') { } public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type) { // get block params and save the current template pointer to use it in the postProcessing method $currentBlock =& $compiler->getCurrentBlock(); $currentBlock['params']['tplPointer'] = $compiler->getPointer(); return ''; } public static function postProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $content) { $params = $compiler->getCompiledParams($params); $tpl = $compiler->getTemplateSource($params['tplPointer']); // assigns params $src = $params['from']; $name = $params['name']; // evaluates which global variables have to be computed $varName = '$dwoo.loop.'.trim($name, '"\'').'.'; $shortVarName = '$.loop.'.trim($name, '"\'').'.'; $usesAny = strpos($tpl, $varName) !== false || strpos($tpl, $shortVarName) !== false; $usesFirst = strpos($tpl, $varName.'first') !== false || strpos($tpl, $shortVarName.'first') !== false; $usesLast = strpos($tpl, $varName.'last') !== false || strpos($tpl, $shortVarName.'last') !== false; $usesIndex = $usesFirst || strpos($tpl, $varName.'index') !== false || strpos($tpl, $shortVarName.'index') !== false; $usesIteration = $usesLast || strpos($tpl, $varName.'iteration') !== false || strpos($tpl, $shortVarName.'iteration') !== false; $usesShow = strpos($tpl, $varName.'show') !== false || strpos($tpl, $shortVarName.'show') !== false; $usesTotal = $usesLast || strpos($tpl, $varName.'total') !== false || strpos($tpl, $shortVarName.'total') !== false; if (strpos($name, '$this->scope[') !== false) { $usesAny = $usesFirst = $usesLast = $usesIndex = $usesIteration = $usesShow = $usesTotal = true; } // gets foreach id $cnt = self::$cnt++; // builds pre processing output $pre = Dwoo_Compiler::PHP_OPEN . "\n".'$_loop'.$cnt.'_data = '.$src.';'; // adds foreach properties if ($usesAny) { $pre .= "\n".'$this->globals["loop"]['.$name.'] = array'."\n("; if ($usesIndex) $pre .="\n\t".'"index" => 0,'; if ($usesIteration) $pre .="\n\t".'"iteration" => 1,'; if ($usesFirst) $pre .="\n\t".'"first" => null,'; if ($usesLast) $pre .="\n\t".'"last" => null,'; if ($usesShow) $pre .="\n\t".'"show" => $this->isArray($_loop'.$cnt.'_data, true),'; if ($usesTotal) $pre .="\n\t".'"total" => $this->isArray($_loop'.$cnt.'_data) ? count($_loop'.$cnt.'_data) : 0,'; $pre.="\n);\n".'$_loop'.$cnt.'_glob =& $this->globals["loop"]['.$name.'];'; } // checks if the loop must be looped $pre .= "\n".'if ($this->isArray($_loop'.$cnt.'_data'.(isset($params['hasElse']) ? ', true' : '').') === true)'."\n{"; // iterates over keys $pre .= "\n\t".'foreach ($_loop'.$cnt.'_data as $tmp_key => $this->scope["-loop-"])'."\n\t{"; // updates properties if ($usesFirst) { $pre .= "\n\t\t".'$_loop'.$cnt.'_glob["first"] = (string) ($_loop'.$cnt.'_glob["index"] === 0);'; } if ($usesLast) { $pre .= "\n\t\t".'$_loop'.$cnt.'_glob["last"] = (string) ($_loop'.$cnt.'_glob["iteration"] === $_loop'.$cnt.'_glob["total"]);'; } $pre .= "\n\t\t".'$_loop'.$cnt.'_scope = $this->setScope(array("-loop-"));' . "\n/* -- loop start output */\n".Dwoo_Compiler::PHP_CLOSE; // build post processing output and cache it $post = Dwoo_Compiler::PHP_OPEN . "\n".'/* -- loop end output */'."\n\t\t".'$this->setScope($_loop'.$cnt.'_scope, true);'; // update properties if ($usesIndex) { $post.="\n\t\t".'$_loop'.$cnt.'_glob["index"]+=1;'; } if ($usesIteration) { $post.="\n\t\t".'$_loop'.$cnt.'_glob["iteration"]+=1;'; } // end loop $post .= "\n\t}\n}\n" . Dwoo_Compiler::PHP_CLOSE; if (isset($params['hasElse'])) { $post .= $params['hasElse']; } return $pre . $content . $post; } } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/plugins/builtin/blocks/section.php000066400000000000000000000132431225466040700317060ustar00rootroot00000000000000 * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ class Dwoo_Plugin_section extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block, Dwoo_IElseable { public static $cnt=0; public function init($name, $loop, $start = null, $step = null, $max = null, $show = true) { } public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type) { return ''; } public static function postProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $content) { $output = Dwoo_Compiler::PHP_OPEN; $params = $compiler->getCompiledParams($params); // assigns params $loop = $params['loop']; $start = $params['start']; $max = $params['max']; $name = $params['name']; $step = $params['step']; $show = $params['show']; // gets unique id $cnt = self::$cnt++; $output .= '$this->globals[\'section\']['.$name.'] = array();'."\n". '$_section'.$cnt.' =& $this->globals[\'section\']['.$name.'];'."\n"; if ($loop !== 'null') { $output .= '$_section'.$cnt.'[\'loop\'] = is_array($tmp = '.$loop.') ? count($tmp) : max(0, (int) $tmp);'."\n"; } else { $output .= '$_section'.$cnt.'[\'loop\'] = 1;'."\n"; } if ($show !== 'null') { $output .= '$_section'.$cnt.'[\'show\'] = '.$show.";\n"; } else { $output .= '$_section'.$cnt.'[\'show\'] = true;'."\n"; } if ($name !== 'null') { $output .= '$_section'.$cnt.'[\'name\'] = '.$name.";\n"; } else { $output .= '$_section'.$cnt.'[\'name\'] = true;'."\n"; } if ($max !== 'null') { $output .= '$_section'.$cnt.'[\'max\'] = (int)'.$max.";\n". 'if($_section'.$cnt.'[\'max\'] < 0) { $_section'.$cnt.'[\'max\'] = $_section'.$cnt.'[\'loop\']; }'."\n"; } else { $output .= '$_section'.$cnt.'[\'max\'] = $_section'.$cnt.'[\'loop\'];'."\n"; } if ($step !== 'null') { $output .= '$_section'.$cnt.'[\'step\'] = (int)'.$step.' == 0 ? 1 : (int) '.$step.";\n"; } else { $output .= '$_section'.$cnt.'[\'step\'] = 1;'."\n"; } if ($start !== 'null') { $output .= '$_section'.$cnt.'[\'start\'] = (int)'.$start.";\n"; } else { $output .= '$_section'.$cnt.'[\'start\'] = $_section'.$cnt.'[\'step\'] > 0 ? 0 : $_section'.$cnt.'[\'loop\'] - 1;'."\n". 'if ($_section'.$cnt.'[\'start\'] < 0) { $_section'.$cnt.'[\'start\'] = max($_section'.$cnt.'[\'step\'] > 0 ? 0 : -1, $_section'.$cnt.'[\'loop\'] + $_section'.$cnt.'[\'start\']); } '."\n". 'else { $_section'.$cnt.'[\'start\'] = min($_section'.$cnt.'[\'start\'], $_section'.$cnt.'[\'step\'] > 0 ? $_section'.$cnt.'[\'loop\'] : $_section'.$cnt.'[\'loop\'] -1); }'."\n"; } /* if ($usesAny) { $output .= "\n".'$this->globals["section"]['.$name.'] = array'."\n("; if ($usesIndex) $output .="\n\t".'"index" => 0,'; if ($usesIteration) $output .="\n\t".'"iteration" => 1,'; if ($usesFirst) $output .="\n\t".'"first" => null,'; if ($usesLast) $output .="\n\t".'"last" => null,'; if ($usesShow) $output .="\n\t".'"show" => ($this->isArray($_for'.$cnt.'_from, true)) || (is_numeric($_for'.$cnt.'_from) && $_for'.$cnt.'_from != $_for'.$cnt.'_to),'; if ($usesTotal) $output .="\n\t".'"total" => $this->isArray($_for'.$cnt.'_from) ? count($_for'.$cnt.'_from) - $_for'.$cnt.'_skip : (is_numeric($_for'.$cnt.'_from) ? abs(($_for'.$cnt.'_to + 1 - $_for'.$cnt.'_from)/$_for'.$cnt.'_step) : 0),'; $out.="\n);\n".'$_section'.$cnt.'[\'glob\'] =& $this->globals["section"]['.$name.'];'."\n\n"; } */ $output .= 'if ($_section'.$cnt.'[\'show\']) {'."\n"; if ($start === 'null' && $step === 'null' && $max === 'null') { $output .= ' $_section'.$cnt.'[\'total\'] = $_section'.$cnt.'[\'loop\'];'."\n"; } else { $output .= ' $_section'.$cnt.'[\'total\'] = min(ceil(($_section'.$cnt.'[\'step\'] > 0 ? $_section'.$cnt.'[\'loop\'] - $_section'.$cnt.'[\'start\'] : $_section'.$cnt.'[\'start\'] + 1) / abs($_section'.$cnt.'[\'step\'])), $_section'.$cnt.'[\'max\']);'."\n"; } $output .= ' if ($_section'.$cnt.'[\'total\'] == 0) {'."\n". ' $_section'.$cnt.'[\'show\'] = false;'."\n". ' }'."\n". '} else {'."\n". ' $_section'.$cnt.'[\'total\'] = 0;'."\n}\n"; $output .= 'if ($_section'.$cnt.'[\'show\']) {'."\n"; $output .= "\t".'for ($this->scope['.$name.'] = $_section'.$cnt.'[\'start\'], $_section'.$cnt.'[\'iteration\'] = 1; '. '$_section'.$cnt.'[\'iteration\'] <= $_section'.$cnt.'[\'total\']; '. '$this->scope['.$name.'] += $_section'.$cnt.'[\'step\'], $_section'.$cnt.'[\'iteration\']++) {'."\n"; $output .= "\t\t".'$_section'.$cnt.'[\'rownum\'] = $_section'.$cnt.'[\'iteration\'];'."\n"; $output .= "\t\t".'$_section'.$cnt.'[\'index_prev\'] = $this->scope['.$name.'] - $_section'.$cnt.'[\'step\'];'."\n"; $output .= "\t\t".'$_section'.$cnt.'[\'index_next\'] = $this->scope['.$name.'] + $_section'.$cnt.'[\'step\'];'."\n"; $output .= "\t\t".'$_section'.$cnt.'[\'first\'] = ($_section'.$cnt.'[\'iteration\'] == 1);'."\n"; $output .= "\t\t".'$_section'.$cnt.'[\'last\'] = ($_section'.$cnt.'[\'iteration\'] == $_section'.$cnt.'[\'total\']);'."\n"; $output .= Dwoo_Compiler::PHP_CLOSE . $content . Dwoo_Compiler::PHP_OPEN; $output .= "\n\t}\n} " . Dwoo_Compiler::PHP_CLOSE; if (isset($params['hasElse'])) { $output .= $params['hasElse']; } return $output; } } smartyinterface.php000066400000000000000000000044511225466040700333640ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/plugins/builtin/blocks * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ class Dwoo_Plugin_smartyinterface extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block { public function init($__funcname, $__functype, array $rest=array()) {} public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type) { $params = $compiler->getCompiledParams($params); $func = $params['__funcname']; $pluginType = $params['__functype']; $params = $params['*']; if ($pluginType & Dwoo::CUSTOM_PLUGIN) { $customPlugins = $compiler->getDwoo()->getCustomPlugins(); $callback = $customPlugins[$func]['callback']; if (is_array($callback)) { if (is_object($callback[0])) { $callback = '$this->customPlugins[\''.$func.'\'][0]->'.$callback[1].'('; } else { $callback = ''.$callback[0].'::'.$callback[1].'('; } } else { $callback = $callback.'('; } } else { $callback = 'smarty_block_'.$func.'('; } $paramsOut = ''; foreach ($params as $i=>$p) { $paramsOut .= var_export($i, true).' => '.$p.','; } $curBlock =& $compiler->getCurrentBlock(); $curBlock['params']['postOut'] = Dwoo_Compiler::PHP_OPEN.' $_block_content = ob_get_clean(); $_block_repeat=false; echo '.$callback.'$_tag_stack[count($_tag_stack)-1], $_block_content, $this, $_block_repeat); } array_pop($_tag_stack);'.Dwoo_Compiler::PHP_CLOSE; return Dwoo_Compiler::PHP_OPEN.$prepend.' if (!isset($_tag_stack)){ $_tag_stack = array(); } $_tag_stack[] = array('.$paramsOut.'); $_block_repeat=true; '.$callback.'$_tag_stack[count($_tag_stack)-1], null, $this, $_block_repeat); while ($_block_repeat) { ob_start();'.Dwoo_Compiler::PHP_CLOSE; } public static function postProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $content) { return $content . $params['postOut']; } } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/plugins/builtin/blocks/strip.php000066400000000000000000000027611225466040700314060ustar00rootroot00000000000000 * * mode : sets the content being stripped, available mode are 'default' or 'js' * for javascript, which strips the comments to prevent syntax errors * * * This software is provided 'as-is', without any express or implied warranty. * In no event will the authors be held liable for any damages arising from the use of this software. * * @author Jordi Boggiano * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.1.0 * @date 2009-07-18 * @package Dwoo */ class Dwoo_Plugin_strip extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block { public function init($mode = "default") { } public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type) { return ''; } public static function postProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $content) { $params = $compiler->getCompiledParams($params); $mode = trim($params['mode'], '"\''); switch ($mode) { case 'js': case 'javascript': $content = preg_replace('#(? * * name : template name * * rest : list of arguments and optional default values * * This software is provided 'as-is', without any express or implied warranty. * In no event will the authors be held liable for any damages arising from the use of this software. * * @author Jordi Boggiano * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.1.0 * @date 2009-07-18 * @package Dwoo */ class Dwoo_Plugin_template extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block { public function init($name, array $rest = array()) { } public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type) { $params = $compiler->getCompiledParams($params); $parsedParams = array(); if (!isset($params['*'])) $params['*'] = array(); foreach ($params['*'] as $param=>$defValue) { if (is_numeric($param)) { $param = $defValue; $defValue = null; } $param = trim($param, '\'"'); if (!preg_match('#^[a-z0-9_]+$#i', $param)) { throw new Dwoo_Compilation_Exception($compiler, 'Function : parameter names must contain only A-Z, 0-9 or _'); } $parsedParams[$param] = $defValue; } $params['name'] = substr($params['name'], 1, -1); $params['*'] = $parsedParams; $params['uuid'] = uniqid(); $compiler->addTemplatePlugin($params['name'], $parsedParams, $params['uuid']); $currentBlock =& $compiler->getCurrentBlock(); $currentBlock['params'] = $params; return ''; } public static function postProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $content) { $paramstr = 'Dwoo $dwoo'; $init = 'static $_callCnt = 0;'."\n". '$dwoo->scope[\' '.$params['uuid'].'\'.$_callCnt] = array();'."\n". '$_scope = $dwoo->setScope(array(\' '.$params['uuid'].'\'.($_callCnt++)));'."\n"; $cleanup = '/* -- template end output */ $dwoo->setScope($_scope, true);'; foreach ($params['*'] as $param=>$defValue) { if ($defValue === null) { $paramstr.=', $'.$param; } else { $paramstr.=', $'.$param.' = '.$defValue; } $init .= '$dwoo->scope[\''.$param.'\'] = $'.$param.";\n"; } $init .= '/* -- template start output */'; $funcName = 'Dwoo_Plugin_'.$params['name'].'_'.$params['uuid']; $body = 'if (!function_exists(\''.$funcName."')) {\nfunction ".$funcName.'('.$paramstr.') {'."\n$init".Dwoo_Compiler::PHP_CLOSE. $prepend.str_replace(array('$this->','$this,'), array('$dwoo->', '$dwoo,'), $content).$append. Dwoo_Compiler::PHP_OPEN.$cleanup."\n}\n}"; $compiler->addTemplatePlugin($params['name'], $params['*'], $params['uuid'], $body); } } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/plugins/builtin/blocks/textformat.php000066400000000000000000000056251225466040700324440ustar00rootroot00000000000000 * * wrap : maximum line length * * wrap_char : the character(s) to use to break the line * * wrap_cut : if true, the words that are longer than $wrap are cut instead of overflowing * * indent : amount of $indent_char to insert before every line * * indent_char : character(s) to insert before every line * * indent_first : amount of additional $indent_char to insert before the first line of each paragraphs * * style : some predefined formatting styles that set up every required variables, can be "email" or "html" * * assign : if set, the formatted text is assigned to that variable instead of being output * * This software is provided 'as-is', without any express or implied warranty. * In no event will the authors be held liable for any damages arising from the use of this software. * * @author Jordi Boggiano * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ class Dwoo_Plugin_textformat extends Dwoo_Block_Plugin { protected $wrap; protected $wrapChar; protected $wrapCut; protected $indent; protected $indChar; protected $indFirst; protected $assign; public function init($wrap=80, $wrap_char="\r\n", $wrap_cut=false, $indent=0, $indent_char=" ", $indent_first=0, $style="", $assign="") { if ($indent_char === 'tab') { $indent_char = "\t"; } switch($style) { case 'email': $wrap = 72; $indent_first = 0; break; case 'html': $wrap_char = '
    '; $indent_char = $indent_char == "\t" ? '    ':' '; break; } $this->wrap = (int) $wrap; $this->wrapChar = (string) $wrap_char; $this->wrapCut = (bool) $wrap_cut; $this->indent = (int) $indent; $this->indChar = (string) $indent_char; $this->indFirst = (int) $indent_first + $this->indent; $this->assign = (string) $assign; } public function process() { // gets paragraphs $pgs = explode("\n", str_replace(array("\r\n", "\r"), "\n", $this->buffer)); while (list($i,) = each($pgs)) { if (empty($pgs[$i])) { continue; } // removes line breaks and extensive white space $pgs[$i] = preg_replace(array('#\s+#', '#^\s*(.+?)\s*$#m'), array(' ', '$1'), str_replace("\n", '', $pgs[$i])); // wordwraps + indents lines $pgs[$i] = str_repeat($this->indChar, $this->indFirst) . wordwrap( $pgs[$i], max($this->wrap - $this->indent, 1), $this->wrapChar . str_repeat($this->indChar, $this->indent), $this->wrapCut ); } if ($this->assign !== '') { $this->dwoo->assignInScope(implode($this->wrapChar . $this->wrapChar, $pgs), $this->assign); } else { return implode($this->wrapChar . $this->wrapChar, $pgs); } } } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/plugins/builtin/blocks/topLevelBlock.php000066400000000000000000000021321225466040700330020ustar00rootroot00000000000000 * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ final class Dwoo_Plugin_topLevelBlock extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block { public function init() { } public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type) { return 'ob_start(); /* template body */ '.Dwoo_Compiler::PHP_CLOSE; } public static function postProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $content) { return $content . Dwoo_Compiler::PHP_OPEN.' /* end template body */'."\n".'return $this->buffer . ob_get_clean();'; } } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/plugins/builtin/blocks/with.php000066400000000000000000000041551225466040700312170ustar00rootroot00000000000000 * * var : the variable name to move into * * Example : * * instead of the following : * * * {if $long.boring.prefix} * {$long.boring.prefix.val} - {$long.boring.prefix.secondVal} - {$long.boring.prefix.thirdVal} * {/if} * * * you can use : * * * {with $long.boring.prefix} * {$val} - {$secondVal} - {$thirdVal} * {/with} * * * This software is provided 'as-is', without any express or implied warranty. * In no event will the authors be held liable for any damages arising from the use of this software. * * @author Jordi Boggiano * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ class Dwoo_Plugin_with extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block, Dwoo_IElseable { protected static $cnt=0; public function init($var) { } public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type) { return ''; } public static function postProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $content) { $rparams = $compiler->getRealParams($params); $cparams = $compiler->getCompiledParams($params); $compiler->setScope($rparams['var']); $pre = Dwoo_Compiler::PHP_OPEN. 'if ('.$cparams['var'].')'."\n{\n". '$_with'.(self::$cnt).' = $this->setScope("'.$rparams['var'].'");'. "\n/* -- start with output */\n".Dwoo_Compiler::PHP_CLOSE; $post = Dwoo_Compiler::PHP_OPEN. "\n/* -- end with output */\n". '$this->setScope($_with'.(self::$cnt++).', true);'. "\n}\n".Dwoo_Compiler::PHP_CLOSE; if (isset($params['hasElse'])) { $post .= $params['hasElse']; } return $pre . $content . $post; } } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/plugins/builtin/blocks/withelse.php000066400000000000000000000024231225466040700320640ustar00rootroot00000000000000 * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ class Dwoo_Plugin_withelse extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Block { public function init() { } public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type) { $with =& $compiler->findBlock('with', true); $params['initialized'] = true; $compiler->injectBlock($type, $params); return ''; } public static function postProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $content) { if (!isset($params['initialized'])) { return ''; } $block =& $compiler->getCurrentBlock(); $block['params']['hasElse'] = Dwoo_Compiler::PHP_OPEN."else {\n".Dwoo_Compiler::PHP_CLOSE . $content . Dwoo_Compiler::PHP_OPEN."\n}".Dwoo_Compiler::PHP_CLOSE; return ''; } } nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/plugins/builtin/filters/000077500000000000000000000000001225466040700277215ustar00rootroot00000000000000nagvis-1.7.10+dfsg1/share/frontend/nagvis-js/ext/dwoo-1.1.0/plugins/builtin/filters/html_format.php000066400000000000000000000135631225466040700327560ustar00rootroot00000000000000 * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ class Dwoo_Filter_html_format extends Dwoo_Filter { /** * tab count to auto-indent the source * * @var int */ protected static $tabCount = -1; /** * stores the additional data (following a tag) of the last call to open/close/singleTag * * @var string */ protected static $lastCallAdd = ''; /** * formats the input using the singleTag/closeTag/openTag functions * * It is auto indenting the whole code, excluding