jffnms-0.9.3/0002755000175000017500000000000011760060424012320 5ustar csmallcsmalljffnms-0.9.3/UPGRADE.win32.txt0000644000175000017500000000413111760060424015106 0ustar csmallcsmallHow to do an upgrade on Windows? -------------------------------- Please read all this note before executing something, so you can understand all the process. Step 1 - Code Update: ===================== 1. Rename the c:\jffnms folder to jffnms-old 2. Rename the new jffnms version folder (like c:\jffnms-0.7.3) to c:\jffnms 3. Copy your c:\jffnms-old\rrd folder to c:\jffnms\rrd 4. Copy the c:\jffnms-old\rrdtool.exe and nmap.exe to c:\jffnms\ 5. Re-apply the permissions, give the jffnms user FULL CONTROL over c:\jffnms 6. At this point you have the new version in place with your old version data. The only thing missing is a correct configuration. You have to go to your setup.php and reconfigure everything like you did when you first install it. (Step 3) Step 2 - Database Update: ========================= You have to send every file in the c:\jffnms\docs\upgrade\mysql to the mysql daemon : 1. Backup in case of failure: c:\> c:\mysql\bin\mysqldump.exe --opt -u root jffnms > c:\jffnms.backup.mysql 2. Go to the DB upgrade folder c:\> cd \jffnms\docs\upgrade\mysql 3. Replace OLD with your current JFFNMS version number (like 0.7.2) and NEW with the new version number (like 0.7.3) c:\jffnms\docs\upgrade\mysql> dir jffnms-OLD-to-NEW* (look at all the file names) 4. Apply the DB changes c:\jffnms\docs\upgrade\mysql> c:\mysql\bin\mysql.exe -u root jffnms < or, as suggested by Michael Mayers: If in .cmd file: for /f "tokens=*" %%i in ('dir jffnms* /b') DO c:\mysql\bin\mysql.exe -u root jffnms < %%i If not in .cmd file: for /f "tokens=*" %i in ('dir jffnms* /b') DO c:\mysql\bin\mysql.exe -u root jffnms < %i Step 3 - Check Everything: ========================== Go to your setup in http://yourserver/admin/setup.php (put the correct path here). Check if everything is ok, and Save the configuration. ----------------------------------------------------- If you have any other note you will like added here, please send it to the mailing list. Thanks. Javier Szyszlican jffnms-0.9.3/logs/0000755000175000017500000000000011760060411013256 5ustar csmallcsmalljffnms-0.9.3/logs/.check0000644000175000017500000000000011760060411014322 0ustar csmallcsmalljffnms-0.9.3/README0000644000175000017500000000170411760060424013200 0ustar csmallcsmallREADME file for JFFNMS ====================== This file contains important information about JFFNMS and should be read before installing or upgrading JFFNMS. Upgrading from 0.8.4 -------------------- JFFNMS version 0.8.4 shipped with a serious bug with the database extraction. The part of the build process that makes the databases differences was missing, however the database dump worked ok. This gives us two scenarios: * You had a pre 0.8.4 (eg 0.8.3) JFFNMS and upgraded, giving you an unchanged 0.8.3 database. * You (re)installed jffnms 0.8.4 and used the database dump. You got the correct database. The schema for 0.8.4 and 0.8.5 are the same. This means if you are the first pre-0.8.4 scenario you WILL need to run the SQL update scripts to update your schema, just like you normally should do. If JFFNMS 0.8.4 was your first database install, your schema is already current, do NOT update the database (it will error out anyhow). jffnms-0.9.3/Changelog0000644000175000017500000022577411760060424014151 0ustar csmallcsmallJFFNMS 0.9.3 ============ * You can re-edit system config without the profile error * TFTP transfers work again * strip enterprise oid from sysobjectid * fixed up interface autodiscovery * fixed snmp interface status caching * fixed snmp index for storage devices * storage interfaces for JUNOS work correctly * hostmib apps match and dont always show down * select only one host config on admin screen * system name has carriage returns escaped * Hostmib perf entries have memory used * Admin header more/less/next now carry across selected interfaces * Work-around for php brokeness in SLA analyzer for string to float * Strip out extra quotes and other junk some snmp libraries return * Adding a trigger rule won't make it disappear * Tracked fields are now updated again * Massive amount of poller buffer fixes JFFNMS 0.9.2 ============ * really save config file * engines run with unset repeat values * Fixed profile update so it works * Interface selector can select multiple interfaces again * config save fixes to reduce warnings * Changed all php short tags to full ones * Check for existance of some snmp functions that are not in windows * Update to pass syntax for PHP version 5.4 JFFNMS 0.9.1 ============ * SNMP trap receiver table can be edited with poller_backends * poller backend select fixed * Consolidater default repeat value set * check for array to silence error message when array not set * Config page saves config file and renames it * Interface selector has some height JFFNMS 0.9.0 ============ * Fixed error in syslog consolidator which fails for postgresql * All webpage input passes through Sanitizer * register_globals no longer needs to be turned on, so turn it off! * rrdtool v1.0 support dropped * lots of cleanup * poller rewritten with parent/child code * autodiscovery the same as poller * Removed php rrd module support * Interface auto-discovery will check sysobjid before trying discovery * IPv6 reachability support * Separated interface selector code * SNMP interfaces can have High Speed and optinally no Cisco proxy ping JFFNMS 0.8.5 ============ * Fixed traffic graph * Commented out logfile checking * postgresql schema uses mysqldump compat mode * Adjusted build script to make cleaner tar files * Change logfile column name offset to file_offset for pgsql * Cleaned up some more code so STRICT complains less JFFNMS 0.8.4 Released 2009-10-05 ================================ * tcp_status poller only returns ascii data * Config script redirects to https url if called that way * Added security patches as per Debian security patch 20_security * Above Closes SF:1725069 * blentz patch for Dell OpenManage Fans and Tempeature added SF:1633506 * Removed non-free font and change code to handle no font present * Started on logfile reading * UPS poller now can work with Mitsubishi Diamondlink devices * APC PDU support - this and above patch from falz * Added support for IBM Blades, IBM Servers, IBM DS4XXX controllers, generic Fibre Channel - All from David Lima * Informant-Advanced logical disk support added - From Sebastian van Dijk * Network UPS Tool support added * import_custom.php fixed for multiple fields in same table * Host MIB Apps can be case-insensitive checking JFFNMS 0.8.3 Released 2006-09-16 ================================ When other people are involved is noted if not it was me: Javier Szyszlican. * New Features: - Support for RRDTool 1.2.x - Escapes : in COMMENT statements (Reported by: Aaron Daubman ) - Uses LucidaTypewriter font so the graphs are about the same as with RRDTool 1.0.x - Storage device interface type now tracks index changes (like when adding a USB drive) or restarting the Agent - OS/400 Interface type with CPU Utilization graph By: David LIMA - Per-Host CPU Threshold for Cisco and Linux/Unix hosts By: David LIMA - Initial Dell OpenManager Interface type (only general alarm for now) By: Ben Lentz and David LIMA * Bug Fixes: - Apache Discovery now has a 10 seconds timeout. by: Craig Small - Install guide includes cron.allow and new tmpwatch and pcntl dependencies Reported by: Joel Harrison - New Installation guide for Windows By: Fabricio Castro - Host name field now is bigger Reported by: Emmanuel Doguet - crontab example now has only one Autodiscovery enabled (old one) Reported by: Cody Holland - Changed some tables to avoid MySQL 5.x keywords ('condition') Fixed by: Craig Small - NAD now works in PostgreSQL - Cisco CC TFTP copy now works even with the MIBs loaded Fixed by: Nick Korosi - NTP Client GPS support - TCP Port Status now supports hosts with a different SNMP port Reported by: Tim Nelson - tmpwatch.sh script should work in most Unices now Fixed by: Aaron Daubman - RRDTool will not use the Pipe system when the command line is bigger than 1000 characters Fixed by: Aaron Daubman - Added PortChannel link type to NAD - SNMP Traps Backend GUI now works Fixed by: Craig Small - Timezone removed from PostgreSQL Date results Reported by: MOYA Yves - Changed state field in alarm_states to int (10) Reported by: frederic Vay - HostMIB interfaces on Windows paths with Non-Printable characters were not correctly handled - Fixed RRDTool grapher to skip empty array items causing problems with some RRDTool versions By: Sebastien Namche - Added blocked_devices to storage discovery to avoid problems on MacOSX with /dev and /.vol JFFNMS 0.8.2 Released 2005-05-09 ================================ *New Features: - Host MIB hrSensor support, tested under net-snmp with lm_sensors patch. It can graph Temperature, Voltages and Fan's RPM. Requested by: Michael Fuereder - New SNMP Trap handler. It uses plugins (receivers) to parse the traps and send them to backends. It provides a more flexible system for SNMP Trap processing. By: Erno Rigo - SystemMIB Name, Contact and Location added to the Windows, Linux, Solaris, Cisco and Alteon System informantion interface types. This information is also tracked via AD so you will be notified of any change. Sponsored by: John Wagrowski of Moraine Valley Community College - UPS MIB support, this should enable support for the Riello UPS or any other that implements the UPSMIB. Sponsored by: Novikmec Jozef of Zentiva - Linux IPTables Chain support. This Interface type will graph the IPTables build-in chains bytes and packets. By: Hans Peter Dittler - Cisco BGP Neighbor Routes graphing. This will only work with Cisco IOS version 12.0(26)S or later. Request and info from: Fabiano Rodrigo Boscatto and Jade JDeane@sungardfutures |d|o|t| com - Cisco PIX support, Number of connections graph included. By: Mario Spendier - Windows SNMP Informant Logical Disk Interface Type, offer Windows Disk Usage stats. by: David Lima - Cisco NAT support, Active Binds and Input/Output packets graph by protocol (UDP, TCP, ICMP, Others). By: Karl S |d|o|t| Hagen - Support for PHP snmp2_* functions. By: Karl S |d|o|t| Hagen - The host_information discovery script now tries to discovery how many CPUs the host has. - Added Alarmed Hosts & Events to the Default View profile option values. - Added PIX Event and PIX Port to the PIX filter - Added Cisco ISDN Syslog Events Requested by: Roberto Veiga - Included the "simple" discovery script, takes a Test OID and an interface name as parameter and returns an interface if the OID is available. - Compaq Temperature Graph can be displayed in Fahrenheit now Requested by: Chad Markley *Fixes: - Start Page alarms now exclude the hidden interfaces, so now the number matches what is seen in the interfaces screen. Reported by: Chris Hammond - Rechability interface information is correctly tracked now if the Host IP changes. Reported by: Travis Johnson - The cpu_util no longer users the number of cpus to scale the graph, since the only ones using this are the Cisco System Info, and the Windows System info, which we do an average of the CPU usage of all the CPUs, so the MAX is still 100%. Reported by: David Lima - The jffnms-snmp system (for tc and iptables) now uses the pass_persist call in snmpd.conf please re check your configuration. Reported by: Hans Peter Dittler - SNMPv2 GET now handles multi-line strings correctly. Reported by: Manoj Khabe - is_process_running() function now works fine on BSDs, changed "ps -eo args" to "ps axo args". Fixed by: Chris Cappuccio - Disabled ordering in edit mode. - Triggers Users filter by user when used by a User Admin. - Trigger analizer now again honors the default "from" field from the trigger definition, if the trigger action parameter is not set. - PIX Syslog messages should match better now, removed the ^ in the regexps Reported by: GuruLeeNyc - Its now possible to ack a lot of events with one click. Reported by: GuruLeeNyc - Alteon Polling and Syslog Fixes By: Craig Small - Poller2 and NAD now work with PostgreSQL. - Zone and Map trigger fields work again. Reported by: Karl S |d|o|t| Hagen - Windows Security events work better now. Reported By: Brian Hoban Fixed by: LIMA David JFFNMS 0.8.1 Released 2005-03-07 ================================ *New Features: - New View: Alarmed Hosts & Events. It will only show the alarmed hosts screen and the events frame. - Windows Syslog Install Guide by: Ruud Hop - Added 2 - 24 hours Poller Interval options. Requested by: Jade - Added Link to the Aggregated graph, useful to show only that. - Added Host Name to the State Reports screen. Requested by: Mario Spendier *Fixes: - The events_latest_max config option is back, this was causing slowdowns in the events screen. Reported by: Travis Johnson - Syslog matching of messages that contain the work "Unknown" now works again. Reported by: David Lima - New Poller now polls the host in order to avoid gaps in the graphs when using a low number of threads, starts threads in groups of 5 so it can start working earlier and there were some speedups in the next-host-to-poll finder. Reported by: Travis Johnson - User deletion works again. Reported by: Thomas Mangin - Logged in Customers can use the calendar page now. Reported by: ChakraPani - Physical interfaces now show the correct bandwidth instead of 128k, it was caused by a parsing error in the snmp response. Reported by: Balu - Matching of Client for Events Triggers now works. Fixed by: Hans Peter Dittler - Logging file name fixed when using logger() from a web page. Now we use $_SERVER["SCRIPT_NAME"]. Reported by: Eugene Turovsky & Min Qiu - Removed Totals section from the Aggregated Traffic graph, because its giving real values. Reported by: Eugene Turovsky - Remove the SNMPv2c option if we're running on a Windows Host, because there is no support for SNMPv2 on it. - Events and Map refresh intervals from the User Profile work again. Reported by: Renegade - Titles with \r\n were causing problems in the RRD Graphs. Reported by: Chris Zimmerman - Using lots of interfaces in the DHTML maps were generating a long scroll, now they go to a new row at the end of the visible screen. Reported by: Jason Humes - SNMPv2 SETs were not returning a bool value and causing problems with CISCO Ping-MIB. Reported by: Jose Amengual & Javier Reyes - Cisco SYSMIB config transfer had a very, very long timeout. Now it waits around 4 to 8 seconds. Reported by: Johan - Fixed Cisco SAA Agent poller to work correctly with the new SNMP API. Reported by: Jose Amengual & Javier Reyes JFFNMS 0.8.0 Released 2005-02-15 ================================ *New Features: .API: ----- - New Launcher thread manager, its a generic way to handle item processing to child process, while keeping the load down. It will launch a fixed number of threads and send them work. Requested by: Travis Johnson - New Poller using the new launcher. (poller2.php) Its simpler than the old poller (which is kept for some features like DMII and Satellite that are not implemented here). This is still experimental and only works in Unix. - Network Autodiscovery. Allows you to add 1 or more seed networks and snmp communities to a zone, and when the daemon runs, it will discover the devices in that network and in attached networks. This is very useful to add a lot of hosts easily. Experimental Too. - Support for SNMPv2 and SNMPv3, Including 64 bits counters. For SNMPv1 and SNMPv3 we are using the integrated PHP functions and for SNMPv2 we are calling the net-snmp executables (snmpget, snmpwalk and snmpset) that is a little slow, but it works. When using SNMPv2 or v3, the 64 bit OIDs will be used automatically for input and output, bytes and packet coutners. Requested by: A lot of people - New Backend Configuration Format, uses one defaults file (conf/jffnms.conf.defaults) and one user-config file (conf/jffnms.conf) for easier automated upgrades. JFFNMS should automatically upgrade from the old config system (conf/config.ini) to the new format. Requested by: Craig Small - APC UPS Monitoring: Autodiscovery, Status Alerts, Load, Capacity, Voltage (in/out), Time Remaining and Temperature Graphs. Requested by: Travis Johnson and Novikmec Jozef - Nth Percentile graphing support. (Like 95th percentile graphing). This is configured per-interfaces and allows you to specify the Nth percentil you want. A New line will be shown in the traffic graph. Requested by: Richard Sears and Paul Matuszewski - Alteon AD3 monitoring Monitors system, real and virtual servers and real services, Graphs for bytes, session rate and current value, Alarms when servers or services go down, Fixes problem with physical ports all having the same name. By: Craig Small - Brocade Fibre Switch monitoring Monitors temperature and fan sensors, Graphs temperature or fan speed, Monitors FC ports, Graphs traffic by bits or frames. By: Craig Small - Cisco AS 5300 Count the number of Async or DSX1 lines used by an access switch removing the D channel. Should work with all Cisco Routers with an E1/T1 connection to a Telco. By: Thomas Mangin - New SQL Query Interface Type. It uses ODBC to query any database and graph the number of rows returned by the specified query. Also includes Min/Max limit alerting. Requested by: Daniel Afonso - New Interfaces Autodiscovery using the new launcher, replaced the old autodiscovery under the same name, all features re-implemented. - Managed RRDtool: one RRDtool process is called by each poller and we use the open connection to multiple operations, reducing the fork load. Only works on Unix. - New Host fields: Creation, Modification, Last Poll Date and Last Poll duration Time, useful for debugging. - Cisco PIX syslog events matching and filtering. By: David Lima .GUI: ----- - Complete GUI redesign using HTML 4.01 and CSS, known as DHTML. If you want to modify how JFFNMS looks you can use your own CSS file, check the 'Custom CSS' Setup option. Too many changes to describe them all, you have to see them for yourself. - New Logo - Interface Selector: we now use a popup system to show the selected group interfaces, making it possible to select some interfaces from more than one group at the same time. Its also hiddable. And when in Customer or Map Filtered mode, you can still select by host. Requested by: Craig Small , Jason Humes , and others |d|o|t| - Faster Tools system, now will need to ask for a specific or specifics values, no more load-all-on-start. Requested by: TIBA Staff - New Standard Administration Features: - Add without insert - Discard Save - Export to ASCII Table - Filter by Field - Sort by Field - New Administration Menu Now its vertical on the right side of the screen, and its hiddable. - View Type (DHTML, text, etc) saved in a Session Cookie. So it will keep your selection until you change it or you logout, and it will get back to your default. Requested By: falz - Option to hide a complete Zone from the interfaces view. Requested by: Chris Hammond - Events ACK, now its easier, just click on the blinking red dot. - View Performance: - CSV Export of the Input/Output value on Physical interfaces, including Nth percentile calculation. - Allows hidding of the options box so you will get more space. - Better Events RSS output, now its RSS 2.0, tests with Mozilla Live Bookmarks Used as: http://yourserver/jffnms/events.php?view_type=rss&user=admin&pass=admin .DOC: ----- - New UNIX Install Instructions using a 'jffnms' user, that way we don't need the system crontab anymore. *Fixed Bugs: - Interface Map sort order fixed, using SORT_NUMERIC for the interface field now. Reported by: Kelly Hamlin - Events Interface Filter, now matches *INTERFACE instead of *INTERFACE* Reported by: Durga Prasad - Reachablity interface now works when using a host with : in the IP (useful for snmp agents on different ports). Reported By: Manoj Khabe - IF-MIB discovery now works when the host IP is a DNS name. Reported by: David Lima - Setup screen works correctly under SSL now. - Windows Event Log Syslog events fixes. By: David Lima - Fixed NTP poller bug when you have a Stratum 0 device connected locally. Reported By: Karl S |d|o|t| Hagen - Cisco SEC-6-IPACCESSLOGDP syslog rule fixed. By: Craig Small - Maps order fixed. Now its by Map Name, not ID. Reported by: Kelly Hamlin - Better Linux Syslog matching. With help from: Craig Small - Removed Consolidate Events->Alarms item limit. - Syslog message matching fixes: now its case-insensitive and has better handling of old/simple match strings, and has better handling of not-matching hosts. - NTP discovery and poller do not output errors now. - Removed support for old UCD-SNMP 4.x - Old experimental poller removed. - Apache Poller now works with Apache 1.3.x - Fixed CatOS interface naming Reported by: falz - IOS Configuration now skips the ntp clock-period line. By: Craig Small - RRDtool Number of DS JFFNMS 0.7.9 Released 2004-09-21 ================================ *New Features: - Support for PHP5 I've been testing on PHP 5.0.1 and everything I tried works. *** Please report any warnings or errors you may get *** - Support for CatOS, Cisco Catalyst Switch. Now you will see the correct interface names and descriptions. Idea/Sample Code by: Perry Lewis - Apache /server-status? Monitoring. You need to enable mod_status.so with permission to access from the JFFNMS server. Will autodiscover the server on port 80, and allow for manual add for other ports. Graphs for: Hits (with aggregation), Bytes transfered (with aggregation), Bytes per Request, CPU Load and Uptime, Busy/Idle Workers. By: Robert St Denis - IIS (Internet Information Server) Monitoring. Graphs for: Bytes Received, CGI Requests, Files Sents, number of GETs and POSTs. By: Robert St Denis - Compaq Insight Manager Monitoring. Will allow you to monitor fan, temperature and disks on Compaq/HP servers. By: Craig Small - Livingston Portmaster Serial Port Monitoring. Allows you to see the general status of the ports in a graph. By: Thomas Mangin - Windows EventLog Messages parsing and filter. You have to use NTSyslog. By: David Lima - Windows CPU and Running Processes SLA New 'Process Threshold' field for SLA By: David Lima - Support for changing the envelope-sender in Triggers/Action emails. New 'From' option in the trigger configuration. Requeted/Idea by: ML - New Aggregation (Average) Graphs for: Cisco CPU Utilization, Linux CPU Usage and Load Avearge. By: Robert St Denis - New Packets and Errors Graphs, still in development. - New Temperature Aggregation Graph. By: Craig Small - New Manual Discovery Without PorScan (without using nmap). Requested by: Robert St Denis - Interface Selector now allows to select all interfaces in the group with one click. And also, when using the Performance Screen, to show only the Date/Graph options before showing any graph. Requested by: Robert St Denis - Added HELP link from the setup.php screen to the JFFNMS Documentation. Documentation By: Craig Small - Added 'active alarm' and its start date to the alarmed interfaces infobox. Requested by: Chris Landegent - Customer Selector in the Interfaces Viewer (Map Selector). Requested by: Travis Johnson - Performance Viewer now allows to show only the Aggregate Graphs, and to select all the graph types with one click. Requested by: Robert St Denis - New Trigger Filter to Match by Interface name using 'Contains'. Requested by: Chris Landegent *Fixed Bugs: - Fixed Host Screen, now it does not have filters, and when you execute an action, it will show only the affected host. It also has a new Select Box for selecting the actions. Reported by: Jason Humes - Speed in Physical Interfaces will now be correctly set for interfaces without IPs. - Peer IP will now be correctly shown in the RTT Graph. Reported by: Jason Humes - Bandwidth information in traffic graph is now shown even if the BW is not in range - Temperature Graph will now work, the RRDTool DS name was bad. Reported by: Chris Epler - Graph Titles are now better centered in Debian PHP/GD systems. Reported by: Karel P Kerezman - RRDTool Fetch Fixes that show up on sparc are now fixed. By: Craig Small - RRDTool Fetch Fixes when using RRDTool > 1.0.47 fixed (timestamp parsing problem) Reported by: Jeff Vaneek - Windows Upgrade documentation now includes .exe files copying. Reported by: BJ - Allow values of '0' in multi_buffer (!empty("0") is not equal to ("0"!=="")) - BGP Peers now use the Remote Neighbor IP as the Index field. - HostMIB Applications now use the process name as the Index field, no need for hashes now. - Traffic Aggregation Graph now includes Totals. By: Robert St Denis - Linux/Unix Net-SNMP CPU Usage graph now does averaging on devices with more than 1 CPU. By: Robert St Denis - When evaluating if we are going to store a new TFTP dowloaded config, don't escape the ' - Better SNMP Trap RegExp By: Nistor Lubomir - Interface values are now trimmed, to avoid problems. - Performance Viewer was not filtering by Customer when the User had a Fixed Customer. Reported by: Johan - Performance Viewer nows has a JavaScript refresh stopper (like the events screen). - Show Hour Control now adds the current hour:minute if not in the list. - Users List is now sorted by Username. Reported by: Johan - Allow for interfaces with '0' as the value. (!empty("0") is not equal to ("0"!=="")) Reported By: Craig Small - RootMap is now shown in the Maps screen for easy background changing. Reported by: Kelly Hamlin JFFNMS 0.7.8 Released 2004-06-21 ================================ *New Features: - Host Information discovery (Windows, Unix, etc) now gathers the SysDescr, usually it contains the Kernel and Host name, as this field is tracked, you will now when host changes kernels, or host name. Requested by: Gregory Leggett - New general interface option to disable Status Polling completly. This way all graph information will be polled, but status will not, not even syslog messages for that interface. The interface upper-right corner will be gray. Requested by: Tony Nelson & Others. - Application interfaces now include the Memory used by the Application, with graph. Requested by: Doug Toombs - New Calendar for Reports. We're now using 'The Coolest DHTML Calendar' from http://dynarch.com/mishoo/calendar.epl , Behavior is better now. - Profile Option to disable DHTML informational boxes. Requested by: Travis Johnson - Profile option to restric interface viewing by customer, much like the Base Map option. Requested by: Travis Johnson - New Trigger field to match by Map. Requested by: Alexandru Thomae - New Trigger Field to match by Customer. Requested by: Travis Johnson - UDP Port Monitoring, much like the TCP, but we use NMAP for testing, because it gives better results. Based on design by: Yery Tannus - New Option to show the temperature in Farenheit Requested by: Travis Johnson - Added Mask to the Physical Interfaces options. - New AD Policy option to don't alert if an interface is not in host (deletion). - New Poller for easier handling Status MIB variables. by: Craig Small - Add 'nolog' to the autodiscovery_interfaces to avoid creation of events, useful for debugging. *Fixed Bugs: - Marked Disabled interfaces now don't count in the Status of a host in the Hosts Screen. Requested by: Chris Tuska - Easier event ACK'd now works as it should have been in 0.7.7 Reported by: Thomas Mangin - Syslog Consolidator works again with the * and D variables. Reported by: Mario Spendier - Session locking bug, now JFFNMS GUI should feel a lot faster. - Event Filter fixes. Reported by: Chris Landegent - TCP Connections tool fixes. Reported by: Thomas Mangin - NTP fixes. Reported by: Thomas Mangin - Popups & MiniSLA deprecated. No one used them. - Interfaces are now sorted using Natural Sort, this will make finding an interface by name easier. - Better Filter behavior on the Hosts Screen. - AD Output now includes the Interface Name. - SNMP Counter function now removes the ( and ) characters from output. - DOC: Windows Install, added creation of c:\tmp folder JFFNMS 0.7.7 Released 2004-04-05 ================================ *New Features: - New Login Screen, a new DHTML login screen, is selectable from the setup. You can also add a logo to the page. This new method uses sessions/cookies to store a session id, and internall is faster because we don't have to auth in every page request, which made some IDS ring. An event is created when a user tries to login successfully or not. Old method (HTTP AUTH) is still there, and will continue to be supported. - New Tools Framework. This system allows changes to be made to interfaces on the host. Examples provided for Changing the Interface description and Admin Status on Routers and to list or finish TCP connections on agents that support that feature (Cisco's TCP MIB). A new event (Tool Action) is generated everytime something is changed using this tools. - New Profile option to select which "View" Page do you want to see when you login. - New ToolBox Interface Alarms widget. This allows access to more pages related to the selected interface. Like Tools, Edit, Events and Performance. This is shown when you pass over an interface in the HTML or DHTML view types. - New Event Type "internal" for JFFNMS related events. Also added a new option to hide the Host Name in the events viewer. This event is used by the new Login Screen. - 'Or' Type matching for Triggers. Requested by: Alexandru Thomae - Poller, Autodiscovery, and Satellite Distribution now verifies that no other process with the same name are running. To avoid duplicate processes. This works only on Linux. - New Poller Helper, checks DMII and Alarmed interfaces, this allow faster UPs and faster poll of imporant interfaces. Requested by: David Lima. - Alarm Backend now supports to set the time-span between down and up events, and the value to assume (or not) when no result is given by the poller. Also, better (human readable) return values are given. - RRD Backend again supports update on one DS by call. This is to make simplier poller groups when only one value is graphed. And also to check if performance is better than doing all the DS at the end. - New poller option to poll just the DMII interaces on a host. Requested by: David Lima. - snmp_interfaces_status_all now checks if the host has more than 30 interfaces before doing the walk, if it does not, then uses normal snmp_get's - When ACK'ing summarized events ('Message Repeated N times'), all events are now ACKd rather than just one. Requested by: Thomas Mangin - Interfaces Alarm Screen now autodetects the screen width at start, so no more 'Big Screen' View types. - New folder ('engine/shared') to store shared code (ie. that may be required for pollers and for tools), and a new function to call them jffnms_shared(). - Satellite now works with HTTPS, new https_post_message function, that uses the CURL extension. by: Chris Landegent - Allow interfaces to be checked only every X minutes (N > 5), useful when used with the TCP Content Checking. Requested by: Chris Landegent - Anonymous customer logins. Just define a customer with no password. Example URL: http://youserver/jffnms/?user=customer_username&pass=&logout=1 Requested by: Chris Tuska - Direct Graph download. Useful for embedding them on a site, examples: - Get the traffic graph from one interface: http://youserver/jffnms/view_performance.php?interace_id=332&want_graph=traffic - Get the Aggregation Traffic graph of a whole host: http://youserver/jffnms/view_performance.php?host=6&want_graph=aggr&graph_type=traffic - Use with the Anonymous logins http://youserver/jffnms/view_performance.php?user=customer1&pass=&logout=1&interace_id=332&want_graph=traffic - Syslog Consolidator has a Position parameter now, to handle the order on which the syslog RegExps are tried. - New Syslog Event Type to match normal linux syslog messages. - DOC: Added Another Example on using Syslog-NG - GUI: ACK'd events show differently on the Event Viewer Requested by: Thomas Mangin - Storage Threshold can be configured per interface now. Requested by: Thomas Mangin - Cleanup Raw tables now supports deletion of N days old Router Configs, N is controlled via setup. Requested by: Chris Tuska *Fixed Bugs: - DOC: Fixed the documentation about the PHP trap_receiver. - Alarm table now allows bigger alarm_state ids. - Syslog Consolidator now checks for Literals. - Events Screen now does escaping of HTML meta-chars. - Removal of un-matched < > variables in events. - Tacacs Consolidator now checks the Normal IP too, rather than only the Tacacs IP of the host when matching. Requested by: Thomas Mangin - Severity Level Filter now works again. Reported by: David Lima - NTP Discovery now verifies if the Host has and IP address. - NTP Poller Now checks for timeouts. - Exp_poller now works correctly with this version. - Removed old snmp_interfaces_status - Old 'Event Tools' depreacated. It was an old code that nobody used. - Old perl trap_receiver depreacated. - GUI: Event Screen code cleanup, uses more CSS and the resulting file is smaller. - GUI: Better Interface Selector in the Triggers screen. - GUI: Better Recursive URL cleaner. - Manual Add is now show event if the host does not have any interface of that type. - We now only distribute the SQL Diffs of the past to the current version, not older files. - Coding Style changes and Call By Reference bugs fixed. JFFNMS 0.7.6 Released 2004-02-22 ================================ *New Features: - TCP Port Content (port response or URL content) can be checked against a Regular Expression to validate it. Requested by: Richard Sears - Manual Add of TCP Ports, now its possible to add any port number you want manually, or to set up the same port a more than one time with different testing Regular Expressions. - CPU Usage and Load Average SLA for Linux Hosts. - CPU and Memory Usage SLA for Cisco Routers. - Graphing of the number of Application Instances. - NTP syncronization testing, it reports when a NTP server is syncronized or not to another peer. (it requires the ntpq program) - GUI: Added New "only when filtering" option to Event Types, to better manage its showing. Requested by: David Lima - GUI: New DHTML View Type for Interfaces and Hosts, it doesn't use png's anymore for the boxes, its all CSS and JavaScript, Tested with Mozilla/Firebird/Firefox on Linux and Windows, and with Internet Explorer 5.0 and 6.0 - GUI: New option to disable refresh on the Interfaces/Hosts Screens. Requested by: Lucas Iglesias - GUI: New option to diable the refresh of the Events Screen more easily. Click on the 'round arrows' icon to stop the refreshing, and click on the 'page refresh' to enable it again. - GUI: Faster event Acknowlodge, without selecting a Journal. Requested by: Aaron Aubman - New Physical Interface option to avoid the automatic Admin Status modifications. When you mark "Fixed Admin Status" the show type of the interface (Show, Mark Disable, Don't show) will no be modified by the poller. The Default is not checked, so the poller will automatically modify the Admin Status/View Type of the interface. - New trap_receiver coded in PHP, now you can use the trap functions with postgresql, because it uses the JFFNMS DB abstraction. by: Aaron Aubman - New Way to use Satellites "Local Master", this means the Satellite will poll the values, store them locally AND send it to the master too. Requested by: Juan Rojas - Added Interface Type to the list of Trigger Rules Fields, to match by the interface type. Requested by: Ray Hatch - API: Its now possible to poll more than one interface on the same host via the command line (ie for testing) - API: Added option to use HTTP/1.0 or HTTP/1.1 in HTTP queries - API: The jffnms-snmp system (plugin's for net-snmp) now caches its response for one minute to ease the load on the server. - API: Its now possible to setup Default SLAs per interface type - GUI: Double Clicking on a Graph Type on the Performance Screen, will show it without needing to click on the 'View' Button. - GUI: Its now possible to select a Default View type in the User profile (ie Normal, Text, etc). - GUI: New button in the top frame to reload the current selected view Requested by: Thomas Mangin - DOC: msyslog & SLA configuration example documentation by: Chirstian Zimmerman *Fixed Bugs: - Dates in graphs are checked to be sure they are valid. - BGP Verify Number poller removed, its no longer needed. - When adding a new interface from Manual Discovery, the interfaces screen now its correctly positioned. Reported by: Ray Hatch - Autodiscovery and RRD Analyzer now check the "poll" option in the interface and the host they are working on. - Last Poll Date is now handled as an added poller/backend because it shares the same structure. (its now injected from poller_plan) - Cosmetic Changes to Config Transfer Types, and Autodiscovery Policy Requested by: Thomas Mangin - Performance Graph Title was badly calculated. Reported by: Pierre-Damien Gatouillat - Autodiscovery now checks if the host is localy managed or satellite, this way AD only runs over the hosts this Satellite manages. - Changed some Satellite Calling functions to make correct use of the 'params' field. - Interface Type RRA Structure now included in the default field values. - Fixed handling of & and | in the Satellite Query content. - Customer Username can now be 60 characters long Requested by: Thomas Mangin JFFNMS 0.7.5 Released 2003-12-16 ================================ *New Features: - Per Interface-Type Fields: Until now every interface had the same fields, for some interface types this was ok, but others required more or different fields, so this new feature allows different fields per interface type. ie: Linux TC now has Rate and Ceil fields, and its not using the BW in/out fields, TCP Ports don't have IP address or BW, etc. This was one of the big "barriers" in the internal design of JFFNMS, so I'm glad I finally made it configurable/modular. - DB: 3 new tables: interface_types_fields, interface_types_field_types, and interface_values - GUI: Manual Discovery has a new layout and includes all the specific interface fields. - GUI: View Interfaces shows all the 'description' fields and has a better text layout - API: interfaces_update updates every interface value not just the interfaces table. - API: Events Text now can include any interface type specific fields - API: Poller Parameters can include any interface type specific fields - AD Tracked Fields are set from the Interface Type Fields. - SLA: now you can use SLA expressions with the name of each interface type specific field - Changed all discovery, poller and backend scripts to use the new and specific fields, ie: - ALL: changed 'descr' fields to 'description' - Physical: Pings to Send configurable per interface - BGP: Separated field for Local IP , Remote IP and ASN values. - Applications: Number of Instanses stored in DB. - Linux TC: Specific Ceil and Rate fields. - Storage: Specific Size Field (it was bandwidth before) - TCP: Check content option now allows for a specific URL to be included - Reachability: Now you can configure the fping parameters per interface - Verify Interface Number Backend now uses specific Index Field. - RRD Backend gets the RRD Structure from the Interface Type Fields. Important Notes: ---------------- * If you have "custom" interface types, please read the UPGRADE file carefully * By default we not 'track' the network interface's description via autodiscovery, so if you don't want to loose your custom interface descriptions, please disable the field tracking via the Polling & Discovery=>Interface Types Screen. - All AD changes to an interface are summarized on one event. - Cleanup old Events and Alarms integrated to cleanup_raw_tables. - the number of days is configurable via setup.php (Defaults to 7 Days of Raw Events, and 60 Days of Normal Events/Alarms) - We try to repair the tables using a REPAIR/OPTIMIZE or VACUUM command at the end. This is to avoid index problems. - Per Host 'Polling Enabled' Option to disallow polling of all host interfaces more easily. Requested by: Richard Sears - Host View option now acts over the View option of its interfaces, so if the Host is in Don't show or Mark Disabled, it will look as all its interfaces where in the same state. Reqiested by: Richard Sears - Experimental Poller (for networks with a lot of hosts) A new polling system that keeps a number of pollers running, and distributed the polling load by interface to them. This allow us to poll a lot of hosts without the problems of lauching one poller for each host. This is still experimental, don't use it yet for production enviorments. It Requires the SHMOP and PCNTL PHP Modules to work. By: Anders Karlsson - RRD_Analyzer: SLA is now a seprated analyzer, this mimics all other plugin scripts, SLA still the only one implemented. - When a Network Interface (IFMIB) has AdminStatus 'down', it will be set to 'Mark Disabled' automatically, also when the interface is back in AdminStatus 'up', it will be set to 'Show'. Requested by: Richard Sears - GUI: Interface Viewer (Status Map) now includes a link to the interface editor - GUI: Graph legends now include the Site Name. - GUI: Alarmed Interfaces view now includes the Host Name of the interfaces in a new line Requested by: Chris Landegent - GUI: When inside a Host in the Interface Viewer, clicking on the "card" (gray) box will show all the graph for that interface type - GUI: Added the Current and Last Polled Date to the Performance Viewer Requested by: Smith Chen - API: Added fetch_ds() method to the interfaces class, to allow an RRDTool Fetch remotely. - API: Temporal Buffer Backend supports calling the same variable more than once, until it has a value. - API: Poller Plan now allows to filter by type - API: Interfaces_Add can use an array as parameter to define more than the host_id of the new record, but only interface table fields - UTILS: Added Debug option to jffnms-snmp, to check the output tree. *Fixes: - Linux TC regexp fix to allow leaf and prio options By: Craig Small - Better Autodiscovery Output with specific interface type fields. - Better Handling of subinterfaces (VLAN, FrameRelay, etc) - Removed some 'extract()' calls in graph's that were not needed. - Added more colors to the TC Aggregation Graph. - Added more descriptive names to 'View' options in Administration - Windows CPU Polling now doing a walk of the CPUs tree to get the avarage usage of all processors Report and Fix Concept by: Chen from Taiwan - Zone filter now works again. - Don't Discover the Reachability Interface if the fping executable is not set-uid. - Fix fping response when the IP is in the local subnet and its unreachable (read the last line) Reported by: Ben Lentz - Cisco MAC Accounting Interfaces now include a unique indentifier. - BGP4 MIB implementation fixes, the index is now better calculated to be unique, so no AD problems occur. - Alarm Editor is back (under Internal Configuration=>Reports) Requested by: Rob Laidlaw - Fixes SMS Client action message creation to include the interface data, and to trim the message to 140 chars. Reported/Fixed by: Ben Lentz & Yuri Krichevsky - Maps List is now in a Select box, because if you have a lot of maps, or long names, you loose the View Types section. - API:DB some internal modifications, query doesn't die on failure, it tries 5 times, then it returns, but it doesn't die. - API:Satellite - WDDX Fixes - Import/Export (distribution) now also updates records on changes, not just deletes and inserts a new one - Setup: don't allow " ' & | # = / characters in the fields (SF BUG 841139) Requested by: Mark Burdick - Cisco CPU Poller now uses the 5 Minutes CPU utilization, rather than the 1 min OID (SF BUG 841140) Requested by: Mark Burdick JFFNMS 0.7.4 Released 2003-10-13 ================================ *New Features: - Reachability Interface Type Using fping (http://www.fping.com) we can now monitor hosts via ICMP (ping) and graph the RTT and PL from the JFFNMS server. It also issues events when the PL is over a treshold. This plugin will not work on Windows. Requested by: a lot of people. - Linux Traffic Control (tc) Support Using our own net-snmp extension (pass-type) installed on the Shaper Box you can see each Class Bandwith Usage, including aggregation to view all usages on the same graph. Tested only with HBT. Scripts and example configuration in docs/utils/jffnms-snmp/ . - Configurable Interface Field Tracking. Now is possible to track other interface fields rather than the name, for example the description. Added BGP Description Tracking. Requested by: Richard Sears - TCP Content Checking. The TCP Poller now also check for a valid response in HTTP/HTTPS/FTP/FTPS ports using fopen(). Until we get Per Interface Type Fields, configuration is done via the description field. ie: http|/jffnms/admin/adm/test.php ie: ftp://testuser:testpass@|/test.txt ie: https|/jffnms/admin/adm/test.php 'http' tells the poller to use the HTTP protocol and whats after the | specifies a page rather than the default (/). Requested by: Richard Sears - Added the SNMP Auth Failed Trap. - Added Acknowlodge Field to Express Filter. Requested by: Craig Small - Added Creation, Modification and Last Poll Time Stamps to the Interfaces table. All this information is useful when looking for something wrong. - Trigger rule to match the ongoing duration of active alarms (includes new consolidator process). By: Anders Karlsson - News Section included in the Start Page. - Support Client Only in Satellites (just incoming queries). - Added Example on how to use Satellites, in docs/utils/satellite-client.php - Better support for Juniper Routers (Based on M20): Consolidate Interface List and LowerLayerDown Support. Requested by: Richard Sears *Fixes: - Added BASE64 Encoding to API:rrd_grapher() and BASE64 Decoding to GUI:performance_graph() - When No Zone Image is configured the Events screen doesn't try to show it. - When no interfaces were alarmed the 'Alarmed Interfaces' View showed all interfaces, now its fixed. Reported by: Kevin R. Armstrong - RRDTool Graph now returns the real result of the command. Reported by: Anders Karlsson - Fixes to poller_plan_next to replace all poller parameters - Problem with changing Fullname or Router Access to User, now its not needed to re-enter the password - Support WDDX over TCP in Satellites. - RRD Files are now (back again) deleted when the interface is deleted. - Now we check if allow_url_fopen is set to On in setup. - Changed JFFNMS URL to http://www.jffnms.org - Fixed Input Error Rate Graph and SLA calculations (Total Input Packets = Input Packets + Input Errors) - API:DB added db_free function By: Anders Karlsson - Make sure most public API functions return some value (breaks satellize otherwise). - More separation between API and GUI code. - Discovery_none script now doesn't return an error, just an empty list, to use when a new interface type does not have a discovery system. Requested by: Craig Small - New Database entries on system tables start with id 10000 from now on, so we can add more things without interfering with user-created internal configurations, like new Interface Types JFFNMS 0.7.3 Released 2003-08-02 ================================ *New Features: - Host Config Downloader Rewrite: Modular, More Secure and Better Error Reporting (via log, event and alarm) by: Javier Szyszlican Ideas from: Michael Samuel - GUI: Performance Viewer: Added 'Last 2 Days' to Time Span Options, Multiple Graph Selector, Graph Scale Legend included in IMG ALT Requested by: Juan Rojas (TIBA) by: Javier Szyszlican - SMS via Mail Action: Modified Email Action for shorter messages. Requested by: Michael Orth by: Javier Szyszlican - SMS via Modem Action: send SMS via modem with SMSClient (http://www.smsclient.org/) by: Craig Small - GUI: Interface Viewer Reworked and Modularized: - View Interfaces, View Hosts and View Maps use the the same engine (but different sources), this also means that you can now view Hosts and Maps in Text Mode also. - 'Performance View' is nicer now, and it can also use dynmap. - 'Text View' now shows all the links and it has a better layout - Temp Files Cleanup Script for Unix by: Kovacs Andrei - Get Interfaces (Manual Discovery): Show Interfaces not found in Host but found in the DB. - Support for Cisco Catalyst Config Download Thanks to and Requested by: Paul Stewart by: Javier Szyszlican - Logging is disbled by default, and the files now don't have the date in their name. - New Engine Temp Folder, to store Engine (poller, autodiscovery, etc.) Temporary Files. - TCP Port Discovery now uses the New Engine Temp Folder. - API: Graph handling was put in the engine, and a wrapper function (performance_graph in GUI) was created. Now graphs are stored in the Engine Temp folder, read, deleted, and returned as a variable to the GUI, which stores it in Temp Graph Folder and allows the browser to see it. - GUI: Some Graphs now show the 'In / Out Flipped' Legend, to let the user know the graph Input and Output are inverted. Requested by: Juan Rojas (TIBA) by: Javier Szyszlican - SNMPTraps: the traps consolidator now supports placing literal data in the SNMP Trap Rules screen (like 'down' in the State field) Also some rewrite of the code, and handling of Up's and Down's in numeric mode - GUI: Behavior Change, if the Events Frame does not exists (ie. Hosts, Maps, Interfaces WITHOUT Events) don't display a new window. Requested by: Rob Laidlaw *Fixed Bugs: - Fixed TCP Port Discovery to only return Open TCP Ports, because Validate in AD is unchecked for feature reasons. Reported by: Daryl G. Jurbala by: Javier Szyszlican - Changed Cisco EnvMIB Discovery (Voltage, PowerSupply, Temperature) to check for status, and to give a more generic Interface Name Reported by: Daryl G. Jurbala by: Javier Szyszlican - Fixed Customer Login when JFFNMS is installed in the Document Root (relative path /) Reported by: Brian Watters - Fixed Storage Interface Type to return the Device Type String from hard-coded values if the MIB doesn't include them (return OIDs is set). - Fixed Host Information Interface Type to convert 'enterprises' to its OID when comparing (return OIDs is set). - Smokeping Internal Number Tracking Fixes by: Craig Small - Don't send the Alarm's 'Date Stop' Field on a Down Alarm in Email Action - PgSQL 7.3 fix in UnAck Filter (changed '' for 0) - PgSQL 7.3 fix in insert_alarm, don't include zero-lenght string for referer_stop - PgSQL fixes (changed " for ') in interface_filter and cleanup_raw_tables - Fixed TCP Number of Connections Poller for use with NET-SNMP (not absolute OIDs in the returned array key) - Physical Interfaces Discovery now puts the correct Name for Cisco VLAN Interfaces (IOS 12.2.16b) Reported by: Lucas Iglesias (TIBA) by: Javier Szyszlican - Autodiscovery now informs the New Interface Name when the AD Policy dont allow the name to be changed - Fixed Physical Interfaces Status Pollers and Discovery to not depend on the MIBs values - Packets Graph does not use the Flip Graph option anymore. - Fixed interface_shortname_and_card() to manage a new case when the interface[pos] is not numeric for Cisco ENVMIB - snmp_get now tries 2 times to get the requested data. - GUI: Administration Menu Internal Code and Organization reworked. - GUI: First,Prev,Next,3Next Options Menu now is fixed size, the options don't change places. Requested by: Alejandro Alvarez (TIBA) - Fixed crypt() usage in Authentication Reported by: Michael Samuel - Internal Messages Framework Deprecated. - Disabled the TIBA TT plugin. You have to write your own TT plugins. - Fixed more NET-SNMP returned values handling - Fixed most of the functions that use the DB from the GUI, only 2 left. Added more API Classes, and fixed others. - Cleanup of unused GUI functions (due to the migration to API Classes) - Check if the DB module is loaded before testing the connection for setup in db_test. - DOCS: Fixes and additions to the Windows Install Procedure, also start of the Windows Upgrade Procedure. By: James Swart - Zone Image (flag) is not longer Required, now is optional. JFFNMS 0.7.2 Released 2003-05-27 ================================ *New Features: - Cisco Temperature (with graph), Voltage and Power Supply Monitoring. By: Anders Karlsson - Internal: Support for more alarm_states, now pollers and events can return any state value Already Implemented for tcp poller (up,down) and Applications (running, not running) Requested: Anders Karlsson - Internal: the Alarm Backend can get extra info from the poller with | as the separator to include it as the info of a new event. - Cisco SA Agent (Service Assurance) (Round Trip Latency, Jitter and Packet Loss) By: Anders Karlsson - The TCP Poller now tries to read 1 second of data from the open socket to report it in the events. - New Autodiscovery Policy to allow adding of interfaces without checking if they have an IP Address (for Switches) - NetSNMP Agents added to UCD-SNMP System Interface Type - Physical Interface Status is now gathered with a new poller which stores all the table and then processes it. By: Anders Karlsson - Added in-development tools, an mib parser and an sql update generator (internal) - Added InfoBox explaining the alarms in the Hosts View. - Hosts now can be hidden or marked disabled like interfaces (to hide old routers) - Added Refresh link to the menu interfaces list. - New Mailing List Archives at: http://marc.theaimsgroup.com/?l=jffnms-users - Added Storage Aggregation (All Selected Storage Interfaces in the same graph) - Storage SLA alerts when the Used Space is more than 80%, its autoselected on every new Storage Interface. By: Dan Ratzlaff - Satellites understands SOAP, you can talk SOAP with the satellite.php to call any method of any class. *Fixed Bugs: - State Report didn't show correctly the duration of alarms which lasted more than 24hs. Reported: Kevin R. Armstrong - Missing Check in hosmib_apps poller caused error when the host had no snmp daemon. Reported: Larry Burton - Dont show RTT/PL in state report on interfaces which don't have them. - Some bugfixes to allow use of net-snmp v5. - Modified autodiscovery_interfaces for better output and now it uses alarm_lookup to see if somethins is up or down - Modified the tcp_ports discovery to answer open or closed, because discovery now understands them via alarm_lookup - Poller Position is now included in the command line parameters when forking poller.php Reported: Nigel A. Taylor - Changed Interface Types Order, for manual Discovery - Performance Graphs now works in paths with dots. Reported: Peter Burgstaller - Autodiscovery now let you set any interface field from the discovery script's (like slas, clients, etc) - Autodiscovery can now be called with a second command line parameter to only discover one interface type (for debugging) - New Autodiscovery Policy options to check if the state is UP, and if the IP Address is valid. (both checked for all except the new policy for switches) - The Cisco Ping Pollers where using the old buffer, changed to the new one. Reported: Oliver Kuhn - Coding Style Fixes to get SOAP working, mostly undeclared variables and constant array keys By: Anders Karlsson - State Report now shows only the customer, map, type, host or interfaces selected. Reported: Kevin R. Armstrong - Added Zone Image (flag) to the Hosts View. - Added Images of More Coutries Flags in the Full Install. - Modified view_interfaces card detecting code to handle ie. Tunnel0, Tunnel1 and eth0, eth1 as the same card - Modified 'Mark On Map' tool to show only the host of the interface in selected. - The syslog consolidator now checks for the host name and ip (for syslog-ng) by: Craig Small - More Flexible and Clean auth.php by: Michael Samuel - Customers are now allowed to see their State Report. - Fix possible overwriting of unavailability array. - Physical Interfaces Discovery and the Tacacs Consolidator didnt handle the ' character in a good way. Reported by: Brian Watters - Off-by-one RRD DS Position error fixed and now we use interface_name as the file name. By: Craig Small - snmp_walk now makes 2 tries to get the requested data. - Changed INSTALL to allow PHP CLI work correctly from crontab (Current Working Directory Problems) - rrd_analizer took the 0's as a value to calculate the averge causing bad readings. Reported by: Dan Ratzlaff - Some Fixes to clean some alerts when viewing JFFNMS using SSL Requested by: TIBA Staff - Quick/Bad Fix for the init - exim hash collition. Reported by: Craig Small JFFNMS 0.7.1 Released 2003-04-02 ================================ *New Features: - HostMIB Running Software Polling and Discovery By: Anders Karlsson - Events RDF Feed availble from http:///jffnms/events.php?view_type=rdf By: Craig Small - Raw tables cleanup script By: Andrei Kovacs - Added Latitude/Longitude fields to Host table (for future GIS Maps) Requested: Anders Karlsson - Added Filter to show only UnAck'd Events Requested: Walter Brock - Added 'Default Event Filter' Profile Option - Added 'Events & Maps Refresh Intervals' Profile Options Requested: Daniel Farinella - Documentation on how to use syslog-ng with JFFNMS. By: Craig Small *Fixed Bugs: - strpos() haystack, needle inversion in syslog parser. Fixed: Craig Small - Bad Loop in Somekping Poller Fixed: Craig Small - Satellite Field is now a text label when listing in the Hosts Screen - Changed order of Hosts from Zone, Name to Name, Zone Requested: Lucas Iglesias - Reworked interface_status its lot faster now. Requested: Anders Karlsson - Added interface_count and hosts_count for speed ups. - Graphviz doesn't show the unknown host anymore. - Removed Link to old Message System from the control.php, also disabled refresh becasue it was not needed. - trap_reciever.pl does not mix the order of the OIDs now. Also changed the DB to reflect the real OID order. - Fixed trap_reciever.pl RegExp to match multi-word values in OIDs - Setup.php on Windows Escaped \ as \\, causing problems with RRDTool, now it replaces \\ with / Reported: BEV - Added ScrollBar and Set the height of the color_select.php row to be sure of their size. Reported: Jack Snir - Fixed Repeated 'control name' in select_color(), it was causing problems in IE. Reported. Jack Snir - Period Can't be 0 in get_availability, changed to 1 if zero, to avoid division by zero warnings. Reported: Andrei Kovacs - State Report now sets the default TO time to the actual time rather than at 00:00 today. Reported: Andrei Kovacs - Customers are now allowed to see the Graph Type Chooser, until we get more flexible on what can a logged in customer do. Requested: Alexandra Alvarado JFFNMS 0.7.0 - Released 2003-03-10 ================================== *New Features: - New Syslog Message Processing System (support for RegExps and compatible with older definition) by: Craig Small and Javier Szyszlican - New SNMP Traps Processing System by: Craig Small - Tacacs+ Consolidator now Supports REJECT messages (minor changes also). - Reworked State Report - Internal changes to use new rrdtool functions - Time filter - CSV Export - New API for some rrdtool functions to get dynamic structure changes, this includes cleanups in all graphs and every function that uses rrdtool. Now every DS goes on a different file like interface-999-0.rrd this is handled by the rrd_mode field - The Interface Map Views has been broken in pieces for the cleaness of the code. This also helps to add a new Map View type. (htdocs/views/*) - New Interface Map View on SubMaps (dynmap) allows you to change the position of the interfaces in the map and to establish connections between them. - Bulk Interface Add Feature in Manual "Get Interfaces" Option, it allows you to add a lot of interfaces with only a few clicks, without using autodiscovery. - Designated Main Interface(s) (DMII) : You can select an interface or map of interfaces which will be the Main ones for that host, this means: if the DMII are all down, the polling of that host other interfaces will stop, except for the DMII (to detect the UP again), this solves a domino or 'stacking' problem when some hosts are unreachable. Also, a new event is generated when the Polling Fails because of DMII being down. Requested: Larry Burton - Added Packets Aggregation (useful to see how much packets per second your router is handling) - New Interface Type for Windows Hosts (Servers), Number of Users, Number of Processes, Processor Utlization, and TCP Connections Graphs Requested: Rob Laidlaw Information: Musfa Baig Coding: Javier Szyszlican URL: http://snmpboy.msft.net/ - New Interface Type: Cisco MAC Accounting, Polling and Graphing (ip accounting mac input, ip accounting mac output) This allows one graph per MAC Address giving you accounting per machine in an Ethernet Segment. Experimental, Autodiscovery Disabled. - Modified Linux Host Type: New Graphs and Pollers for Number of Users, Number of Processes, and TCP Connections Graph Also Changed its name to UCD-SNMP Host, because we support FreeBSD (Need Testing) or other ucd-snmp implementations with this Interface Type - Modified Cisco Host: New Graphs and Pollers for TCP Connections Graph, and Accounting - TCP Port Delay and Number of connections graph (aggregation too) (modified interface type) Requested: Karlheinz Hagen - Smokeping Integration (RTT & PL), Discovery, SLAs, Graphs by: Craig Small - Cisco IP Accouting Polling and Graphing (ip accounting output-packets) - If no interfaces found in Manual Discovery Show the "No Interfaces Found" Message - Cisco CPU SLA, SLA set to match at > 80% Requested: Brian Watters - Cisco Syslog Message: ACL Match Requested: Alexandra Alvarado - Cisco Syslog Message: CDP Duplex Mismatch Requested: Alexandra Alvarado - Cisco Syslog BGP Notification Message - Added Profile option to not show the stats on the start page. - Added Shortcuts to go bettween View Performance, Interface Administration and State Reports - New FrameWork for Distributed Processing (Satellites) Each Satellite is an jffnms in a different machine, this allows Distributed Polling for now in the future this will allow to do syslog,trap,discovery an other in a distributed fashion. Experimental, Needs Testing, Allows Load Balancing. - Added Label at the Setup to know which config file are you using - Added Option to Event Filter so now you can filter by Extra Info too (LIKE), useful for seaching in tacacs logs. Requested: TIBA Staff - Added Options to Event Filter to NOT get a field when it matches. - Added the RRDTool Step value to the Interface Type options. This is used when creating a new rrd file. - Added a Favicon icon and some HTML meta tags. - Setup.php now checks for Register_Globals to be set to On - Added RRDTool Dump & Restore functions to API *Fixed bugs: - Wrong Query date compare in interfaces_status (typo from postgres changes) Reported: Stanislav Gaydukov Fixed: Javier Szyszlican - RRDTool Fetch Speedups (it was using too much memory) Reported: Juan Rojas Fixed: Javier Szyszlican - Verify length of info field in insert_event Reported: Alejandro Alvarez Fixed: Javier Szyszlican - Better handling of LIMIT on a pgsql query Reported: Alejandro Alvarez Fixed: Javier Szyszlican - Field type of interfaces.host was tinyint, now changed to int. (it was a typo) Reported: Kevin R. Armstrong Fixed: Kevin R. Armstrong - The Maps Interfaces GUI type changer didn't work right on Mozilla Reported: Javier Szyszlican Fixed: Javier Szyszlican - The Path of the TFTP windows .bat file was wrong. Reported: Gregory A. Leggett Jr.Fixed: Gregory A. Leggett Jr. - If no tcp ports were found on a host, the Manual discovery showed garbage Reported: Javier Szyszlican Fixed: Javier Szyszlican - Sounds where not working on the view_interfaces.php (Main Map). Reported: Javier Szyszlican Fixed: Javier Szyszlican - Off by 1 error didn't show events if only one is found. Reported: Javier Szyszlican Fixed: Javier Szyszlican - Events View All Option didnt show all the events. Reported: Juan Rojas Fixed: Javier Szyszlican - SQL LIMIT and OFFSET doesnt accept numbers with decimals, now rounded. Reported: Javier Szyszlican Fixed: Javier Szyszlican - State Report showed dates in Seconds, now in Hours:Minutes:Seconds Reported: Javier Szyszlican Fixed: Javier Szyszlican - State Report did wrong math in Total Values Reported: Javier Szyszlican Fixed: Javier Szyszlican - Java Map was deprecated. - Availability Report was deprecated in favor of the State Report. - Fixed SLA Processor (rrd_analizer) to take care of one line SLA's Reported: Brian Watters Fixed: Javier Szyszlican - Fixed Event Filter to Allow Search of Unknown Events - Disable refresh when you go back in the Events Screen - Behavior Change: when an interface/host is not reachable (non response) is taken like a down response. This affects the report generation also... please test this and give me feedback so we could know which is best. - Added Verification of SNMP community to a few pollers - Fixed Typo in menu_interfaces - Fixed Typo in db_copy_table() - Changed Most Event Filter Fields to the LIKE expression rather than equal (=) - Added Default Customer to the Get Interfaces Option - New Include File Loader, fixed for multiple installtions JFFNMS 0.6.9-2 - Released 2002-09-21 ==================================== *Fixed bugs: - Modified some SQL querys to make them compatible PostgreSQL Postgres support now works. - Fixed a typo in trap_receiver.php (the name) - Make RRDTool functions check for the .rrd file. - Converted some GUI selects to the new API. - Fixed a function name change in filters. JFFNMS 0.6.9 - Released 2002-09-07 ================================== *New Features: -Triggers Framework: Parse New Events or Alarms with a condition, and triggers an Action. -Actions Framework (email for now) -Host Default Customer Assigns a default customer to an autodiscovered interface. -Host TFTP Config Get Type included in DB. -TFTP Get Hosts Changed its name. (please update crontabs) -TFTP Config Upload Tool (external utility) -Use Interface Bandwidth parameter for number of CPU's on CPU Information. -SLAs: more verbose debug. -SLAs: Updated Rules. -Maps: Mark Disabled now affects Maps also. -GUI: Events: Summary of Identical Events. -GUI: New Interfaces Views (supports bigger graphs) -New To Do List. *Fixed bugs: -Documentation fixes. -Changed field 'tipo' (spanish) from events table to 'type'. -Reorganization of some API Classes. -FreeBSD (PHP 4.2.2) $_SERVER variable Changes. Reported: Nicolas Huret Fixed: Javier Szyszlican -Autodiscovery: Verify more before Modification. -Consolidate sub-programs name change. -API Alarms: Fixed Filters. -API Events: Variable resolution now is internal, not in GUI. -API RRDTool: verify if .rrd exists before tune. -Ticket: Some changes. -GUI: Interfaces '1 record only' fixes. -GUI: Standard Admin Fixes. -GUI: Updated some selects to objects. -GUI: changed RRDTool Graph grid color. -Alarm Viewer is gone, it didnt work. JFFNMS 0.6.8 - Released 2002-07-27 ================================== *New Features: -Windows 2000/XP Support. JFFNMS works correctly on Windows, all functions work except TCP Port Autodiscovery (I need a windows nmap). Install Guide Included. -New Graph Types Framework Converted all graphs to the new format. -New Interface Types (by Robert Bogdon): Cisco CSS VIPs Linux Processor Usage Linux Load Average Solaris Memory Utilization Solaris Processor Usage Solaris Load Average Includes Autodiscovery, Graphs and Poller Groups. -Better Host Information Identification Based on Robert Bogdon code. -Added Drops () variable to SLA's -Better SLA presentation, more flexible and useful output. Requested by: TIBA Staff -New MiniSLA's, SLA verifications every 5 minutes (optional) Requested by: TIBA Staff -New Journaling Framework, better handling of comments and Reporting/Editing. -New Trouble Ticket Integration Framework, send Journals to your TT System. Example included. -Interface Selector, you can now select by Interface Type and the View all button is back is Wizard Mode. *Fixed bugs: -Documentation fixes. -PHP Time Limit Handling implemented. Reported: Micheal Orth Fixed: Javier Szyszlican -Quotes Handling in Tacacs and TFTP Reported: Alberto Passariello Fixed: Javier Szyszlican -Changed snmp_interfaces to numerical OIDs. -Take care of HexStrings and Quotes on Windows Agents -Changed Default Speed of Snmp Interfaces to 128k because 0 makes no graphs. -Changed $argv[] to _$SERVER[argv][] in engines. Requested by: Someone running FreeBSD with PHP 4.2.1 -Fixed a typo in poller.php str_replace. Fixed by: Robert Bogdon -When creating a new Host, now the filter is to the seleced zone, not Uknown. -Fixed some Setup Autoconfiguration options -Move MiniSLA's and Messages to popups.php and popups/ directory -New Graph Type Selection (performance) Algorithm -Moved all RRD Related functions to api.rrdtool.inc.php -Changed Host_Interfaces (aka Get Interfaces in Host Configuration) to only show the interfaces types with records. -Don't Show MultiEdit in Interfaces Administration when only one record is shown. JFFNMS 0.6.7 - Released 2002-06-29 ================================== *Fixed bugs: -When changing password the Router Access was disabled. Reported: Mariano Schuler Fixed: Javier Szyszlican -Handling of shutdown events, leaves interface down. Reported: Lucas Iglesias Fixed: Javier Szyszlican -Storage discovery broken in UCD-SNMP 2.4.4 -TCP Port Poller timeout, too short, increased to 8 seconds. -Some Orders are inverted. -API: better filter management in interfaces object. (status & list) -API: Auth now on jffnms object. -API: new delete_from_all method on map_interfaces object. -Change Clock color to white in Events. *New Features: -New Interface in Rootmap status, you can mark the interface as disabled (grey). -Add to Map option in Interfaces Editor. -New Interface Selector (Wizard and Classic mode) (faster) -Autoconfigurable Setup.php (Robert Bogdon) -Use the OLD-CISCO-SYS-MIB for configuration retrival (optional) (requested by: Mike Hide) -Wait 3 seconds before spawning new a process in autodiscovery_interfaces.php and poller.php (requested by: Robert Bogdon) -New Poller: BGP Peer Interface Number (track when new bgp peer are added). -New Views: Host All Interfaces (not only the ones with show in rootmap), Alarmed interfaces & events. OLDER RELEASES ============== Please check http://sourceforge.net/tracker/?atid=444844&group_id=46041&func=browse jffnms-0.9.3/htdocs/0002755000175000017500000000000011727542662013620 5ustar csmallcsmalljffnms-0.9.3/htdocs/view_interfaces_map_list.php0000644000175000017500000001416611653615532021377 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ { include ('auth.php'); $active_only = $Sanitizer->get_int('active_only', 0); $only_rootmap = $Sanitizer->get_int('only_rootmap', 1); $map_id = $Sanitizer->get_int('map_id', 1); $client_id = $Sanitizer->get_int('client_id', 0); $break_by_zone = $Sanitizer->get_int('break_by_zone', 1); $break_by_card = $Sanitizer->get_int('break_by_card', 0); $break_by_host = $Sanitizer->get_int('break_by_host', 0); $events_update = $Sanitizer->get_int('events_update'); $host_id = $Sanitizer->get_int('host_id'); $mark_interface = $Sanitizer->get_int('mark_interface'); $no_refresh = $Sanitizer->get_int('no_refresh', 0); $source = $Sanitizer->get_string('source', 'interfaces'); $sound = $Sanitizer->get_string('sound'); $view_type = $Sanitizer->get_string('view_type',NULL); $big_graph = $Sanitizer->get_string('big_graph', 0); $Maps = new JffnmsMaps(); $REQUEST_URI = $Sanitizer->get_url('', 'all'); if ($map_id_profile = profile('MAP')) $map_id = $map_id_profile; if ($client_id_profile = profile("CUSTOMER")) $client_id = $client_id_profile; $sound = profile("MAP_SOUND", $sound); $view_type = cookie('VIEW_TYPE', $view_type); if (($view_type=='') && ($view_type_profile = profile('VIEW_TYPE_DEFAULT'))) $view_type = $view_type_profile; if ($view_type=='') //If we coudn't get the view_type from the cookie or the profile $view_type = 'dhtml'; //use the 'DHTML' view type $events_update = ($events_update=="")?1:0; switch ($source) { case 'interfaces': $view_types = array ( 'normal'=>'Normal', 'normal-big'=>'Normal Big', 'text'=>'Text', 'performance'=>'Performance', 'graphviz'=>'GraphViz', 'dhtml'=>'DHTML', 'dhtml-big'=>'DHTML Big' ); break; case 'maps' : case 'hosts' : $view_types = array ( 'normal'=>'Normal', 'normal-big'=>'Normal Big', 'text'=>'Text', 'dhtml'=>'DHTML', 'dhtml-big'=>'DHTML Big' ); break; } $old_view_type = $view_type; // for Select switch ($view_type) { case 'normal': $big_graph=0; $image = 'normal.png'; break; case 'text': $image = "text.png"; break; case 'performance': $break_by_host=0; $break_by_card=0; $image = 'graph.png'; break; case 'graphviz': $break_by_card=0; $break_by_host=1; $break_by_zone=0; $image = ''; break; case 'normal-big': $big_graph=1; $view_type = 'normal'; $image = 'normal.png'; break; case 'dhtml': $big_graph=0; $image = 'normal.png'; break; case 'dhtml-big': $big_graph=1; $image = 'normal.png'; $view_type='dhtml'; break; } $map = current($Maps->get_all($map_id)); $maps = $Maps->get(NULL,$map_id); $maps_list = array($Sanitizer->get_url('')=>"Choose Map"); while ($rmaps = $Maps->fetch()) if ($rmaps['id'] != 1) { $maps_url = $Sanitizer->get_url('', 'all', array('events_update' => $events_update, 'map_id' => $rmaps['id'], 'break_by_card' => 0, 'map_color' => $rmaps['color']), array('host_id')); $maps_list[$maps_url] = $rmaps['name']; } if (count($maps_list) > 1) $select_maps = select_custom("map", $maps_list, 0, "change_map_url(this)", 1, 0); else $select_maps = "None"; $options = "&map_id=".$map_id."&map_color=".$map["color"]."&mark_interface=".$mark_interface."&active_only=".$active_only. "&break_by_card=".$break_by_card."&break_by_host=".$break_by_host."&break_by_zone=".$break_by_zone."&break_by_card=".$break_by_card. "&view_type=".$view_type."&host_id=".$host_id."&sound=".$sound."&big_graph=".$big_graph."&only_rootmap=".$only_rootmap."&source=".$source."&client_id=".$client_id; $url = "view_interfaces.php?$options"; adm_header('Interface Map List'); echo script( " function change_view_type(select){ var url = select.options[select.selectedIndex].value; location.href = location.href+'&view_type='+url; return true; } function change_map_url(select){ var url = select.options[select.selectedIndex].value; location.href = url; return true; } function change_client(select) { var client_id = select.options[select.selectedIndex].value; location.href = location.href + '&no_refresh=0&events_update=1&client_id='+client_id; return true; }"). table("map_list"). tr_open(). td(control_button ($map["name"],"_self","$REQUEST_URI&map_id=".$map["parent"]."&host_id=&break_by_card=0&events_update=".$events_update,"world.png")). ((($client_id_profile==0) && ($map_id_profile==0)) ?td(control_button ("Submaps: ".$select_maps,"","","none")). td(control_button ("Customers: ".select_clients("", $client_id, 1, array(0=>"All"),"change_client(this)"),"","","none")) :""). td(control_button ( "Options:". linktext(image($image)." ",$url,"map_viewer"). select_custom("view_type",$view_types,$old_view_type,"change_view_type(this)",1,0),"","","none")). td(($no_refresh==1) ?control_button("","_self","$REQUEST_URI$options&no_refresh=0&events_update=0","refresh.png") :control_button("","_self","$REQUEST_URI$options&no_refresh=1&events_update=0","refresh2.png")). td(($active_only==1) ?control_button("","_self","$REQUEST_URI$options&active_only=0&events_update=0","all.png") :control_button("","_self","$REQUEST_URI$options&active_only=1&events_update=0","alert.png")). td(control_button("","_new",$url,"popup.png")). td(($sound==1) ?control_button("","_self","$REQUEST_URI$options&sound=0&events_update=0","sound.png") :control_button("","_self","$REQUEST_URI$options&sound=1&events_update=0","nosound.png")). tag_close("tr"). table_close(). script(($no_refresh==1) ?"parent.map_viewer.no_refresh = 1;" :"parent.map_viewer.location.href = '$url'+'&screen_size='+window.document.body.clientWidth;"). (($events_update==1) ?script("parent.parent.events.location.href = 'events.php?map_id=$map_id&refresh=&client_id=$client_id';") :""); adm_footer(); } ?> jffnms-0.9.3/htdocs/logout.php0000644000175000017500000000075411716447477015654 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ @include_once ("../conf/config.php"); @include_once ("../../conf/config.php"); ?> JFFNMS

You must enter a valid Username and Password to access this system.

"> Login jffnms-0.9.3/htdocs/controls.php0000644000175000017500000000714511522754051016167 0ustar csmallcsmallget_string('view_mode', profile('VIEW_DEFAULT')); if (!$view_mode) $view_mode = 'start'; $filtered = (profile('CUSTOMER') || profile('MAP'))?true:false; $view_modes_list = array( 'start' => array('url'=>'start.php', 'name'=>'Start Page'), 'hosts-events' => array('url'=>'frame_interfaces_events.php?source=hosts', 'name'=>'Hosts & Events'), 'interfaces-events' => array('url'=>'frame_interfaces_events.php?source=interfaces', 'name'=>'Interfaces & Events') ); if (!$filtered) $view_modes_list['maps-events'] = array('url'=>'frame_interfaces_events.php?source=maps', 'name'=>'Maps & Events'); $view_modes_list['alarmed-hosts-events'] = array( 'url'=>'frame_interfaces_events.php?source=hosts&active_only=1', 'name'=>'Alarmed Hosts & Events'); $view_modes_list['alarmed-events'] = array( 'url'=>'frame_interfaces_events.php?source=interfaces&active_only=1', 'name'=>'Alarmed Interfaces & Events'); $view_modes_list['alarmed'] = array( 'url'=>'frame_interfaces.php?source=interfaces&active_only=1&events_update=0', 'name'=>'Alarmed Interfaces'); $view_modes_list['interfaces'] = array( 'url'=>'frame_interfaces.php?source=interfaces&events_update=0', 'name'=>'Interfaces'); $view_modes_list['hosts'] = array( 'url'=>'frame_interfaces.php?source=hosts&events_update=0', 'name'=>'Hosts'); if (!$filtered) $view_modes_list['maps'] = array( 'url'=>'frame_interfaces.php?source=maps&events_update=0', 'name'=>'Maps'); $view_modes_list['hosts-all-int'] = array( 'url'=>'frame_interfaces.php?source=hosts&only_rootmap=0&events_update=0', 'name'=>'Hosts All Interfaces'); $view_modes_list['events'] = array( 'url'=>'events.php?span=40', 'name'=>'Events'); $view_modes = array(); foreach ($view_modes_list as $view_mode_name=>$aux) $view_modes[$view_mode_name]=$aux['name']; echo script (" function change_view_mode(select){ var url = select.options[select.selectedIndex].value; location.href = location.href+\"&from_refresh=0&view_mode=\"+url; return true; } function toggle_menu() { fs = parent.document.getElementById('menu_frame'); showed = '*,152'; hidden = '*,0'; fs.cols = (fs.cols!=showed)?showed:hidden; } "). table("mainmenu"). tr_open(). td(linktext(image("jffnms_small.png", 0, 0, "Small Logo")."JFFNMS", 'http://www.jffnms.org/about/?version='. JFFNMS_VERSION. '&site='.$Config->get('jffnms_site') ,'work','logo')). td(control_button($_SESSION['auth_user_fullname'],'work','admin/menu.php?menu=users','users.png')). td( control_button("Views:","", $Sanitizer->get_url('',FALSE, array('from_refresh'=>0, 'view_mode'=> $view_mode)), "none"). select_custom("view_mode",$view_modes,$view_mode,"change_view_mode(this)"). linktext(image("bullet6.png"),$Sanitizer->get_url('',FALSE, array('from_refresh'=>0, 'view_mode' =>$view_mode)))). td(control_button("Performance","work","admin/menu.php?menu=performance","graph.png")). td((profile("ADMIN_ACCESS")?control_button("Administration","","javascript: toggle_menu();","lock.png"):" ")). td(control_button('Logout','_top',$Config->get('jffnms_rel_path').'/?logout=1&OldAuth='.$_SESSION['auth_user_name'],'logoff.png'),'logout'). tag_close("tr"). table_close(). (($view_mode)?script ("parent.work.location.href = '".$view_modes_list[$view_mode]["url"]."'"):""); adm_footer(); ?> jffnms-0.9.3/htdocs/view_interfaces.php0000644000175000017500000002150211661365011017470 0ustar csmallcsmall Javier Szyszlican * Copyright (C) 2010 Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ require ('auth.php'); { # Get the following from the request $action = $Sanitizer->get_string('action', 'view'); $break_by_card = $Sanitizer->get_int('break_by_card'); $break_by_host = $Sanitizer->get_int('break_by_host'); $break_by_zone = $Sanitizer->get_int('break_by_zone'); $client_id = $Sanitizer->get_int('client_id', 0); $dhtml = $Sanitizer->get_string('dhtml'); $mark_interface = $Sanitizer->get_string('mark_interface'); $map_id = $Sanitizer->get_int('map_id',1); $view_type = $Sanitizer->get_string('view_type', 'normal'); $source_type = $Sanitizer->get_string('source', 'interfaces'); $client_id = 0; if ($client_id_profile = profile("CUSTOMER")) $client_id = $client_id_profile; //fixed customer if ($source_type == 'hosts' || $source_type == 'maps') { $break_by_card = 0; $break_by_host = 0; $break_by_zone = 0; } if ($map_id > 1 && $source_type == 'interfaces' && $view_type == 'normal') $view_type = 'dynmap'; require_once("views/view_$view_type.class.php"); $view_class_name = "View_$view_type"; $View = new $view_class_name(); // Setup source require_once("views/source_$source_type.class.php"); $source_class_name = "Source_$source_type"; $Source = new $source_class_name($View); $interfaces_shown = 0; //number of interfaces shown if ($action=='save') $View->save(); $View->html_init(); //load items source $items = $Source->get($View, $client_id); $alarms_actual = array(); $old_zone = ''; $old_host = ''; $old_card = ''; if (count($items) > 0) //if there were items returned foreach($items as $item) { //Array ( [alarm] => [alarm_name] => [alarm_start] => [alarm_stop] => [alarm_type_description] => [alarm_type_id] => [bgcolor_aux] => [check_status] => 1 [client_id] => 1 [client_name] => Unknown Customer [db_break_by_card] => 0 [default_graph] => rtt [description] => Array ( ) [fgcolor_aux] => [have_graph] => 1 [have_tools] => 0 [host] => 2 [host_ip] => 172.16.242.2 [host_name] => cisco [id] => 2 [index] => [interface] => [interval] => 300 [make_sound] => 1 [map_int_id] => [map_x] => [map_y] => [pings] => 50 [shortname] => Unknown [show_rootmap] => 1 [threshold] => 70 [type] => Reachable [type_id] => 20 [zone] => sdfsd [zone_id] => 3 [zone_image] => unknown.png [zone_shortname] => UNK ) if ($item['show_rootmap'] > 0) //if its meant to be shown { unset($alarm); unset($alarm_name); //debug ($item); //clean the interface name $interface = str_replace(array('"',"'"),'',$item['interface']); list ($item['int_sname'], $item['card']) = interface_shortname_and_card ($interface, $item['type'], $item['db_break_by_card']); //get short names for interface and card $urls = $Source->urls($View, $item); if (property_exists($View, 'cols_count')) { //break the current row because something has changed if ( (($break_by_zone==1) && ($old_zone != $item['zone_id'])) || (($break_by_host==1) && ($old_host != $item['host'])) || (($break_by_card==1) && ($old_card != $item['card']))) $View->cols_count = $View->cols_max; if ($View->cols_count==$View->cols_max) //when we get to the end of the row { $View->break_finish_row(); $View->cols_count=1; //set current column count to 1 } if ($View->cols_count==1) //if this is the first column in a new row { if ( (($break_by_zone==1) && ($old_zone!=$item['zone_id'])) || (($break_by_host==1) && ($old_host!=$item['host'])) || (($break_by_card==1) && ($old_card!=$item['card'])) ) { $View->break_init(); //include the new row header if ($break_by_zone==1) $View->break_by_zone($item); if ($break_by_card==1) $View->break_by_card($item); if ($break_by_host==1) $View->break_by_host($item); $View->break_show($urls); } else $View->break_next_line_span($break_by_host, $break_by_zone, $break_by_card); //if new row but not because of a break } //cols = 1 } if ($item['alarm_name'] == '') $item['alarm_name'] = 'OK'; if ($item['alarm'] != NULL) //interface is alarmed { $bgcolor = $item['bgcolor_aux']; //take colors from the item $fgcolor = $item['fgcolor_aux']; if ($item['make_sound'] == 1) { $tmp_alarm = $item['alarm']; $alarms_actual[$tmp_alarm][]=$item['id']; //if make_sound active for this interface, put the id in the alarms list } } else { $bgcolor='64FF64'; //use standard colors for non alarmed interfaces (green) $fgcolor='000000'; } if ($item['show_rootmap'] == 2) //if its "Mark Disabled" { $bgcolor_status = $bgcolor; //set small box color to the real bgcolor $bgcolor='777777'; //set disabled colors (gray) $fgcolor='222222'; } if ($View->interface_show($item, $bgcolor, $fgcolor, $mark_interface, $urls)) //show the interface $interfaces_shown++; if (property_exists($View, 'cols_count')) { //save current zone, host or card to compare it to a new one if ($break_by_zone==1) $old_zone = $item['zone_id']; if ($break_by_host==1) $old_host = $item['host']; if ($break_by_card==1) $old_card = $item['card']; $View->cols_count++; } } // show rootmap }//while items //view_type_finish($view_type); $View->finish(); if ($interfaces_shown == 0) //if no interface were shown $View->no_interfaces($source_type); $url = view_interfaces_alarm($action, $alarms_actual); if ($Sanitizer->get_string('norefresh') !=1) //dont refresh if we're ask not to echo javascript_refresh("if (self.no_refresh!=1) location.href=\"$url\";",$Config->get('map_refresh')); adm_footer(); } function view_interfaces_alarm($action, $alarms_actual) { global $Sanitizer, $Config; $sound = $Sanitizer->get_int('sound'); $alarms_last = unserialize(stripslashes($Sanitizer->get_special('alarms_last',''))); $alarms_time = $Sanitizer->get_string('alarms_time',''); $map_sound_renew_time = $Config->get('map_sound_renew_time'); if ($map_refresh_profile = profile('MAP_REFRESH')) $map_refresh = $map_refresh_profile; else $map_refresh=''; if ($action != 'view' || $sound != 1) return; $alarms_diff = array(); if ((time() > $alarms_time+($map_sound_renew_time*60)) && ($map_sound_renew_time > 0)) //if the alarms are expired unset($alarms_last); //delete the last alarms so we play the currents again if (!isset($alarms_last)) $alarms_last=array(); $array_aux = array_merge(array_keys($alarms_actual),array_keys($alarms_last)); //merge both keys foreach ($array_aux as $key) //every different alarm_state id (new or old) { if (!isset($alarms_last[$key])) $alarms_last[$key]=array(); //if not set, set it empty if (!isset($alarms_actual[$key])) $alarms_actual[$key]=array(); //if not set, set it empty //get the diff of both alarms list (in = exists in actual, and not in last), (out = exists in last but not in actual) $alarms_diff[$key]['out'] = array_diff($alarms_last[$key],$alarms_actual[$key]); $alarms_diff[$key]['in'] = array_diff($alarms_actual[$key],$alarms_last[$key]); } unset($alarm_api); if ((count($alarms_diff) > 0) && ($alarms_time)) //if there is a diff and this is not the first call foreach ($alarms_diff as $alarm_state_id=>$diff_items) //go thru all diffs if ((count($diff_items['in']) > 0) || (count($diff_items['out']) > 0)) //if there's something to do { if (!isset($alarm_api)) $alarm_api = $jffnms->get('alarm_states'); //get the api handler $sounds = current($alarm_api->get_all($alarm_state_id)); //get the record for this alarm state id if (count($diff_items['in']) > 0) //if there are IN items in this alarm state echo "\n".play_sound($sounds["sound_in"])."\n"; //play the sound if (count($diff_items['out']) > 0) //if there are OUT items in this alarm state echo "\n".play_sound($sounds["sound_out"])."\n"; //play the sound $alarms_time=time(); //set alarm last time to now } if (!isset($alarms_time)) $alarms_time=time(); //if this is the first time we've been called set the alarm last time to now //get the new values in the url for the refresh $url = $Sanitizer->get_url('', 'all', array('alarms_last' => serialize($alarms_actual), 'alarms_time' => $alarms_time), array('alarms_last', 'alarms_time')); return $url; }//alarm sound processing ?> jffnms-0.9.3/htdocs/images/0002755000175000017500000000000011377440254015060 5ustar csmallcsmalljffnms-0.9.3/htdocs/images/bullet2.png0000644000175000017500000000051311377440254017134 0ustar csmallcsmall‰PNG  IHDR e^|èxPLTEÿÿÿÜòüÌâüÌêü4–ì~ìbÜnÜ4žì~ܼÚì¬âü¼êü¬ÒüDŽìnì^Ü4ŽÜD–ÜvÜfÜTªì †ìT¦Ü ~Üìþü”Êì¼âü¤Âì¬Úü„ÊüD–ì fÜ^ìvìdºì4Žì$~ìd®ì$†ìCPwtRNS@æØf pHYs  ÒÝ~ülIDAT™U̓ à“© q ü‡¹1Ýû¿áj ˼¤É}iš¿$ì‚¿¤Y~"?ñ*x¬¬(å-RÝ5L®#+N¬›È¶èAÍJçðG<ÝkßxºQošãÖó‰~jTóN»„Õn&` |÷B¶Aë1IEND®B`‚jffnms-0.9.3/htdocs/images/b-left.png0000644000175000017500000000037211377440254016737 0ustar csmallcsmall‰PNG  IHDR é°GoWPLTEÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÜìztRNS@æØf pHYs  ÒÝ~üW÷äIEND®B`‚jffnms-0.9.3/htdocs/images/jffnms.png0000644000175000017500000000760611377440254017060 0ustar csmallcsmall‰PNG  IHDRddGfb`¯ïnjhÈÇÆòññÝÝÜ!$…‚äñ÷ÿÿÿ‘uµ`tRNSÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿsmäC €IDATxÚìšy[ÍÒ‡†åaqh2›8#‹ YÔ–£ã‚H„ñ<ßÿ[œªîvIÞëý眾rE›_UwuuU;þùŽÿˆ0™¾9ÂoNoŽéä! ß«lPÚlÀƒGƒbô<á·!‚ã…Â3LMƒg=&Ö>À+!ðžfRBÅð{)<ÄPT·ûøØ­j„®üêT&šz ï¹UÅ$¤÷&ü:$ñŸ³'®“:%oKh^æïÇ ´n”!rrrâr¹®Õ%Šƒ’ú5¼ o25îºIèƒð+DPÅF ÆP|ö/ Q/ðUÆA̱[1H/±;䂹Ý6Ÿuxxxñ<¤äM×Ä;¡êó¼È9fƒã>†<  dX$\D£Ñý¬Iú/ß+˜2»/\XŽ?QÄþ2 ´¾„@Âóóþþ~ä{xë{~|~æœ LÁ.)˜´Ï@€'îw:‘Èmð{Vf÷ƒ·‘H§ƒ¯"gŽqeº"ôH}æ Ña„ÛÛ`ðêÓ§OWÁ`~@Ngޱ\S'=a+ähîEƳ¥€˜ q=Ï‹·¶¼ž6B~•1Ljøôé_l°o‘œE RTò(l²þ`2.ÁH€gÿµ0 8óŒ3€‰9výÉÈÄ0m“á~°ív;¾X æ Àp1ÜdnƒôÍ9ƒÍ'D0@f\·ÿºñW¾Í0àoæ”íadœØî`28¢©fÎ[úf0L­>lÃKmŽáb¸c\'¦1Ùîø!®ð(7ÕGŒÇçCẌ́о £Ï¾U†çã1Ç\q“1J–ö¶9bJý‚1"KF{œi!AÖ½±n2¹·—Lvc^]FN+ƒ&&a” •¼oÂS¢À´Zñ4>S€P' GG{lÁ·Ép8ÊÙøiALô"Z_,kðü!L+›Ñ®ž× 5“€'ØI…dsDHý¼Ú¶) %ªÑÄö°òH]à‹‘©f Òoîà™Ép¸› ÅC¡9§°×ì£UÍXðË5m+ÿ¼“,¬@Îxj«„¤“€8%ÓºHÃ@aƒs É4ì_í'Nu™%?vˆÂ2¼µw éÇ G{¡xÞ[N§Óâ—\FþG-&åΦÜf‰g'H cÜhdÔE¡|þï\ü>ïÏqærÎÆ—¼¿ëgrÀŽ`2í†Q Èd×'×È#i9ãN#µ¤%#.WbNI’€!]úŠår9ÝDË…u]#× ¶ÈãvÈ„šh,ðyF™1r^Mn8aH÷Þrª’J•›N0Y(Ó‘¢dÀûh0“N¶A‘¨W(¤]UɈ3BÎ0à³{$d|ñ¦*0RÅ{ ïD7‰ 3¤\©dËŠ¦=¢D®£Eú]Μ‘J݃”F,U„‘òÜ7¤ú?èºh§Ü*¤7ý"$°„;ÜX7i¸ Àå˜Ôh\z‘jäóNðPüïJ©Q󆬣ú2˜l€oï=ˆOÚ0äÆª“gäîËKH%å‰ùóÈ(Aªx‰”\¥@,«s)ÁÈrcù‡/± @ f}ø ; Ÿ‘>:$d;1pý^¯—1*©N)_fÑ gc”»Kté$¡? É#¡Z=‹1«Ã–HûI!^&$.ùô™ Hðøâq–ÅJÓ‰¡ÑÔÓŒ2"Ê÷ F}×sýÊĆ@dª.Ø©`£âBžÎˆœä“÷ |ÎEˆ·ˆË”¤\ŠIÏž¸¾Mž¨&éM8D¨혥'áƒWÜ#(Œ%ùuI8<·“¤Ü{u„€æ aûQ–¼@~ô"0È”˜˜ à¶nY+snÐf iÄÐZ鹋áõ5$›"9} "ÆyƲ*ÁÔÅ$„¯˜22ˆm­j–˜:÷z#á˜ô6…•4nY6d.å!^y˜ÄR¥†Œš¶VàÄý:Ù I Rܸs^ñè+„€ø†¼^FmÀK6°)Ô·ïL£ 'œfÞ™[†À>»æ]>b¨+)Ñh d…"^æ ï½Í€ãœ†+)‘j°JKîÞñäïbU+¹;§3WhâL‹6ÃW²(¤;2èùRrw §ÿwa– àDn*ÃëýŽ•¦‚ëQJJ Û¾ŸQb ýR²wŃƒ£ÔìˆrÛéì_d±Tlq­”xâ±b®d#·–½"Ë鹋s°µJc¶ó%GÔ°„ÜF\u KžÄÊùD˜ú^û`¶ïÖÑaHÌÿ8sˆoÁ!á£Ãw«÷ž·ÉÆ“VÂ'³uÅOŒEƒÉp0\óM·^†àŒ½$ÔüÔxÕ2‰ü0>>3NÞ‰ùáÇÊ Vf9^n"bœ}~§´Àˆz>fgùï†U¢þÉÁBÙ?4f Ì0Y܃-rq*ßc´¬Ä#l@hDc]]Õ׫뵕¾±ÏNèC–GÉEÉ-@Fµ¼´Àèö™Cðĸoôw¨­¼ÚÅ‚ÌSZ€- &{÷€Ð=~‰#¸Ž>lV^,Ȓʯ”=ÚH¡^^ö@ —s/Žô/ Èå,Ä^¡iúS†/‘à<ìáœvf<$4µ‡‡GÄ„XåæoqÔ•p {)B†cÆÀÎnWâš•¢2Õ%£0«qD=7+EÂ#Bg¯H'2Ü¥J$ÈÆá¼¨Ö®ž+„è]ÀìYµ´xJ´‹]G…®Nˆ2/ÝÁ±×E…]jÑèBypœÉš„êá=›ê´f„½°Ž«ÖÉ˃χæ³ËGêÑ¥Bg¦z3„“ÿ¨ˆ•NV‰ŒÅ Xç,Ž Ú oÐT …Î e½·±yÁºðrÉ1!TSÍX¸ÛíÆš)â6ѱZ²­¯7ƒÖ+Üôäz­øœ©¶Ï†Xçv ³¶]ã^(>׋«„aº\Êèí§jæü,«Öu5{vž©>µ7”ѯ·W¸§Tû¨!€juüôľdÚ4Ž y$AµŸ´6XsÃnl|ÐÚØòÇMš÷ ËZÿ Ý´K¨g土5Î>miœ™;¬á…°S‘M¹`}Lä° 20W@'<[ MÞht+¬ø´-@ 2QÜ‹b8†5o#-UQÔÖímÇêe.!£?Ù¥-›0æïüFy_¶“Õ¬…xá]Ù(ïþºf J§»5˜ìÎÀcw˜ŸUJzÓéƒ 1k±¿l!TÓ][å“GbðŽÿ¬…P~Bð:ŒÎ:åqì®Ôw|p±€°Ž¼{v¯àúðZ!rb¡Ó­ÎDð69È€CÕ/Ý‘˜âÝ‚9À˜¬]_89±T¨5ö¦¿zCðõÙ]~ë¢Ë¦ŠÂ/HsDß'üÆ•’‰ÇÀš4ÊÁ‡¼®LÍi¯j°7aè?L~óÎä6?j%ÆúMŽÉþ&üßóMþàšàð<Ê}Y|Hl|ó½'÷G¯ËÙõo]Xš:Žž2Á7ÂÿîwýŸŽÿ0®6@…³/*¬IEND®B`‚jffnms-0.9.3/htdocs/images/host.png0000644000175000017500000000035011377440254016537 0ustar csmallcsmall‰PNG  IHDR ´@+gAMA± üaPLTEÿÿÿÿ÷ÜÜÜÂìÿ¸¸¸£££hÐÿ]bdLLLÆöÚœbKGDˆH pHYs  ÒÝ~ütIMEÒ. d@IDATxÚcðèèèhahRRRÒdh*//÷dh*66‘‚é@², D‚Å[\\\<8€ê'0´†††F2xΜ9s ¬‚¸ëNåIEND®B`‚jffnms-0.9.3/htdocs/images/uy.png0000644000175000017500000000035111377440254016220 0ustar csmallcsmall‰PNG  IHDR  ŒåªsBITÛáOà PLTEÿÿÿÞßkŽÿI” Í pHYs  ÒÝ~ütEXtCreation Time04/01/02¼ Å:!tEXtSoftwareMacromedia Fireworks 3.0ïi1ð%IDATxœcø ˜Žj­ZÌpÄ:bÅN­ÂdtR*©¿·©IEND®B`‚jffnms-0.9.3/htdocs/images/pen.png0000644000175000017500000000043711377440254016352 0ustar csmallcsmall‰PNG  IHDR áfàgAMA± üa3PLTEÿÿÿÙÙÙýº/ÀÀÀDBBòòòŽŽuhMÌ™1Ø¡0vtt´³³‚ÍÌÌ755ÿÿÿ§¦¦bZ¢tRNS@æØfbKGDˆH pHYs  ÒÝ~ütIMEÒ5|ÛUIDATxÚMÎAÀ ÀU±¶ŒÿmÑt$³p8áÁ>O¢±®)H+¼ JX†‘€!±±ÒåàP1\jM7•'SÇç»×­IWµÇB²2]ÿ/?PÊ'ÚDÛÉIEND®B`‚jffnms-0.9.3/htdocs/images/es.png0000644000175000017500000007022111377440254016175 0ustar csmallcsmall‰PNG  IHDR V‰eŸsBIT|dˆ pHYs¼¼º· »!tEXtSoftwareMacromedia Fireworks 3.0ïi1ðìprVWxœíÒANÃ@ @Q“@¡I›Ò6 @á;ͺ×ñe8ò]¸fš¨P!±6ÿå,¿2š÷Ï·9È!ŽR„FH¸‡å±°)F’P • õwuKny‹'u135KjILÅDMà—³ÉÕì¤+Ú¿iÛe>ÓäÕ.‡¢ýë&›7g^Šö«ª®V}¿®ê“‡¢ý‹\|¼Ûm×ßý§²ýª¾Ýîž7›ÿêçâvÝŸýÙû?¾¿ù¢Yü<Áû¢ý¶–C7tãg_´?ìÇó:~¦)ÚÀo_Ôù?bû/\ñHmkBFúÞÊþ)¤3¡mkTSxœí]YsÜF’Æzlˤ.kfÃû°/ŠØØØ'{pl6›ä¨Iöt7uøESâX¦¼$E[ÛÑÿ}³² u 4R2)‚-G¨Ê¯2¿ÌÊ*4ž .£éöÉÂX¾og }ùŠn^ì³…,÷öç°Õ—ÓY¶ðŒŸßro9“{»pk†?ËÉx|¹Là×öÖü|¡mh‘k¯µ‰–j§°w¢½[î@É&”œB‰¡ý¥'ÚpÅ»åtxAŃ­ÃÜÌNVê/Ã}¬éàj‚ œ—ƒÙ^4aÙl7ƒ1ž<ÃÍö!{ÀΧs¼h4À£Ñ7‡ôälr²Üå`N çôéó­ä€>nö·H+—ý2Aµ§Úœ½€ãaïlCíJ’Ï qEŒ†Y¸îr69"Í áD¾3Ð’ÛNÆì˜n›!vŸ!¶ X…ÚoÚ[(»ÐÒZå(IoR7)ö)H–©ªG)L0Å…‹lKà‚öf@ñ!;2@ß1€h'ZÌàyÀàÙƒóg¨Jc(=ýTµ +.³ž -j"êãQ§`Aà\²–.|eƼvó¾˜(ýúÖÈìν[ªþ-„5Zõ®öн[ùÊȘÈ[ î6€ß@ø·Lôï˜è’:aI3$i]›Š‹åkÅõí‚C*“NÚ(4Á\a8Ò*d88Ñ’œõçÐ÷€6| ž²³L êq1†ŒÕQ™VäŸcƒÔÞ›G ›mP‡w½á¾ï#ÃgCR™_aÿ½ö¾>\b&bXÐÐíö¡ƒ£S`Ðø0Y]ôÀÜ¢å›ËHZ#Qo<^BðcŠCzMŽO¯ófGžh#î?Á$NÈUЏ¶CÅ5¢B¿çq²N%Žël‚tÙú~G*‘¤&Øàƒ'â ñ}lDzLzÃŒKå/О·ïn›˜B†€•ØëBAýùx€Ñg{\&HëÓ\2»7Èro@\^CX8'0XÐm®C…€1Ëý%!ê8ó‚õœùÎÓ§çl;e†m§ã– wOIÛ€Š »6 E•ljÊ|,¹™ÀŠãõX§€¦™¦™"ÅÖ#Ð%+'Ì`T›í­ŽGaŽI ˆÔ)˜¬ý?ŽVÒÇBÜËa¬M²±…£2:Xš2•œ²(§!N›§ ~H¾þ¼‰³ÎS‘yÛÓ«&°™™:3UɉPAÉ(C)GÀÈÔ8ÏÏVâ™2@þV>dbIîf,æud±FÔÍ¢ä,,¤j>v¤˜­¤ìx›†~SŠÐlÊh‹äÁUúzÈ{&•²'N…"æ=Ìñ\®Éñ’þ<Üi6ûCŽ-=7:´ÙÆÙ 1à€0ß™I:§SäÜ ‡P˜2oŽd³±‡é—Û1–¾F󡇕Ù0⪪uí@iCeŒ©2•©²°$Mâ‰.±4õˆDÉŽÀŠs(ùÐtʸù½ökÁѵ(§ZF’ÉdN"†cSD\‘° n©Žèe€Ðázã™Ç½-æÞžç;hN.³§æˆÜãÐ÷€D½³Ê¬¥0¯R:ʲôæt¶ Dd×d1È‚R4Ù™äHÌr¿>Í©‡Åž„Z ¯!BùÔȸµ2|"[ …rEi Õ.ÂADÊr=åNž!dÕéÊ£Ø#‘>ÎÙîíåwä;¹Š|r5r"Nú_À.Ä  ^Ü®óT-ؘ:i(³6—¼%&°Ak¨'ó¨žå¨¡šíåwÉb¦õø ªggÕ_5šÅh¤bª Fv™~‚$½f^3×\ÞeHˆ`xT±.âP8Eö£ê<¸ü†áciÃ9x¯É‘&©KõåšöÊHFÆÄsµxS ô.ºòßëE/eæfËcrÙõz—2³‘–ñŽÑMöÜA¿ÅÙN’JWæ·‹ò»]3 Fóì†-·éìÃ^µå;{ùÎó|-½×x53¶¬'Ü3½Ã¥ms åÙëk NKI°<ØKk¥ˆÉ”g2$¿]45¦#8Iåu‹ ¯Ã˜œæcÑ(AU:­ƒ1åúA&ÉOpÁù'ו™«TA_Í’e¥¬Zž[ÔW‹üsÉò蜪´Ôs¨ÿi©Aùèé=ÆÈoA¶è ^J׿uZ¢YçüÒ¥Wdd+Ag*‰úèq¾3[/¬Ãä‘„É8Ð~ŠãÏÖ¨à"€k92öú!U‹D=[ÓoÆ^É1Îiá‰|çù@MþLX¼3+†Ë{,—ñ<Ïi”d×aýÃú9&Òb\!|ޝ6#ï<Þޞ顦 YjΪB¢Lz¬³­3›eõ%òŸ0ô•¼v‡”óÕ‰,—£ñðr1’W_gˆï ³"à%ù¢ q=ÄwR~EÄ+K®#*Ùˆçˆ 4ÚA¥M‡xÉtJËp°²ÉcÚ¶¤Äû…¶È%Ç•%ÝÚe»¼)O !1Å$aŠt!½¤sÎé/f-ÄmÄÚ/`èù )£Ýçõá6}ø>ìïNÈ«c#úR˜Ž?K©ÈÈ‹Øcäg$OflMÁ ¦±>`E¦¬Å«&—tɺù =b M¡51Ô@Æ“o P=—]sÜàšnð…7¾M®c$H\—,fRz0/;®)ë“}óa¬⋊bqOÆr:ùùãŠóÝ qn4¤äXz§%cáv~þ¸â|7h¼ÛÍ[‘ð6äˆóÇç»Aãß|h2hvØ÷ßÐLdöyÈÀ(»âxíÝ€ n>p÷pÌžó¬iƨžq}*žíJ|óAÙàAÑ‚ßpv½%‰’b”$Jº”Ü|€r&zêé ‰óÇç»A“Þ|h6¹ÿâi îÞ7¹¯’ËŽkʺÁ”)-zÀ;+…Áîå~‹é©<+œwN±üxMy·Ö°¸£¡©YÊ‘­Íñ]çå.Co¢.tjÔ÷R£>ÀUS\àó ôt‚B4Í*mZ ë‘)7MÿÉ«kwLŠ:¶ûI¡ÝR‹ósU-ÿ‰·At3 «ÚždP¬Å;;¶þk=)‰ðõ¸ \TUl·[® –Oz\n˜é‹R3=µÔvDiäïuënõjn5Š-êˆÆ†„q`ÄÀvg»F¡ç,ÞsQâÇŽZèóR76SÃ-•#Í’(N®lK;8Á…¹>œ»ÙÅr¸k]Ïšº«æ"÷¬žUõ¬‘Ú™íTô¬¦±nTõìêƒb‹:"²É‘^烲5(@s]×­BÁ×}½¨Á×¥lXйÑ˪P Wp•ÿ®ŒåÖU+/¥üêÌ)·cs+ÍáʹŽ6«&‘¦®“ÿ$¡ë×@3|Wü²@¥ŠX@U¥H¶I>UŠ9‘Uæä®j¨P¤$%ŸR ˆòúÝÍé>Çà7–Ü#_5ñëzƒZí1S.\±'É#„5î¢Ø×@³²5Uz~Úœ+ª/™7yË.´#¶^ûÍz»2=t‚*3¿ ÙåñêD¤·ÞØ‹´¥˜ mÔrg¡çÎHJ=¤Ø´}œa"g¿/ñ¥é|4ò•Ü/w&³ËÅp{‡üz†Xî@ˆ1eÚަ³QäëÈ0r¸ý®úš)è´tï}åÞ|[c_²{þ[[h–ºš]3µa?†3dœKðëÓ|8çA‰Ž¯ôà·%äh©Ôº!dÔæÚGb¬ÆÓtåÊMéʸŠìÚ¯H‹”«JWÓT0}¼¿ÇÓœÂ=;ðTÐ9\‹«à`‹¯Š6=Ä/ˆ{ƒZ›;Ð)ÞwÎï°”;à;cç0X¨º¾XƒxßlȖ臘žÌqú öF+qo¡t½U|Zó£µtM/<–®<ÀYˆ LSÐ9Î3~—Q¸‹®ëPtZ˜»ëžö_€Æ4G­÷®|ý¹5bÉÊýp¿.},-+`¹‡†\ÿ„LúŸpŸðŽÑAYû¥» wÎp©T‚R”Ý)µ¼€ÝûаümnìŧÜ©?`:€ØÂ µè¢²—ŸäËÙØ•g•ÚW¼sƒßY´Ñâ•ÿRýrщöŒ!{u¼=¤¯ªü úõ­÷ ÎÉ,u ×Òh¬–û{>•øé¶Ón0¦ýíèg¨ãM϶=Û~r¶µz¶íÙöαíæ*ÛjfÏ·=ß~r¾µ{¾íùöÎñmžG˜âR—>²í™öÓ3­Ó3mÏ´wŽió<ÂP#õûéÙ¶gÛOͶn϶=ÛÞ9¶ý+cÛ<; ^ÌØÊ¤çßž?9ÿš=ÿöü{çø7v%þíÙ¶gÛOζEÞìÙ¶gÛ/…mK´òN®3z¦½LÛ¯ë™ö61­Ð´«0íÝ[ Ö³íM`Û~5X϶wmïâj°žooßö«Áz¾½{|{·VƒõL{˜¶_ Ö3íÝcÚ»·¬gÛ›À¶ýj°žmïÛö«Ázþ½üÛ¯ëù÷îñïÝ[ Ö³íM`Û~5X϶_*Ûµ3Ôe©oø÷¨Q¶_GûZ¹êó2o\h6|xž-Ì[¯‘E} Qצr÷ºu¼òµô‹SØ;—¯­Ò9¯F’U¾³ç³è^®OO]i«{ù ówN×ÜB†åútÍo­k$²0o±¶=bÚ&ûbdùÓ72–?‡ý/}í«UИ긲8Ö¼½QeQŽ?;ªìW¾ÞƨÒX±í»U>Ül+!w¶%¶Èþ¥ÏYãÆžm{¶íÙ¶ÃW³íCÁZRË·÷ßæ.^Í”ÊÉôËæX»1ÇvË”ºXÖhɲ_ôN+ž]›õLÛ3í—´Ÿ#‡ð5gÎ&¼šç¥ö£jï{N½"§ï¹ œZÔ»žQ{F½ÙŒê7fTûOdÔÇ þOQ ú×Ïd†ÝT¾Ë /û¼PžôçÍx:̇g轉÷àcÃõݵ°íŒ§SðiýŒgy^´L[TÝûêPÿ¸í÷Œòµ£OÑ3<YÞAýðœ}kÂ\HnB 2_ úAþH¸s˜r„è –4‹ÿj2âFÙå5´ð †Ä¿ÃñG•èÿÿq|¾ÁšŸ’ߟ¡7Öcº®W6±E§,ëB£Ñó=‘a®cdˆzûŽd½:öD„ñ;µ6ÒľøOb§à÷D9Ž*ú _í_À çØW‚ò?g¸…þŒôà˜û³.½Aж¡<ÃÑ‘\j€ÌöÊÈÉoÜ Õï «a4øšy¿×püF‹*cwõž·lŒ Þõ2fY‰ôý kz(]ß¼– ('½H2†Åç ¥O+çê¤w5—¾º¦*éëk)JŸVŽ;¿¯þ–ÿ%ߪ¨¾ âeí{T‚º—"Ѥ¶û «õÇ—åˆDý£±å­+â(Z¨ÞWÖ¾‡%hÔ×ö¨‹õ5m*Hë0n-GWñk;–þä=ã¹6BÑþ^åh?‘Ï w?©Vï~í$šqÊÇG«šjhr×z_aë¶0š¦þ:­0”¸›”m"¾"E_`DE"/ÿVÇPíú³®lÀbí—øÔrؤ~ñy1Äèäî*ÙÌ//ÇÛä/ã¾¢›¥8g:=Kv– F6¿Ög>œx­Ï½Ÿ3Ì5?µÞ§\ï­;¢÷eºÙN»Ÿh{Øo‡q Éí}Àš‰tÄrʵ½m¿$¼_Ì+ôË&Ø6Õ°õŒIb–UišÜù=æiÛ3û¸ã^çô"Ãù—óBNå6i[]i§}ßÊo¢v#‘ÈÇÆœgÀÆHDÜ’1’þŽXUüÚú5)~êléê(Õä£T§¥ö£Ô~”ÚRïä(µŒ[UvþšÏ/P6Ç]ò¶”eØÓ6Ïæñp7¾Mh ìê1ÞÈ¡eøôÕUÜmÑ6ïÚe(Öãþ½¶ Oø€±ô Α=åϸž¸Cçq‡u…^øwd#¹9'¡×"³d'¤œµã¯ð´Ÿp¾¤úãÞÚ~^ßkÅÕgt&ñ WùœòÕgêÙö=cÿ‘y(²ÆÎJÑÕb«³RÞhoE› þ@={%¾#3ó&þwØ+ÀwL½KËçô¿,ü«±lÒቧ¸&–<åëcº2Ÿêììþ†!ûkŒóÎñ­üë`Óºç¯fl¾"ë”û¨¹ÿ¢á{HŸFçÖiªyOp¾ú#<Œòé ¡°oÁµΓì(¹ì D¦jv£‰ïõ1O—¢†QF&kx"…‘]À›¾“náÇÅþ‡qÀ-f„2»öÈcD8Ï¡=…¶6ÖþY½“`FíööÎ:DÉÏÁ ºj9Ùš_.Ûã“E–éø³©GÞ£ß!ãÒow â„[T¶òÖÒqeÉtx-à¹óÁ ÙìŒp3;8Y˜p4?YËÑtˆ—L§´ll–ó—ƒË­ñˆË¨D§ dzËÅ‹ÉË“…¯/÷Øv>ûÍŸïCóçûC82‚0pt"úüåèšž´Üy9¹\Œæ¤õÛclïd G. ×3,ƒXF6K]C:J¥²H½R7¥£X·¤£D·å+ßñùQ¸›Å<Åeð[92¥#¹e¤q_¢´3È é(Ìäv’vó’(‰Ä3 G<ÅLÍ”—ÁGyJl‰²´P–X±ÀE–6K_:²<íL~Š)—Å–Ò²XA×Óei3¥è3¹-j?è®Ò¼¯´ŒôX–¥¨Jß¼ºÒ_‘(Ó¥û‚DÖèé(6iõŠ´zhJÚx4ÂP´Ç´Ç DzJ ûò•º§è¼8RZ5ðv¦v9r}žÅ1‹í 4ºD]¾cé¢ÇÃ2„Dq&£G‘*º+]éø.?Š<374©¾@éÛDÑO®® ¥²ÄÊ„ÎÕj߆¢-AªhVæ…×/t¤þK  Là z&°ö­XÒݬ…÷_š€¶ ‰"]:Ê"h¤F`ðÚá.Y>[±‚ï??³M]H 'LŽ|@´×Pޤú”k¸Žß:ާ « e<ã0Ô ^Ÿç:²ÅÛ”8Ò‰Ew-Oj‹®‡RYbñÚ#…õ£D> \×2…|!I!ŒÂHB^–/Tù%KF‰¯hVšY¦„`*#˜F¦„|‡B …ç= œX‘]<% çm[ D ±©²›n¢Õ–ª×N&Idé¾Äªºês2E#%¿Éû/¶<ÇäLajrtc×ЄGÈdÖGÖâGnâ8B'’ÌY1³-¹e±Ä(A`Û×e‰lj$ ÇŠ´žÒß<:„¼/»•q1ä#è! ¥È ´Á´(ƒÄå–#t ÕZ–ݳNȇ‘H5Ø`ª™ÔNSŠ<œ\DYKz†¶bIíT=l&1;ñB¢Dö‰â}SbÅ®„¼lÄþd/cØ‚MÁy-mÏQpÉL!C,G:‘%ÖN !¼§XŽ÷„¶\Cjж˜‘kÊWÚÂ3Ç®oÚ‚mR¹†ÈtSòNŠG †+"Û%þtÀREßZn(s¹›ºÜÆÒ4¶%¯*‘G*÷&rˆ)µSá3Û2¤¾ìß±-¼>ß·m‰‰’ж¿øðL^CHàWú‘*"•¦'ÛJȶÊñgdù²&„|z¬ÄìžéI–£'º¤Y$6æíŒåÚS+ôDœ§A$¢Cà%Éâ¢Lõ ‘„¼ìÃ##p…儺ç*HÈ=f‚‚R;e#òŠ˜/¶áW&‰±Äº´¥È®zXÎ!hïR,×ò²ÈsCÁ|ØNé)NèJžìH>r‚‰—ȺäÐÙ‚'Â@x{h¤iÉÞ>^-ÕCI¾0ô ÓYÂ`ð'dpˆ;óC:J„a°±ÜšŒéf†›­mºâfÉ®â óýœ,[î’A¦¾üÇäŸ' ‡lgôðˆŒŸÿ1™ñóîh‡Ñã )ÛÉÑxvL6CºÏp¤}ø «Ïfäö½ù¹aoNýÚòð—‡0j>žŽó¡³–Ë ôHšt<Å6ŒGs²¼q~4!›é> ŽpÏâ‡8Ð_Ž_ÁãÆ[¯.ƒg»¤%ð|l{©g Ñ¯0% h*3!‰ rÉÁ6n¶Ç$?±C³ýŒœØ@ v‹ë-q`*ŽûŽë}uXŸFNF‡õËçû ìó}„šYÕÂ{ÚZøQ£¯‘JÛŒŠ¶­ºÁž¾¡½€'G˜,cµÐŒzéWjXîN‡—‹Ý£—ˆÝ£W¸™Á‘iþää_ᡳܥ½jèä·gpë«Û>Ë;\'G{P×îð9©ñh†ùœ£Ù*ËÿK”æòà¿ õ´mkBSxœ]NA Â0ÌÍoø„&Ô£MkºiS´Þ”èU! ËþÝZ,îevfv–±up×è%@{L¨ÿÀÑäÕJQe/Ɇš¢õÈBÓv#d%§üwzÛ>`V—W¶»"ÀÞ>P,ˆ‹xŠ›¸‹¥dÛ·©CºˆI]G¡ÐØ2à_™Ã‰Ê„ª¸ ’\{q3v&nꕌÊDR&vÞñg ³»TÍ ÿœæʉ^Ömiæ3*mkBTúÎÊþ©Pxœí}+À$+’nÊ”iS¦L™™‰Ä"‘)±HdJ,‰Db‘H$‰ŒTŸ3;;³³WÖŠŠóèîzü]@<¾/”¬Çv°ªØr[ëõpÁIáØwጀÏÝ`YX€h€›Ã ª<ðY·Èv¾†T|Rn_~Æ€×p9`‚»ÈMß{ᥜëN¡Î°|Y¶}—Ëv@[/ï ;«Pù6@_Wçî€ëµ–rk•ð¢ÌG=-<À÷ûî¸b9F©Ýú!!‘2ßr¾ ³_ ‚¹ŸpUº|ïº1WµìÛëßµyíÝ‚±v¤D!8…‡D†§ò=y1rV›¸tÇ`÷@Ù…«»´ä¾ v÷t†êÂ7A{ózoõ­Mž9X.(Ý-¦ãïùÜ–_Mc÷ú´ùÛëŸåè(QxN^^À¥x&`p¸Ts^TT{P?¹9½{…ƒ`ð¡{¾Ýƒc·{rûâf^7±Ótðøê•·¸¹²wË,wjãDÚO÷Üß_G¥ä{m—vÕ>&¿ú-YÑ>\yÔÙ†yØtác ÍÁuâ¯/$©žž¤åÑ€‡æ_é ݈†vvâv…„‡Í…ìU¾¨J•@í¬Á4ZûúúaE—†6HxV:FÄÅ6ôQ>KÓSy÷.ö&Û{ñƒË<}Adä:KNü•?2ðƒÿ n3œ°àöì7,OMEN#HF`?¦- j¢¾½þÌ!¢÷j ƒ{r+èœÃ%AÓ¾»q¬h ‹ã$S©¯Ž@ÜûÞÛ%Œ%|9`Æ…Ð}6¢×ù.?šòjU™ë  ÿ7KBC²ã_{-æÛë×®8ôÖé`S‚ª™eœ[ò lhÞFçú-å*,º?€ÂøÇî‡nt ó„WTÀe¼Ñ\¾øÃšüìËMO¯sëøfÂ^|àÅ}EÄmøöò— ™ ;G…F÷ÁÔóŽnÑ^KbŸ¿[ôdAݜҥyŽÀ_g§¹:Ò=h5=#*|3z¡FÁÇ#$Ì£[^Yü éEO)ñÔþÙ€¾~þ¹›÷¸á¼IÈ‘›ìŒ8éþà š• ¸Ä½ã¯&CÃ}24£ L  >bXÍÚXFkµhÜFÝWI·±£.ÀØ ü-h-–ƒyìU¿®`Þµ¡çF îm<}hRåvTÒf«}ž|dôäÅ¢T@O¾P\ÙIú' „ýÁ0‚ïÔ%U-„büÚîÔøÅ2°Ö“‘¬yxŸÏúÕñäèdšÖß^¿Æ£ÖÓcAÄ“û<¥Ž¾žQzB±À /Û/æB]×abãzn»s¤ÝDD5~ßr(|ÖŽN¨´já@®0ƒ`}4¨Áïå÷)`Aíǧîxýöú9ÇE-[­nû†:·àLi­C~º‡% ‘{¶´éÏ·÷Ðâ<1J¼d‘õ€¸¹e¨vmÜ;¬T ã>«w¾PÉ)XÉÍ£ þK†ZQ—X!+}¾½~CX@- Ñ>ë9ŒFwx+$‚@>°,‚¾#åÌå£XÙµïÖÍÜ1v÷Q5%t˜á‘„J÷£›ãÿÄÇ#5Ì–3ÁS=R eã[ÌÁÛ÷ùOØjRà¯gfòM߉ZpE9%ü˜è¾´tÓåc°â¥R 1žó.®ª’ Šp8Yw€¡øhÉæú;w@^ðt¿ug.ê©X·ÒH¯ñïTì¡ß^?ò2ó±‚Þì–!³+ªõtÛáˆýU#_Ð:{Û*•!Šny³gÐn’:ÿ@º Zg¾púwîè¬p¨ùÙ§PÅõöþæ ¢Ý=ÚÔ‡|½þUëtlèÛ7~ä™”@0 +—«„²h‹%âÃ\'‡ÃàªãÃÌŠ!ÜLu`tp/˜ùØß¹Ã·0Œ!–óú:lH- ŒgA®õ ˆß^Z÷1öKO½¢ƒ_çŸ<í’*•ÍG}|;n'e}…ð*Éé#(4hŠBÏ9Th玡œø®NÈŶæâ†@…%fî£Ä p–o¯ŸìèÝœš9¤Õÿ,ïvãrd«–Ô¬ç,qcD˜õï-7ß= »Ì7ãVü´™‰ >ü§v`f1ÅB+‚ó?`®‚ÁÍãØ•—ýÛë?Õ»û+ÂyKV"oòú6ÀTÁpúÄÅšUÕk–ôª}"¹äÀˆÝb„Çñ™Éæ7þª!H*3(T¢u|jG¤yÓÑŪÛÚ÷E¨ôe™18ñ-BºöYÕYd ƒf[ÈLùŽ>”®=…'ƒ4"Ÿæ}\ôÓxÇä¹¢2EçöOçÁcû«vxV¡|çMÎÀŸÚ¡ŽB¨s%ȧÔœøíõŸ?UÝ$gÕ{075ŽŒ™ÕºÏ[°§=‡h`ôIu7«ô<¶ƒƒ»n†n€®h*±0¿4àÇñÀ_µã‹ÅPžOÑ•éïÚ1•E Ã@úíõ㉊—³þÌ#`9F]à:{C Ãï·Ût'öƒ=©­Û4v9ÓÏÚŸp ¾¬tÜ8\•Á³7|z0î½tíŸÔ ¾áOï€t5 š 5–M|Ýÿ£/ sÙèÄéÖ=8ßß¡¯ T37„NÑð¨Ù][ýGkp®aÿ–LÇûÌ)ãŸÞ‘fº±ú2—,é?zGúKWÇ«—ýëù¯ {ÿ€eKΓø/èɳ}OˆðXþ«Ð «VçÏs Ls’àÔ‹{æÐªqHHÎÊaéõézÂBf‰w&¿0”>ù¯Þ¡1¸tè(Ñfä×õ£Øã\·³%É}R@uPÛËA(Î@£™0M¶z>n‡ /–:ä{—7µl6u]~öŽmç'3Žæu/Èü¶OéOïX¿-ô?JôíõŸk¤¤3pçúÉMNVÏnuŽ´S>êÁq$t>NSãgüÙ,½ŒyÈf®z™Ækf6ð“ñ“{’4µ!Úµ Y̳–ßX?îðýöú%Å£G÷ý|Èjî}Â~ºõÌÓH®þ)´ü¶Ø'FC‡Šy6µÁ«)$ž.[­§xgšßÀ¿J<×MCô+QòÉñgPX— 7¿¾½~P°T¢¥ÖœÑû~–¤5ÍÕ=4»úW aHàñ¸]0/q³J!ÚѦ?q?åˆç+kp¯§Á€ðB7ýÞ "¤>‘ðòÂÙGª}ÅW=ÿ‹ÊÏ\®ñç&ÙÉ«ÏfH0e—áþ¡× ¼ækƲûÒÁ¨]N0ðG¼Õg4îìø5*öƒ˜O‚Üï xFŸ·Dà ‚ µ~P»vá_þuþ›Á9èÞ%ÿ¼|?v¨Ç¾al°*áþ.ØýÉpèÖ,S?û5j¼Ïí‘ÍïŽP»tè~Û¢¾4ÝÃ$FMÒmÔÇ3º\9„\fV…d¨Ù¿ßÿ‚šI•¾ÌuKk¬ß+síÒ]hÁðö?:õi²Äºˆ™-˜Õ†^pÐYçlj¿ð¤keÑAÍ ©Ö£;…$Â3ÕØ~Šç:ôLšŽÎH ïI¾pý#‘Wí,%ÄûebøÂbad{ãO`úÈeE·}9†!mBæ ·À,ú™î’Åûƈy×ûAµ€¨¡U¡kîèìb¤½]N©Ã¸ ˆËŒ‡·’D_×ÿËj5j%u©Á^׸ä `îO ·„ g9cE @=—B´HMÇÃl„kæ@È$ Ø¡÷Û–“ñ#iBâOÊO¾ Aðò\åìûzþ»ìá“ÖXCÞàÁR×%¥ˆø»À6¨ ñ_Ílõoê”NVžLŽíµ?Ð7\i–Ž‘ûBò½#~’ò_—l5Üzöq#wR£f|{ýjÂSôK åËlÜcÔÄt‡”*™€=ûLfïLâQóûšJ_KeÊíÊ[L·ƒE›“(ÄE×U­²‰ìÃü0Ž"°²R¤À4hÐbR |û¾ý;¤iã@õ»fT,¡}±ˆXß?€G°ëBP7ÙAí#Hk2§d¶wµÕ¨U¢Â¢§¼Ø ¶Â{’3—ŠeŒøå‰àKxŨ!tŒ°ŒÏ¼Ñ¾½þ;Z³Ù‡›MKÉ+2S:¾¥mŠÏäÞ:Ê‹TÏ,ŸÆÖÙØ´t|H¿>( Ÿº;:ûHµÙf…³T®Ëì«+ü¹È_Žo¨G=ÍËíê3fôþöú¼´éLÃál,ãñ÷š0ÑK@§ÎI¹ rØáH½m´¤óDƒ†ƒ-ˆ‹ºKÇɵ·•¢¯¨ù„"ô"·ø§À7³@æÆ8b›R‚øzÿ¿˜=÷Dmc ËCF×_ÕÅ€T¼Ï-œèÛçD¸ÑM2·ÎÁ³â¹_Ø=£Wl½»@Fä´¦ÝÛ"Ó”%bÄ|ÿ|Ð+¸‚hð éU”n¬Ýÿç»+‚ôz`Dv¶™Ñ~_Clç£Oêøý¥Ü$>Y Bìcyg |ƒÖr¢p]Ío:Ú8khÛ˜ÀMåŸ/ñ…Wâêñ^Ö†Eß^ÿæÒl½ðs  wŸfîYÈ~(cU¸SÍMé6ã:ä‘-=šj0áy£¤èò-ÆAgЀNN2¢g¨ï$>ü+ñy…|Û GA]cÙ¾Îÿ¬6àÐm n‚5v {Œy4y:ÿ´ôl¾ùŽ<ú¡Þ5y“€Ô7¸™/CäÙBøôqP£ƒð!¾ûÿL|«|RíÛ‰I×·×ÿIw|X\¼öZꑽܳ›uu}1´¶cž¾š™¼%ß÷(ÜHêåö±húŸÁ!Ó!¤ò¿&>ª{Ny! BØCþ~ý{‚ Uàzýê£ø˜-bñ i>ùˆhñÃåïTN„./Œh<çTW³3“Õý‚ÿŸÄܼɖ‘F–q=U›¯÷¿Ï5Š®¯·"f“ödZ#Î`g—· ‘¾êC¾#ï–_®û‘ù™®} ΗòvÞ¶ÏöÏÿ5ñùgh²1_¢ILß?ÿB7\/©²Ö›H%)yËõñ‚4sˆýEvM‰óvýôÿ{ÅD/¦§Y«ûð1Äø{hò?%¾çФT¨#Å…#bù~ÿÿõhå-²nŒ×‡®è±ò\Úyj´½9Ôû³iÙ$G#â‹`Â=Î_ ¦·Šþšü…?C“C²Y>Y}«êÔ_ïsÈPôpÍ ºÿ²û 'åŸù.Dî¼1Ò›bÉêàÔ¿ëôoÎK'mCnò0H¦Þ]Šú_ _†&k°Çd°x‘ãëý¯3{G×!~ŒKÃÝdlåfPá×eÎj’9Ī¡dm5Zãq[nJÉ;øæ#ô:Šuˆ’|ÿCáóC“-Üy à¼Ë®¯Ÿ¿O¡«èã½o!¡šNç¼7;tYW¸Ä[”ª©Ðô§kcd ’“[@Pû ú‘³ýƒ‘{Îq”7wÎŽd²'>{ˆ*ÐóQÁÅVúߨ¿MšAN: Zê÷ëÿl]öѓ䯹Ùc[™Ø}ëê:ç pz„À$1 UÙð(ðrt¤H):=)öÄýß_ΚÌà‹]Ò2{…¿Þÿ„§x°l™u:ä0'Y0v½~p ñ%ûÇ‹ ’¡‚£#o^'XÕœøT¯‡-Ãd'–ÝdT{„vîoáŸÆ§ã߇&9‚¹âÞŽÎí×ãÿlôOzØÄÐÁƒ|ÄlxÜëq!áƒë–òl‰¢e™P>ÝÞ“ ËÛìƒ4ôl˜BïÞž‹}Õy•ÙøÆ¡üûÐ$9Eg/>_ïÿðY\Ãj*SCÅŸîì®9ßPædo/øøágâ_J°·7ù¥°‰¹úðÙ³ÙwGå`¾f×¢ý4>Î*Øÿ04yWĉ £&¿ŽoD·§æÉ9›3mÙÏ»Lº}5Čގv$­îOçEˆü§AÚ0Þâþh61ýs_¯† ÉqhµµL`ü‡¡IŒý——wÚ^ìëóï%ãÅM„å2ÈÖgó™Ó 0Ó=òf_vèç ñï“ÇfòMÙØ7Rž‘;I›¹üÃÓãE„JQÿ04Yús‘€ „NÓ½ÿ[4Hìã±WR¤9«Êç—9¶Ãí¥Ñs_;o@OùäÂ7 ÿ@‘ásÐô21âF÷…Ž«ÍQ‰ÿyh’Åóm`êã:ƒo¯_ 㘠π¾7ú:zßëAÐE^,ù¹Î­x!Çß{>Ìû!7r#¶øÓ{7Òô7ðË÷;"{úŸ‡&/ÁŠ›0–Æÿõ¿W‹àœÃŸøï³ A[yÍÏ…ëmk}ßݲõÄC,NZ û¥ÞMúê9@ì•`CtDÀ"<Æpûú†&Ù ¹^K_ÏJ}£GRæ}/ õì©+-khO.ÐЙÍZ"W è8šû3;½&_ §EKÙ‹´ÆH|‡¿Ñà!ÄGCVº•ÿyh²Kóñj-Ò¯÷‘PöŒ~ZÌšö¬lp§ÈyN7³·ï;ašACNš†h·µ }Ãì–ÉÕp*©‚}ÔÙFZÛMÜõÓ8œoMÛGáÿeh’ Å•W&õæëþÏ;üÈà0Ü• Œ äò+$Dz ÆsÑD %0ïx/·õ{ð¦Ç¢¨Ýßg°óÝ·¿B#”cpD³ù÷¡ÉÄ˵#e"K÷íå/Š) !¢×Yâ‘Ö#̓DÚlg¡‚í”4b>EM3£T„÷ (Ð9ð&®ÙpóÙÿ~Ñ-'Œ¦¢GÝû—¡É‘ÏÉlÖ˽þúäÍY[ñ£ë?êEë.`Þ€ÔM ‘³EŽøvÀ n4ˆs¿ž„í<{ÄÌnÒŸû¸4z„÷3—‡âÆ¿M¦ˆ(pï¥4xÐø¯ïûÿÖ‰mŠžþÚÑì |&xÕ%ZÂ@­(„{÷~»«÷N1´qî£óÜyˆ›Á8F÷ÇPjŽDo6SÿX§þyhr¢ õ˜àž®:úJ„‹güºÿ÷ÐǾ‚šäfN&bç7ÔŠ{Àd®ÙK<ÚœwË#êâžs²ÚºŒ¸ÉN}xUÂ~ÒÛMfì_ 2§¤Èÿ44yYhâ‘tvш̪ûª¾>ÿQcî˜8¡úÇ{Y¿Ž oß›|uß„ì¯ë¢ñ·6ŒïW˜(-œßºÈ¢Þ#¼ nÖš™ÉMPj¿‚]ç MÂp#Çâì ÍÆÍÙy}ÿíªáÁXK süS‚Uò>ºq•êÝ( y u…ìðgêÚó5s”«™3q° À¹!{;ß“"®4†ÿÓÐdGȺΠ_4>7éI®¿žÿ¾½î¸H4(.ø#Bñ ØœœÜcÙz œ(˜#ÿ“}Ú%ÅŸnM«ýžC¸-’Á“Ò ™‚Å}€ÿš|[ϸ%6†Peî>í4íëýRñQoZú ]r;^@UoÍófJ«Ô_„»nÞnaÛLëŸ3ÞœR¢lÆP?¾åyר˜¶füchR––r$R΄ˆ…"úàrÌKG¿,-c¸J³£é“ž\ö³´ëà©‚Jq¦„À{ë} ›•y+wÜ¥™äòMYa‰Áq$ð¡—xHø{h2Ø‚H·ê!¶ñšXGÖâ-C¢úzÿ‡+æ†ÄÕNg÷M#Y#„—Çdn¸rñÜjíE²!©Ù¯ˆ.ÍT¸hÙ";†vé¸v  õ×Iã4œ2'°ö¢ZŠJFïöB Ñ³$.½üëùî›¶Õ2§ÔõÜún;Ó¹Åtw=xÒt‡ï§‡f¿àäö>W:m©+´—õzÌl<QÆ¡¦” C¢àsŠöBÊL†@G1òÍÂèìŸóú¸Rÿþý¢ÜìBÂá9Îò–ÑzBG/æu…³×9ß±\ç!ùp"ôMj} ­Ó†ÇûÌr÷)nÀ²ï—ST&tÄ`²“&Y‡fp¦KÀíÎOŸm·é5Þöo¯I~ï6‡;6‚‘¼®º††h'!ªaG^ drE%¶ ôÅÐv <‡‘Rºóžà1ç%/õLPœsóÏk÷K\wIÎŒ\úšÓ€x· I7JÂËÙäÿób(‘£ÞÈèiŸ÷(H‹Äî¥Òì·<'ߟ›ºèÕ-Ô¤)yÊcN„Åšž:±¯ÏÿV J>çðÌ›ÚØjA´Tgô /d©Þ^YOìñ´CrßG:iïc;ÙèCÚÊ€´ºWù4' ¹ÕêôhòÑñJ7Ò_s÷Q•ƒL„Ñ3!¢ÉMÛ¯û6¯½ ³…K‡y˜{â¼²q ¯† 7x˼Ý`[ÿÁµ(úôs‰k³ã349bÂxæÓ7|q¼ T‡€éüÜ zíôÕ¨HøÒ?—‰-³m䙄3šÎ{ýž ‹Kü@lëg)­ݺ•–õÚÐý„®@ R™t˜iŸMdµ·õ\zKÊó.(\ÊÈÞrZ¹®Èž¢âqpüìƒ~’ìòM`d6 /°wO¿Îÿd`.HÉîyEϼ³è zö°dî¯Û&¥èÃ<ʉdÝ»d¶á9ÿ}hR^Ö…¤=Wñó†×"3¹´Dè_=‘,!÷©l´,¯û¿ëÅq?èàç„E¿?ï»BІ^^‡ŒüÎÃc˜] ëÀúóJ*¥þסIq+\bjÅ 0¸ è}6?¼´t˜´Å6GÉл̂:Äûûë?”·ÍªsÕ%‚VÄÄñ¹ª/ãD¶¨f= ¸~4‡_Äê¿ Mî=?® ‹àöuAÏ?›ˆ þ™äÐLž¨`RðÊ.[ æëõßëÉB:RZõ^޳A)ŒD¤(ϼ®RSÈ÷JÑÀÙu!älö¼Çø¾êŸ†&£/Λž cöM}¸…´[¸cXaD™e(ì¸È÷ç_þLz"ÚoÑÈÙÐHq¼cT“xwât]ø8a‹ Sš“”!BÉ„ÿšL}XJ—…"Š’¨±Ã ³õ‘µY[à8ÉÀ¬°“—¯ãè>;r¾Š x¦Dv騅†7ÈQñ°/²Ïb˜ .Ò=Á±_ƒ—UØ$Í?†&Y ]…X>e€£Í ÒF€"‰ÞUEê,h÷iòŸ¡#øzüÏ@¥7Hzc­–/x2™îŠÎÁ7m0"¢žÁíÕf†Œ¾á\0Ѓ>#aöu Mb5s$T‘Êvb1öáŽ8°ô¼’±£Š#{cúã4¿½þ+ ÎÑ­¦ ™_'éð2EeÐú½o¹ßŸùþÏÇeÞ-Ý2$„‡i%³ þ MråžÙNéMÝòáöàA£N.·9$äDayÃjõ~\â×ólÖ;úµ®Þ]?B¿~^òN‚gå¹âÁÏá~5/øB€€±m€Žu™%ƒÁÛh÷k^BiåöªïùJʵ+èøçw @FÓ!œMˆá*yg_8,Â|½ˆË:Ö†îmWàæc 3çFGåuÙÚ~™2'ÃuF<ûywµZåÌ“ W"¸RŒëOéÓÞŸyäÔ}¶þët çhüûÌ>§†=!"ct8Ù×ñ/Z±›·ÚÔ¸ruÚ£GtX‡Cgÿê÷5Z¨bKZÒbÿº»b[^VÓƒÄç Ù¤”öª)Eô=+!KΔ€\©C5¸0ºÎ!êxV~&§ô,”~½ÿë"¢µ1>þÏ­Õ^¢/·ÍkdCïmùëBœÃb4 ÂrQ"x DŠ!›­W'Ü»Û}QÎy½«Ÿœ"Bxƒ|î”’›ûÙ3±Ùù1H.ͶÔ2!qbÚ̬?ï‚ñ¯œ¥MØ!?†¿qò‚9äÅô>µ<-ÐÏlW¬Ï]ïMÁ}•óímŽ5NgOï4ÁëZ{mˆ†Ý…ðoÀì #CÇÒM]‘ ‚Îé…‚2ïÛì²h2ã_¯AG«¬@n¦éü°n*ìI ˆJ<&ߟí îÓèJÌkŽ`óþ:„˜•¡©1Ϩ»èŸß#{D+B<™!âGù§^¸Íþ‡†?¢áÏéíqz?ûƒPñëë/¸ÂG>øÉ2y\iè¯1^_E1ÐÏlöAbØþBAnEÏ F„ÜXª‡Ã0Ž>Ú>“H1¸Ù'±H$Kó[~æ l¯Å5äìªnáÂ}*jVË×ñï9/@˜ƒ>RL.$?m>øEN£ð—íò$D'“~.„ñ%8±yFc`Œó}{C;+@03Ft¯©Ì‹g÷‚”—²; »Õ$ÐO)öëýO‹Ë:fïÜÈòÓº „|Õ"¾""yAБ‡l•ÝDŠkå#Ää‰/º{µ¥Ï†¶ñú7$Å; áŽzóø»åÞòÊË ,^r„‹Ãp"~}ý5C–|pÉËKA»Õ‚ùyÃɼÀç"7zq%{SJ·{.Ḁ̈܅ÍÒØÇØ”NIŸîíCC½!nVzСÊÃ’+e1Æf(‡ª™ÁÅGŒœ ‚ÞóÛëŸ-Ý/µ¹Û3©îöh)ÈI=óÒ›¶ŸÏUb’öŒ®P…Éx’þFƒ?’ðMðÝÕ;YͶTj^•zW¾ïy‹r½>&‡5Üz‘„¾R„nqýˆ¾½þ¢¦OÛ÷ Mžyç•}—vP/žvF‹ZÛ4Z#êGqESú¹ÃÁÖ:/ó]ßð`<{f#Üy3®ÄlfÈTŸ9Fó×÷G Ûë—OÈy6Œú¾ÿ“uŽçÂÃÐB%½þ|Î@æuîf~‰Í3ÏË™Ø@“}ØÛXÉSœwx$´ãö"’…¬žóQ}ºÐS¼Î!T³ îA“H§PÓ!Âç.±E©ev‰_\κ°ÿúý7+mièÀ‡y’4qv0‰jŒ<þ¨h Ž©¶ØÓ¹uAä'ûljŸw¸p°Îá–m}6<Ÿ/NÁ C~èÌϯJÍÙŸ;`H°Ú7G>Éâ½Ëdž¯Ï?žä©ó+o^+òÞùí-ÐY“¦é>ã›VH?¿uã§ÓhóRŒ?wøÄÏX[ЦKíZ$'Í¡´WÜF² E c½‘[¸·ùí`†“P[œÐ q‚\_÷ÿ]R ¿‚‹­„Ï+zZ‰Q>œ¿3óÓÑÈÇàÙåjžQùÿºÃ‰¦(äÌcé‘F̬š£èÚBYßBüìŠ-ÄyðFvrQ¹ÓYä±c ¹µÔùëç?Úý àõPCétïü8¢Ô|]üÌ;_¹ svXVíÿ¹Ã ôÕÉúÌ+PÙ­Íoè)³1[òÜH>—Êâfo]H‡ðÈLˆÕû@c9Çÿùwè ttW†œ#0*É-ZDx}nÎö;,^ÑyÇ{Rïû÷n³]ì à*»§j^–ýD; òbï¸0úõé 7 ƒ63Š&°7”Å*}Qx¾Îÿæ—¥ü°ŸoÁ›ïøÉ¶RŽÞ^dte3ÊaáÚ(ÔÊ›þã?˜ßš”îáÆÐ÷Wÿ¾â™°é\È#zzæË>% ˆéT,ȦR“óøƒ½ýkY¬÷p\V$PUàªèuAàXcgó{ ›.u¼ žÐÌþ÷U6Ÿ9W„D°Ô¶âé—,|=?_xë÷b}œNÁ¯@Ê;¾|–Pß•Š%})äAáëù?zR!œ@²‹@øP’·þÓÆ?ïðt@­óJøy1P{mÿ¸ÃSÌ”ÇìeYZ^§çw^Ï1*| §ÖŠ9ýø¬L'Üd ƒ!ÎP'hKh70bø¾ý—:çÛlf'bÝYø¸­y‡kxD¥³×m–·1mxüã*îÿ|Éõ§u’Õ'™8¿Bð@(ˆæžå¡Äb£èJJ«c~Å0¥Ïy7æõï¯ÿœãÅz #´9‹{®khAæ×¿•Y&Y7NÿÓU6üîùS@þcFåÁ¼ƒÄLòRz}n@*&d^O?¿b—ŸF½™4ù¼k@þ~ÿÿO~ò“Ÿüä'?ùÉO~ò“Ÿüä'?ùÉO~ò“Ÿüä'?ùÉO~ò“Ÿüä'?ùÉO~ò“Ÿüä'?ùÉO~ò“Ÿüä'?ùÉO~ò“Ÿüä'?ùÉO~ò“Ÿüä'?ùÉO~ò“Ÿüä'?ùÉO~ò“Ÿüä'?ùÉO~ò“Ÿüä'?ùÉO~ò“Ÿüä'?ùÉO~ò“Ÿüä'?ùÉO~ò“Ÿüä'?ùÉO~ò“Ÿüä'?ùÉO~ò“Ÿüä'?Y–ÿMwªo,¿ÚmkBTúÎÊþµðxœíÖÍKTQÆñ3o–še¡8dšYùÒ*ÿ[’Fôb¦.¬E¡ÿ"lYmÚˆ3Q8jæ ­¢E‘E­"‚Z´©”Ò±B;çé—¸ImãF&¾>œ{î9\8<÷üî‘ÆÇäSRŸ|2!ŸHÊßM*Hö+è¿/%†m,ië»gszoh¡´ÔIBnQp¾[¾±I™Ò:eâõÊT4h)^#_]£`ßaeË(¨¨S6^»Vy­´·A¿ŠÊõĹÍ^ 6¿¿Ù¢LO™ºB :·JÝ%ÒåÝRÛ©³H¾ÓiñŠS¶ÃÉ_ZÅÆdfÛžŒlöZ°ü¥ÓʪRK*ЕéSº^G÷èQ²XïßМªôSa›—÷Oi3ñ,ºÙkÁFòZ•õqe¬û=½]cwöëÁµC½Ú —·NèÃä±åü3>dßÉß¼"ö‚ˆæÒO„6{-ØHþÙVy_¹ÜþÓàõZõ]<¨T{µ¦z›õzàŒÕ†¨oõ~­äŸžh‚üs‘]gmWXÕ¬Õñçuz3\­ýEz5\¥wSM¶×c6'jmÞ_üJýŸ³ññ§Ôÿ¤àö9ùž*©Ãöø…|-œj”ZâRsØ~ ¥ ¬Ÿµ³¡:ÜúºœæÛœÆsþÏAZ¬=ª™Ð.}v…úêJÌN»kÚÅ–ŸM»b}qÛLÄÆÖš1͈ãüŸƒ4iÛvÄJwÊ2O¹ Åœc1 „ò­-ÔÀŸ¾Û¢¡PTCáȺC›OþÀî7ö|öO «Â–qmkBTúÎÊþòxœíá‘»… ˆÈ€(øM¿‰‚Hˆö½³Uß­s…¤¶gzf®NU×öö¸mY²ånÛýô4 ƒÁ`0 ƒÁ`0 ƒÁ`0 ƒÁ`0ü¿~ýzúñãÇo‡®ó[†Ÿ?>;Pzò£Œx>ø7.Ñó¾|ùòôêÕ«ß]ç· ïÞ½{>VññãÇò–½)Cðó¿ß¿úúõëÖ=»z¾ØÄû»Ûÿ¨Ò·«4ªÃÛ·oÓߢýÝO\ |W”‡ëG}ªKã׫tÙõ¬W:£þ/Áþ²}Wm8ÊõáÇùÒÄ|tpOÕÿ=¯¬½È¼yóæù\zSºoß¾ýs¯îQùÑ— JçוWåOåI”÷ëׯŸ¯Ë¶®ÒI&Òx}õ×åÑýžŽ:øýú+Ymì鲸ý•æýû÷Ïçòo±Ý«NÒ•~ËìÝAõ6Òýè_:St¯s•¯ƒûT¦Ë¬:H•Û© û”u!=ºÐ_ÉçéÐòÓ9º`Ìs¹%+ú@.÷³ú]ù2îëüÑöns?÷±þýXfÊ#mUwÙD¶‘ž]_º—çVÉDŸ#÷ Ê#{æ¨üm¦ ä£ò“lüî÷Ä:ÓŸð#Ò},ÿ%øÿL?—¾éøÈˆûKoÞª±Ûª•-=ª-0^ð¿îåêšò×ïø‡ç£¼ñËQJ§râ;“Ú#×ã=^gÉ®<üþX¾à~â–¸Æþª‹ädŒd|v¬ØŸ±Oéô?þ<‚¾Žžð?¤E®»ÌúMycÿøì…нޖ£.H'{3àû)#ëÿ’A÷rþÒ–<_]CÆ{ØŸ¾âýAmßË–¬Œ«~®{¤¥e|‹ðô‚ÒÒ·ü\y©Þ´ *{ã7tˆ,œ»úŸ¾—zãC2]x9™üä¯ß(‡qñQõËdqùýYf0 ƒÁ`08‘ûË~dù× ã0o‰Ý2!#åFîO良Ïdq{–ßa…Oë8Ì[aWg·ÖñnÙÄT»{*Ϋò—¶Zþµ|Ú­àrÍê´Â9FÜšû2YW‹¿gœWä²bü2¦ß)ÿZ>­êÿ‘7Œœ"q8Ú—ËÉ92(ŸÈé¬Òç΃Þ2þSùçºø½â¼Ð1m½VéwË¿†O«ìOŒNíá4ž ó‘ý‰Û¹,¶ëtVéÀ휷¿vì_q^‘³FöŽ#[-_¸†O«ìwŒßžSŒùg6ò¹lÕÿ»:ˆyÝúù%Ó?¾/Žeç%Ö¹˜.ýjù×òiþèÃ*Cí¾Fÿôü}nB”™þÏ}žvW²¿t ²ðWøR—§â¼އ1±J¿Sþµ|Z§¿ÌÞþÜɸ <˜”ÙH€+t9;e:x„ý#çðwªÈ fœ—€Ž×«ô;å_çe¼ ?àœb,›zðL¹RîGže:ŽywòƒÁ`0 —‚ØóðwÁ{ swÖsuiôÌ»Âÿœâ—G`]Á-Ë\•ål°.†øYŒáø‡î×;îÊ;K÷^çŠÞ×èΉÞªÌîú-ßáú¦¾è€õ/UûgÞ>¿GÎ=»ûó›×;ò^úX´§a~~¦3îéô‰Šq ¯KUþJ^™ŒYºîúnš]Pß ÄǙןùxª,æîsõÉG yz¬5®-$èœk¹2_åëˆ*Î ŸG|Þcþ^—ªüL‡¤¡/E«2«ë¼gá(¾˜q£YÛ­b–~?úôõtÄÂã:=ÙúNòêô@Ü5æëP>Qÿø-êÒ•_ååóõ£ŒU™ÕõNÞ³PõïgÞ'V8<·ÿÎzºhòG—¯ Ûãoª5„Y¾1þÞ•óZYKX•Y]ïä= Ùøïëðb›¯æý\ÚÿAfÿØÿ¼Otö÷uÃ+ýßóîú5¯¨ëÿ^vUfu½“÷LàsX£íc&ã¿Ó%ìŒÿ Z[È\ çÑcšx»XfUgÒGyi¯YùŽnü÷ôU™ÕõN޳ѽÿÓ_™ë‘Ýë¿Åwûìù?¦ñgäøLŸ=Ëw1§à<2Ä÷Êëʯò:’±*³º¾›f0 ƒÁ`0èàÏö~t±îG¡’+¾ü ¸È»;q’nž¢ƒùÒ÷Dg«æcþɸX­¿îœŒûùq„”Eï«ÄÚ¼gœöç·˜‡¹ÃÈE®py¤©ÞÑ;»dzðuΑVúZ‘ñ,Äù÷ça]OŒý»#æµÂºŸ!O¿OÆÞlä—ÍÏ÷ؾçÁúyü™ûbœÎá{†y¼o…£ëb¾§(üz¦¯Ïô •ÿ§Ñ6”ÎûUŒÑq„Ä_ÇGùøõŒsãÜãÒÕzîGVöÃ~1FŸX;ÂÚW°ÂÑqäWékUÆ3ã¿GþŸ5+ô½lÿß޵Þ׳ò;y<ßnÍŒä‘Ü´!ò U9q__ê¸ÂÑíp™¾Ve<“ÿëôí}Vz©öÿ]á}_ˬÿû³E×ÿWìÏÚN_˹ڷ|_`ï·+Ý*×Yéë‘ý?úÙÈÇÿ¸v•1ZuYá#VÙßóÎÆÿû ¾ìŽÿ»Ý*×ÙéëÞãõþïœ7¼`6§Ûq„‚Ï¡U:æÇe÷dÏÀñÄŸScÕûóʳ5÷^ÂÑ­pžnµîƒÁ`0 ƒÁ™€Ïñw¿[ážÆ÷Ö¨¾C°Õõ’ûVeÿ“¸(ÞÍáx¿½EøþÂxÖ½z'òy•Ý<à ÊãîÒã‰.©ã£@Ì"¾Óò !ÎcõwSÿ^‡Ïö=oWòa µóQ^æ·uz¹•ÿ÷ù[ÁŸyðSgôoÿÌ·ŠivóËžÿô7[·,tvs{ pþøº|ÔwŽdñ5å^ªýl?^Âûâàqûÿ·ç ƒÁ`p)²÷¿£X¸÷·Ê:t<Ó.<þÞ·G{g­`Uױ̳ã?G\œ¿—¾œ9O’˜çê|Ík°¢ë˜þö¯êá±UÄ5NGA\žD€[óX‹ÇnXdz¯Ïà·xNìÔ뀜ptY̽ª寸M·ï¬úåÄ|¼®ð?Q×Î-?b¿­[Ø?ãg­‡Ç~}cÅ:<žwâå³V ŽÍyÅ(OsôséÈãä´#bl’ybÈÖoÂC³§[äbßñuf?ÏêJºŽ[Ìôq*ÿhÃj§wŽq׌#Œ`­œ×òéSÕÿ;öGÿ¬£óx»· _ãêÈÖïø:¡ŠÙ:Á£¼„Œ[ŒeÜÛÿG™è/ý3¿«¿îêúù:”]û ô1Éæ2¿û{ú˜WäïeÿØÿñóø¤l>©â£Ny¦Êúô9™ÿ÷ýˆUŽï#uîœKÜ_³óÿÈê϶gûÿÌþ·xÿŸ—äcº¤^´‡Œ#t o|@Õ¾‘‰´Q>¬Z› ²oÿ=ÿ ÑþÕó_ç;³ç¿Îþ·èÏÕÏú[qÆ;öàÏÅØ0¶ ƒÁ`0 ƒÁ`0 ƒÁ`0øïásÑÅ»Ÿ¹Öú%Bs>}úôÛÑÍ{gŽ ó$”>îÌÞÚñØ™ë¾S¾1áó«ý¾Ù9Ήû ª[ÔûžŸù]Ž{A2þüù·£²?skeGÕ]ºUzß§¨ÊSs§ÎóÒ*ŽØ÷±F† ºÎ<Ú sG½OŸ·iæ1ýí¾‚ù”BÜ\ú«æSæÅ9|?æ²ÿÈÑ÷¹â¾û¼wög_&åž ´Wï™OxþÓæ>è­Ë DmkBTúÎÊþò@xœíá‘Ô:„ áR †‹€ ˆ‚ßdð›(€Há^õU}¼fÉ^ï²öîvW¹nÏ–å‘FËÓ#éå%‚ ‚ ‚ ‚ ‚ ‚ ‚ ‚ ¸iüüùóõ8?~üøëøõë×ïk{Brœ+ƒ—çÞñîÝ»×ã¼yóæ¯ãË—/¯õ¦ß{¶É!¶âùùùw™¾~ýzAÉn 3¢ï-yÉÖlm³{Õ_uÌômÙ»ïß¿¿<==½^ÿøñãYíèVàý_ß¿ÿZ*»þvvp¤ïÿüVžúûíÛ·—>üî[êg‚êùíÛ·¯¿õ,Ò JO:òÑ¡ôèù9ïúWÞèSyº½Òµ$‡ž{ª]¼ETýS_:Fzîì¿Ðé_íI¿©ú¯ž#ðt¤óÒ;idƒÑ):—ž]f]SßÕuÒòñz[¸ÁKã\.î|à%P9Ò£ø•Ü_Vý¹[¸ÁKãT®Éá>÷]úž\‚—ÃÃ5í…SùRx6pN[žÝKŸéßmU¾õ—ò™ñŠÕQeîê¯Ëo¤ÿ½ûØLÿoÐù7xB÷³Vþ®r{òÅÀóT.®ã ©+ü‡øg§ñ”ßs§ãŽ“¤È¡4žÎýØÕfÎò«úwÛ»Wèì×6+Ïæü¨·!õ7úœtn¤|±úK×Må ÷ÇréSyÌìHÕ€ªœ$Ï•üôwäâyØô­tKùUýÃ3ëØkœ…îºX®%n–¾Ï ‡žÛëxêct­ÚÁû¿ò^ª?ÉŠí¨eï8Éú¾€w -áSö¶¿6¿[¶ÿÝÖo¨¾¥3øl‡ë’¾¥62Ò?}ßÇp|›`WêLùºéêyÆIVý+?b$¶Ìëom~÷ ¸5ý­ºq} ¼£=_¸8¯Ë™màýïvBÏK¬}[LÊŸ¾[9«'Yõ¯kÊ ™)/õ§g¬Í¯êŸø‡Ž3ûטq[3nPP:>­òwÎíÕ{gëÊï|ï¿ãòQþ#¾’4]>õÏËeÆÎ ךüü7u¥´{è?‚ ‚ fиß%cY¾ÍöóÎáÖôñÈó¾–à~-¾ gßY×À¹1Ûø"ô=þ/ùÂ#ÿ}h¤Ç™¿ªã¸ñë Ø ¯s+·ê½.³Îé9Õÿîþ7ýÆ^uöAç|NË#Äþ øÍT/´{|ë_ÿÈïë>.å…oŒ9ÎíùÜ/¡òBøé—Ü‹½AfçäÐþ7æ|àG†“n«ã‹î̃¨sìFó}&GÇÕ;§ÙÍëľ2KÏuÝàg«ó‘Óe®óÏœ“ðËc‹fã=ÏçÞ;¼¿80²ó3û?òqWžÜùr¸]¥¥]Ð_õ·Êå¶yt­¶KN»´4F¤½Ü;¨‡©ÿÚÿ½î}î—ôM{À¬éÿý3‡9á ÚV}·qÙEÿ)\Rÿ6¹òâïpÁm8˜½ÿG¶Áyfÿ{¬BWŒfœä={ ToÝ7Àè¼àãóÎÀ¾ÞO܈çÓÍͬyV™ë÷¿ËÊÚ3ÿß+Þï/áS‚ ‚ ‚{@¸ÀÇF¸ÀÛßЮ«púO.\àŸx.ãgø? ìô.ðï²Üë8Ðy–p/œ.°{† |.Ûéí;\`¸À ‚ ‚ N]›¢[7d Î'qà#Þ{}Œs÷Ð÷g]CäV€oî̾GÀ7à¼2¾Ú½¿¿fë%-Á×-: ¯Àú=Þ§|]ÖpÂ÷¦óîcïöäp¸þõ—ïôÙº=#¾ÉõÏoú~äAnÖ›ô²9/é{ŽteÁgÄ®ü¾`WŸ.?Ïó½iöëw±NcÝYCKþ0ôH[®{ò8êbðzøà»vÓõÁýoü†ŸaïF—ÝW"ù©|¾&áh!ÖþÒ5׿¯)H꺯UÙ<ް¿œÊŽOÔ÷c¢?¸­óz™íÉå¨ú­‰êp½úýþ}m0t®kì!F~Î' ç—öókèÎ×€ó{à)g` Á£ØcÑ87ÒõýÞ‹³5gúïÎwú¯\P‹ÄZ”ªoìÇÌÊ2ºÆúÅ>¡}q½ƒÇ K@~ÖÐõ>:ëÿ5F`Ä“_KÿÎSdƒÇG'ôww•eÖ6ÜÆè<í­ò”ÀíŠï/¹ç•§|ô%oãpsnüþnÌs-ý ¾ö¶êÙ÷x­9írve™éße¨û w}õAISûÒ¨q[‚ïûQcdº´³¶ëyÕýDFñ7³¸œÊùuÏŸ•cto•¹öÕ®~–üõž£ìQAAF¾‹¥óõèâ¶÷À,Žuíý|óݧ·3ßÕè>·:Wèß>ç蟎| îºx µàûyY܇VçÔ€??k/Χ뷞碶<úßç 9oçºókÈ /à–Ø¿Æõ†<økFþ-Ê-t{L> ÿ”~×ùTp`ú7¿dÿ™Gæ¾y·ÿüf_çtÜG«{á^œëó=½_’ïQè{ 9ÿÁ„G…·8j|ÿ¯uëûþ¼®Põïr1'kðíø¥ñÕûá_¯vÍç0ÖkØdôó´[öw~q‹sÑ?zržû’úïìÿ)ú÷9:O óEáù„%ý×÷ã·ÊÛ©MaKºuˆ…è俸ýG~ìç¥íÿ©úw» OmF÷è›± 6zÉþWýÓ6|ÏNÞçØÿQ|û„zÛ÷¶ÜæaOé;ô=>Ƶkè_ðñh«ê:õyä`4þ›éßçÁ3æeü×½ÿY#û1â ƒ ‚ ‚ öÆ^Ü‹Ç[Ö˜ÉQüçµpnl6~Hßÿý¨ØSÿuíÀQÌéµqŽþñKø\±#ïçîñóø:fslé·Î‡ÁÛùºNÌÁqÞ®æ3òø¼ÊÕ¹Êç8@¿6*cå=~NÓåÁ^æ5ûœ Ÿ?"èk´Yü˜¯›yÕJ;W}PwøË:ŸºÀyŸ¯ã¼›¯æ\qüÝ/÷ï2‡…y?³2VÞ‘þ/ù™#èéð)ϸ^têÜ÷k£‹Á©kçú ë3ŽbxÖÌmè¸_oÏõOVÑç§ÁýOàü s]GkÇÕ9^~^Ï›ù÷áQÏG\[õï:Ûªÿ‘ý¯ú¯óGæc.l¿Ïåíd\£æ?ûX”9ßøükàY]YŽˆ-ö¿Ú¿ké_à!9á©ý>ŸÇg)¬±ÿ^'Þ6È“9£*3]ïõøêxïµ+:lÿy¿¸¦þ}üW99ç+?8+ãLÿBçßñ‘¸i¯£s¿)ƒ ‚ ‚ ‚ ‚ ‚ ‚ ‚àÈ`ÍiáÔ9ÓðûŸ>}j¯×ýg8e®î)i?þ|˜øÅ%ÔøbY¶@ñªûYù؃AéˆÛt«%¬Y;ßAÌÆ(ÆRy­]iíº Ä­ÅRœ ƒuˆQ-Å -Õ¯ƒ}2€òVûÔq*ˆ­d} ÚqÄ^yÌ kôt2©-3ã1Á”G2Ö=!ÈÛÓêP]pÆãx+XO†xïWFÖ!"hf[xþš´qÊÊ_÷I•™Øeá”ú%ÖâY½Ž·êŸø;8o=ÛÛ—Îùž"^dĆ{=²­œÄ•{¹õ¥Ã®ùz^ˆ!—Ô71ò•|¬5ë›<ŸxÁY¿ôrsîåöõ9ÖÖ/í9ÑQ±õÿ>Иw`‰»ËmkBTúÎÊþòÐxœíÛÝMã@…aJ j :  ®é:àš*(€h(!«“Õ‹ŽFc'Ã"ö}¤(ŽÇž¿o<ö®‡Ý¸Ø½¾¾î·v777ïiÏÏÏ»óóóÕów××׋éÉ#Ÿ———ÝÕÕÕîíímz\ö'ŸÔçììlµÌä—¼âþþ~ÿÓ#Ç°ÝÆüsÌååå{]9'ßä{{»¯_Ž‹üÎvòJÛ"éÙN[ØŸmús(k–ïfm^Ò}‘Ø'žÈ¸X‹EÚ–x­•—6&iß,öÙwww·ï£ô}·¦ÇÜÿ´áééi¿ý‘ø§äE~ÿÔ8'òN]ˆ]¶s ‘ÎvÚÕuN¿&¿1ß­ê¿Ù±ŒSæ‚Hý–®íŸv÷|1“<ÒKc„ë¾Ë=TÿŸ<ÉŸx¥.=Î:þùÎ8Ë'ù÷Xìù¤uü{Œ1¦Ç´´!ã(õHLÓŸlyôxÛZÊ͸ëù¬çµ–v0u,Ó¿é§ñœô[Æ2m;¤ï/ÇZ‹?÷$âÇMÜóÝqíø÷üžüS¯ŒòüHü¹¾ƒñ æwÊï¹s2¾2þÔoöQúŽ9}6¯ÓwKóê˜oÆÇgÚ·êÖ÷¨ŒÓìcÎoiûžoh+÷ë|r Œ²?eñi}_ë¾àžNÝúa¾Ï9÷O3ëKûl‘ö­=®™S|¤¿2ï0ä;ñÈùKÏ ’$I’$I’$I?ÙGß¹~&߯*ã·£ßxߺ5ÖZÍôþµ÷lKN=_û-1Ê{Öµw­ŸÕñ×õ»õÙ{öµµHýž|éùwézæzç¢\W¬¿›í_Ëoö{©¬¥¼f×5Çÿ¯ÂúÖ¢ôzÖoôvŽÏ1œÓëkzŒ$ÞÔ›í^ÊúF$¿SÓǾîz²þ,mH>¬ K>9†6R礳þ‚6f_çÅú"ò옱ރ²8¯Ûß9.åSÖ­P÷|’oÒ»Î[ãÂz“˜]ÿIë5q©Ó¬>³¹¿×[Òɧ×Â’~¨]ô_¯áJž´%íà˜>7ûˆÁ¸~‹¾b¼ÑÞ.kÖ¿¬óõï:P1þǬ¥;Öxÿïùf)þ}üÒóC÷S¯e%fùN[{Íë©éǶk¼ç1/¤ÄzÖ¦ŽÁØ?ý{©¬N£¼þ°¿ç{~wÙ[Þ>ÿžw3¾Çµ[‰ ñèí`M^b–sÓ÷ÙÇ5xjú1íê¿/`ýk÷1ã <ŒñÿÞßÇÄ?}Öëã¨ÿ¸Ÿù‚²ûo¶p(þÜSÙfþgv¯i伞S{;¸ßr,÷º­Òõ{§qßHý3ú¹€ûãþïø³>”x2/ÿ”Gß±F:ºOYW=ŽÍñ^wŠä×÷ïlsÖz÷6íI]Ƶ½}Oí>Ëëþà:Þ*´µvuíàÙbŒoßËgÿãü>o©¬1µ×ãß4ð|³UÒºì.ë»­ý~?ã/I’$I’$I’$I’$I’$I’$I’$I’$I’$I’$I’$I’$I’$I’$I’$I’$I’$I’$I’$I’$I’$I’$I’$I’$Iÿµ?=ISô5Ã/°mkBTúÎÊþô xœíÚÑM#1…aJ jHt@<ÓtÀ3UP-Ð5PBVÿH½ò$yZ–Ýÿ“"’}}íñŒ„OOOG>ŸŸŸÇÛÛÛãûûûöýp8l¿ùð{ÏÇÇÇVæååå·ã¯¯¯Çûûû¯2777Ç···¯r»¾¾ÞŽ#©ëññqûtÄH™ÄDœü±R÷ ±såW¸Ž2WWW[=é+ßWèSÚz~~Þb \OŸ&ŽŸC|¹–:“·ÄGýÓ¹üFÆ’üQÏÌǶ2Ée’[¾ïå®ËÎv©·#}븈Ÿk;¦üžífžâîîî«ÝŒÁìsŽç³ê{ùëy¾7n=Gèß*7™›”¥ÝÄæõÔmËÌÛ*–sù ʤMb`ÞÌzˆ‘9üæ8åÉõêþÏ¥íÜ¿}ý*žéÔø÷ñÿÜÿÔOnæd¾sœØ¨‡þíå'ó£%çô=ý_õ󔾺s趈£ÏÓÆ`º4¿½–S÷ê>M^)GÛ”I9ÚèyɘSs½Ìú~jíÀjüS·ËøÑ©7ýÊÚ™±Æ%knâÎ}?¯Éorß¹ }œz&ÆÞøÏœpŒzi«×þÌïÕºui~[?g¢Çšºˆƒ¾KîÿÕs ”¥Î~v´ä—óôkUÏjüÏÅNy~wÚègPrɹ¬#«¶ég®™ãÏõËx£ß3Ò.åò¾2Ç)÷3ã˜gójýH¾³Öæ%Ïô=—ä78ß}ù“˜ó¹ÄÔsg#ýêã3/|§}O’ë¼_¬ÞO¦½y×VïV´5rï>%öÜã§Æ¨íåkåT~‘w*ð¿mö0d/[ïOȱÞC]Ù»Ðÿß«_ß+÷åÞþ¸ÞÇùìê²)3÷bö˜ïÕ¯ï•{”±šãÓ{¬ÛÜÃÖû1»ŽÞS5ÏéïÀ¾¡ÕؽJ½¯3Ïõ쿎ìuüÆ‘9}Šè=jŒmÖý|Ï~ßì}ËžFÇÿçaíæÀ˜f|æ>Å<#zü(ŸkóÁ±Þ‡ØÏŽyN’$I’$I’$I’$I’$I’$I’$I’$I’$I’$I’$I’$I’$I’$I’$I’$I’$I’$I’$I’$I’$I’$I’$I’$I’$Iÿ¥_K=„±ŽÆmkBTúÎÊþô€xœíÑ1 1 Al!ãÚ AëHÑspñ3͵'m7¿½÷îµÖôdæÛªš=ˆsÎk¯?ð¹ÚÒýy½í˜IDATxœm’ÁŠQEOÕ«—NbPfp¥‚ˆEp3_ä¯èø®Ü únDÜ©‹A™&"‰6ÝIºß+q ¹Pws¸u)ñׯܛij\¸€Bö ¹Gx 8[#œž²|úKÏ_¢_¿Óü‚§%Ö‡ÜrqKHÚsÐh¦ÞWg˜þ"í"•g˜„8˜·„˜p*ºl²ÉÓõZ%˜M&¥3`Á¦Õ_Þüd5sn>¸Îµ;W1ŽéaÛÏüÇ´·#9h‹HM[^ éŽv ‹È¬< ”-ûŽé¼Eå"DPð ¼Ìk'D 躆夠;ËYƒ×³“="ŠàˆoÌ9T@C##î÷„áíÄâÏe7nD ?/éB:ð‘ã—KÏý` £6p¿RH iN²K§°Ó!ù’ÍÂtŒA–wzuôÎ( “ùM è02 h¶Â¨€€¼´}4Ö8‘ÜjJf޶"iËo¬å¾.ê/Çó¹S½C˜IEND®B`‚jffnms-0.9.3/htdocs/images/be.png0000644000175000017500000000032511377440254016152 0ustar csmallcsmall‰PNG  IHDRíf0âPLTEõÐñõGúÑQBøúHñ¯€²tEXtSoftwaregif2png 2.4.2£^GtEXtCommentMade with GIMP~e•4IDATxœc``VRbÓiI ZÄB;ŠChˆxˆ LB‡ˆ@Åqªw‡ÐŽPsAöð ‰ x3¯IEND®B`‚jffnms-0.9.3/htdocs/images/refresh.png0000644000175000017500000000041311377440254017220 0ustar csmallcsmall‰PNG  IHDR ?è gAMA± üaPLTEÿÿÿeb›b0›……ŒÐÐÊûû–ûûô»;øëtRNS@æØfbKGDˆH pHYs  ÒÝ~ütIMEÒ7“ 8ÌYIDATxœc†ˆŽŽŽV0]QÚ¦Ý@´KEnwqqoÒE.e@º©Ý½̯¨(ñÛÛÝ›@üŠ£2$õ@~T¤>, Á@·Ñ%jH¶kIEND®B`‚jffnms-0.9.3/htdocs/images/alert.png0000644000175000017500000000200011377440254016663 0ustar csmallcsmall‰PNG  IHDR(–ÝãsBITÛáOà×PLTEÿñªúñ©ÿæœ÷á”ùÚ•÷ÛõÙˆóÕŒÿËxýȇ÷ÇsôÆpò¿qÿºiÍ»Àïµqó¯]ì¥Zé•Rî“Cî‹@ªš£žœ¡ß‡K©“€ä@à}Aóq/ÿi)år/£ƒnâo/þb'åk/‡ƒáh(¡y_Õg.ßb&ã\$Õ\%ÜX!ÚZ#q_ÜU rr×R †lozqrÖP}nnÅU({nkÔOskkÏL}gZ×E|eYÛBÈA€ZWÌ?Ê?vZOÍ:Ë8dWW¶8–D)Á2€L-lL<¯1~E) 6½*Ã&PNRÈ!bI=XKHº$ ¶& ·% gD3ZEC™.§& »a?7§# ¡%¢%¡# P?<c7 ‡' P:;¥‘ ¦—‚# R4)Ž  ‘ˆvO'hfe lH$E$F!W f`? cb]c]/^ NP F 9ON%4 G5>//4*#"!'ÿÿÿ*PpütRNSÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿËü¼L pHYs  ÒÝ~ütEXtCreation Time04/01/02¼ Å:!tEXtSoftwareMacromedia Fireworks 3.0ïi1ðÈIDATxœc˜“åàa¢$&¡U1‡¡.0¬ØËA_E”OÎ=±’Á¢ªsRkS_×äî =-V sú³cãŠÚjÚë›gΞÃ0§!:Ú'¡ ­07wâ, 7Ç¥<ÃIˆS*2µc›dšbÏÏÀÀ¤˜Þ8ÈÍTדeaegÐŒ™äÖJ›; ²qs©õ¹¶Âjò’âÆùvžÎ@îœeß™²9 ®‘+¯ˆ¡–ŽB¸.˜;ǬÚÛÒÚ­Ô`„;gNò´iñ`ø³G¡a&vIEND®B`‚jffnms-0.9.3/htdocs/images/ca.png0000644000175000017500000000107211377440254016147 0ustar csmallcsmall‰PNG  IHDR ƒ‹ŽÔPLTEâ. é+é. éçŒ}äñóäááääääßÞåíîäàßäããæ“„é.è+ï(ï,î÷—ˆÿÿÿþúúþýýþÿÿüåâÿþþþúùø ‘ïï+é+ø˜ˆÿüüÿùøù©šòB&ù§™þõôÿþýîø™‰þöõóO:îòK5þòñþõóø¡’îøœÿýýóX<òM0òR4ïóP4òQ5ù¥–øŽþûùï! îï(ï,ï(ï%þýûù¤–ø—‡ù®¡ð- ïïñ2ú¹®øŸóL-ôdHòG)ù¨›ÿúùüÏÇè,ï(ï+÷˜ˆþþþüäàþüüãÇQŸ pHYs.#.#x¥?v IDATxÚMÍYPÐ’²Ëõ Ù“]Ù÷=»¸‰ÿÿO0cš^ÏË!’tQnšñx}þC©Ia– (p|,.ð “)–%Ò?” “Íå ň²eP”JµVo@ÓÆV[Õ:ÝžÖpCdãh<™Îæ ´\­mDØîô½~8ÂIvD ž/×8# î‚jüñ±)?³ø×Ûâ¾hbüfÒ¯¾ùX,tEXtCommentFile written by Adobe Photoshop¨ 5.03d)>IEND®B`‚jffnms-0.9.3/htdocs/images/query.png0000644000175000017500000000052011377440254016726 0ustar csmallcsmall‰PNG  IHDRíÝâRsBITÛáOà!PLTEÿÿÿïèïðèàØoÌÌf™™f€€€xfff Oa J tRNSÿÿÿÿÿÿÿÿÿÿ}v}Õ pHYs  ÒÝ~ü!tEXtSoftwareMacromedia Fireworks 3.0ïi1ðtEXtCreation Time04/06/02!÷ýƒ`IDATxœ=Ê!€0 Ð nE&kw‚%à&9Ç(0þ)ià'¿}iJô§”ê{HiyžJ9LG@Ø(GnÑ0šAîÙÁ°(0B€n¸>œŽ¢«at+‘@¼ÚoD1F«DÿPIEND®B`‚jffnms-0.9.3/htdocs/images/pencil.png0000644000175000017500000000044511377440254017041 0ustar csmallcsmall‰PNG  IHDR ?gAMA± üaNPLTEÿÿÿþ þýþmýÊŠùËøì˜ÖÖÖÏÏϵµµ´´´³³³¦~N¢¢¢   }}}uuuooonJ kkkfffaaaM³›HbKGDˆH pHYs  ÒÝ~ütIMEÒ}W+ÁMIDATxÚ]ÎÙ €0 DÑ[\0.Xûÿ?jRµ‚ót†)ºC—iêyð)­ßÕô[±KQ­~›d™A³Ë¬ M.§ªÐˆ7–Š hã—ˆ|LrIEND®B`‚jffnms-0.9.3/htdocs/images/graph.png0000644000175000017500000000102211377440254016660 0ustar csmallcsmall‰PNG  IHDR ê!®<gAMA± üaPLTEÿÿÿÿÿÿÿþþÿýýÿüýÿüüÿúûþûûþúúþùúþøøþ÷øþ÷÷ýö÷ýööýõöýõõýôõýôôýóóýòóýñòüñòüðñüîïûçèûæèúâäùàâùÞàùÛÞùÚÜøÛÝøÙÜø×Úø×ÙøÖØøÔ×øÒÕ÷Õ×öÎÐöÌÏöËÏöÈÌõËÎõÉÍõÇÊõÅÈôÂÅóÀÃó¿Ãó¾Âó½Áó»¿ò¸½ò·»ñ³·ð¬±ð¬°ï©®êŠ’æu~â\fáXbàU_ßMXÞITÞGSÝDOÜ?KÚ4@Ø&4Ø&3Ø%3×#1×"0× .× -Ö+Õ)Õ'Õ&Ô#Ô ÓÓ Ó Ò ÒÒÑÐ Ïg¾‡[tRNS@æØfbKGDˆH pHYs  d_‘tIMEÒ*.hìêdIDATxœc`'W=(‰6‡1"MÁ´—žŒŠ`†hú…ZØØÊ10¸ëù„ZÄuz˜–^ 5îHLZ Q$µ~zÁ‘Ö~Ñ@¦³º³ƒ‹&ƒž*£’¦¦*£œ&%‡¹\´ûuIEND®B`‚jffnms-0.9.3/htdocs/images/it.png0000644000175000017500000000024211377440254016176 0ustar csmallcsmall‰PNG  IHDRb&ÅB PLTE‚ÿÿÿý Wåô}tEXtSoftwaregif2png 2.4.2£^GtEXtCommentMade with GIMP~e•IDATxœc`ÍZÀ@)G³ |)2IEND®B`‚jffnms-0.9.3/htdocs/images/text.png0000644000175000017500000000041411377440254016547 0ustar csmallcsmall‰PNG  IHDR Q‹ásBITÛáOàPLTEÿÿÿÀÀÀ€€€ÿ3ÿÀ/øtRNSÿÿÿÿÿ %ß pHYs  ÒÝ~ütEXtCreation Time04/01/02¼ Å:!tEXtSoftwareMacromedia Fireworks 3.0ïi1ð0IDATxœcPcFe(Í¡YCÀ4#fqqq`$¢t(,ˆ HA© IEND®B`‚jffnms-0.9.3/htdocs/images/tag.png0000644000175000017500000000030611377440254016336 0ustar csmallcsmall‰PNG  IHDR[ú¦©gAMA± üa PLTE3¥õõõÊ7ÚbKGDˆH pHYs."."ªâÝ’tIMEÒ! è¦ò3IDATxÚcXÁ‹V­j`èZ`bi”МÙÀ 6-ÊBhNrµ¦EÁ„Axö=¢?IEND®B`‚jffnms-0.9.3/htdocs/images/a-up.png0000644000175000017500000000033511377440254016427 0ustar csmallcsmall‰PNG  IHDR ÿîƒsBITÛáOà PLTEÿÿÿ€€€<^», pHYs  ÒÝ~ü!tEXtSoftwareMacromedia Fireworks 3.0ïi1ðtEXtCreation Time04/06/02!÷ýƒIDATxœc u`php`pZàÀàµÂFÆ@y§ )[E€IEND®B`‚jffnms-0.9.3/htdocs/images/a-top.png0000644000175000017500000000027411377440254016607 0ustar csmallcsmall‰PNG  IHDR £_ÎgAMA± üa PLTEÿÿÿÀÀÀðá±4tRNS@æØfbKGDˆH pHYs  ÒÝ~ütIMEÒ‘· bIDATxœc`P```XÁÀÀÔÅÀÀ¥Ô€`35/Á‰÷/IEND®B`‚jffnms-0.9.3/htdocs/images/color.png0000644000175000017500000000037411377440254016706 0ustar csmallcsmall‰PNG  IHDR „0)rsBITÛáOàPLTEÿÿÿÆÃÆ„‚„„„;“È’ pHYs  ÒÝ~ü!tEXtSoftwareMacromedia Fireworks 3.0ïi1ðtEXtCreation Time04/06/02!÷ýƒ2IDATxœcP‚€T†#ƒ!1… !"Ì H )T]pF(ë ¦ImkéIEND®B`‚jffnms-0.9.3/htdocs/images/bullet3.png0000644000175000017500000000034411377440254017137 0ustar csmallcsmall‰PNG  IHDR ¿#gAMA± üaPLTEÿÿÿÿÿÿûûûïïïéééèèè———WWWZÒ:tRNS@æØfbKGDˆH pHYs  ÒÝ~ütIMEÒáÚ“)5IDATxÚc``Kc```KL3``S- 3`H M`H,//M€²ÙB‹âl)¡@5@õÆ +G ”/HÊIEND®B`‚jffnms-0.9.3/htdocs/images/tickmark.png0000644000175000017500000000043311377440254017371 0ustar csmallcsmall‰PNG  IHDRÉøˆygAMA± üaPLTEÿÿÿÊ ª3;qdDÚf~²Ý¾D£]âÕÔ‰Á—ÏYntRNS@æØfbKGDˆH pHYs  ÒÝ~ütIMEÒ%!Â8š¶iIDATxÚc`Í!T$ÙËÅ4kGF€"P€½---I(Pš––f¨d”‚©@FX²r’pÑ–,d¨–b ¦aiŠÂi )Ž4  H1+PWZDjØÆˆV ‰ÚÞl£IEND®B`‚jffnms-0.9.3/htdocs/images/log.png0000644000175000017500000000042011377440254016341 0ustar csmallcsmall‰PNG  IHDRÔ¹gAMA± üaPLTEÿÿÿÿÿÿ„„„ÆÆÆÿÿ„„ÿÿ%‰Ð8tRNS@æØfbKGDˆH pHYs  ÒÝ~ütIMEÒA½¬µaIDATxÚ-ŒA À —^<=W > à#ò¯Zªù~c螆ÙMlÑ’`ÀÄ”ZèF³ÎêfJ]fˆÊ¿â ¼nìœ8¹9˜º®‡'q/É›½Äfp_OTk à?0@› $IEND®B`‚jffnms-0.9.3/htdocs/images/de.png0000644000175000017500000000162411377440254016157 0ustar csmallcsmall‰PNG  IHDR qLÕRtIMEÒ9;ݱ  pHYs  ÒÝ~üPLTEø¸ø°ø¨è¨è à ä˜Ì”øøäãмÞÎÆ„{scZR„scÖÎÆ½µ­µ­¥œ”Œ”Œ„{skskcïçÞŒ„{kcZν¥÷޽ƵœÞÎµÖÆ­÷ÞµçÞÎÆ½­ÿ÷çÞÖÆïÞ½çÖµÞέ÷ïÞïçÖÖÎ½ÎÆµµ­œ­¥”skZÿïÆ÷ç½ïÞµ„{cÿ÷Þ½µœµ­”­¥Œÿï½ÿ÷Îïç½ïïçÿÿ÷½½µ­­¥œœ”ssk„„{½½­ÎνZZRccZRRJÿÿ祥”JJB””„BB9991ÞÞ½11)))!!!ÖÞÆçïçÆÖÆ½ÖÆÞïçµÖÆµÎÆ­ÎÆ­ÖÎ¥ÎÆœ¥¥ÖççZccBJJÆÞÞs„„k{{199Æçç)11!))µçç­ÞÞœÎÎsœœ!!)99ŒÆÆsµ½{ÆÎœÎÖŒÆÎ{½Æ­ÞçµÞçŒÖçs½Îc­½k½ÎJ½Ö9BÖ÷ÿkÆÞJµÎ9µÖœÖçk¥µ9ZcZ”¥sÆÞk½ÖcµÎZµÎJœµJ½Þ!ZkBµÖ9­ÎÖï÷½ÖÞkœ­ŒÖï„ÎçJ{ŒkÎïRµÖR½ÞB­ÎRÖÿ1”µ1­Ö­ÞRk¥ÖÆÞ祽Ƅœ¥½ç÷œÞ÷”ÖïŒÎçsÎïJŒ¥kÖÿZÆïJ¥Æ1Œ­9­Ö)­Þs”!¥Ö¥Þ­ç¥Þ)9k”sœsœ­R{Œ„Ö÷kÎ÷)RccÆï1”½9­Þ9µç1­Þ!„­!”Æ{¥!­çBZ­ïRsŒÆœÞµÆÎœ­µ”¥­{Œ”kŒœ¥Þ÷BcsŒÖ÷„Îï)1{ÖÿJ”µ!BR9„¥œÖ!1Jk”ÖÆÖÞ¥µ½”Ö÷9Zkc¥Æ9k„BcŒÖŒœ¥k{„9ZÖïÿÎç÷µÞ÷JsŒ)1R{„ŒÞïÿÖç÷½ÎÞZck9BJZk{ÆÎÖ­µ½„Œ”ÎÞïJRZBRcµ½ÆRZcÖÖÞcckï“ò'IDATxÚcàÇHåø9±*ˆ²2a ¬ŒXI¢ì,XŠ#¤¡N IEND®B`‚jffnms-0.9.3/htdocs/images/all.png0000644000175000017500000000046311377440254016337 0ustar csmallcsmall‰PNG  IHDR <ðsBITÛáOà0PLTEÿÿÿïïïßßßÌÌÌÅŲ»»»ªªª™™™ŠŠŠvvvfffEEE333!!!½A—¸tRNSÿÿÿÿÿÿÿÿÿÿÿÿÿÿöIú& pHYs  ÒÝ~ü!tEXtSoftwareMacromedia Fireworks 3.0ïi1ðtEXtCreation Time04/06/02!÷ýƒ/IDATxœc`À8'Ì„²¸7ìQL«BYÌ3^AY¬·_CYÜ×`,ö§¡,|5x1ûè4kIEND®B`‚jffnms-0.9.3/htdocs/images/new2.png0000644000175000017500000000127111377440254016440 0ustar csmallcsmall‰PNG  IHDR a«¬ÕqPLTE£¨ÀÄ·µÃ—ž¿ž¦Ÿ›²}ްwˆ¬p‚§ÿÿÿÈ“–ÿfÿ›]ÿqNÿͦÿèãÿÿÿÿÿÿ~ޱÿÿÿãfMÿžIÿøcÿâmÿ{Cþ½­úøúùûýÙâõÿÿÿñš[ÿíWÿÍÿì<ÿ‚:þ›‰ûòñèX:ÿá`ÿåÿí[ÿ³_þÀ¡ûõôøûýôùüîôùàèðp€ŸØ˜~ÿ—Tú¯ZøšKîgWׯµºÄÞ´ÁÞ­¾Þ«¾Þîöüm|œ©¦ÿ³§þ‘ƒÿѦýÑÇûö÷öúýóùüð÷üíöül|›x‡©ÿÿÿÂÇÛÁÆÛ¼ÄÛ·ÁÛ²¿Û­¼Û¨ºÚ§»Üèôûk{™p€£ÿÿÿ»ÃÛºÃÛ¸ÂÛ³¿Û¯½Ûª»Ú¥¸Ú¥¹Üæóújz™o¢ÿÿÿµÂݵÂܱ¿Ü®¾Ü©»Ü¥ºÜ£ºÜâñúhy˜fw›ÿÿÿéôúèóúçóúæòúäñúàïùÚíøgy—k|›m~m~œm}œl}œj|šh{™=°m tRNSÿÿÿÿÿÿÿÿSOx pHYs ð ðB¬4˜+tEXtCreation TimeMo 15 Aug 2005 11:31:14 +0100Ùþz¢IDAT™c``dbfaeccçàà`àäâæáåã`â`—”b—”a•“WPTR–bU5u M-m]=}C#cS3s K+k[;{Gm'gW7wO/o_?ÿ€À †àаðˆÈ¨è˜Ø8†ø„ÄĤä”Ô´ôŒL†¬ìœœœÜ¼ü‚¢b†’Ò²²²òŠ’’ʪy3!orO+IEND®B`‚jffnms-0.9.3/htdocs/images/edit.png0000644000175000017500000000047211377440254016514 0ustar csmallcsmall‰PNG  IHDR ½«¡QsBITÛáOà!PLTEÿÿÿÿÌÌÌÌÌÿÌ3™™™Ìfff3Ì™ÿæ6e8 tRNSÿÿÿÿÿÿÿÿÿÿôi pHYs  ÒÝ~ü!tEXtSoftwareMacromedia Fireworks 3.0ïi1ðtEXtCreation Time04/06/02!÷ýƒJIDATxœcX3gÎdXÀÀàå ¡¹VÎZİ --aåò.ŸaUyˆÏ°0|%X^X ¨.-a¡ÑJ°úÅZ`}\Z+4иE@ó¥A! ܯKIEND®B`‚jffnms-0.9.3/htdocs/images/au.png0000644000175000017500000000142011377440254016166 0ustar csmallcsmall‰PNG  IHDR ƒ‹ŽÔ­PLTEÉj_Þ¤ ws¹54ž}dŸüT+…jŸ68¢iM•ã’Œ££EGTOSNPK›>8“PKRNed±{³Å£º™—͘–ÍÿT,žˆ¹ƒ½¼¤ÄŸ›Ïgh»UM§XR«VP©]W­ŠÆ\V­VPªWQªÓkd×njæm^ÿ‚döƒmï3ôoXþˆmãzpàk`˜]‰MO°ZRªVP«`[°ª¨Õ`Z¯RM©TM©XQ«ÒZR×[Ußh`úx_ögNí1õr[ütZÝ\RâaU›[…MP±WO¨QK¨OH§LF¦Ž‹ÇšÏNH§myÆ——ÏÆ®Ç¡Ž½¡’ÂÿR*¦˜Ç¢¤×ɫ•‚¸`]³a\±uq»ZT¬TN©lh¶ok¸¢¢w hS¡FC§l`¬²Qgq]¦EC§jd³©†­|^ŸKHªup¹¯­×SM©WQ«kfµIE™JJ«SP­[T«WR¬`h¿WR­RL©JI¬UOªUNªWP«TOžYR«YS¬PJ¨“É÷õøšÍZS«WR«a[°RMŒ‰Æííö•’Ê^Y¯¾¼Þd_²SM_Z¯XS¬a\°rxã pHYs.#.#x¥?vÑIDATxÚc``dbfaecçàäâæáåãàd—”’–‘•“WPTR–SaPUS×ÐÔÒÖÑÕÓ70426153·`°´²¶±µ³wptrvquSv÷ðôòfðñõó  30ŠŒŠŽ‰bˆ‹OHLJNIMKÏÈÌÊΉÌu“cÈË/(,*.),-+°(ÏΩ¨Ì‘Ëa¨ª®©­«o¨­i´ÈÉ‘kj–ËÉÉahQ‘ËnmkÏqrÊ;:»¢€*»UrÊåzzËsÀ@®$ þ«9Ýl’ë,tEXtCommentFile written by Adobe Photoshop¨ 5.03d)>IEND®B`‚jffnms-0.9.3/htdocs/images/eu.png0000644000175000017500000000137411377440254016202 0ustar csmallcsmall‰PNG  IHDR žŽ¾lÚPLTEþþûöòûÿøøûüÿûú ÿ&$êZ\µ ÿþùýý ýx–mn¡*+ÛÀº_*,Ùrt¢qvš þÿüùó÷YU¼XT¸ÿüûZV¹VT»÷ðüø ýst—©¥x ü ýýþþ þ ø­©ron› ÿùøþ##äC@Ê÷ùüøùD?Ëëÿüþý.-ß”#$êþýüý#%é|}œ,.ßÿÿ0/מŸu-,áÿüÿ..ᦨp10Óÿøþó!#îýúûü !ìñúú ÿei©’•…ÿøüúû ÿ”—„Y[¶ ÿùý3.Ø05Ö54Öü ÿý98Ò4:Ò60Ø$%êüûûûùÿ‰Š~œ튈ƒ‰Ž„…Žÿûþø!èó&$æ~ƒ˜(&èñ íùÔ+4ÝIDATxÚc`F&fV6vN.nàáåãàAˆ‰Š‰KHJIËÈʉÊC…•”UTÕÔ54µ´utÀbòzú†FÆ&¦fæ–VÖ6A[;{G'gSW7wO° —·¯Ÿ€ƒH`PpHh˜(X0<"2*:ÈŠ‰‹OH 2$%§¤¦¥+(ddfe‡ç@lÏÍË/(,J/.)-+¯¨tVU‡ÖÔÖÕ7465·´¶µC;:»º{zûúû&LœÄ4ê'y†)S§MŸ1sÖì9s§€ 5¿“ÈIEND®B`‚jffnms-0.9.3/htdocs/images/a1-down.png0000644000175000017500000000021311377440254017026 0ustar csmallcsmall‰PNG  IHDR é°GoPLTEÿÿÿUÂÓ~tRNS@æØf pHYs  ÒÝ~üIDAT™c```dd€Æq„Ԁ8`¼ 'ŸIEND®B`‚jffnms-0.9.3/htdocs/images/bullet4.png0000644000175000017500000000027511377440254017143 0ustar csmallcsmall‰PNG  IHDR ð\'.gAMA± üa PLTEÿÿÿÀÀÀ™y2šÔtRNS@æØfbKGDˆH pHYs  ÒÝ~ütIMEÒ$ ûXIDATxÚc`Zµ€„5 áU¼€aÕ*05Õÿo 8IEND®B`‚jffnms-0.9.3/htdocs/images/plus.png0000644000175000017500000000033311377440254016546 0ustar csmallcsmall‰PNG  IHDR ÿîƒsBITÛáOà PLTEÿÿÿ„„„ À*[ pHYs  ÒÝ~ü tEXtSoftwareMacromedia Fireworks MX»‘*$tEXtCreation Time05/13/02>/µIDATxœcXµªaj(‹BðF$”ÜÀ 6ckŸIEND®B`‚jffnms-0.9.3/htdocs/images/service.png0000644000175000017500000000034611377440254017227 0ustar csmallcsmall‰PNG  IHDR … ïgAMA± üa PLTEÿÿÿfffÌÌÌ_C +tRNS@æØfbKGDˆH pHYs  ÒÝ~ütIMEÒ š¾ëCIDATxÚc`àakaÄüæ6 Vß_30ü+Ï?Àðjûª ׿.=Àp/+÷ÃÏ›·0˜ÿÎÀ`onT Ä8oŸ“ÛÛhIEND®B`‚jffnms-0.9.3/htdocs/images/unknown.png0000644000175000017500000000034711377440254017267 0ustar csmallcsmall‰PNG  IHDR  ŒåªsBITÛáOà PLTEÿóÖ„öú–“ pHYs  ÒÝ~ütEXtCreation Time04/01/02¼ Å:!tEXtSoftwareMacromedia Fireworks 3.0ïi1ð&IDATxœcX L ¬@B@H0€ —$–…³@:/ šÕ!+IEND®B`‚jffnms-0.9.3/htdocs/images/a-right.png0000644000175000017500000000027511377440254017123 0ustar csmallcsmall‰PNG  IHDR £_ÎgAMA± üa PLTEÿÿÿÀÀÀðá±4tRNS@æØfbKGDˆH pHYs  ÒÝ~ütIMEÒ9/Â5€ÛIDATxœcÐÐ``àâb``jj``X°Lƒø@q7ÄRó´IEND®B`‚jffnms-0.9.3/htdocs/images/bullet1.png0000644000175000017500000000140511377440254017134 0ustar csmallcsmall‰PNG  IHDR exgAMA± üa­PLTEÿÿÿÿÿÿûúûùúúþÿþýþýùúùÈÞÂv´cx´eÙæÕ4‰–½ˆš¼öùõ8—4‰?Ÿ>œ9Y¬9I‰0^¯?ÉÜÂ16†<“7…EŸK¬"O­'K¥%M§'M¦'Z·1[·2C‰%Y³1\µ6G‰,c¹@h½C^–Eаy•¸†ŸÁ‘?—<‹N§%R¬(M¡&f¾:cº:nÃFmÁFsÆKqÂIqÂK~É[¶~ÜèÖõùó÷ùö?ŒC’@‹@‰J™!rÃI}ËTY‘<}ÌU€ÍW‰Ðb—Ôx¥Û‰ÞóÓAŠŽÑg“Õk•Õn›Ùx›ØwžÙ{¡Û§Ûˆ¬ßŽÀç©Ïî¼ÒîÁÙïÌßòÔè÷ßèöàê÷âçóà«Þ‹°Ý’¶ã™·âšµß™¿ç¦Çë°Æè°Ïí»ÒíÁÙñÉâòØñùìöüò÷úõ¸ß›Ðí»ÔïÀì÷äðøêôûïõùòÙñÆÞñÏâôÔâóÔîùåîøæÖîÂßñÏàòÐçòÝñùêôûîñøëóùîñøêöúòùúøõøñ÷úòùú÷úú÷úúùûúúúúúœúÑ tRNS@æØfbKGDˆH pHYs  ÒÝ~ütIMEÒ ­ZàÒÁIDATxÚc`B ‚ƒSTÍÒ;Êgã3ñ Ì`óõ¤ôå]CÒ 3#²A|[UGCóÐȸÜÜâòR ߯ÙEÝ?=>¿§¯»9È×ö3Ö «(낞 _ÌIÉ*µÁžÈgnò5- øÛA|~w³¤;v†F _GFÖ4(ª¤«··¯£Èç‘6òH©kílk©Ê¹‡ORXÅ+¹¨Þ·¶â^]!e·àÄð,V¨$¸Ä5­}b@L¿|2€w+¤EIEND®B`‚jffnms-0.9.3/htdocs/images/est.png0000644000175000017500000000014611377440254016360 0ustar csmallcsmall‰PNG  IHDR ;7é± pHYs  ÒÝ~üIDATxœc`˜ùŸ|4€šG øO8͘çül©rIEND®B`‚jffnms-0.9.3/htdocs/images/mail2.png0000644000175000017500000000055211377440254016572 0ustar csmallcsmall‰PNG  IHDRFßCfógAMA± üa!PLTEÿÿÿÿÿÿ›Ã ððçÒÒËçËŒÓÓÓÀÀÀIII?–ttRNS@æØfbKGDˆH pHYs  ÒÝ~ütIMEÒú ù²IDATxÚÍÑ=Â0 à0x€ ¤Ž·`Ž„ÄäÅWÈÀÆ”k°!6&9%ÏNÄO©Ü˪ÔôÓ³Õ„€š­Âd­ÓrÚlº¿1‹R ÌÕ3·”Ìáä™#ÌÖ5»œ‡†y`öå~ìÏ0"íˆÿΪæãÃHNîr5Â$D¤‘$í‰ÖœjDHˆuÛVµmgTËQcû °âo£‡Í¼¯oƒY:]mb!ØŠí.Pï.æ+ï7?K„G\ïIEND®B`‚jffnms-0.9.3/htdocs/images/uk.png0000644000175000017500000000034311377440254016203 0ustar csmallcsmall‰PNG  IHDR “‚š@gAMAÙܲÚšIDATxœ|QI€ CO=úŽ>ž'pô+XH·©ÓÑiCš´l¥”ëÎ{Îg§öxŽÔZK„ÑÏ:„RÞ †P ù`Kœï£ç4ìŠ2¸ iñ 0q•õ@g¬Äý,*™´© )s¨Q¸zI_±„jð虫Mýwòk÷ ~¼Ž¯Ë0CtE$}*Ó"}_ÿÿ‡:3Ñ\ÐßüIEND®B`‚jffnms-0.9.3/htdocs/images/tool.png0000644000175000017500000000062211377440254016541 0ustar csmallcsmall‰PNG  IHDR ?sBITÛáOàNPLTEÖÖÖÖÎÎÌÌ̵µµµ­­­­­¥œœ™™™”ŒŒŒŒŒŒ„„„„„„{{{{{{ssRRRJJJBBB333)))!!!ÿÿÿw÷ÑÀtRNSÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ"Ú pHYs  ÒÝ~ü!tEXtSoftwareMacromedia Fireworks 3.0ïi1ðtEXtCreation Time04/06/02!÷ýƒfIDATxœ5ÌÛƒ0 PË`Všµ«ýÿ?º”‰‡HGNè̕ڄ”W]‘€ÐfDÆÃkÛÂ}˜_BÅg3R| éÒx+ß™ççÿîÌãº[ïú´4òxeÙ¨Kßf]ýsìĘ¢Ÿ eüó&èIEND®B`‚jffnms-0.9.3/htdocs/images/event2.png0000644000175000017500000000041111377440254016763 0ustar csmallcsmall‰PNG  IHDRÉøˆygAMA± üa!PLTEÿÿÿÿÿÿÿÌ™ÌÌÌÌ™f™™™™f3fÌf3™3f¤KtRNS@æØfbKGDˆH pHYs  ÒÝ~ütIMEÒ MoÜ%QIDATxÚc`@€U«V-3 ®‚1.€‰¬‚2„£¸€j‚ååUZ`FGG—×bcæÌYYÆP5‹M£@º‡‚KCC!ŒU €°™p]˜÷ÀIEND®B`‚jffnms-0.9.3/htdocs/images/user2.png0000644000175000017500000000033111377440254016621 0ustar csmallcsmall‰PNG  IHDR fì2 gAMA± üaPLTEÿÿÿÿÿÌÿ̙̙f™™™Àc*jtRNS@æØfbKGDˆH pHYs  ÒÝ~ütIMEÒ&)çÎAG0IDATxÚc` e` `T 2…Ê¡@"$¦ÀdlÀV¬@á‚XWNÊ 6=ÄIEND®B`‚jffnms-0.9.3/htdocs/images/delete.png0000644000175000017500000000046111377440254017027 0ustar csmallcsmall‰PNG  IHDR ?è sBITÛáOàPLTEëë鸸¹™™™fff>>=**)ÿÿÿhÌ·tRNSÿÿÿÿÿÿÿÞƒ½Y pHYs  ÒÝ~ü!tEXtSoftwareMacromedia Fireworks 3.0ïi1ðtEXtCreation Time04/06/02!÷ýƒMIDATxœc(//K+//`(/O`LÒei PÀÀÀÀ ¨”Àæ¦%0”±°²²‰åYX 4+&-ŠM¦ÈPÒJJJÆn@û@Ʀ^g¦ÈDŠIEND®B`‚jffnms-0.9.3/htdocs/images/nosound.png0000644000175000017500000000101111377440254017242 0ustar csmallcsmall‰PNG  IHDR(–ÝãsBITÛáOà„PLTEÿÿÿÿÿ™ÿÿfÿÌÌÿÌfÿÌ3ÿ™™ÿffÿf3ÿ33ÿ3ÿ3ÿÌÿÿÌÿÌÌÿfÌÌÌÌ̙̙™Ì™3ÌffÌ33Ì3Ì™Ìÿ™Ì̙̙™™Ì™™™™™3™ff™f3™f™f™ff™ffffff333f3333333ÿÿÿSâ~,tRNSÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÇÖ Œ pHYs  ÒÝ~ütEXtCreation Time04/01/02¼ Å:!tEXtSoftwareMacromedia Fireworks 3.0ïi1ð•IDATxœMË‚0 ESPJ¤Õ¨ÔŠ–—"Tòÿÿg©ŒcÉœÉâÜ ÇÏß qçQ¦+ÊËvª4aF –]2¸”*V&àywÞnP*†ÚÞCj%3B‡ÇD¼Ÿ£ Ä ^Å>|eˆœS0öu"F+µ[Àƒ}lŠè¤YEÑÜ›;Q™Å¥m'º6˜ÝÖhÑþBþUø_x³W//¥IEND®B`‚jffnms-0.9.3/htdocs/images/map2.png0000644000175000017500000000041111377440254016417 0ustar csmallcsmall‰PNG  IHDR VœRgAMA± üa0PLTEf™fÿÌf™™Ì/NjKoq4W„fffwƒ¶IZlä½e‹ y3fId–Ūfff™Bnê¿’ bKGDˆH pHYs  ÒÝ~ütIMEÒ-B’GèOIDATxÚcPRõ)RRR`P ap}¤00¸)080Ah„æŸÀ`¢Í ˜X À|æ‹ €´… Ã0ÎZÂ`Ü)(Y« ùŠªæ IEND®B`‚jffnms-0.9.3/htdocs/images/usa.png0000644000175000017500000000034511377440254016356 0ustar csmallcsmall‰PNG  IHDR  ŒåªsBITÛáOà PLTEÿÿÿÿÿoÆ÷ pHYs  ÒÝ~ütEXtCreation Time04/01/02¼ Å:!tEXtSoftwareMacromedia Fireworks 3.0ïi1ð!IDATxœcø ”˜Nt„†£³®†YPX @ƒ8ÖçIEND®B`‚jffnms-0.9.3/htdocs/images/normal.png0000644000175000017500000000046211377440254017056 0ustar csmallcsmall‰PNG  IHDR Q‹ásBITÛáOà$PLTEÿÿÿÌÌÿ¿¿ÿÀÀÀÿ€€€ffÿÿf??ÿ33ÿÿܯ tRNSÿÿÿÿÿÿÿÿÿÿÿõ¹æÏ pHYs ð ðB¬4˜!tEXtSoftwareMacromedia Fireworks 3.0ïi1ðtEXtCreation Time04/01/02¼ Å:>IDATxœcò†æp(Í ¤³wo`XÀÀÔÀŒD/RRÓ+::QÄ±Ñ Àæ1éÝ`°C®ÝÑø#IEND®B`‚jffnms-0.9.3/htdocs/images/bullet5.png0000644000175000017500000000052611377440254017143 0ustar csmallcsmall‰PNG  IHDR E5NrPLTEÿÿÿ›Ê®ï¤Ý)‘¸=ƒfÎõÿÿÿÌïü³ðD~”ÿÿÿ ¬èÿÿÿ[ÃêˆÙøÿÿÿ²î6ˆ¦¸æøÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿUÉôÿÿÿÿÿÿRtÿÿÿ.¢Í«ß©â7 Çž¢MŸtRNS@æØftEXtSoftwareAdobe ImageReadyqÉe<mIDAT™EŽÙÂ@ÇI$lŒ&®ÏõöÿQ <ú‰¦¦`cBV5›éW¤ÑD¶f¾—™i÷ËÉÜ´½£ƒ.3¸ZoÆín8žJFɤgaþ\Izò t.7“;âEé ùˆ2O¿ðï=ßsÈ•2ÀûIEND®B`‚jffnms-0.9.3/htdocs/images/jffnms.ico0000644000175000017500000000257611377440254017047 0ustar csmallcsmallh( @ÿÿÿᙟ›—tGØÐÄrog³’:¦iE6+édŒv=TQK¼µ«ìëÞ¾ŒrŽbº¬‰„{›{%Àu”TSJ1|h0ÿúç‚J ˶̌°©œ‡viaN‘Œ†±¹žYæÞÓǶ^[Tvtv„efA!¦™z½„÷òà·lØ“m š“Š³®¨¯vâØËKD-Œlü´ÿÿõÐɺŒº©€‹^¼‡ ·~¶­ “jF&úô黡`¥ž“™W—v!óìÞ×–ÿÿîÖ̼±Ž5ÜÕÅÓÌÃݓӋ—q%˜…ÌżëáÒªy‹ylJ8,ÆÁ¸œv'ÿõårDûòãÐȉvqi¿ˆˆƒ{¶¯¥´{gD$µ€ÓÌ¿°© —U\YRéâÔG5)­y¹€žx(²7Û‘Õd†ysF¼‚¶H8-gC"Û”¥g°xb¾‹‰wiºž[–T^YTúóâÙÑÅÁ‹¹«ˆ²‘9J •Uà˜Öޤh¿tøžZÿÿöÿÿïéáÔâÙ˃J tG•T¼µª™Wܔے×Ò‹·m¿u¯w‹ykhT‘C:C„™Mnx`—˜,wŠI"|l]•ˆ*R2dg‚zjVi3KŒQ%69bNœmD“ fJ0'L…(š[AWGŽ =&F‰a?‰ #7^U@E5ZuS}-€O~p_Y+>4–’{.;$\B/HPsk< c)!rvƒ‹ 8†w™˜‡›1‡˜™qeoy”X tûßñàààÀÀàààñûßjffnms-0.9.3/htdocs/images/home.png0000644000175000017500000000034611377440254016517 0ustar csmallcsmall‰PNG  IHDRÔ¹gAMA± üaPLTEÿÿÿÿÿÿ³³³ŒŒŒsss…{tRNS@æØfbKGDˆH pHYs  ÒÝ~ütIMEÒ '9Gî@IDATxÚuÊÑ P‰6i@Èýgªî¾óGyÃè,uÒjØRÁUÀ; HÑEÝ“>Óó3ÏFS#°²fVIEND®B`‚jffnms-0.9.3/htdocs/images/filter.png0000644000175000017500000000113411377440254017050 0ustar csmallcsmall‰PNG  IHDR(–ÝãsBITÛáOàÆPLTEÿÿÿÿÿÛÿÿ×ÿÿrÿÿfÿÿ\÷÷“ÿÿÿÿÿÿØØÚææ ÌÌÌÚÚ/ÌÌfÃÃ^··°ÌÌ¿¿[­­­««§¼¼¥¥ª··¢¢¦ ®®™™™¤¤ŽŽŽ™™‡‡‚ŠŠYŽŽŒŒ„„V‡‡{{`tt†vvo||vvgg{ssfffggAbbQff3\\PffYYY\\RR7LL•+Uc·F2Ô^“RÆ(õ=Þ‚Ún!Böa ‡Ñˆ1Ïg*æc€Ét6×Ib˜Èlm½ÔFá•Ì_ËõF«xûÀnŸšÃ žþñ|IÍ5(ˆnw÷à×ó•ß7?Ê š©¢ 5IEND®B`‚jffnms-0.9.3/htdocs/images/filter3.png0000644000175000017500000000054611377440254017141 0ustar csmallcsmall‰PNG  IHDR lµÜ’¢PLTEÿÿÿ³³³»»»¨¨¨‡‡‡rrrkkkwww{{{¬¬¬ÂÂÂCCC)))"""000ƒƒƒ™™™'''  žžž¸¸¸£££VVV444...@@@nnn±±±ÙÙÙôôôìììåååÕÕÕÀÀÀŠŠŠÎÎÎÅÅŵµµ°°°–––ää䀀€ooolll¿¿¿\\\ZZZŸ³tRNS@æØf pHYs  šœ]IDAT™=ÆUƒPÑ‹»[‹;-Neÿ[#xó19E3,Ç " ÉŠªé†iÙP×óƒÇS (NÒ,/J@U7m÷zã¨JÆÁ™IDATxœc(™ X*Á4 ;˜æãÿÿL3°à¡™ 4[ƒ˜f¼}"/¬ÀÀVÇ¢ÿƒÁ×”FHðIEND®B`‚jffnms-0.9.3/htdocs/images/b-right.png0000644000175000017500000000037211377440254017122 0ustar csmallcsmall‰PNG  IHDR é°GoWPLTEÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÜìztRNS@æØf pHYs  ÒÝ~ü&õç¬Ùáó62ÎæØtûõÁ&(ss’|Ž€’€äõíìB2šºÎ6üö•ûó}{|#âþôÌÇëùýßÛùõüûùŽŽnGB¿vbKGDˆH pHYs  ÒÝ~ütIMEÒS)}ÄIDATxÚ-’ƒ D!X­…*µ9ùÿϼEº$0¼Ù F»D¸|½*kéWrÇŒh_*çœP£¥ñ€Ây;ÖžKe·“ÎéSÚ³µR 9Î|~¾öîôŒ5\ÿÖåý­5Tco'‘\Þe@Ç>%Ä#ù)ÂÚB’ -íÓ>Çå|w×tûk~¸è^hoš§kOØæ? v†ßùVÍIEND®B`‚jffnms-0.9.3/htdocs/images/bullet6.png0000644000175000017500000000024611377440254017143 0ustar csmallcsmall‰PNG  IHDR IDATxÚc``PRb&G! ¥"À¤¤ÁN)))*00)"ƒj()c R@1<%ˆAÎÏ v° )IEND®B`‚jffnms-0.9.3/htdocs/images/popup.png0000644000175000017500000000041611377440254016730 0ustar csmallcsmall‰PNG  IHDRíf0âsBITÛáOàPLTEÌÌÌ™™™fffÿÿÿ^R›vtRNSÿÿÿÿû¶S pHYs  ÒÝ~ütEXtCreation Time04/01/02¼ Å:!tEXtSoftwareMacromedia Fireworks 3.0ïi1ð6IDATxœcpc @¦M\\œ]…Ðh QçèÀÀÀÔï4Ä™°¹0óÁ·Õ|ùÇ^IEND®B`‚jffnms-0.9.3/htdocs/images/users.png0000644000175000017500000000152311377440254016726 0ustar csmallcsmall‰PNG  IHDR ãÅgAMA± üaIPLTEÿÿÿ3f™Ìÿ333f3™3Ì3ÿ3f3fff™fÌfÿf™3™f™™™Ì™ÿ™Ì3ÌfÌ™ÌÌÌÿÌÿ3ÿfÿ™ÿÌÿÿÿ333f3™3Ì3ÿ333333f33™33Ì33ÿ33f33f3ff3™f3Ìf3ÿf3™33™3f™3™™3Ì™3ÿ™3Ì33Ì3fÌ3™Ì3ÌÌ3ÿÌ3ÿ33ÿ3fÿ3™ÿ3Ìÿ3ÿÿ3f3fff™fÌfÿf3f33ff3f™3fÌ3fÿ3fff3fffff™ffÌffÿff™f3™ff™f™™fÌ™fÿ™fÌf3ÌffÌf™ÌfÌÌfÿÌfÿf3ÿffÿf™ÿfÌÿfÿÿf™3™f™™™Ì™ÿ™3™33™f3™™3™Ì3™ÿ3™f™3f™ff™™f™Ìf™ÿf™™™3™™f™™™™™Ì™™ÿ™™Ì™3Ì™fÌ™™Ì™ÌÌ™ÿÌ™ÿ™3ÿ™fÿ™™ÿ™Ìÿ™ÿÿ™Ì3ÌfÌ™ÌÌÌÿÌ3Ì33Ìf3Ì™3ÌÌ3Ìÿ3ÌfÌ3fÌffÌ™fÌÌfÌÿfÌ™Ì3™Ìf™Ì™™ÌÌ™Ìÿ™ÌÌÌ3ÌÌfÌÌ™ÌÌÌÌÌÿÌÌÿÌ3ÿÌfÿÌ™ÿÌÌÿÌÿÿÌÿ3ÿfÿ™ÿÌÿÿÿ3ÿ33ÿf3ÿ™3ÿÌ3ÿÿ3ÿfÿ3fÿ./átRNS@æØfbKGDˆH pHYs  ÒÝ~ütIMEÒ(.ç)ùjsIDATxÚ-ޱÄ0CEun\eWé ‹ä¥¸IÒ’ŠaÜ1ÁMvG4=”PÀ"“·¹’4›r#BåC*·“æOÎ5²»+fæˆÖ8Äètl¯ý´Í¬­c¡M?…[ÓõBãüÞgâ1ú–u¿?.á¾t?kv•ÜIEND®B`‚jffnms-0.9.3/htdocs/images/fr.png0000644000175000017500000000044311377440254016174 0ustar csmallcsmall‰PNG  IHDR H×]qgAMA¯È7ŠétEXtSoftwareAdobe ImageReadyqÉe<KPLTEÿÿÿÿÿÿ ÿÔÔÿúýýûüÿùÿúùþþûüûýÿúûŸ¤k^IDATxÚbaV0`fn€bÅ” NLA~€bÀä 6LA^€Â&(@ ìX´ƒ0¦ @1pa 6í‚Ä Ž)È` "FAÅ–ÃIEND®B`‚jffnms-0.9.3/htdocs/images/alert.gif0000644000175000017500000000366311377440254016664 0ustar csmallcsmallGIF89a÷ÿ€€€€€€€€€€€€Œ üü„||D LDDÄ, ”„Œlä„<ôÔŒ$„L,Ü\$ì¬\D$l\d´¬´d<$ÌÄĬ$ ÔL,$,ôÄt¬|TT Ô4œ””ìœLüì¬4œlDät4T,tlltD, œ$ TLL”ŒŒ|ìŒDôÜ”Œ\<Üd,ì´d¼¼¼l<$äÜä´, ôÌ|¼”l\Ô<<\4|ttÀÀÀÿÿÿÿÿÿÿÿÿÿÿÿ!ÿ NETSCAPE2.0!ù ,å¨hðÇ +À€ƒŠ ~4À„xdȱ! .€œpB"J2`àá¡‚ "b@HЃA (E€@ @tp ¡èÍ zŠÊ¡):b¸€€´'„1bp¨ðÁć: 0˜`µ5f˜PkÁA d@¨Ð!… ;fÌøk ¥j Ý!Á šÆÐ!B l|hëÂGž=cÈ(‘"ÅMT€Ð³'ˆ &JTpСƒ>’–V‡…èVw6m•}¸•í»4ˆÇ‹!ù ,Ñühð¢A ‚,XCƒ <4ÀA 2dÈÄŠ<\`0A’ €HÒƒ"bˆèqâ„JRP @„ =L2X bBÎ=9$€ÀàÄQN íQÁÁÒ @%™“gŒ#–ºàâÄI§ x&øPC dô€‰’§)”º1¢©ˆ¿HO@á`ìˆ $à iÒ°DÔŒ1Â…ž<'Ĩ&Ùi1+8ÑÃA 1b8 )ó˜§M†nÍ3¥NÚ!ù ,ÀLhð‚  À8€¡Á`(ˆaÅrÜ€±¢‡@€ À„“ @*Á`dI‘'IP PÄ’#MN8qs¦‚N¸¥O.ZNÁ“©Í¥4E¸€°“©N nFÁëÉ" ØA“A=²f=Ñ#†X²GTàÐc'ƒ°.ºúT#ˆ CHÀUMšF”áB bÀ= ÂE®1Ç8q¸3Ó ¼íLZ™¥!ù ,ÕLhð‚  @AÃ`(ˆaÅràCAˆ‡@ bÂ"@\ð¨ äH’Nô!ó„'DQ%J"nÊœ°SdL¸ªàDŒ;œ¨à‚ Üá‚I8$ˆaD­ DŒèÁ„:bÄàPa‡‹› :=9ÂX)"00‚ªˆ =FˆuáéM1døxÊ)¿LoQÂA ”=8¤H0áñM.*Œ ›ÀA›¦OËAöD騦EêŽ!þïThis GIF file was assembled with GIF Construction Set from: Alchemy Mindworks Inc. P.O. Box 500 Beeton, Ontario L0G 1A0 CANADA. This comment block will not appear in files created with a registered version of GIF Construction Set;jffnms-0.9.3/htdocs/images/calendar.png0000644000175000017500000000037411377440254017341 0ustar csmallcsmall‰PNG  IHDR „0)rsBITÛáOàPLTEÿÿÿÆÃÆ„‚„„„;“È’ pHYs  ÒÝ~ü!tEXtSoftwareMacromedia Fireworks 3.0ïi1ðtEXtCreation Time04/06/02!÷ýƒ2IDATxœcP‚€T†#ƒ!1… !"Ì H )T]pF(ë ¦ImkéIEND®B`‚jffnms-0.9.3/htdocs/images/sound.png0000644000175000017500000000113411377440254016713 0ustar csmallcsmall‰PNG  IHDR(–ÝãsBITÛáOà½PLTEÿÿÿÿÿàøøøùúçÿÿ¥ÿÿ™ÿÿŒÿÿƒïïïÿÿtÿÿføû~òöæææãå±ÛÜÛíð>êìYÖ×Öäå[ÐÓÐÌÌÌÝá$ÉÍ­»½»´¶Á´µ´­µ­¬­¬§©§¤¦¤®±2Ÿ¢Ÿ§©S™™™¢¥3œžY£¥!Ÿ¡6™™’• €‚2{~+‚npptv9x{fffhjIIKKNPPQ?@>@A9@@2>?:;<::>333./*+)((¦DO.?tRNSÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿHlÁ pHYs  ÒÝ~ütEXtCreation Time04/01/02¼ Å:!tEXtSoftwareMacromedia Fireworks 3.0ïi1ðœIDATxœ=ŽëÁ0„WP)¢TŠ^UÜïBµUåýK:1Ý_»³;ç|@%Z~)jÑùMÎêÄ–“„6©ºÍèä‚ 8¡Š«õ¸õ¸çD*-¦ÃHJð€UÓÙèw²PZ!@.ÃfÏÈ¥´<.„@~ßwÛYé7×ähêT`iúÚž]Â};&£8=ûIEND®B`‚jffnms-0.9.3/htdocs/images/mail.png0000644000175000017500000000125011377440254016504 0ustar csmallcsmall‰PNG  IHDR´´gAMA± üabKGDÿÿÿ ½§“ pHYs ï ï}vŠHtIMEÒ;„p;%IDATxÚc|õæÑ€‰€OõŸ?ß¾yûøñ.ˆ \îçÏßïÞ¾}ùòÅóçÏn\¿þèÑ×/_ܼyÓÍÝ£½£¢†ñÄ©ÓW¯\Ú´ië—ÏŸ%%ÅUUUtuu%%%ÿþvëÆgW¸ß•””ƒƒ"""TT”¹¹¹™™™™þüùýçÏÏ?¾÷öLæâ d``` ççç¹{÷nwOž®33ó¿ÿÿÿÿ÷ïßß)“§›˜êéé ‰AŒgñöñûøáUaIåÚ•KìÛÏÁÁnjjljfµaÃê={ö†…ÿùóÛÒÜüÍÛw"ÂB ÷>usuþ÷÷÷Ÿßß_¾xÒÖÚÔP_qùÊÙœìô'Ž<¸'4,òÕ›w,ÜÜœ¯Þ¼}ñü‰ˆ˜˜˜¸èÍ›·æÌ™õû÷÷Ÿ?}ùúµ¦¶jãÆÓŽçåãþúõ;siY9'÷·¯Ÿ555¶mݦ¤¤¨¡©ÍÀÀÀÊÊÊÂÂÄÈÀ §§/%%“ŸW +'ËðêÍ»SgÎ{zºÿÿÿ³£½éÆõ‹ß¿½ýõëÓÿÿ??ºèËÀÀ %%õðñóWoÞ1100((Èoß¾óò¥‹Ÿ?V×ÐZ³j]C}“€€¤¬œŠ­½ëµ›w.\ºÂÉÉŽˆËèèØËW_¿y][[ÛÒÊéãÇÇOBK Œ€/µIDATxœcXµªaj(O`DååîÀ 6wxœøIEND®B`‚jffnms-0.9.3/htdocs/images/event.png0000644000175000017500000000046011377440254016705 0ustar csmallcsmall‰PNG  IHDRÉøˆygAMA± üa0PLTEÿÿÿÿìs ÿå;ÿÇÿ¬ÿìKÿØ$ÿ×ÿ¡ÿÒÿ¸ÿß1ÿßÿ™(ë÷KtRNS@æØfbKGDˆH pHYs  ÒÝ~ütIMEÒ Yn€jiIDATxÚc```àg€‚ 4¿ <”q ÊøqI"÷C_ÌàwÑ×Ëñ;ë«Ý1~ïÑW» ’ûZsÈ,ÈàŸZ~È8(÷oÖr}e³Þ ÿ^­*:cÜñÿÝÌÐÝ.þ@ÅÿAàL`(dWý”>IEND®B`‚jffnms-0.9.3/htdocs/images/sla.png0000644000175000017500000000052111377440254016341 0ustar csmallcsmall‰PNG  IHDRÚ­¿gAMA± üaD«¥vïÞ°ÑUYjëRØ<·àwúp!‹O Nÿ>gšè±/ЉCU^„IEND®B`‚jffnms-0.9.3/htdocs/images/refresh2.png0000644000175000017500000000033511377440254017305 0ustar csmallcsmall‰PNG  IHDR ‰ÕgAMA± üa PLTEÿÿÿIá¤tRNS@æØfbKGDˆH pHYs  ÒÝ~ütIMEÒ/ÈðãÀ=IDATxÚ Ê1 Á/ À€‹JèÐF¤`¿t¼ä`nà”]9©ª(ábt«žì„–åŽ ±øâ®Á‘„áIEND®B`‚jffnms-0.9.3/htdocs/images/new.png0000644000175000017500000000034511377440254016357 0ustar csmallcsmall‰PNG  IHDR¤[ÜgAMA± üaPLTEÿÿÿÿÿÿÿÿÀÀÀ}êMïtRNS@æØfbKGDˆH pHYs  ÒÝ~ütIMEÒQ¼?IDATxÚ]ËÁ CјÀ ؤöŸÉ‚’82âïŠÕ ¤ÈÜi¢ ÓUHÖPySBkA ©w-1i |ÍÌÎIEND®B`‚jffnms-0.9.3/htdocs/images/temp/0000755000175000017500000000000011377440254016023 5ustar csmallcsmalljffnms-0.9.3/htdocs/images/temp/.check0000644000175000017500000000000011377440254017067 0ustar csmallcsmalljffnms-0.9.3/htdocs/images/mess.png0000644000175000017500000000040111377440254016526 0ustar csmallcsmall‰PNG  IHDRÉøˆygAMA± üaPLTEÿÿÿÿÿÿ„„„ÆÆÆ„„]`ãtRNS@æØfbKGDˆH pHYs  ÒÝ~ütIMEÒÅ€¯UIDATxÚ=ŒÁ €0 ­là‚ú&Y˜"û@’"üÉé,Ä6T”½®S°”ì™3S®Çˆ¢µó*—ëþÄæšÆôÎUwŸæÿ[à匠ÚIEND®B`‚jffnms-0.9.3/htdocs/images/csv.png0000644000175000017500000000107311377440254016360 0ustar csmallcsmall‰PNG  IHDR(–ÝãsBITÛáOà«PLTEÌ̵§§sss÷÷÷SS×××ÿн½™™""OOOƒ™™JJJ($$ŒŒŒëë*qqëÞÞfff;DD!##½½¤¤¤ÝÝÝáÁÁxxxffm{{33™™™ÌÌ̸¸¸3ffÿÿÿÛÛííí333ffů¯™™™ZZZ®®®………!--)))¨¨¹¬¬÷÷##BBBÏ+19tRNSÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ§¦š¬ pHYs  ÒÝ~ü tEXtSoftwareMacromedia Fireworks MX»‘*$tEXtCreation Time05/13/02>/µ”IDATxœMÌk@ÅñCÙuÍ Q‰žgÙ¥\¾ÿ'³îþï~sf¤\”D¤l{)¡õYŒÛÚ£{k‰b¹iú-¸Æ(Å„UãÞ·ë!Ï HÔ£Ý`’X›-cºL;Ù,å×#ê¬;|SÚ÷àT¹Z¸Ú¼(ùÑuÈsþHåÍ1ñ—ÈEaô¤"TWêEfŽl`ÜåϵLÏÞIEND®B`‚jffnms-0.9.3/htdocs/images/jffnms_small.png0000644000175000017500000000172211377440254020241 0ustar csmallcsmall‰PNG  IHDR(-SgAMA¯È7ŠétEXtSoftwareAdobe ImageReadyqÉe<ÔPLTE‹Òm·ŽÖ J‚t¿W™g¥àò÷’ÛU•%{›T”iqvvtvÙáÓÞæ+6EW™‹ÓËØâËÙâ JNabŽÔáéÔâéöÿÿly‹e„,8Jyªy­rÄÐØâóú”Üb m“ïÿÿ`¡»‹Ái¦Dr¶‰ÈŒÂ7²U—!v—éôú1JS‚¼Þë쀹^‹5ޱ!AfÐ=vŒiw‰dœ©°ÅÑÙd©Ã{´ˆ«¹ÅÕÜ“ž¥(xžˆ¿¼ÅÌ…˜€©º¿ÌÓRY\Š“š0h| JƒGtv¯‘Û-8H¶ÂËz™¦ ©°gorT[^)5G9‘²×´¼Ã:’³%q—ŒÌ‰¬º$DgŒ¾Yž¹Õãòûu¿lŒ”Û{„ØFs“ÝZž¸±çúÿiv‡x°KQTuÀ¥¯¶–×Þìów¯T• ­¶ºÉÐõÿÿ˜àTY^y†åõÿ€µ ‡¼ky‹„½{ƒˆ—›Ÿh¤~·îÿÿÃÌÓGt"Cgl·ªµ¼'vœ[žº¨®³†Œ‘“¶ÇT–‹¾Òáë&Fj¸ÁÆ«µ¼¼ÌÖ-DKÜÕöœtRNSÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¿g_ÜIDATxÚb˜ ‚ "ÌdY¶³g« iÃü˜Ê˜™¡Zéš‘91zÕlP¶ÄøJ¢^!¹&µ†IÁ<.>3Ýu\2“3¹ì=jj‹SØ'¦q”Û0Lc‰³¨lžnTªíkUÔÅ`™ª«Q×.9!#¬‚W¼„%¡‘;а%O½§ÐÛ¹_6›3hh¯Â¬é©ávUžõ±k›äMEB¥œ¦˜AÝÁÆÏg‘Ô§ï¦Ò cN.pŒbè†9}v'«ÄìÙæ¬þpßÎŽr`&@€,ófjE[˜DIEND®B`‚jffnms-0.9.3/htdocs/images/ar.png0000644000175000017500000000034011377440254016163 0ustar csmallcsmall‰PNG  IHDR  ŒåªsBITÛáOà PLTEÿÿÿÞßkŽÿI” Í pHYs  ÒÝ~ütEXtCreation Time04/01/02¼ Å:!tEXtSoftwareMacromedia Fireworks 3.0ïi1ðIDATxœcø ¯V­ZD` `F"ÐdA: ·Ä[ä,IEND®B`‚jffnms-0.9.3/htdocs/images/ok.png0000644000175000017500000000022511377440254016174 0ustar csmallcsmall‰PNG  IHDR žr‡PLTEÿÿÿÝ™ÿ™3f3»"e€]ÕtRNS@æØf1IDAT™EÇÁ ÃÀÖÂþ+«€5¯ p#ܢ̒3Å2ºL@2gš5g>æ3®Ø/oÿ½IEND®B`‚jffnms-0.9.3/htdocs/views/0002755000175000017500000000000011716447477014763 5ustar csmallcsmalljffnms-0.9.3/htdocs/views/view_dynmap.js0000644000175000017500000001377111377440254017637 0ustar csmallcsmall function ir_url(url,url2){ if (url!='') { if (top.work && top.work.events) top.work.events.location.href = url; else window.open(url); } if (url2!='') { if (top.work && top.work.map) top.work.map.location.href = url2; else if (top.work) top.work.location.href = url2; else window.open(url2); } } function show_objects_debug() { for (i = 0;i < objects.length;i++) if (objects[i]) { debug ("Object "+i+", X: "+objects[i][2]+", Y: "+objects[i][3]); for (j = 0;j < objects[i][1].length;j++) if (objects[i][1][j]) debug("Object "+i+", with Line "+j+", to "+objects[i][1][j]); } } function real_debug (data) { if (!document.all) debugtext = document.getElementById("debugtext"); debugtext.innerHTML = debugtext.innerHTML + "
" + data; } function link_to_object(id) { selected_name = null; if (link_to_a==null) link_to_a = id; else { if (id) if ((link_to_a!=id) || (confirm("Are you sure you want to delete all conections from this interface?"))) { new_link(link_to_a,id); setTimeout("document.location.reload();",1000); debug ("Link From "+link_to_a+" to "+id); } link_to_a = null; } debug ("Link From "+link_to_a); } function select_object(name) { if (selected_name != null) { if (was_moved!=null) { debug ("saving position "+was_moved); redraw_connections (selected_name); save_object(selected_name); } selected_name = null; } else { selected_name = name; } debug("selected "+selected_name); } function select_object_by_mouse(event) { select_object(object_by_pos (event.clientX, event.clientY)); } function object_by_pos(x,y) { for (var i = 0;i < objects.length;i++) if (objects[i]) if ( (x > objects[i][2]-(sizex/2)) && (x < objects[i][2]+(sizex/2)) && (y > objects[i][3]-(sizey/2)) && (y < objects[i][3]+(sizey/2)) && (x < (totalx-(sizex/2))) && (y < totaly) ) return i; return false; } function redraw_all_connections () { for (i = 0;i < objects.length;i++) if (objects[i]) redraw_connections (i); already_lines = null; } function position_new_objects () { sepx = Math.floor(sizex+gridx); sepy = Math.floor(sizey+gridy); maxx = Math.floor((totalx / sepx))-1; posx=0; posy=0; var i; new_objects_found = 0; for (i = 0;i < objects.length;i++) if (objects[i]) if (objects[i][2] < 5) { do { x = (posx*sepx)+(sizex/2)+10; y = (posy*sepy)+20; //debug ("New "+i+", X: "+x+"("+posx+"), Y: "+y+"("+posy+")"); if (++posx>maxx) { posx=0; posy++; } } while (object_by_pos(x,y)!=false); move_object(i,x,y); //debug ("Moved "+i+", X: "+x+"("+posx+"), Y: "+y+"("+posy+")"); new_objects_found = 1; objects_to_save[objects_to_save_id++]=i; } if (new_objects_found==1) save_new_objects(0); } function redraw_connections (id) { for (j = 0;j < objects[id][1].length;j++) if ((objects[id][1][j]) && ((!already_lines) || (already_lines[j]!=1))) { //debug("Object "+id+" connected to "+objects[id][1][j]+" with Line "+j); id2 = objects[id][1][j]; if (!document.all) line = document.getElementById("conexion"+j); else eval("line = document.all.conexion"+j+";"); line.src="views/view_dynmap_line.php?totalx="+totalx+"&totaly="+totaly+"&con[]="+objects[id][2]+","+objects[id][3]+","+objects[id2][2]+","+objects[id2][3]; if (already_lines) already_lines[j]=1; } } function draw_all_connections () { var url = ""; var cnx = 0; for (id = 0;id < objects.length;id++) if (objects[id]) for (j = 0;j < objects[id][1].length;j++) if (objects[id][1][j]) { //debug("Object "+id+" connected to "+objects[id][1][j]+" with Line "+j); id2 = objects[id][1][j]; url=url+"&con["+cnx+"]="+objects[id][2]+","+objects[id][3]+","+objects[id2][2]+","+objects[id2][3]; cnx++; } if (url!="") { if (!document.all) allconexions = document.getElementById("allconexions"); allconexions.src="views/view_dynmap_line.php?totalx="+totalx+"&totaly="+totaly+url; } } function follow_object (event) { move_object(selected_name,event.clientX,event.clientY); } function move_object (id,x,y) { if ((id) && (id!=null)) { if (!document.all) object = document.getElementById("object"+id).style; else eval("object = document.all.object"+id+".style;"); if (object) if (x < (totalx-(sizex/2)) && (y < totaly)) { x=(Math.floor(x/gridx))*gridx; y=(Math.floor(y/gridy))*gridy; object.left = x-(sizex/2); object.top = y-(sizey/2); objects[id][2]=x; objects[id][3]=y; //redraw_connections (id); //follow was_moved = true; //debug ("Moved Object "+id+" to X: "+x+" Y: "+y); } } //debug("X: "+event.clientX+" Y: "+event.clientY); } function save_object (id){ save_url (document.location+"&action=save&update[]="+objects[id][0]+","+objects[id][2]+","+objects[id][3]); } function new_link (id1,id2){ save_url (document.location+"&action=save&update[]=1,"+id1+","+id2); } function save_new_objects (part) { parts = 2; if (objects_to_save.length < 50) parts = 1; cant = objects_to_save.length/parts; debug ("Save part "+part+" of "+parts+" parts "+cant+" items each"); if (part==0) for (j = 0; j < parts; j++) setTimeout("save_new_objects("+(j+1)+");",1000*(j+1)); else { url = ''; for (i = 0; i < cant; i++) { id = objects_to_save[i+((part-1)*cant)]; //debug ("part "+part+" i "+i+" id "+id+" "+objects[id][0]+","+objects[id][2]+","+objects[id][3]); url = url + "&update[]="+objects[id][0]+","+objects[id][2]+","+objects[id][3]; } if (url!='') { debug ("Saving Part "+part+" of "+cant+" new objects positions"); save_url(document.location+"&action=save"+url); } } } function save_url (url){ url = url + "&debug=0"; if (!document.all) { savebox = document.getElementById("savebox"); savebox.src=url; } else savebox.document.location = url; } jffnms-0.9.3/htdocs/views/toolbox.js0000644000175000017500000000113111377440254016766 0ustar csmallcsmall function toolbox_get (id) { name = "t"+id; if (document.all) { toolbox = document.all[name]; if (toolbox) return document.all[name].style; } else { toolbox = document.getElementById(name); if (toolbox) return document.getElementById(name).style; } } function toolbox_show (id,x,w,y) { if (toolbox_style = toolbox_get(id)) { toolbox_style.visibility = 'visible'; toolbox_style.left = x+w-90; toolbox_style.top = y; } } function toolbox_hide (id) { if (toolbox_style = toolbox_get(id)) toolbox_style.visibility = 'hidden'; } jffnms-0.9.3/htdocs/views/view_normal.class.php0000644000175000017500000002153211537371635021114 0ustar csmallcsmall Javier Szyszlican * Copyright (C) 2010 Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ require_once('toolbox.inc.php'); require_once('view_base.class.php'); class View_normal extends View_base { public $filename; protected $break_image; protected $break_filename; protected $break_bgcolor; protected $break_fgcolor; // Only for this class private $break_url = ''; private $rnd; private $image_events; function __construct() { parent::__construct(); if (($this->active_only==1) && ($this->host_id < 1)) //add one more line for host name in Alarmed Interfaces $this->sizey += 10; if ($this->big_graph==1) { $this->sizex *= 1.5; $this->sizey *= 1.5; } $this->cols_max=round(($this->screen_size/$this->sizex))-1; $this->table_width='100%'; $this->cols_count=$this->cols_max; $this->rnd = substr(time(),5,10); } // View_normal function break_init() { $this->break_image = ImageCreate ($this->sizex, $this->sizey) or die ("Cannot Initialize new GD image stream"); $this->break_bgcolor = ImageColorAllocate ($this->break_image, 150 ,150, 150); $this->break_fgcolor = ImageColorAllocate ($this->break_image, 255, 255, 255); $this->break_filename = ''; } //break_init function break_by_card(&$item) { if ($item['db_break_by_card']) ImageStringCenter ($this->break_image, $this->break_fgcolor, 0, array("Card",$item['card']),$this->big_graph); else ImageStringCenter ($this->break_image, $this->break_fgcolor, 0, $item['card'] ,$this->big_graph); $card_filename = str_replace(array(' ','/'), '_', $item['card']); $this->break_filename = "c".$card_filename."-$this->big_graph.png"; if ($item['have_graph']==1) $this->break_url = "javascript:ir_url('','view_performance.php?type_id=$item[type_id]&host_id=$this->host_id')"; } //break_by_card function break_by_host(&$item) { global $Config; $jffnms_real_path = $Config->get('jffnms_real_path'); if ($item['host'] > 1) { $zone_image_filename = "$jffnms_real_path/htdocs/images/$item[zone_image]"; if (!empty($item['zone_image']) && file_exists($zone_image_filename)!=FALSE) { $im_zone = ImageCreateFromPNG($zone_image_filename); list($aux_w,$aux_h) = @getimagesize($zone_image_filename); ImageCopy($this->break_image,$im_zone, ImageSX($this->break_image)-$aux_w, ImageSY($this->break_image)-$aux_h,0,0,$aux_w,$aux_h); imagedestroy($im_zone); } ImageStringCenter ($this->break_image, $this->break_fgcolor, 0, array($item['host_name'],$item['zone_shortname']),$this->big_graph); $this->break_filename = "h$item[host]-$this->big_graph.png"; $this->break_url = "javascript:ir_url('events.php?express_filter=host,$item[host],=','')"; } } //break_by_host function break_by_zone(&$item) { global $Config; if ($item['zone_id'] > 1) { $jffnms_real_path = $Config->get('jffnms_real_path'); $zone_image_filename = "$jffnms_real_path/htdocs/images/$item[zone_image]" ; if (!empty($item['zone_image']) && file_exists($zone_image_filename)!=FALSE) { $im_zone = ImageCreateFromPNG($zone_image_filename); list($aux_w,$aux_h) = @getimagesize($zone_image_filename); ImageCopy($this->break_image,$im_zone, ImageSX($this->break_image)-$aux_w, ImageSY($this->break_image)-$aux_h,0,0,$aux_w,$aux_h); imagedestroy($im_zone); } ImageStringCenter ($this->break_image, $this->break_fgcolor, 0, array($item['zone'],"Zone"),$this->big_graph); $this->break_filename = "z$item[zone_id]-$this->big_graph.png"; $this->break_url = "javascript:ir_url('events.php?express_filter=zone,$item[zone_id],=','')"; } } // break_by_zone function break_show($urls) { global $Config; $images_real_path = $Config->get('images_real_path'); $images_rel_path = $Config->get('images_rel_path'); if ($this->break_filename) { ImagePng ($this->break_image,"$images_real_path/$this->break_filename"); ImageDestroy($this->break_image); $this->break_image = NULL; echo td (linktext(image("$images_rel_path/$this->break_filename",$this->sizex,$this->sizey),$this->break_url)); } } //break_show() function break_next_line_span($break_by_host, $break_by_zone, $break_by_card) { echo td(' '); } // break_next_line_span() // Interface functions function interface_show(&$item, $bgcolor, $fgcolor, $mark_interface, $urls) { global $Config, $Source; $images_real_path = $Config->get('images_real_path'); $interface_shown = FALSE; $int_filename = ''; $item_id = $item['id']; if (($item_id > 1) && ($item['host'] > 1)) { $interface_shown = TRUE; $int_image = ImageCreate ($this->sizex, $this->sizey) or die ('interface_show(): Unable to create image.'); $background_color = ImageColorAllocate ($int_image, hexdec(substr($bgcolor, 0, 2)), hexdec(substr($bgcolor, 2, 2)), hexdec(substr($bgcolor, 4, 2))); $text_color = ImageColorAllocate ($int_image, hexdec(substr($fgcolor, 0, 2)), hexdec(substr($fgcolor, 2, 2)), hexdec(substr($fgcolor, 4, 2))); $mark_interface_filename='0'; if ($item_id == $mark_interface) { ImageFilledRectangle($int_image,0,0,$this->sizex,$this->sizey, ImageColorAllocate ($int_image, 0, 0, 0)); $mark_interface_filename='1'; } $int_filename = $Source->source_type.$item_id.'-'.$this->big_graph.'-'.$mark_interface_filename.'.png'; ImageFilledRectangle($int_image,3,3,$this->sizex-3,$this->sizey-3, $background_color); $infobox_text = ''; if (($item['show_rootmap'] ==2 ) || ($item['check_status'] ==0)) //if its "Mark Disabled" { $small_box = $sizex*0.13; if ($item['show_rootmap'] == 2) $small_box_color = ImageColorAllocate ($int_image, hexdec(substr($bgcolor_status, 0, 2)), hexdec(substr($bgcolor_status, 2, 2)), hexdec(substr($bgcolor_status, 4, 2))); if ($item['check_status'] == 0) $small_box_color = ImageColorAllocate ($int_image, hexdec(77), hexdec(77), hexdec(77)); ImageFilledRectangle($int_image,$this->sizex-7,0,$this->sizex,7,$small_box_color); } list($text_to_show, $infobox_text) = $Source->normal($this, $item); ImageStringCenter ($int_image, $text_color, 0, $text_to_show, $this->big_graph); ImagePng ($int_image,$images_real_path."/".$int_filename); ImageDestroy($int_image); if (array_key_exists('events',$urls)) $events_url = $urls['events'][1]; else $events_url = ''; if (array_key_exists('map',$urls)) $maps_url = $urls['map'][1]; else $maps_url = ''; $a_events = "href=\"javascript:ir_url('$events_url','$maps_url')\""; if ((strlen($infobox_text) > 1) && $this->popups) $this->image_events = "onMouseOver=\"javascript: infobox_show(this,event,'$infobox_text');\" onMouseOut=\"javascript: infobox_hide();\""; $interface_html = image($Config->get('images_rel_path')."/$int_filename?r=".$this->rnd,$this->sizex,$this->sizey,ucfirst($Source->source_type)." ".$item_id,"","","",""); } //id>1 host>1 if (($this->map_id > 1) && ($source=='interfaces')) //switch to dynmap if we are using a map (has x,y) and source is interfaces { $this->interface_process($item, $urls); } else if ($int_filename) { $interface_html = '>'.$interface_html.''; $interface_html = str_replace ('',$a_events,$interface_html); $interface_html = str_replace ('',$this->image_events,$interface_html); $interface_html .= view_toolbox($item['id'], $urls); echo tag("td", "","","bgcolor='".$this->map_color."'"). $interface_html. tag_close('td'); } return $interface_shown; }//interface_show() function finish() { //if (($map_id > 1) && ($source == 'interfaces')) //dynmap_init - but that function does not exist } // finish function interface_process(&$item, $urls) { $id = $item['id']; if (($this->active_only==0) || ($id > 1)) { $dynmap_objects[$map_int_id][int_id]=$id; $dynmap_objects[$map_int_id][x]=$map_x; $dynmap_objects[$map_int_id][y]=$map_y; $dynmap_objects[$map_int_id][a_events]=$a_events; $dynmap_objects[$map_int_id][html]=$interface_html; $dynmap_objects[$map_int_id][image_events]=$this->image_events; $dynmap_objects[$map_int_id]["toolbox"]=view_toolbox($id, $urls); } } // interface_process() } ?> jffnms-0.9.3/htdocs/views/view_text.class.php0000644000175000017500000000247611537372063020612 0ustar csmallcsmall JFFNMS Authors * This program is licensed under the GNU GPL, full terms in the LICENSE file */ require_once('toolbox.inc.php'); require_once('view_base.class.php'); class View_text extends View_base { function html_init() { adm_header('Alarms - Text View'); echo tag('pre'); } //html_init() function interface_show(&$item, $bgcolor, $fgcolor, $mark_interface, $urls) { global $Source; if ($item['id'] <= 1 || $item['host'] <= 1) return FALSE; // soruce->interfae list ($dummy, $item_text) = $Source->text($this, $item); $text = str_pad(strtoupper($item['alarm_name']), 12, ' ', STR_PAD_BOTH). "\t".$item_text; if (is_array($urls)) foreach ($urls as $frame=> $url) { if ($frame == 'map') $frame = '_parent'; $text .= "\t".str_replace(array("\t","\n"), '', linktext($url[0], $url[1], $frame)); } $text .= "\n"; echo $text; return TRUE; } //interface_show() function no_interfaces($source_type) { if ($this->active_only == 1) echo 'No Alarmed '.ucfirst($source_type)." Found\n"; else echo 'No '.ucfirst($source_type)." Found\n"; } // no_interfaces function finish() { echo tag_close('pre'); } //finish() } jffnms-0.9.3/htdocs/views/view_dhtml.class.php0000644000175000017500000002577311716447477020756 0ustar csmallcsmallsizey += 3; $this->cols_max-=1; $this->cols_count = $this->cols_max; $this->charsize = 10; if ($this->big_graph == 1) $this->charsize *= 1.5; } //View_dhtml() function break_by_card(&$item) { if ($item['db_break_by_card']) $this->break_text = array("Card",$item['card']); else $this->break_text = array($item['card']); $this->break_urls = array(); if ($item['have_graph'] == 1) $this->break_urls['map'] = array('Performance',"view_performance.php?type_id=$item[type_id]&host_id=$this->host_id",'graph.png'); } // break_by_card() function break_by_zone(&$item) { if ($item['zone_id'] > 1) { $this->break_text = array($item['zone'],'Zone',$this->add_image ($item['zone_image'],'br')); $this->break_urls = array('events'=>array('Events',"events.php?express_filter=zone,$item[zone_id],=",'text.png')); } } //break_by_zone() function break_finish_row() { if ($this->first_time) $this->first_time=FALSE; else $this->html_current_y += $this->sizey + $this->html_separation_y; $this->html_current_x = 0; } function break_next_line_span($break_by_host, $break_by_zone, $break_by_card) { if (($break_by_host==1) or ($break_by_zone==1) or ($break_by_card==1)) $this->html_current_x += $this->html_separation_x * 2 + $this->sizex; } // break_next_line_span() function break_show($urls) { if (is_array($this->break_text)) { $this->html_current_x += $this->html_separation_x; $bgcolor = 'rgb(150,150,150)'; $fgcolor = 'white'; $text_to_show = join(br(),$this->break_text); if (array_key_exists('events', $this->break_urls)) $event_url = $this->break_urls['events'][1]; else $event_url = $urls['events'][1]; if (array_key_exists('map', $this->break_urls)) $map_url = $this->break_urls['map'][1]; else $map_url = $urls['map'][1]; $events = " onClick=\"javascript:ir_url('$event_url','$map_url')\""; $this->show_div ("b".$this->break++, $fgcolor, $bgcolor, $text_to_show, $events); $this->html_current_x += $this->sizex + $this->html_separation_x; } } // break_show() function html_init() { adm_header('Alarm Map', $this->map_color); // Popup Delays $base_delay = 1000; $show_delay = $base_delay*1; $hide_delay = $show_delay*4; //take 4 times more time to hide than to show echo script(" var shown_objects = new Array(); var lastzIndex = 1; function show_info(o,text) { oid = o.id; //hide all other boxes. already shown or not for (var i in shown_objects) if ((shown_objects[i]!=null) && (i!=oid)) { if (shown_objects[i]['state']==0) //if it was not shown yet shown_objects[i] = null; //just delete it, to avoid it to be shown else window.setTimeout (\"real_hide_info('\"+i+\"');\",".$hide_delay."); //hide it normally } if (!shown_objects[oid]) { //if not's already created shown_objects[oid] = Array(); shown_objects[oid]['obj'] = o; shown_objects[oid]['state'] = 0; window.setTimeout (\"real_show_info('\"+text+\"','\"+oid+\"');\",".$show_delay."); //delay real show } } function real_show_info(text,oid) { a = shown_objects[oid]; if (!a) return 1; //if exists o = a['obj']; if (!o) return 2; //if its valid; if (shown_objects[oid]['state']!=0) return 3; //don't do it again shown_objects[oid]['state']=1; //save values for restore shown_objects[oid]['old_x'] = o.style.left; shown_objects[oid]['old_y'] = o.style.top; shown_objects[oid]['old_w'] = o.style.width; shown_objects[oid]['old_h'] = o.style.height; shown_objects[oid]['old_text'] = o.innerHTML; shown_objects[oid]['old_size'] = o.style.fontSize; shown_objects[oid]['old_border'] = o.style.borderStyle; //save current position values x = parseInt(o.style.left.replace('px','')); y = parseInt(o.style.top.replace('px','')); w = parseInt(o.style.width.replace('px','')); h = parseInt(o.style.height.replace('px','')); o.style.width = 'auto' ; o.style.height = 'auto' ; o.style.overflow = 'visible'; o.style.zIndex = lastzIndex++; o.innerHTML = text; o.style.fontSize = '".round($this->charsize*1.6)."px'; o.style.lineHeight = o.style.fontSize; o.style.borderStyle = 'solid'; //re-center the box o.style.left = 0; o.style.top = 0; new_w = o.offsetWidth; new_h = o.offsetHeight; new_x = x + (w/2) - (o.offsetWidth/2) new_y = y + (h/2) - (o.offsetHeight/2) o.style.left = new_x ; o.style.top = new_y; //Fix Position win_w = window.document.body.clientWidth; win_h = window.document.body.clientHeight; win_t = window.document.body.scrollTop; win_l = window.document.body.scrollLeft; dif = 2; //fix the scroll values new_y -= win_t; new_x -= win_l; if ((new_x + new_w) >= win_w) o.style.left = win_w - new_w - dif + win_l; if ((new_y + new_h) >= win_h) o.style.top = win_h - new_h - dif + win_t; if (new_x <= dif) o.style.left = win_l + dif; if (new_y <= dif) o.style.top = win_t + dif; x = parseInt(o.style.left.replace('px','')); y = parseInt(o.style.top.replace('px','')); toolbox_show(oid,x,new_w,y+new_h); return 0; } function hide_info(o) { window.setTimeout (\"real_hide_info('\"+o.id+\"');\",".$hide_delay."); //delay real hide } function real_hide_info(oid) { a = shown_objects[oid] if (!a) return 1; //if exists o = a['obj']; if (!o) return 2; //if its valid if (shown_objects[oid]['state']!=1) return 3; //if is shown o.innerHTML = shown_objects[oid]['old_text']; o.style.fontSize = shown_objects[oid]['old_size']; o.style.lineHeight = o.style.fontSize; o.style.borderStyle = shown_objects[oid]['old_border']; o.style.width = shown_objects[oid]['old_w']; o.style.height = shown_objects[oid]['old_h']; o.style.left = shown_objects[oid]['old_x'] o.style.top = shown_objects[oid]['old_y'] o.style.overflow = 'hidden'; o.style.zIndex = 0; shown_objects[oid] = null; toolbox_hide(oid); return 0; } function ir_url(url,url2){ if (url!='') { if (top.work && top.work.events) top.work.events.location.href = url; //if events frame exists use it else if (url2=='') url2=url; //if it doesnt and this is the only url take it to the main frame // else // window.open(url); //if the events frame doesn't exists, but we have to show 2 urls, show this one in a new window } if (url2!='') { if (top.work && top.work.map) top.work.map.location.href = url2; else if (top.work) top.work.location.href = url2; //y esto que si no esta map salga en work else window.open(url2); //esto hace que si no esta la frame salga una window } }"). html ("script", "", "", "", "src='views/toolbox.js'"). html ("style"," .interface { position:absolute; border-width: 1px; border-color: black; border-style: solid; font-size: ".$this->charsize."px; line-height: ".$this->charsize."px; font-family: sans-serif,monospace,arial; letter-spacing: 0px; white-space: nowrap; margin: 0px 0px 0px 0px; padding: 3px 0px 0px 0px; overflow: hidden; float: right; align: left; word-wrap: none; text-align: center; cursor: pointer; }","","","type='text/css'"). script(" //FIX IE Things if (document.all) { document.styleSheets[0].rules[0].style.paddingTop = '0px'; document.styleSheets[0].rules[0].style.cursor = 'hand'; }"); } // html_init() // returns boolean if we show it function interface_show(&$item, $bgcolor, $fgcolor, $mark_interface, $urls) { global $Source; if ( ($item['id'] <= 1) || ($item['host'] <= 1)) return FALSE; $this->html_current_x += $this->html_separation_x; list($text_to_show, $infobox_text) = $Source->dhtml($this, $item); if (($item['show_rootmap'] == 2) || ($item['check_status'] == 0)) //if its "Mark Disabled" { $small_box = $this->sizex*0.13; if ($item['show_rootmap'] == 2) $small_box_color = $bgcolor; if ($item['check_status'] == 0) $small_box_color = "777777"; $text_to_show[] = html('div', '', '', '', "style='position:absolute; top:0; left:".($this->sizex-$small_box).'; '. "width: $small_box; height: $small_box; background-color: $small_box_color;'"); } $text_to_show = trim(str_replace("\n","",join(br(),$text_to_show))); if ($item['id'] == $mark_interface) $border = 'border-style: double;'; else $border = ''; if (array_key_exists('events',$urls)) $events_url = $urls['events'][1]; else $events_url = ''; if (array_key_exists('map',$urls)) $maps_url = $urls['map'][1]; else $maps_url = ''; $events = " onClick=\"javascript:ir_url('$events_url','$maps_url')\""; if ((strlen($infobox_text) > 1) && $this->popups) $events .= " onMouseOver=\"javascript: show_info(this,'$infobox_text');\" onMouseOut=\"javascript: hide_info(this);\""; $this->show_div ($item['id'], $fgcolor, $bgcolor, $text_to_show, $events, $border); echo view_toolbox($item['id'], $urls); $this->html_current_x += $this->sizex; return TRUE; } public function add_image ($image,$pos = "br") { global $Config; $jffnms_real_path = $Config->get('jffnms_real_path'); $jffnms_rel_path = $Config->get('jffnms_rel_path'); $zone_image_filename = $jffnms_real_path.'/htdocs/images/'.$image; if (!empty($image) && file_exists($zone_image_filename)!=FALSE) { list($aux_w,$aux_h) = @getimagesize($zone_image_filename); $zone_image_filename = $jffnms_rel_path.'/images/'.$image; if ($pos == 'br') // bottom right { $top = $this->sizey-$aux_h; $left = $this->sizex-$aux_w; } else { $top=$pos; $left = $this->sizex-$aux_w; } return html('div', '', '', '', "style='position:absolute; top: ". $top."px; left:".$left."px; width: ".$aux_w."px; height: ". $aux_h."px; ". "background-image: url(".$zone_image_filename."); z-index: -10;'"); } } //add_image() private function show_div ($id, $fgcolor, $bgcolor, $text_to_show, $events="", $more_styles="") { echo html('div',$text_to_show, $id, 'interface', "style='". "top: $this->html_current_y; left: $this->html_current_x; width: $this->sizex; height: $this->sizey; ". "background-color: $bgcolor; color: $fgcolor; $more_styles' ".$events); } // show_div() } ?> jffnms-0.9.3/htdocs/views/toolbox.inc.php0000644000175000017500000000115311454507720017713 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function view_toolbox($item_id, $urls) { $toolbox = tag('div', 't'.$item_id,'', "style='position: absolute; visibility: hidden; z-index: 10;'"). table().tr_open(); foreach ($urls as $frame=>$aux) { list ($text,$url,$graph) = $aux; $toolbox .= td(' '.linktext(image($graph,'','',$text),$url,$frame,'','',0,$text)); } $toolbox .= tag_close('tr').table_close().tag_close('div'); return $toolbox; } ?> jffnms-0.9.3/htdocs/views/view_graphviz.class.php0000644000175000017500000000574611455764574021476 0ustar csmallcsmall Javier Szyszlican * Copyright (C) 2010 Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ require_once('toolbox.inc.php'); require_once('view_base.class.php'); class View_graphviz extends View_base { private $graphviz_text = ''; private $graphviz_hosts = ''; private $graphviz_nodes = ''; private $graphviz_cnx = ''; function __construct() { parent::__construct(); $this->graphviz_text = "strict graph map { bgcolor=\"#$this->map_color\"; margin=-0.03; ratio=fill; size=\"10.2,5.3\"; overlap=false; node [fontsize=50]; edge [len=3]; "; } function break_by_host(&$item) { if ($item['host'] > 1) $this->graphviz_hosts .="\tH$item[host]\t[shape=egg,fillcolor=\"#000000\",fontcolor=\"#FFFFFF\",style=filled,label=\"$item[host_name] $item[zone_shortname]\"];\n"; } //break_by_host() function interface_show(&$item, $bgcolor, $fgcolor, $mark_interface, $urls) { global $Config, $Source; if ($item['id'] <= 1) return FALSE; $this->graphviz_nodes .="\tI$item[id]\t[shape=box,fillcolor=\"#$bgcolor\",fontcolor=\"#$fgcolor\",style=filled,label=\"$item[int_sname]\",URL=\"". str_replace(" ","+",$Config->get('jffnms_rel_path')."/". $urls['events'][1])."\"];\n"; if ($Source->source_type == 'interfaces') $this->graphviz_cnx .="\tH$item[host] -- I$item[id] \t;\n"; return TRUE; } // interface_show() function finish() { global $Config; if (empty($this->graphviz_hosts)) return; $neato_executable = $Config->get('neato_executable'); if (!is_executable($neato_executable)) { echo "
Unable to execute neato program \"$neato_executable\".
\n";
      return;
    }
    
    $this->graphviz_text .="\n $this->graphviz_hosts $this->graphviz_nodes \n $this->graphviz_cnx";
    $this->graphviz_text .="}\n"; 
  
    $graphviz_filename = uniqid('');
    $graphviz_name = $Config->get('images_real_path')."/$graphviz_filename";
    if ( ($graphviz_file = fopen($graphviz_name.'.dot','w+')) === FALSE)  
    {
      echo "
Unable to open .dot graphviz file \"$graphviz_name\".
\n"; return; } fwrite($graphviz_file,$this->graphviz_text ,strlen($this->graphviz_text)); fclose($graphviz_file); $graphviz_exec = "$neato_executable -Timap -o $graphviz_name.map $graphviz_name.dot"; $result_exec = exec($graphviz_exec); //echo "
".join(" ",file("$graphviz_name.dot"))."
"; $graphviz_exec = "$neato_executable -Tpng -o $graphviz_name.png $graphviz_name.dot"; //echo $graphviz_exec; $result_exec = exec($graphviz_exec); $images_rel_path = $Config->get('images_rel_path'); $map_html = "\n"; echo $map_html; } //finish() } jffnms-0.9.3/htdocs/views/source_hosts.class.php0000644000175000017500000001112111524621512021267 0ustar csmallcsmallsizex *= 1.3; $View->sizex += 5; $View->sizey *= 1.43; if ($View->sizex > 0) $View->cols_max = round($View->screen_size/$View->sizex); $View->cols_count = $View->cols_max; $this->Hosts = new JffnmsHosts(); $this->Interfaces = new JffnmsInterfaces(); } //__construct() function get(&$View, $client_id) { $items = array(); $host_count = $this->Hosts->get(); if ($host_count < 1) return; while ($host = $this->Hosts->fetch()) { if ($host['show_host'] < 1) continue; // Dont show this host if ($host['id'] < 2) continue; $alarms = $this->Hosts->status($this->Interfaces, $host['id'], $View->map_id, $this->only_rootmap, $client_id); if (($View->map_id != 1 || $client_id != 0) && $alarms['total']['qty'] == 0) continue; if ($View->active_only == 1 && count($alarms) <= 1) continue; list ($status, $bgcolor, $fgcolor, $status_long, $alarm_name) = alarms_get_status($alarms); $items[] = array( 'id' => $host['id'], 'host' => $host['id'], 'make_sound'=>1, 'show_rootmap'=>$host['show_host'], 'check_status'=>$host['poll'], 'db_break_by_card'=>0, 'type'=>'Hosts', 'interface'=>'Host'.$host['id'], //alarm info 'alarm'=>((array_key_exists($alarm_name, $alarms) && $alarms[$alarm_name]['alarm_id']!=ALARM_UP)?$alarms[$alarm_name]['alarm_id']:NULL), 'fgcolor_aux'=>(array_key_exists($alarm_name, $alarms)?$alarms[$alarm_name]['fgcolor']:''), 'bgcolor_aux'=>(array_key_exists($alarm_name, $alarms)?$alarms[$alarm_name]['bgcolor']:''), 'alarm_name'=>(($alarm_name!='total')?$alarm_name:NULL), 'alarm_type_id'=>0, //fixed, use only for administrative //internal info 'host_status'=>$status, 'host_status_long'=>$status_long, 'host_ip'=>$host['ip'], 'host_name'=>$host['name'], 'host_lat'=>$host['lat'], 'host_lon'=>$host['lon'], 'zone'=>$host['zone_description'], 'zone_image'=>$host['zone_image'] ); } //while return $items; } //get() function dhtml(&$View, &$item) { if ($View->big_graph == 0) $View->cols_max = round($View->screen_size/$View->sizex)-1; $text_to_show = array($item['host_name'],$item['zone'],$item['host_status'],$item['host_ip']); $infobox_text = join(br(),$text_to_show).br().br(); $text_to_show[] = $View->add_image($item['zone_image']); foreach ($item['host_status_long'] as $alarm_key=>$qty) $infobox_text .= html('b',ucwords($alarm_key),'', '', '', false, true).': '.$qty.br(); $infobox_text = str_replace("\n","",$infobox_text); return array($text_to_show, $infobox_text); } function normal(&$View, &$item) { $text_to_show = array($item['host_name'],$item['zone'],$item['host_status'],$item['host_ip']); $infobox_text = ''; foreach ($item['host_status_long'] as $alarm_key=>$qty) $infobox_text .= html('b',ucwords($alarm_key),'', '', '', false, true).': '.$qty.br(); $infobox_text = str_replace("\n","",$infobox_text); return array($text_to_show, $infobox_text); } function text(&$View, &$item) { $item_text = str_replace("\n", '', str_replace("\t",'', html('b',str_pad($item['host_name'].' '.$item['zone'],30), '', '', '', false, true).' '. str_pad(html('u',$item['host_status'], '', '', '', false, true),20).' '. str_pad($item['host_ip'],15))); return array('', $item_text); } // text() function performance(&$View, &$item) { return array('',''); } // performance() function urls(&$View, &$item) { $urls = array( 'events' => array('Events', "events.php?map_id=$View->map_id&express_filter=host,$item[id],=" , 'text.png'), 'map' => array('View Interfaces', "frame_interfaces.php?host_id=$item[id]&break_by_card=1&break_by_zone=0&active_only=$View->active_only&events_update=0&map_id=$View->map_id&only_rootmap=$this->only_rootmap",'int1.png'), 'tools' => array('Tools', "admin/tools.php?host_id=$item[id]", 'tool.png') ); if ($this->permit_host_modification == 1) $urls['modification'] = array('Edit', "admin/adm/adm_standard.php?admin_structure=hosts&filter=$item[id]&actionid=$item[id]&action=edit", 'edit.png'); return $urls; } // urls() } // class jffnms-0.9.3/htdocs/views/view_base.class.php0000644000175000017500000000573211533577041020535 0ustar csmallcsmall Javier Szyszlican * Copyright (C) 2010 Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ class View_base { public $cols_count; public $cols_max; public $screen_size; public $sizex = 60; public $sizey = 30; public $host_id; public $map_id; public $map_color; public $active_only; public $big_graph; public $table_width = '100%'; // Private but inheritable protected $popups; public function __construct() { global $Sanitizer; $this->map_id = $Sanitizer->get_int('map_id', 1); if ($map_profile = profile('MAP')) $this->map_id = $map_profile; //fixed map $this->map_color = $Sanitizer->get_string('map_color'); $this->host_id = $Sanitizer->get_int('host_id'); $this->active_only = $Sanitizer->get_int('active_only'); $this->big_graph = $Sanitizer->get_string('big_graph', 0); $this->screen_size = ($Sanitizer->get_int('screen_size', 1020)-39); $this->popups = (profile("POPUPS_DISABLED")==1?false:true); } function html_init() { adm_header('Alarm Map',$this->map_color); ?>

ERROR

map_color); }//html_init public function break_init() {} public function break_by_card(&$item) {} public function break_by_host(&$item) {} public function break_by_zone(&$item) {} public function break_next_line_span($break_by_host, $break_by_zone, $break_by_card) {} public function break_finish_row() { echo tag_close('tr'). tr_open('','',$this->map_color); } function break_show($urls) {} public function no_interfaces($source) { echo td ('No'.(($this->active_only==1)?' Alarmed':'').' '.ucfirst($source).' Found','','no_interfaces_found'); } // no_interfaces function finish() {} } jffnms-0.9.3/htdocs/views/source_interfaces.class.php0000644000175000017500000002046511462427151022271 0ustar csmallcsmallInterfaces = new JffnmsInterfaces(); $this->permit_modification = profile('ADMIN_HOSTS'); parent:: __construct($View); } function infobox(&$item) { $formatted_desc = ''; foreach($item['description'] as $desc => $value) $formatted_desc .= "
$desc: ".htmlentities($value); $description = join(' ',$item['description']); $alarm_text = ''; if ($item['alarm_name'] != 'OK') $alarm_text = " ($item[alarm_name])"; $infobox_text = "$item[host_name] $item[zone]
$item[interface] ". $alarm_text. "$formatted_desc
$item[client_name] ". (($this->permit_modification==1)?"($item[type] $item[index])":"($item[type] $item[index])"); ///FIXME this has to be more generic if (isset($item['bandwidthin'])) $infobox_text .= "
D".($item['bandwidthin']/1000)."k/U".($item['bandwidthout']/1000)."k"; if ($item['alarm_name']!==NULL) $infobox_text .= "
Alarm: ".$item['alarm_type_description']." ".ucwords($item['alarm_name']).' since '.$item['alarm_start'].''; return array($description, $infobox_text); } function dhtml(&$View, &$item) { list ($description, $infobox_text) = $this->infobox($item); $text_to_show = array($item['int_sname'], ucfirst($item['shortname']), $description); if (($View->active_only==1) && ($this->host_id < 1)) //if we're in the alarmed interfaces screen, and not filtering by host $text_to_show = array_merge(array($item['host_name']), $text_to_show); //add the host name as the first line of the graph return array($text_to_show, $infobox_text); } //dhtml function normal(&$View, &$item) { list ($description, $infobox_text) = $this->infobox($item); $text_to_show = array($item['int_sname'], ucfirst($item['shortname']), $description); if (($View->active_only==1) && ($View->host_id < 1)) //if we're in the alarmed interfaces screen, and not filtering by host $text_to_show = array_merge(array($item['host_name']), $text_to_show); //add the host name as the first line of the graph return array($text_to_show, $infobox_text); } // normal() function performance(&$View, &$item) { list ($description, $infobox_text) = $this->infobox($item); $text_to_show = array(substr($item['int_sname'].' - '.$item['shortname'],0,20)); return array($text_to_show, $infobox_text); } //performance() function text(&$View, &$item) { $infobox_text = str_pad("$item[host_name] $item[zone_shortname] $item[int_sname] ".ucfirst($item['shortname'])." ".join(' ',$item['description']),80); return array('',$infobox_text); } // text() function get(&$View, $client_id) { $items = array(); if ($View->map_id > 1) $this->only_rootmap = 0; $interfaces_filter = array( 'map'=>$View->map_id, 'host'=>$View->host_id, 'in_maps'=>$this->only_rootmap, 'map_order'=>1, 'only_active'=>$View->active_only, 'alarms_summary'=>0, 'with_field_type'=>1, 'client'=>$client_id); $alarms = $this->Interfaces->status(NULL,$interfaces_filter); //get alarm list $ids = array_keys($alarms); //get first list of ids if (count($ids)==0) $ids[]=1; //if no alarms found, forbid the interface list from returning all the interfaces $interfaces_filter['graph_fields']=1; //get graph data $interfaces_filter['map_cnx']=$View->map_id; //get map conexion information if ($View->map_id > 1) $ids[]=1; //allow id = 1 for maps cnx $ints = $this->Interfaces->get_all($ids,$interfaces_filter); //get interface data if (array_key_exists('field_types', $ints) && is_array($ints['field_types'])) { $all_types_fields = $ints['field_types']; unset ($ints['field_types']); } $ids = array(); foreach ($ints as $pos_id => $tmp_int) $ids[] = array('int_id'=>$tmp_int['id'],'pos_id'=>$pos_id); //make a interface id list foreach ($ids as $aux_id) { $alarm_data = $alarms[$aux_id['int_id']]; //get alarm data $item = $ints[$aux_id['pos_id']]; //get interface data list ($aux1, $bgcolor, $fgcolor, $aux1, $alarm_name) = alarms_get_status ($alarm_data); //process alarms $alarm_name = ($alarm_name=="total")?NULL:$alarm_name; $aux=array( //required "id"=>$item["id"], "interface"=>$item["interface"], "host"=>$item["host"], "make_sound"=>$item["make_sound"], "type"=>$item["type_description"], "type_id"=>$item["type"], //if the host is in show, use the interface show field, if its not, use the host field "show_rootmap"=>($item["zone_show"]==1?(($item["host_show"]==1)?$item["show_rootmap"]:$item["host_show"]):$item["zone_show"]), "check_status"=>$item["check_status"], //alarm "alarm_name"=>$alarm_name, "alarm_type_id"=>($alarm_name)?$alarm_data[$alarm_name]["type_id"]:NULL, "alarm_type_description"=>($alarm_name)?$alarm_data[$alarm_name]["type"]:NULL, "alarm_start"=>($alarm_name)?$alarm_data[$alarm_name]["start"]:NULL, "alarm_stop"=>($alarm_name)?$alarm_data[$alarm_name]["stop"]:NULL, "alarm"=>($alarm_name)?$alarm_data[$alarm_name]["alarm_id"]:NULL, "bgcolor_aux"=>($alarm_name)?$bgcolor:NULL, "fgcolor_aux"=>($alarm_name)?$fgcolor:NULL, //internal //host "host_name"=>$item["host_name"], "host_ip"=>$item["host_ip"], //client "client_id"=>$item["client"], "client_name"=>$item["client_name"], "shortname"=>($item["client_shortname"]?$item["client_shortname"]:$item["client_name"]), //zone "zone"=>$item["zone_name"], "zone_id"=>$item["zone"], "zone_shortname"=>$item["zone_shortname"], "zone_image"=>$item["zone_image"], //type "have_graph"=>$item["have_graph"], "have_tools"=>$item["have_tools"], "db_break_by_card"=>$item["db_break_by_card"], "default_graph"=>$item["default_graph"], //map "map_int_id"=>($View->map_id>1)?$item["map_int_id"]:NULL, "map_x"=>($View->map_id>1)?$item["map_x"]:NULL, "map_y"=>($View->map_id>1)?$item["map_y"]:NULL ); //Interface Type Specific Fields Management $fields = &$all_types_fields[$item["type"]]; $aux_description = array(); if (is_array($fields) && ($item['id'] > 1)) foreach ($fields as $fname=>$fdata) switch ($fdata['type']) { case 7: if (!empty($item[$fname])) $aux_description[$fdata['description']] = //Sanitize the Description str_replace("\r\n","",nl2br(htmlspecialchars($item[$fname]))); break; case 3: $aux['index'] = $item[$fname]; break; case 8: $aux[$fname] = $item[$fname]; break; } $aux['description'] = $aux_description; ksort($aux); $items[]=$aux; }//foreach ids return $items; } // get() function urls(&$View, &$item) { global $Config; $jffnms_administrative_type = $Config->get('jffnms_administrative_type'); $urls = array(); $id = $item['id']; $urls['events'] = array('Events', "events.php?map_id=$View->map_id&express_filter=interface,$item[interface],=^host,$item[host],=", 'text.png'); if ($item['have_graph']==1) $urls['map'] = array('Performance', "view_performance.php?interface_id=$item[id]", 'graph.png'); if ($item['have_tools']==1) $urls['tools'] = array('Tools', "admin/tools.php?interface_id=$item[id]", 'tool.png'); if ($this->permit_modification == 1) { $urls['modification'] = array('Edit', "admin/adm/adm_interfaces.php?interface_id=$item[id]&action=edit", 'edit.png'); if (($item['alarm_type_id'] == $jffnms_administrative_type) && ($item['client_id']==1)) //force interface configuration when is autodiscovered. $urls = array ('events'=>array('Edit', "admin/adm/adm_interfaces.php?interface_id=$item[id]&action=edit", 'edit.png')); } return $urls; } } // class jffnms-0.9.3/htdocs/views/view_dynmap_line.php0000644000175000017500000000156011716447477021025 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ /* This is a separate little function */ $totalx = filter_input(INPUT_POST, 'totalx', FILTER_SANITIZE_NUMBER_INT); $totaly = filter_input(INPUT_POST, 'totaly', FILTER_SANITIZE_NUMBER_INT); $con = filter_input(INPUT_POST, 'con', FILTER_SANITIZE_NUMBER_INT, FILTER_FORCE_ARRAY); if ($totalx < 1 || $totaly < 1) die("Unable to create image that is $totalx x $totaly"); $im =imagecreate($totalx,$totaly); $cRed=ImageColorAllocate($im,255,0,0); ImageColorTransparent($im,$cRed); $cBlack=ImageColorAllocate($im,0,0,0); foreach ($con as $aux) { list ($x1,$y1,$x2,$y2) = explode (",",$aux); ImageLine($im,$x1,$y1,$x2,$y2,$cBlack); } Header("Content-type: image/png"); ImagePNG($im); ?> jffnms-0.9.3/htdocs/views/view_dynmap.class.php0000644000175000017500000001475511716447477021134 0ustar csmallcsmall Javier Szyszlican * Copyright (C) 2010 Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ require_once('view_normal.class.php'); class View_dynmap extends View_normal { private $dynmap_objects = array(); function __construct() { parent::__construct(); } function html_init($action) { if ($action == 'edit' && !profile('ADMIN_HOSTS')) $action = 'view'; if ($action == 'edit') { adm_header("Dynmap", $this->map_color, "OnContextMenu='javascript: select_object_by_mouse(event); return false;'"); $url = $Sanitizer->get_url('', 'all', FALSE, array('alarms_last', 'alarms_time')); } else adm_header('Dynmap', $this->map_color, ''); echo script(" var sizex = $this->sizex; var sizey = $this->sizey; if (window.innerHeight) { //Mozilla totalx = window.innerWidth; totaly = window.innerHeight; } else { //IE totalx = document.documentElement.offsetWidth; totaly = document.documentElement.offsetHeight; } totalx = totalx - 65; totaly = totaly - 20; var objects = new Array(); var already_lines = new Array(); var selected_name = null; var link_to_a = null; var was_moved = null; var gridx = 10; var gridy = 10; var objects_to_save = new Array(); var objects_to_save_id = 0; document.write( '\ ". ".mapbox { width:'+totalx+'; height: '+totaly+'; visibility:visible; position:absolute; left:0; top:0; } ". ".infobox { visibility: hidden; position: absolute; } ". "\'); function debug (data) { ".(($debug!=1)?"if (1==2)":"")." real_debug(data); }"); ?>
 
active_only == 0 || $item['id'] > 1) { $map_int_id = $item['map_int_id']; $this->dynmap_objects[$map_int_id]['int_id'] = $item['id']; $this->dynmap_objects[$map_int_id]['x'] = $item['map_x']; $this->dynmap_objects[$map_int_id]['y'] = $item['map_y']; $this->dynmap_objects[$map_int_id]['a_events'] = $item['a_events']; $this->dynmap_objects[$map_int_id]['html'] = $interface_html; $this->dynmap_objects[$map_int_id]['image_events'] = $image_events; $this->dynmap_objects[$map_int_id]['toolbox'] = $toolbox; } }// interface_process() function no_interfaces($source) { die('dynmap no interfaces'); } function finish($action) { if (count($this->dynamp_objects) <= 0 ) return; $js_objects = ''; foreach ($this->dynmap_objects as $object_id => $object) { $obj_int_id = $object['int_id']; if ($obj_int-id > 1) $js_objects .= " objects[$obj_int_id]=new Array(); objects[$obj_int_id][0]=$object_id; objects[$obj_int_id][1]=new Array(); objects[$obj_int_id][2]=$object[x]; objects[$obj_int_id][3]=$object[y]; "; } $connection_count=0; foreach ($this->dynmap_objects as $object_id => $object) { if ($object['int_id'] != 1) continue; $connection_count++; $obj_x = $object['x']; $obj_y = $object['y']; $js_object .= " objects[$obj_y][1][$object_id] = $obj_y; objects[$obj_x][1][$object_id] = $obj_x; "; } echo script($js_objects); if ($action == 'edit') { foreach ($this->dynmap_objects as $object_id => $object) if ($object['int_id'] == 1) echo "
\n"; } elseif ($connection_count > 0) echo "
\n"; echo "\n
 
\n"; foreach ($this->dynmap_objects as $object_id => $object) { if ($action == 'edit') { $object['image_events'] = " OnDblClick='javascript: link_to_object(\"$object[int_id]\");' OnMouseUp='javascript: select_object(\"$object[int_id]\");' OnMouseMove='javascript: follow_object(event);'"; $a_init = ''; unset($object['a_events']); } else { $a_init = '<'.$object['a_events'].'>'; } $object['html'] = str_replace('', $object['image_events'], $object['html']); if ($object['int_id'] > 1) { $top = $object['y'] - $this->sizey/2; $left = $object['x'] - $this->sizex/2; if ($top < 1) $top = 1; if ($left < 1) $left = 1; echo "\n\t
". "\n\t$a_init$object[html]
\n$object[toolbox]"; } } echo "\n
". "

ERROR

\n"; //Debug Box if ($debug == 1) { $visbility = ''; echo "

Debug Console

"; } else $visibility = "visibility: hidden;"; //savebox echo " "; //Edit/View Box //permission FIXME echo script("document.write (\"
\");"); if ($action== 'edit') { echo linktext(image("refresh2.png"),$REQUEST_URI). linktext(image("logoff.png"),$REQUEST_URI."&action=view"); } else if (profile('ADMIN_HOSTS')) echo linktext(image('edit.png'),$REQUEST_URI.'&action=edit'); echo tag_close('div'); echo script('position_new_objects();'); if ($action=='edit') { echo script('redraw_all_connections();'); $norefresh=1; } else echo script('draw_all_connections();'); } // finish() function save() { die('dynmap save'); } // save() } jffnms-0.9.3/htdocs/views/view_performance.class.php0000644000175000017500000000742611716447477022142 0ustar csmallcsmall Javier Szyszlican * Copyright (C) 2010 Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ require_once('toolbox.inc.php'); require_once('view_base.class.php'); class View_performance extends View_base { function __construct() { parent::__construct(); $this->sizex = 65; $this->sizey = 50; $this->new_sizex = 120; $this->new_sizey = 85; $this->map_refresh = 3 * 60; // 3 minutes $this->cols_max = round($this->screen_size / $this->new_sizex); $this->cols_count = $this->cols_max; $this->table_width = '100%'; } function interface_show(&$item, $bgcolor, $fgcolor, $mark_interface, $urls) { global $Config, $Source; $interface_shown = FALSE; if ($item['have_graph'] == 1 && $Source->source_type == 'interfaces') { $interface_shown = TRUE; $filename = substr($Source->source_type,0,1).$item['id'].'graph.png'; $real_filename = $Config->get('images_real_path').'/'.$filename; $result = performance_graph($item['id'],$real_filename, $item['default_graph'], $this->sizex, $this->sizey, '', (-60*60*2),0,'MINI'); if ($result !== FALSE) { $im_orig = imagecreatefrompng($real_filename); $im_new = imagecreate($this->new_sizex, $this->new_sizey); $back_color = ImageColorAllocate ($im_new, 245, 245, 245); $text_color = ImageColorAllocate ($im_new, 0,0,0); imagecopy ($im_new, $im_orig, 0, 10, 20 ,5,imagesx($im_orig)-29,300); imagedestroy ($im_orig); // calls source view type list ($text_to_show, $infobox_text) = $Source->performance($this, $item); $size_text = strlen ($text_to_show[0])*6; imagestring ($im_new, 2, ($this->new_sizex-$size_text)/2, 0, $text_to_show[0], $text_color); if ($item['alarm_name'] != 'OK') { $alarm_color = ImageColorAllocate ($im_new, hexdec(substr($bgcolor, 0, 2)), hexdec(substr($bgcolor, 2, 2)), hexdec(substr($bgcolor, 4, 2))); imagefilledrectangle ($im_new, $this->new_sizex-10, 0, $this->new_sizex, 10, $alarm_color); imagerectangle ($im_new, $this->new_sizex-10, 0, $this->new_sizex, 10, $text_color); } imagepng($im_new, $real_filename); imagedestroy ($im_new); $a_events = "href=\"javascript:ir_url('".$urls['events'][1]."','".$urls['map'][1]."')\""; $image_events = "onMouseOver=\"javascript: infobox_show(this,event,'$infobox_text');\" onMouseOut=\"javascript: infobox_hide();\""; $interface_html = image($Config->get('images_rel_path')."/".$filename,$this->new_sizex,$this->new_sizey,ucfirst($Source->source_type)." ".$item['id'], '', '', '', ''); if ($this->map_id <= 1) { $interface_html = html("a", $interface_html, "", "", $a_events); $interface_html = str_replace ("",$a_events,$interface_html); $interface_html = str_replace ("",$image_events,$interface_html); echo td($interface_html); } } } elseif ($this->map_id > 1) //get image from the normal interface show { //$old_view = $view_type; //$view_type = "normal"; //include(call_view("interface_show")); die('call viw interfasce show'); //$view_type = $old_view; } else $this->cols_count--; //only when not using map (dynmap) if (($Source->source_type == "interfaces") and (($this->map_id > 1) or ($item['id'] == 1))) { $view_type="dynmap"; //include (call_view("interface_process")); die ('call view interface process'); } return $interface_shown; } //interface_show() } jffnms-0.9.3/htdocs/views/source_maps.class.php0000644000175000017500000000674611716447477021133 0ustar csmallcsmallsizex *= 1.3; $View->sizey *= 1.3; $View->cols_max = round($View->screen_size/$View->sizex)-1; if ($View->cols_max < 1) $View->cols_max = 1; $View->cols_count = $View->cols_max; $this->Maps = new JffnmsMaps(); } //construct() function get(&$View, $client_id) { $Interfaces = new JffnmsInterfaces(); $map_count = $this->Maps->get(); if ($map_count < 1) return; $items = array(); while ($map = $this->Maps->fetch()) { if ($map['id'] <= 1 ) continue; if ($View->map_id != 1 && ($View->map_id != $map['id'])) continue; $alarms = $this->Maps->status($Interfaces, $map['id']); list ($status, $bgcolor, $fgcolor, $status_long, $alarm_name) = alarms_get_status ($alarms); if ($View->active_only == 1 && count($alarms) <= 1) continue; $item_alarm = NULL; $item_fgcolor = NULL; $item_bgcolor = NULL; if ($alarm_name && array_key_exists($alarm_name, $alarms)) { if ($alarms[$alarm_name]['alarm_id'] != ALARM_UP) $item_alarm = $alarms[$alarm_name]['alarm_id']; $item_fgcolor = $alarms[$alarm_name]['fgcolor']; $item_bgcolor = $alarms[$alarm_name]['bgcolor']; } $items[] = array( //required info 'id'=>$map['id'], 'host'=>$map['id'], 'make_sound'=>1, 'show_rootmap'=>1, 'check_status'=>1, 'db_break_by_card'=>0, 'type'=>'Maps', 'interface'=>'Map'.$map['id'], 'alarm'=> $item_alarm, 'fgcolor_aux'=> $item_fgcolor, 'bgcolor_aux'=> $item_bgcolor, 'alarm_name'=>(($alarm_name!='total')?$alarm_name:NULL), 'alarm_type_id'=>0, //fixed, use only for administrative //internal info 'map_status'=>$status, 'map_status_long'=>$status_long, 'map_name'=>$map['name'] ); }//while $map if (count($items) > 0) array_key_sort($items, array('map_name'=>SORT_ASC)); return $items; } //get() function dhtml(&$View, &$item) { $text_to_show = array($item['map_name'], $item['map_status']); $infobox_text = join('
', $text_to_show).'

'; foreach ($item['map_status_long'] as $alarm_key => $qty) $infobox_text = html('b',ucwords($alarm_key), '', '', '', FALSE, TRUE). ':'.$qty.br(); $infobox_text = str_replace("\n",'', $infobox_text); return array($text_to_show, $infobox_text); } //dhtml() function normal(&$View, &$item) { $text_to_show = array($item['map_name'], $item['map_status']); $infobox_text = ''; foreach ($item['map_status_long'] as $status_key => $qty) $infobox_text .= ''.ucwords($alarm_key).": $qty
"; $infobox_text = str_replace("\n","",$infobox_text); return array($text_to_show, $infobox_text); } //normal() function text(&$View, &$item) { $item_text ="".str_pad($item['map_name'],30)." ".str_pad("$item[map_status]",20); return array('', $item_text); } // text() function urls(&$View, &$item) { $id = $item['id']; $urls = array( 'events' => array('Events', "events.php?map_id=$id", 'text.png'), 'map' => array ('View Interfaces', "frame_interfaces.php?break_by_card=0&break_by_zone=0events_update=0&map_id=$id", 'int1.png') ); return $urls; } //urls() } jffnms-0.9.3/htdocs/views/source_base.class.php0000644000175000017500000000026611455731452021061 0ustar csmallcsmallonly_rootmap = $Sanitizer->get_int('only_rootmap', 1); } } jffnms-0.9.3/htdocs/views/infobox.js0000644000175000017500000000214311377440254016750 0ustar csmallcsmallvar oid = 0; function infobox_show(image,event,content) { if (document.all) { info=document.all.infobox; infostyle=document.all.infobox.style; w = document.body.scrollWidth; h = document.body.scrollHeight; x = event.clientX; y = event.clientY; } else { info = document.getElementById("infobox").style; infostyle = document.getElementById("infobox").style; text = document.getElementById("text"); w = document.width; h = document.height; x = image.x; y = image.y; } if (x>(w/2)) infostyle.left=x-150; else infostyle.left=x+50; if (y>(h/2)) infostyle.top=y-75; else infostyle.top=y+30; text.innerHTML=content; infostyle.visibility="visible"; if (oid!=0) toolbox_hide (oid); var a = new String(image.alt).split(' '); oid = a[1]; if (y > (h/2)) toolbox_show(oid,x,image.width,y+image.height); else toolbox_show(oid,x,image.width,y-16); return true; } function infobox_hide() { window.setTimeout ('infostyle.visibility="hidden"',15*1000); window.setTimeout ('toolbox_hide('+oid+');',15*1000); return true; } jffnms-0.9.3/htdocs/view_performance.php0000644000175000017500000005063711721261416017662 0ustar csmallcsmallget_int('graph_type', 1); $map_id = $Sanitizer->get_int('map_id', 1); $only_aggr = $Sanitizer->get_int('only_aggr',0); $refresh_time = $Sanitizer->get_int('refresh_time', 60*5); // 5 min default $view_all = $Sanitizer->get_int('view_all',0); $view_type = $Sanitizer->get_string('view_type', 'html'); $want_graph = $Sanitizer->get_int('want_graph', 0); $graph_times = performance_graph_times(); $use_interfaces = $Sanitizer->get_string('use_interfaces',NULL); if ($use_interfaces==NULL) $use_interfaces = $Sanitizer->get_int('interface_id',NULL,TRUE); if (!is_array($use_interfaces)) $use_interfaces = explode(',', $use_interfaces); if ($want_graph > 0) { $view_type = 'graph'; $graph_type = $want_graph; } if (!is_array($graph_type)) $graph_type = array($graph_type); //select default graph if ($map_profile = profile("MAP")) $map_id = $map_profile; //fixed map $Interfaces = new JffnmsInterfaces(); //get graphics array with all needed data list ($graphics, $graph_types_show, $graph_defaults, $number_of_interfaces) = performance_graphs_list ($Interfaces, $graph_type, reports_make_interface_filter($use_interfaces,$view_all), $use_interfaces, $graph_times['start_unix'], $graph_times['stop_unix']); performance_graphs_header($view_type, $graphics, $graph_times, $graph_types_show, $graph_defaults, $number_of_interfaces, $graph_type); if ($Sanitizer->get_int('only_top') != 1) $aggregation = performance_graphs_show($graphics, $Interfaces, $graph_times, $view_type, $only_aggr); //debug ($aggregation); performance_graphs_show_aggregation($aggregation, $Interfaces, $graph_times, $want_graph, $only_aggr); performance_graph_footer($view_type, $refresh_time); function performance_graphs_html_header (&$graph_times, $graph_type, $graph_types_show,$graph_defaults, $number_of_interfaces) { global $Config, $Sanitizer; $jffnms_rel_path = $Config->get('jffnms_rel_path'); $REQUEST_URI = $Sanitizer->get_url(''); $name = $Sanitizer->get_string('name'); $hour = (60*60); $day = $hour*24; // post/get values to copy for selecting interfaces $interfaces_selectors = array('use_interfaces'); $graph_time_presets = array( 0 => 'No Preset', -(60*10) => 'Last 10 Minutes', -($hour/2) => 'Last Half Hour', -$hour => 'Last Hour', -$hour*6 => 'Last 6 Hours', -$day => 'Last Day', -$day*2 => 'Last 2 Days', -$day*7 => 'Last Week', -$day*30 => 'Last Month', -$day*360 => 'Last Year', ); $client_id=0; if ($client_profile = profile("CUSTOMER")) $client_id = $client_profile; //fixed customer $colspan=3; $refresh_url = $Sanitizer->get_url('', 'all', FALSE, array('graph_time_start', 'graph_time_stop', 'graph_time_start_hour', 'graph_time_stop_hour')); $presets_url = $Sanitizer->get_url('', array('name','use_interfaces','graph_type','interface_id')); $shortcuts = array(); if ($client_id > 0) $shortcuts[] = linktext(image('logoff.png',0,0,'Logout'),$jffnms_rel_path.'/?logout=1&OldAuth='.$GLOBALS['PHP_AUTH_USER'],'_top'); $shortcuts[] = linktext(image('refresh.png',0,16,'Refresh Now'), $refresh_url); $shortcuts[] = tag("img", "", "", "src='images/refresh2.png' alt='' OnClick=\"javascript: if (self.no_refresh!=1) ". "{ self.no_refresh = 1; this.style.display='none'; } else document.location = '".htmlspecialchars($refresh_url)."';\"",false); if ($client_id == 0 && profile('ADMIN_HOSTS')) { $shortcuts[] = linktext(image('edit.png',0,0,'Edit'), $Sanitizer->get_url($jffnms_rel_path.'/admin/adm/adm_interfaces.php', $interfaces_selectors)); $shortcuts[] = linktext(image('tool.png',0,0,'Tools'), $Sanitizer->get_url($jffnms_rel_path.'/admin/tools.php', $interfaces_selectors)); } $shortcuts[] = linktext(image('text.png',0,0,'Report'), $Sanitizer->get_url($jffnms_rel_path.'/admin/reports/state_report.php', $interfaces_selectors)); $shortcuts[] = linktext(image('csv.png',0,0,'Export as CSV'), $Sanitizer->get_url('', 'all', array('view_type'=>'csv'))); $shortcuts[] = linktext(image('a-top.png',0,0,'Hide','','hide'), "javascript: hide_menu('options_header', 'options', 'hide','images/a-top.png', 'images/a1-down.png');"); arsort($graph_types_show); $graph_types_marked=array(); foreach ($graph_types_show as $graph_id=>$graph_description) if ( (in_array($graph_id,$graph_type)) || //graph we're looking for or ((in_array(1,$graph_type)) && (in_array($graph_id,$graph_defaults)))) //no graph selected and default graph $graph_types_marked[]=$graph_id; $output = script (" function go_preset(select) { var time = select.options[select.selectedIndex].value; location.href = '".$presets_url."'+'&graph_time=preset&graph_time_preset='+time; return true; } function select_all(field_aux) { field = document.getElementById(field_aux); if (field) for (i = 0; i < field.length; i++) field[i].selected = true; } function hide_menu(ele1_name, ele2_name, img_name, img_show, img_hide) { ele1 = document.getElementById(ele1_name); ele2 = document.getElementById(ele2_name); img = document.getElementById(img_name); img.src = (ele1.style.display=='none')?img_show:img_hide; ele1.style.display = (ele1.style.display=='none')?'':'none'; ele2.style.display = (ele2.style.display=='none')?'':'none'; } "). table("header"). tr_open("top"). td(linktext((!empty($name)?$name." ":"")."Performance",$REQUEST_URI),"title","",$colspan-1). td( html("div", html("div",join("",$shortcuts),"shortcuts"), "","","align='right'")). tag_close("tr"). tr_open("options_header"). td("Graph Types".linktext("[ all ]","javascript: select_all('graph_type[]');","","mark_all"),"graph_types"). td("Time Span","time_span"). td("Time Preset","time_preset"). tag_close("tr"). tr_open("options"). form("", $_SERVER["SCRIPT_NAME"], "GET"). reports_pass_options(). hidden("graph_time","nopreset",1). hidden("name", $name). td( select_custom("graph_type", $graph_types_show, $graph_types_marked, "", 3, false, "", "javascript: this.form.submit();"). (($number_of_interfaces > 1) ?html("div", checkbox_value("only_aggr",1,($GLOBALS["only_aggr"]==1)?1:0).br()."Show Only".br()."Aggregate","aggr_only") :""), "graph_types"). td( //TIME SPAN Table table("time_span"). tr_open(). td("From:" ,"labels"). td(select_date("graph_time_start",$graph_times['start'],7,true,$graph_times['start_hour'])). td(adm_form_submit("View"),"","",1,2). tag_close("tr"). tr_open(). td("To:","labels"). td(select_date("graph_time_stop",$graph_times['stop'],7,true,$graph_times['stop_hour'])). tag_close("tr"). table_close() //TIME SPAN Table end ). td( select_custom("graph_time_preset",$graph_time_presets,$graph_times['preset'],"javascript: go_preset(this)"). html("span",br()."Current Date".br().date("Y-m-d H:i:s"),"current_date"), "time_preset"). form_close(). tag_close("tr"). table_close(); return $output; } //function function performance_graphs_list (&$Interfaces, $graph_type, $filters, $use_interfaces = NULL, $start, $stop) { $graphics = array(); $graph_types_show = array(); $graph_defaults = array(); $interfaces_ids = array(); $filters["with_graph"] = 1; //force graph fields $interface_count = $Interfaces->get($use_interfaces,$filters); if ($interface_count > 0) { $gd_font_size = 5; while ($graph = $Interfaces->fetch()) { //debug ($graph); $graph_types_show[$graph['graph_type']]=$graph['graph_type_description']; $graph_defaults[$graph["graph_type_default"]]=1; $file = 'interface-'.$graph['id']; $interface_ids[$graph["id"]]=1; $graphic_aux2=array(); if (((in_array(1,$graph_type) and ($graph['graph_type']==$graph['graph_type_default']))) || //default graph or in_array($graph['graph_type'],$graph_type) || in_array($graph['graph_type_graph1'],$graph_type)) //match graph type { if ($graph['graph_type_graph1']) { $graphic_aux['image']='i'.$graph['id'].'-'.uniqid('').'.png'; $graphic_aux['type']=$graph['graph_type_graph1']; $graphic_aux['sx']=$graph['graph_type_graph1_sx']; $graphic_aux['sy']=$graph['graph_type_graph1_sy']; $graphic_aux2['graph1']=$graphic_aux; } if ($graph['graph_type_graph2']) { $graphic_aux['image']='i'.$graph['id'].'-'.uniqid('').'.png'; $graphic_aux['type']=$graph['graph_type_graph2']; $graphic_aux['sx']=$graph['graph_type_graph2_sx']; $graphic_aux['sy']=$graph['graph_type_graph2_sy']; $graphic_aux2['graph2']=$graphic_aux; } //FIXME Include all description fields in the title $last_date = ' '.date('Y-m-d H:i:s',$graph['last_poll_date']); $title = $graph['host_name'].' '.$graph['zone_shortname'].' '.$graph['interface'].' '.$graph['client_shortname'].' '.$graph['description']; $title = str_replace("\r","",$title); $title = str_replace("\n"," ",$title); $title = str_replace(" ","",$title); $len_aux1 = (($graph["graph_type_graph1_sx"])/$gd_font_size)-strlen($last_date)-6; //graph length/size of character - length of date - margin $title = substr($title,0,$len_aux1); $title = str_pad($title,$len_aux1," ").(($graph["last_poll_date"] > 1)?$last_date:""); $graphic_aux2["title"]=$title; $graphic_aux2["aggr"]=$graph["graph_type_agg"]; $graphic_aux2["id"]=$graph["id"]; $graphic_aux2["host"]=$graph["host"]; $graphic_aux2["graph_type"]=$graph["graph_type"]; $graphic_aux2["graph_description"]=$graph["graph_type_description"]; if (array_key_exists('percentile', $graph)) $graphic_aux2["percentile"] = $graph["percentile"]; // for Nth percentile // Calculate the Stop Time based on the poll interval and last_poll_date //$poll_interval = ($graph["poll_interval"]==0)?$graph["host_poll_interval"]:$graph["poll_interval"]; //$graphic_aux2["stop"] = ($stop==0) // ?(round($graph["last_poll_date"]/$poll_interval)*$poll_interval)-$poll_interval // :$stop; $graphic_aux2["stop"] = $stop; $graphic_aux2["type_id"] = $graph["type"]; $graphics[] = $graphic_aux2; } // if is used } //while $graph_defaults = array_keys($graph_defaults); } //debug ($graphics); //debug ($graph_types_show); //debug ($graph_defaults); return array($graphics,$graph_types_show,$graph_defaults, count($interface_ids)); } //performance_graphs_list function function performance_graphs_header($view_type, &$graphics, &$graph_times, $graph_types_show, $graph_defaults, $number_of_interfaces, $graph_type) { switch ($view_type) { case 'html': adm_header("Performance Trends"); if (count($graphics)==0) { echo html("span","Error: No Interface Graphs were returned.", "error"); die(); } //show header (selector) echo tag ("div", "performance"). performance_graphs_html_header ($graph_times, $graph_type, $graph_types_show,$graph_defaults, $number_of_interfaces); //debug ($graphics); if (($graph_times['stop_unix'] >0) && (($graph_times['start_unix'] > ($graph_times['stop_unix']-500)))) { echo html("span","Error: 'From' is more recent than 'To'","error"); die(); } echo table("graphs"); break; case 'graph': header ('Content-Type: image/png'); break; case 'csv': if ($graph_times['start_unix'] <= 0) $graph_times['start_unix'] += time(); if ($graph_times['stop_unix'] <= 0) $graph_times['stop_unix'] += time(); header('Pragma: public'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Content-Type: application/force-download'); header('Content-Type: application/octet-stream'); header('Content-Type: application/download'); header('Content-Disposition: attachment; filename='. "performance_data_".date("Ymd-His",$graph_times['start_unix'])."_to_".date("Ymd-His",$graph_times['stop_unix']).".csv;"); break; } // switch } function performance_graphs_show(&$graphics, &$Interfaces, &$graph_times, $view_type, $only_aggr) { global $Config, $Sanitizer; $images_real_path = $Config->get('images_real_path'); $images_rel_path = $Config->get('images_rel_path'); $aggregation = array(); foreach ($graphics as $graphic) { $ret1=TRUE; $ret2=TRUE; //debug($graphic); if ($only_aggr!=1 && $view_type=='html') echo tr_open(); if ($view_type=='csv') $graph_data = 'get_graph_data'; else $graph_data = ''; if ($graphic) { $graph_type_name = $graphic['graph1']['type']; // Generate the graphs if ($graphic['graph1']) $ret1 = performance_graph($graphic['id'], $images_real_path.'/'.$graphic['graph1']['image'], $graphic['graph1']['type'], $graphic['graph1']['sx'],$graphic['graph1']['sy'], $graphic['title'],$graph_times['start_unix'],$graphic['stop'], $graph_data); if (array_key_exists('graph2', $graphic)) $ret2 = performance_graph($graphic['id'], $images_real_path.'/'.$graphic['graph2']['image'], $graphic['graph2']['type'], $graphic['graph2']['sx'],$graphic['graph2']['sy'], $graphic['title'],$graph_times['start_unix'],$graphic['stop']); // show the graphs if ($only_aggr !=1 ) switch ($view_type) { case 'html': $link_url = $Sanitizer->get_url('', 'all', array('interface_id'=>$graphic['id'], 'graph_type'=>$graphic['graph_type'])); if (($graphic['graph1']) && ($ret1!==false)) { $image = image($images_rel_path.'/'.$graphic['graph1']['image'], 0, 0, current(explode(' ',$graphic['title'])).' / '.SCALE_LEGEND); echo td(linktext($image, $link_url), 'graph','',(!isset($graphic['graph2'])?'2':'1')); } if (array_key_exists('graph2', $graphic) && ($graphic['graph2']) && ($ret2!==false)) { $image = image($images_rel_path.'/'.$graphic['graph2']['image'], 0, 0,$graphic['title'].' / '.SCALE_LEGEND); echo td(linktext($image, $link_url),'graph'); } break; case 'graph': if (($graphic['graph1']) && ($ret1!==false) && ($want_graph==$graphic['graph1']['type'])) echo join ('',file($images_real_path.'/'.$graphic['graph1']['image'])); break; case 'csv': if (is_array($graph_data)) { list ($original_values, $selected_values, $skip) = $graph_data; $ids = array_keys(current($original_values)); if (is_numeric($graphic['percentile'])) { $ordered = $selected_values; rsort($ordered); $percentile = round((($ordered[$skip]*8)/1024/1024),2); } echo "\"Raw Data for the period starting ".date("Y-m-d H:i:s",$graph_times['start_unix']). " and ending ".date("Y-m-d H:i:s",$graph_times['stop_unix'])."\"\r\n". "\"For Interface: ".current(explode(" ",$graphic["title"]))."\"\r\n". (is_numeric($graphic['percentile']) ?"\"".$graphic["percentile"]." Percentile for this period is ".$percentile." Mbits/s.\"\r\n" :""). "Measure,\"Input Bytes\",\"Output Bytes\"". (is_numeric($graphic["percentile"]) ?",\"Highest Bytes\",\"Ordered Bytes\",\"Selected\",\"Bits/sec\",\"MBits/sec\"" :""). "\r\n"; foreach ($ids as $id) echo $id.','.$original_values['input'][$id].','. $original_values['output'][$id]. (is_numeric($graphic["percentile"]) //if we're asked to calculate percentile ?",".$selected_values[$id].",".$ordered[$id]. (($id==$skip) //if this is the percentile value ?",\"<-- Selected: ".(100-$graphic["percentile"])."% of ".count($ids)." = ".$id."\",".($ordered[$id]*8). ",".$percentile.",\"Mbits/sec is the ".$graphic["percentile"]."th Percentile.\"" :'') :''). "\r\n"; } break; }// switch view_type //aggregation if ($graphic['aggr']==1) //allow aggregation { $aggregation[$graph_type_name]['ids'][] = $graphic['id']; $aggregation[$graph_type_name]["description"] = $graphic["graph_description"]; $aggregation[$graph_type_name]["type_id"] = $graphic["type_id"]; } } if ($view_type=='html') { if ($only_aggr!=1) echo tag_close('tr'); if ((!$graphic) || ($ret1===false) || ($ret2===false)) performance_graph_error($graphic, $ret1, $ret2); } flush(); }//foreach return $aggregation; } //make_performance_graphs() function performance_graphs_show_aggregation($aggregation, &$Interfaces, &$graph_times, $want_graph, $only_aggr) { global $Config, $Sanitizer; $images_real_path = $Config->get('images_real_path'); $images_rel_path = $Config->get('images_rel_path'); foreach ($aggregation as $agg_type=>$agg_data) { if ( count($agg_data['ids'] <= 1)) continue; $image_title = $agg_data['description'].' Aggregation'; $filename = 'aggr-'.uniqid('').'.png'; $ret3 = performance_graph ($Interfaces,$agg_data['ids'], $images_real_path.'/'.$filename,$agg_type.'_aggregation', 500,175, $image_title, $graph_times['start_unix'],$graph_times['stop_unix']); //FIXME Fixed Size if ($ret3) switch ($view_type) { case 'html': $link_url = $Sanitizer->get_url('', array('only_aggr'=>1, 'type_id' => $agg_data['type_id'])); table_row(linktext(image($images_rel_path.'/'.$filename,0,0,SCALE_LEGEND), $link_url),'graph',2); break; case 'graph': if (($want_graph=='aggr') || ($only_aggr==1)) echo join ("",file($images_real_path."/$filename")); break; } flush(); }//foreach } // show_aggregation function performance_graph_footer($view_type, $refresh_time) { global $Sanitizer; if ($view_type != 'html') return; $url = $Sanitizer->get_url('','all'); echo table_close(). javascript_refresh("if (self.no_refresh!=1) location.href=\"$url\";",$refresh_time); adm_footer(); } //footer() function performance_graph_times() { global $Sanitizer; if ($Sanitizer->get_string('graph_time') == 'nopreset') { $graph_times = array( 'preset' => 0, 'start' => $Sanitizer->get_string('graph_time_start'), 'stop' => $Sanitizer->get_string('graph_time_stop'), 'start_hour' => $Sanitizer->get_int('graph_time_start_hour'), 'stop_hour' => $Sanitizer->get_int('graph_time_stop_hour')); $graph_times['start_unix'] = strtotime($graph_times['start'])+ $graph_times['start_hour']; $graph_times['stop_unix'] = strtotime($graph_times['stop']) + $graph_times['stop_hour']; } else { $graph_time_preset = $Sanitizer->get_int('graph_time_preset',-24*60*60); $graph_times = array( 'preset' => $graph_time_preset, 'start_unix' => $graph_time_preset, 'stop_unix' => 0, 'start' => date('Y-m-d', (time() + $graph_time_preset)), 'stop' => date('Y-m-d', time() )); $graph_times['start_hour'] = round ((time() + $graph_times['start_unix'] - strtotime($graph_times['start']))/60) * 60; //get 1 minutes round $graph_times['stop_hour'] = round ((time() - strtotime($graph_times['stop']))/60) * 60; } return $graph_times; } function performance_graph_error($graphic, $ret1, $ret2) { table_row("The RRDTool files for Interface ID ".$graphic["id"]." (from Host ID ".$graphic["host"]."), has not been created by the Poller Process yet","error",2); } ?> jffnms-0.9.3/htdocs/login.php0000644000175000017500000000460211400372721015422 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ adm_header($Config->get('jffnms_site').' - Login'); $jffnms_login_width = 400; $jffnms_login_height = 230; echo html ("style"," #login #box { width: ".$jffnms_login_width."px; height: ".$jffnms_login_height."px; margin-left: -".($jffnms_login_width/2)."px; margin-top: -".($jffnms_login_height/2)."px; }","","","type='text/css'"). script (" if (this.location!=top.location) //if we're in a frame top.location = '".$Config->get('jffnms_rel_path')."'; function fix_focus() { if (document.all) { username = document.all['user']; password = document.all['pass']; } else { username = document.getElementById ('user'); password = document.getElementById ('pass'); } if (username.value=='') username.focus(); else password.focus(); } window.onload = function() { if (document.layers) document.captureEvents(Event.KEYDOWN); document.onkeydown = function(e) { d = document.getElementById('jffnms_login'); if(e) kC = e.which; else kC = event.keyCode; switch(kC) { case 13 : d.submit(); return false; default : return true; } } }"). tag("div", "login"). tag("div", "box"). table("top"). tr_open(). td(image($Config->get('logo_image'), "","", "Logo","logo")). td(linktext($Config->get('jffnms_site'), $Config->get('logo_image_url')). br(). linktext("JFFNMS Login","http://www.jffnms.org"), "title"). tag_close("tr"). table_close(). tag("div", "", "","align='center'"), tag("div", "controls"). form("jffnms_login"). html("label", "Username"). textbox("user", $Sanitizer->get_string('user','')). br(). html("label", "Password"). tag("input", "pass", "", "type='password' name='pass'"). form_close(). tag_close("div"). tag_close("div"). html("span",$error,"error"). tag_close("div"). linktext("Developed by ".br()."Javier Szyszlican".br()."javier@jffnms.org", "http://www.szysz.com", "", "author"). tag_close("div"). script ("fix_focus();"); adm_footer(); ?> jffnms-0.9.3/htdocs/start.php0000644000175000017500000000724611524056306015463 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ define('NEWS_URL', 'http://www.jffnms.org/news.php'); //just return some HTML to be included in the start page (no body tags) $jffnms_init_classes=1; require_once('auth.php'); $view_stats = $Sanitizer->get_string('view_stats', profile('VIEW_STARTPAGE_STATS')); $map_id = 1; if ($map_profile = profile("MAP")) $map_id = $map_profile; if ($_SESSION['auth_type'] == AUTH_TYPE_USER) $client_id = 0; else { $client_id = profile('CUSTOMER'); } print_start_page ($view_stats, $client_id, $map_id); function print_start_page($view_stats, $client_id, $map_id) { global $Config; adm_header('Start Page'); echo table('startpage'). table_row('JFFNMS '. JFFNMS_VERSION.' Start Page','title',2,'',false). table_row($Config->get('jffnms_site').' Network Management System','subtitle',2,'',false); if ($view_stats==1) { $news = get_news_text(NEWS_URL); echo tr_open('data'). td (table('stats'). tr_open(). td(' ','spacer'). td('Statistics','sectitle','',2). td(' ','spacer'). tag_close('tr'). get_info_text($map_id, $client_id). table_close()); if (!empty($news)) echo td ( table('news'). table_row('News','sectitle',2,'',false). $news. table_close() ); echo tag_close('tr'); } else table_row(linktext('View Statistics','start.php?view_stats=1'),'view_stats',2); table_row('by Javier Szyszlican','author',2); echo table_close(); adm_footer(); } function get_info_text($map_id, $client_id) { global $jffnms; $Interfaces = new JffnmsInterfaces(); $Hosts = new JffnmsHosts(); $Maps = new JffnmsMaps(); $Users = new JffnmsUsers(); $Clients = new JffnmsClients(); $info_text = ''; $info[]=array('title'=>'Alarms', 'data'=> get_alarms_text($Interfaces, $map_id, $client_id)); if (($map_id==1) && ($client_id==0)) //only users with no filtered map { $info['hosts'] = array( 'title'=>'Hosts', 'data'=>$Hosts->count_all()); $info['interfaces'] = array( 'title'=>'Interfaces', 'data'=>$Interfaces->count_all()); $info['maps'] = array( 'title'=>'Maps', 'data'=>$Maps->count_all()-1); $info['customers'] = array( 'title'=>'Customers', 'data'=>$Clients->count_all()-1); $info['users'] = array( 'title'=>'Users', 'data'=>$Users->count_all()); //$info["journals"] = array( "title"=>"Journals", "data"=>$jffnms->journal->count_all()); } foreach ($info as $info_row) $info_text .= tr_open(). td(' ','spacer'). td($info_row['title'].': ','cat'). td($info_row['data'],'data'). td(' ','spacer'). tag_close('tr'); return $info_text; } function get_news_text($news_url) { $news_data = ''; $news = news_get($news_url); if (is_array($news)) foreach ($news as $item) $news_data .= table_row($item,'','','',false); return $news_data; } function get_alarms_text(&$Interfaces, $map_id, $client_id) { $alarms_text = ''; if ($map_id == 1) $alarms = $Interfaces->status(NULL,array('in_maps'=>1, 'client'=>$client_id, 'only_visible'=>true)); //all interfaces in rootmap else $alarms = $Interfaces->status(NULL,array('map'=>$map_id, 'client'=>$client_id, 'only_visible'=>true)); //all interfaces in map foreach ($alarms as $key=>$value) if ($key!='total') $alarms_text .= ''.$key.': '.$value['qty'].'
'; if ($alarms_text=='') $alarms_text = 'All OK'; return $alarms_text; } ?> jffnms-0.9.3/htdocs/blank.php0000644000175000017500000000041011716447477015417 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ include ("auth.php"); adm_header("Blank Page"); adm_footer(); ?> jffnms-0.9.3/htdocs/.htaccess0000644000175000017500000000002111377440254015400 0ustar csmallcsmallOptions -Indexes jffnms-0.9.3/htdocs/admin/0002755000175000017500000000000011725220213014667 5ustar csmallcsmalljffnms-0.9.3/htdocs/admin/calendar.php0000644000175000017500000000333511716447477017202 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ include ("../auth.php"); ?> Calendar
jffnms-0.9.3/htdocs/admin/tools.php0000644000175000017500000001763111721261565016561 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ require('../auth.php'); if (!profile('ADMIN_HOSTS')) die ('

You dont have Permission to access this page.

'); $Tools = new JffnmsTools(); $Interfaces = new JffnmsInterfaces(); $tool_get_data = $Sanitizer->get_string('tool_get_data', FALSE); $tool_set_data = $Sanitizer->get_string('tool_set_data', FALSE); $host_id = $Sanitizer->get_int('host_id'); $use_interfaces = $Sanitizer->get_string('use_interfaces', FALSE); $interface_id = $Sanitizer->get_string('interface_id', FALSE); if (!is_array($use_interfaces)) $use_interfaces = explode(',', $use_interfaces); if ($tool_get_data != FALSE) { tool_get($Tools, $Interfaces, $tool_get_data); die(); } if ($tool_set_data != FALSE) { tool_set($Tools, $Interfaces, $tool_set_data); die(); } $iframe = html('iframe','','NAME','', "name='NAME' OnLoad=\" if (src!='') { frame = (parent.map)?parent.map:((parent.work)?parent.work:((parent.frame2)?parent.frame2:parent)); frame.show(this); }\""); $refresh=0; tools_header(); if ($use_interfaces && !($interface_id)) $interface_id = $use_interfaces; if ($host_id == 0 && !($interface_id)) die ('Interface Not Selected'); $shown_interfaces = 0; $interface_filters = array('host_fields'=>1); if ($host_id >0) $interface_filters['host']=$host_id; $ints = $Interfaces->get_all($interface_id,$interface_filters); if (is_array($ints) && (count($ints)>0)) { head(); echo tr_open('','header'). td('Tool Description'). td('Value'). td("Action ".linktext("[all]","javascript: check();")). td('Result'). tag_close('tr'); $tools_list = array(); foreach ($ints as $int_id=>$int) { $tool_answer_ok = true; if (!array_key_exists($int['type'], $tools_list)) $tools_list[$int['type']] = $Tools->get_all(NULL,array('itype'=>$int['type'])); //get this interface type tools reset($tools_list[$int['type']]); if (count($tools_list[$int['type']]) > 0) //if this interface type has tools { table_row( $int['host_name'].' '.$int['zone_shortname'].' '.$int['interface'].' '.$int['description'], 'interface', 4); foreach($tools_list[$int['type']] as $tool) { $tool_info = $Tools->info($tool['name']); $name = "value-$int_id-".$tool["name"]; unset ($result); //$info_render = tool_info_render($name,$tool_info,$tool_values[$int_id][$tool['name']],$tool['allow_set']); $info_render = tool_info_render($name,$tool_info,NULL,$tool['allow_set']); if ($info_render!==false) { $div_name = 'tool_'.$int_id.'_'.$tool['name']; $result_name = 'result_'.$int_id.'_'.$tool['name']; $iframe_name = 'buffer_'.$int_id.'_'.$tool['name']; $iframe_aux = str_replace("NAME",$iframe_name,$iframe); echo tr_open(). td($tool['description']). td(html("div", $info_render, $div_name).$iframe_aux). td(checkbox_value("action",$int_id."-".$tool["name"]."-".$tool["allow_set"])). td(html('div',' ', $result_name)). //result tag_close("tr"); } else table_row ($tool['description'],'',4); flush(); } $shown_interfaces++; } else if (count($ints)==1) //only if we were requested one interface table_row ('There are no Tools defined for this Interface Type.','no_records_found',4); } } else table_row ('Bad Interface selection.','no_records_found',4); if ($shown_interfaces > 0) head(); echo form_close(). table_close(); adm_footer(); function tool_get(&$Tools, &$Interfaces, &$tool_get_data) { list ($int_id, $tool_name,$tool_allow_set) = explode(',',$tool_get_data); echo tool_info_render("value-$int_id-$tool_name", $tools->info($tool_name), $tools->get_value($tool_name, $Interfaces->get_all($int_id,array('host_fields'=>1))), $tool_allow_set); } function tool_set(&$Tools, &$Interfaces, &$tool_set_data) { list ($int_id, $tool_name, $value) = explode(",",$tool_set_data); list ($result, $value) = $Tools->set_value($tool_name, $Interfaces->get_all($int_id,array("host_fields"=>1)), $value, $auth_user_name, false); echo ($result==true)?"OK":"ERROR"; } function tool_info_render($name, $info, $value, $allow_set) { switch ($info["type"]) { case "text": $result = textbox($name,$value,$info['param']['size'],0,($allow_set==0)).' '.$info['param']['label']; break; case "select": if (!empty($value)) $result = select_custom($name,$info['param'],$value); else $result = select_custom($name,array(),$value); break; case 'table': if (is_array($value)) { $result = table(); if (count($value) > 0) { $result .= tr_open(); foreach ($info['param']['fields'] as $fn) $result .= td ($fn); $result .= td ($info["param"]["action_field"]); $result .= tag_close("tr"); } foreach ($value as $key=>$data) { $result .= tr_open(); foreach ($data as $fv) $result .= td($fv); $result .= td(checkbox_value ($name."[]",$key)); $result .= tag_close("tr"); } $result .= table_close(); } else $result = "No Information\n"; break; case "separator": $result = false; break; } return $result; } function head() { echo tr_open("","top"). td(" ","","",2). td( linktext("Refresh","javascript: tool_execute(true);")."  |  ". linktext("Set","javascript: tool_execute(false);")). td( linktext("Close","javascript: window.close();")). tag_close("tr"); } function tools_header() { adm_header('Tools'); echo script(" function tool_get (intid,tool,set) { iframe_name = 'buffer_'+intid+'_'+tool; ifr = document.getElementById(iframe_name); url = document.location+'&tool_get_data='+intid+','+tool+','+set; document.getElementById('result_'+intid+'_'+tool).innerHTML = 'Fetching'; ifr.set = false; ifr.src = url; } function tool_set (intid,tool,set) { if (set==1) { value = document.getElementById('value-'+intid+'-'+tool).value; ifr = document.getElementById('buffer_'+intid+'_'+tool); ifr.set = true; document.getElementById('result_'+intid+'_'+tool).innerHTML = 'Setting'; ifr.src = document.location+'&tool_set_data='+intid+','+tool+','+value; } } function show (iframe) { name = iframe.name; if (iframe.set == true) { result = 'result'+name.substr(6,name.length); document.getElementById(result).innerHTML = this.frames[name].document.body.innerHTML; } else { div = 'tool'+name.substr(6,name.length); document.getElementById(div).innerHTML = this.frames[name].document.body.innerHTML; result = 'result'+name.substr(6,name.length); document.getElementById(result).innerHTML = 'DONE' } } function check() { field=document.forms[0].elements['action']; for (i = 0; i < field.length; i++) { if (field[i].checked==true) field[i].checked = false; else field[i].checked = true; } } function tool_execute(get) { eles = document.forms[0].elements['action']; for (i=0; i < eles.length; i++) { ele = eles[i]; if (ele.checked) { vars = ele.value.split('-'); if (get) tool_get (vars[0],vars[1],vars[2]); else tool_set (vars[0],vars[1],vars[2]); } } }"). table('tools'). form('','','GET'); table_row('Tools', 'title', 4); } ?> jffnms-0.9.3/htdocs/admin/menu_interface_list.php0000644000175000017500000001523711716447477021454 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ { include ('../auth.php'); $frame = $Sanitizer->get_string('frame'); $field = $Sanitizer->get_string('field'); $field_name = $Sanitizer->get_string('field_name'); $field_id = $Sanitizer->get_string('field_id'); $map_id = $Sanitizer->get_int('map_id'); $client_id = $Sanitizer->get_int('client_id'); $type = $Sanitizer->get_string('type', 'performane'); if (empty($type)) $type = 'performance'; // for urls type= $request_uri = $Sanitizer->get_url(''); $action = interface_list_action($type); adm_header("Interface Selector".(!empty($field_name)?" - ".$field_name:"")); if ($map_profile = profile('MAP')) $map_id = $map_profile; if ($client_profile = profile('CUSTOMER')) $client_id = $client_profile; echo ''. script (" function select_all(field_aux) { field = document.getElementById(field_aux); for (i = 0; i < field.length; i++) field[i].selected = ! field[i].selected; }"); interface_list_popups($type, $action,$frame, $request_uri); echo table('interface_selector'). tr_open('header'). td(linktext(image('b-left.png','','','Back','','back'), "javascript: toggle_menu('back','../images/b-left.png','../images/b-right.png');"). ' '.' '.html('span','Interface Selector', '','title'),'','',2). td(linktext(image('refresh.png'),$request_uri),'action'). tag_close('tr'). tr_open(). td(''). td(''). td(''). tag_close('tr'); print_interface_groups($type, $action, $frame, $map_id, $client_id); adm_footer(); } function print_interface_groups($type, $action, $frame, $map_id, $client_id) { global $Sanitizer; $only_top = $Sanitizer->get_string('only_top'); if (empty($map_id) && empty($client_id)) $groups = array( 'host'=>array('select_hosts', 'Hosts',array()), 'client'=>array('select_clients', 'Customers',array()), 'map'=>array('select_maps', 'Maps',array()), 'type'=>array('select_interface_types', 'Types',array()) ); else $groups = array( 'host'=>array('select_hosts_filtered', 'Hosts', array('map'=>$map_id, 'client'=>$client_id)) ); foreach ($groups as $group=>$group_data) { list ($func, $name, $filters) = $group_data; $js = "javascript: go_select('".$group."');"; echo tr_open(). td( call_user_func_array($func, array($group, 0, 1, array(0=>$name), $js, $filters)), 'select', '', 2). td(linktext(image('bullet6.png'), '#', '_self', '', $js),'action'). tag_close('tr'); } echo form('selector_form',$action,'GET',$frame); table_row(" ","spacer",3); echo hidden("name", "Selected"). tr_open(). td('Selected'.br().'Interfaces', 'selected_header','',1). td( control_button('Mark All','_self', "javascript: select_all('use_interfaces'); ",'world.png'). control_button('Del','_self', 'javascript: del_selected(); ','delete.png'),'buttons','',2). tag_close('tr'); table_row(select_custom ('use_interfaces', array(), '', '', 10),'selector',3); table_row(adm_form_submit('View Selected Interfaces'),'view_selected',3); $show_only_top = FALSE; if (profile('REPORTS_VIEW_ALL_INTERFACES')) { table_row(linktext("View All Interfaces",$action."?&view_all=1",$frame),"view_all",3); $show_only_top = true; } if ($show_only_top && ($type=='performance')) table_row( checkbox_value("only_top",1,($only_top==1)?1:0,1, "javascript: addlink('view_all_group','&only_top=',this); addlink('view_all','&only_top=',this);"). "Show Only the Options ","show_only_top",3); echo form_close(). table_close(); } function interface_list_popups($type, $action, $frame, $request_uri) { global $Config, $Sanitizer; $popup_w = 550; $popup_h = 295; $popup_url = $Sanitizer->get_url( $Config->get('jffnms_rel_path').'/admin/interface_selector.php', array('map_id', 'client_id')); echo script (" popups = new Array(); function ClosePopups() { for (var name in popups) if (popups[name]) popups[name].close(); } window.onunload = ClosePopups; function go_select(field) { select = document.getElementById(field); if (select.selectedIndex == 0) return; id = select.options[select.selectedIndex].value; text = select.options[select.selectedIndex].text; name = field+'_'+id; if (!popups[name]) { rand = new Date().getTime(); url = '${popup_url}field='+field+'&field_id='+id+'&field_name='+text; popups[name] = window.open(url, name+'_'+rand, 'toolbar=no,scrollbars=no,location=no,status=no,menubar=no,screenX=250px,width=".$popup_w.",height=".$popup_h."'); if (!popups[name].opener) popups[name].opener = self; } else { popups[name].close(); popups[name]=null; url = '$action'+'?'+field+'_id='+id+'&name='+text; parent.frames['$frame'].location=url; } return false; } function del_selected() { select = document.getElementById('use_interfaces'); size = select.length; for (i=size; i > -1; i--) if (select.options[i] && (select.options[i].selected == true)) select.options[i]=null; } function addlink(link, part, source) { field = document.getElementById(link); if (field) { value = source.checked==true?1:0; field.href = field.href+part+value; } } // IE FIX if (document.all) parent.document.getElementById('interface_list').cols='275,*'; old_size = -1; function toggle_menu(image_name,img_hidden, img_show) { fs = parent.document.getElementById('interface_list'); img = document.getElementById(image_name); if (old_size==-1) old_size = fs.cols; showed = old_size; hidden = '12,*'; img.src = (fs.cols!=showed)?img_hidden:img_show; fs.cols = (fs.cols!=showed)?showed:hidden; }"); } function interface_list_action($type) { global $Config; switch ($type) { case 'alarms': $action = '/admin/adm/adm_alarms.php'; break; case 'performance': $action = 'view_performance.php'; break; case 'state_report': $action = '/admin/reports/state_report.php'; break; case 'interfaces': $action = '/admin/adm/adm_interfaces.php'; break; default: die ("interface_list_action(): No view_type for \"$type\"."); } $action = $Config->get('jffnms_rel_path').'/'.$action; $action = str_replace ('//','/',$action); return $action; } ?> jffnms-0.9.3/htdocs/admin/reports/0002755000175000017500000000000011721261724016375 5ustar csmallcsmalljffnms-0.9.3/htdocs/admin/reports/state_report.php0000644000175000017500000002012011721261723021611 0ustar csmallcsmall JFFNMS Authors * This program is licensed under the GNU GPL, full terms in the LICENSE file */ require_once('../../auth.php'); jffnms_load_api('rrdtool'); $view_mode = $Sanitizer->get_string('view_mode', 'html'); $client_id = $Sanitizer->get_int('client_id'); $interface_id = $Sanitizer->get_int('interface_id'); $use_interfaces = $Sanitizer->get_int('use_interfaces',FALSE, TRUE); $types = $Sanitizer->get_int('types',FALSE, TRUE); $date_from = $Sanitizer->get_string('date_from', date('Y-m-d', time()-(60*60*24))); $date_to = $Sanitizer->get_string('date_to', date('Y-m-d', time())); $detail = $Sanitizer->get_int('detail',0); $jffnms_rel_path = $Config->get('jffnms_rel_path'); if (!is_array($use_interfaces)) $use_interfaces = explode(',', $use_interfaces); #detail if (!profile('VIEW_REPORTS') && (!$client_id)) die ('

You dont have Permission to access this page.

'); switch ($view_mode) { case 'html': adm_header("State Report"); break; case 'csv': echo tag('pre'). "# Save this file as .txt and then open it on your Spreadsheet, import it as CSV (Comma Separated Values)\n". "Interface Description,RTT msec.,Packet Loss %,Unavailable Time,Availability %". (($detail)?",Start,Stop,Duration,Type,Counted":"")."\n"; break; } if ($interface_id) $use_interfaces=FALSE; //dont use use_interfaces if only one is asked for $Interfaces = new JffnmsInterfaces(); $types_url=''; if (is_array($types)) foreach ($types as $value) $types_url .= "&types[]=".$value; else $types = array(3,6,22,38); //by default select only this ids FIXME $seconds_today = time()-strtotime(date('Y-m-d', time())); $seconds_today = round(($seconds_today/1800))*1800; //take half hour $date_from_hour = $Sanitizer->get_int('date_from_hour'); if (!$date_from_hour) if ($seconds_today < (60*60*12)) { //12am pivot $date_from_hour=$seconds_today; $date_to_hour=$date_from_hour; } else $date_from_hour=0; $date_to_hour=$Sanitizer->get_int('date_to_hour', $seconds_today); $date_from_unix = strtotime($date_from) + $date_from_hour; $date_to_unix = strtotime($date_to) + $date_to_hour; $interfaces_url=''; if ( is_array($use_interfaces)) //handle use_interfaces URL { $use_interfaces = array_unique($use_interfaces); if (!$_SERVER["QUERY_STRING"]) $interfaces_url = "&use_interfaces[]=".join("&use_interfaces[]=",$use_interfaces); //to pass it along } //select interfaces id's based on the filter (from URL) $interfaces_data = $Interfaces->get_all($use_interfaces,reports_make_interface_filter($use_interfaces,0)); $interfaces_ids = array_keys ($interfaces_data); $interfaces_count = count($interfaces_ids); //get availability of each requested interface $avail = array(); if ($interfaces_count > 0) $avail = $Interfaces->get_availability($interfaces_ids, $date_from_unix, $date_to_unix, $types, $detail); if ($view_mode=='html') echo tag('div','state_report'). table('options'). form(). reports_pass_options(). table_row('State Report', 'title', 4, '', false). tr_open(). td ('From'). td(select_date('date_from',$date_from,7,true,$date_from_hour)). td(select_event_types_alarms('types',$types,3),'','',1,2). td('View Details '.checkbox('detail',$detail)). tag_close("tr"). tr_open(). td('To'). td(select_date('date_to',$date_to,7,true,$date_to_hour)). td( adm_form_submit('View'). linktext(image('csv.png','','','Export to CSV'), $REQUEST_URI.'&view_mode=csv','_new'). " | ".linktext(image("edit.png","","","Edit"), $jffnms_rel_path."/admin/adm/adm_interfaces.php?".$_SERVER["QUERY_STRING"].$interfaces_url). " | ".linktext(image("graph.png","","","Performance"), $jffnms_rel_path."/view_performance.php?".$_SERVER["QUERY_STRING"].$interfaces_url)). tag_close("tr"). form_close(). table_close(). table("report"). (($interfaces_count > 0)? tr_open("header"). td("Interface","","",2). td("Round Trip Time"). td("Packet Loss"). tag_close("tr") :""); if (is_array($interfaces_ids)) foreach ($interfaces_ids as $interface_id) { $interface_data = $interfaces_data[$interface_id]; if (!array_key_exists('description', $interface_data)) $interface_data['description'] = ''; $avail_data = $avail["interfaces"][$interface_id]; if (($interface_data["type"]==4) || ($interface_data["type"]==14)) //FIXME make this modular $perf_data = get_rrd_rtt_pl($interface_id,$date_from_unix,$date_to_unix,$interface_data["sla_threshold"],$interface_data["bandwidthin"],$interface_data["bandwidthout"],$interface_data["flipinout"]); else unset($perf_data); if ($view_mode=="html") echo tr_open("", "interface"). td(linktext(image("graph.png"), $jffnms_rel_path."/view_performance.php?interface_id=".$interface_id."&graph_time_start=".$date_from. "&graph_time_stop=".$date_to."&graph_time=nopreset&graph_time_start_hour=".$date_from_hour. "&graph_time_stop_hour=".$date_to_hour,"_new"),"","",1,2). td(linktext( substr($interface_data["client_name"],0,30).": ". substr($interface_data["host_name"],0,30)." ". substr($interface_data["interface"],0,30)." - ". substr($interface_data["description"],0,20), $Sanitizer->get_url('','all',array('view_all'=>0,'interface_id'=>$interface_id,'detail'=>1)).$types_url,"_new"),"","",1,2). ((isset($perf_data)) ?td($perf_data["rtt"]." msec.", "info"). td($perf_data["pl"]." %", "info") :"").//td(" ","","",2)). tag_close("tr"). tr_open(). tag("td", "", "", "colspan='2'"). table("details"); //FIXME add the degraded seconds information if ($view_mode=="csv") echo "\"".$interface_data["client_name"]." - ".$interface_data["description"]."\",". $perf_data["rtt"].",".round($perf_data["pl"],2)."%,". "\"".time_hms($avail_data["unavail_seconds"])."\",". round(100-$avail_data["unavail_percent"],2)."%\n"; if (array_key_exists('detail', $avail_data) and is_array($avail_data["detail"])) { // if we have alarm details if ($view_mode=="html") echo tr_open("header"). td("Start"). td("Stop"). td("Duration"). td("Type"). tag_close("tr"); foreach ($avail_data["detail"] as $detail_data) { if ($view_mode=="html") echo tr_open(). td($detail_data["date_start"]). td($detail_data["date_stop"]). td(time_hms($detail_data["duration"])." hs"). td($detail_data["type"]." ".($detail_data["counted"]=="1"?"X":"O")). tag_close("tr"); if ($view_mode=="csv") echo ",,,,,\"".$detail_data["date_start"]."\",\"".$detail_data["date_stop"]."\",\"". time_hms($detail_data["duration"])."\",\"". $detail_data["type"]."\",".($detail_data["counted"]=="1"?"X":"O")."\n"; } } if (($view_mode=="csv") && ($detail)) echo "\n"; if ($view_mode=="html") echo tr_open("totals"). td("Unavailable Time:"). td(time_hms($avail_data["unavail_seconds"])." hs"). td("Availability:"). td(100-$avail_data["unavail_percent"]." %"). tag_close("tr"). table_close(). //details tag_close("td"). tag_close("tr"); } //for each interface if (is_array($avail["summary"])) { if ($view_mode=="html") echo tr_open("summary"). td("Total Unavailable Time: ".time_hms($avail["summary"]["unavail_seconds"])." Hs","","",3). td("Total Availability: ".(100-$avail["summary"]["unavail_percent"])." %"). tag_close("tr"); if ($view_mode=="csv") echo "\n\n\"Summary\"\n\n". "\"Total Unavailable Time: ".time_hms($avail["summary"]["unavail_seconds"])." Hs\"\n". "\"Total Availability: ".(100-$avail["summary"]["unavail_percent"])." %\""; } if ($interfaces_count < 1) table_row("No Interfaces Found.","no_records_found",4); echo table_close(). //report tag_close("div"); //state report adm_footer(); ?> jffnms-0.9.3/htdocs/admin/interface_selector.php0000644000175000017500000000516411576362676021274 0ustar csmallcsmall Javier Szyszlican * Copyright (C) 2010 Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ { include ('../auth.php'); $field = $Sanitizer->get_string('field'); $field_id = $Sanitizer->get_string('field_id'); $field_name = $Sanitizer->get_string('field_name'); $map_id = $Sanitizer->get_int('map_id'); $client_id = $Sanitizer->get_int('client_id'); adm_header('Interface Selector'.(!empty($field_name)?' - '.$field_name:'')); $Int_obj = new JffnmsInterfaces(); if ($field_id != 'all') $filters = array($field=>$field_id); if (isset($map_id)) $filters['map']=$map_id; if (isset($client_id)) $filters['client']=$client_id; $cant = $Int_obj->get(NULL,$filters); $interfaces = array(); $max_options = 20; if ($cant > 0) while ($int = $Int_obj->fetch()) { $description = array(); switch ($field) { case 'host': $description = array($int['type_description'], $int['interface'], $int['client_shortname']); break; case "type": default: $description = array($int['host_name'], $int['zone_shortname'], $int['interface'], $int['client_shortname']); } if (array_key_exists('description', $int)) $description[] = $int['description']; $final_description = join(' ',$description); $final_description = str_replace(' ', ' ', $final_description); $interfaces[$int['id']] = $final_description; } asort ($interfaces); echo "". tag("div","popup_selector"). table("popup_selector"). tr_open(). td( $field_name, "title"). td( control_button("View Now","_self", "javascript: view_now('".$field."');","world.png")). td( control_button("Select All","_self", "javascript: select_all('selector[]');","world.png")). td( control_button("Add","_self", "javascript: operation('add'); ","new2.png")). td( control_button("Remove","_self", "javascript: operation('del'); ","delete.png")). td( control_button("","_self", "javascript: close_popup(); ","logoff.png")). tag_close("tr"). table_close(). (($cant>0) ?select_custom("selector", $interfaces, "", "", $max_options, false, "", "javascript: operation('add'); ") :br().html('span','No Interfaces Found','no_interfaces_found')). tag_close('div'). script("document.getElementById('selector[]').focus();"); adm_footer(); } jffnms-0.9.3/htdocs/admin/setup.php0000644000175000017500000002222211725220213016536 0ustar csmallcsmall Javier Szyszlican * Copyright (C) <2002> Robert Bogdon * This program is licensed under the GNU GPL, full terms in the LICENSE file */ define ('RESULT_OK', 1); define ('RESULT_ERROR', 2); define ('RESULT_YES', 3); define ('RESULT_NO', 4); function searchPath($cmd) { global $Config; $dirs = explode(":", $_SERVER["PATH"]); if ($Config->get('os_type') =='windows') { $cmd.='.exe'; $dirs[]='c:/php'; $dirs[]='c:/rrdtool'; $dirs[]=$Config->get('jffnms_real_path'); } foreach ($dirs as $thisdir) if (is_file($thisdir .'/'. $cmd)) return $thisdir .'/'. $cmd; return FALSE; } function autoConfig($option, $value) { global $Config; $real_path = '/opt/jffnms'; if (preg_match('/^(.*)\/admin\/setup.php/', $_SERVER['SCRIPT_FILENAME'], $regs)) $real_path = $regs[1]; $rel_path = '/jffnms'; if (preg_match('/^(.*)\/admin\/setup.php/', $_SERVER['REQUEST_URI'], $regs)) $rel_path = $regs[1]; switch($option) { case 'jffnms_real_path': $value = $real_path; break; case 'tftp_real_path': $value = $real_path . '/tftpd'; break; case 'rrd_real_path': $value = $real_path . '/rrd'; break; case 'engine_temp_path': $value = $real_path . '/engine/temp'; break; case 'images_real_path': $value = $real_path . '/htdocs/images/temp'; break; case 'images_rel_path': $value = $rel_path.'/images/temp'; break; case 'log_path': $value = $real_path . '/logs'; break; case 'jffnms_rel_path': $value = $rel_path; break; case 'jffnms_satellite_uri': $value = current_host().$_SERVER['REQUEST_URI']; $value = str_replace('?', '', $value); $value = str_replace('/admin/setup.php', '/admin/satellite.php', $value); break; case 'php_executable': $value = searchPath('php'); if($value == false) $value = searchPath('php4'); break; case 'neato_executable': case 'rrdtool_executable': case 'diff_executable': case 'nmap_executable': case 'fping_executable': case 'smsclient_executable': list ($file) = explode('_',$option); $value = searchPath($file); break; case 'os_type': $value = (strpos($_SERVER['SERVER_SOFTWARE'],'Win32') > 1)?'windows':'unix'; break; case 'logo_image': $value = $rel_path.'images/jffnms.png'; break; case 'rrdtool_version': $value = 'unknown'; $rrd_exec = $Config->get('rrdtool_executable'); if (is_executable($rrd_exec)) { exec($rrd_exec.' -v', $output); if (preg_match('/rrdtool (\d+\.\d+)/i', $output[0], $regs)) { $value = $regs[1]; } } break; case 'rrdtool_font': $value = $real_path . '/engine/fonts/'.basename($value); break; } //TEST Fix for Windows Path \\\\\ escaping problem if ($value) $value = str_replace('\\','/',$value); return $value; } function check_phpconf($value) { return (ini_get($value)==1)?RESULT_YES:RESULT_NO; } function check_enum($value) { return false; //force Auto Config } function check_phpmodule($value) { return (extension_loaded($value)?RESULT_YES:RESULT_NO); } function check_db($value) { global $Config; return ($Config->get('jffnms_access_method') == 'local') ?($conexion = @db_test())?true:false :true; } function check_disable($value) { return true; } function check_text($value) { return true; } function check_menu($value) { return true; } function check_bool($value) { return true; } function check_hidden($value) { return true; } function check_relative_directory($value) { return (@fopen(current_host() . $value . "/.check","r"))?true:false; } function check_uri($test_url) { $new_test_url = (strpos($test_url,"://")===false) ?current_host()."/".$test_url."?from=/admin/setup.php" :$test_url; return (($test_url=="none") || (@fopen($new_test_url,"r")))?true:false; } function check_file($value) { return (is_file($value)?true:false); } function check_directory($value) { return (($value!="../..") && is_dir($value))?true:false; } function check_satellite() { return FALSE; } function verifyConfig($type, $key, $value) { $old_value = $value; $state=0; if ($type == 'phpmodule' || $type == 'phpconf') return array($value, call_user_func('check_'.$type, $key)); if ($type != 'label') { $result = call_user_func("check_".$type, $value); if ($result) $state = 1; else { $auto_config_value = autoConfig($key, $value); $result = call_user_func("check_".$type, $auto_config_value); if ($result || ($key=='os_type') || ($key=='rrdtool_version')) { $value = $auto_config_value; $state = 1; } else $state = 2; } } return array($value, $state); } { $no_db=1; #require_once('../auth.php'); require_once('../../conf/config.php'); $Config = new JffnmsConfig(); config_load_libs('gui',0); if ($Config->get('jffnms_initial_config_finished') ==1) { require_once('../auth.php'); if (($Config->get('jffnms_access_method') == 'local') && (db_test())) $no_db = 0; if (!profile('ADMIN_SYSTEM')) die ('

You dont have Permission to access this page.

'); } $action = $Sanitizer->get_string('action'); $config_file = $Config->config_dir.'/jffnms.conf'; if (!empty($action)) { $new_config = array(); foreach ($Config->default_configs as $config_key=>$default_data) { if (array_key_exists('type', $default_data)) $default_data_type = $default_data['type']; else $default_data_type = 'plain'; $new = $Sanitizer->get_string('new_'.$config_key); if (($default_data_type=='bool') && $new===FALSE) $new = 0; if (($new==="") && ($default_data_type!="relative_directory")) //Only Relative directories can be empty $new = $default_data['default']; $Config->set($config_key,$new); } $Config->set('jffnms_configured',1); $Config->save (); unset ($new_config); unset ($key); unset ($new); unset ($data); //force configuration re-read #include('../../conf/config.php'); } $setup_options = ''; adm_header('Setup'); foreach ($Config->default_configs as $key=>$data) { if (!isset($data['type'])) $data['type'] = 'text'; $config_type = $data['type']; list($value, $state) = verifyConfig($data["type"], $key, $Config->get($key)); $input = ' '; $new_key = 'new_'.$key; switch ($config_type) { case 'bool': $input = checkbox($new_key,$value); $state = 0; break; case 'enum': $options = array (); $enum_values = explode(';', $data['values']); foreach ($enum_values as $evalue) { list ($option_name, $option_value) = explode (':', $evalue); $options[$option_value]=$option_name; } $input = select_custom($new_key,$options,$value); $state = 0; break; case 'file': $state = (is_file($value) && is_readable($value))?1:2; $input = textbox ($new_key, $value,40); break; case 'hidden': $input = hidden($new_key, $value); break; case 'label': $input = $value .hidden($new_key, $value); $state = 0; break; case 'menu': $state = 0; break; case 'db': $state += 2; break; case 'text': $state = 0; /* fall through */ case 'directory': case 'relative_directory': case 'uri': case 'satellite': $input = textbox ($new_key, $value,40); break; } switch ($state) { case RESULT_OK: $result[$key] = 'ok'; break; case RESULT_ERROR: $result[$key] = 'error'; break; case RESULT_YES: $result[$key] = 'yes'; break; case RESULT_NO: $result[$key] = 'no'; break; } if (empty($result[$key])) $output_result = ''; else $output_result = td($result[$key], "result_".$result[$key]); switch ($config_type) { case 'hidden': $setup_options .= $input; break; case 'menu': $setup_options .= tr_open(). td($data['description'], 'field_'.$config_type, 'field_'.$key, 3). $output_result. tag_close('tr'); break; default: $setup_options .= tr_open(). td($data['description'], 'field_'.$config_type, 'field_'.$key, 1). td($input, "value", "value_".$key, (empty($result[$key])?2:1)). $output_result. tag_close('tr'); break; } }//foreach default_configs echo form(). table('setup'); table_row('JFFNMS Setup','title'); table_row(linktext('Main',$Config->get('jffnms_rel_path').'/').' '.linktext('Help',$Config->get('jffnms_site_help')),'help'); table_row('Using '.(file_exists($Config->config_dir.'/jffnms.conf')?realpath($Config->config_dir.'/jffnms.conf'):'defaults'),'config_file'); echo tr_open(). td( table('options'). $setup_options. table_close() ,'setup_options'). tag_close("tr"); table_row(adm_form_submit('Save Changes','action')); echo table_close(). form_close(); adm_footer(); } ?> jffnms-0.9.3/htdocs/admin/menu_frame.php0000644000175000017500000000332211403162064017516 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ include ('../auth.php'); { global $Sanitizer, $Config; $menu = $Sanitizer->get_string('menu', 'frame1'); $menu_type = $Sanitizer->get_string('menu_type'); $type = $Sanitizer->get_string('type'); $frame = $Sanitizer->get_string('frame', 'frame2'); $scroll1 = $Sanitizer->get_string('scroll1', 'yes'); $scroll2 = $Sanitizer->get_string('scroll2', 'yes'); $size1 = $Sanitizer->get_string('size1', '100%'); $size2 = $Sanitizer->get_string('size2', '*'); $post_name1 = $Sanitizer->get_string('name1'); $post_name2 = $Sanitizer->get_string('name2'); $jffnms_rel_path = $Config->get('jffnms_rel_path'); if ($post_name1 === FALSE) $name1 = "menu_$menu.php?type=$menu_type&frame=$frame"; else $name1 = "$jffnms_rel_path/admin/$post_name1"; if ($post_name2 === FALSE) $name2 = "$jffnms_rel_path/blank.php"; else $name2 = "$jffnms_rel_path/admin/$post_name2"; $frame_def = ($type=="vertical")?"rows='*' cols='".$size1.",".$size2."'":"cols='*' rows='".$size1.",".$size2."'"; echo tag("!DOCTYPE", "", "","HTML PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\" \"http://www.w3.org/TR/html4/frameset.dtd\"", false); adm_header("Menu","","",true); echo tag("frameset", $menu, "", $frame_def." frameborder='no' framespacing='0'"). tag("frame", "", "", "name='".$menu ."' noresize scrolling='".$scroll1."' src='".$name1."'", false). tag("frame", "", "", "name='".$frame."' noresize scrolling='".$scroll2."' src='".$name2."'", false). tag_close("frameset"). tag_close("html"); } ?> jffnms-0.9.3/htdocs/admin/color_select.php0000644000175000017500000000232111460220342020050 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ include ("../auth.php"); $actual_color = $Sanitizer->get_string('actual_color'); adm_header('Color Select'); echo script(" function selectColor(color) { select = opener.document.getElementById(opener.select); select.value = color; select.style.backgroundColor = '#'+color; self.close(); } "). table('color_select'). list_color($actual_color). list_color('000000'). list_color('FFFFFF'). list_color('FF0000'). list_color('00FF00'). list_color('0000FF'); $color_array = array('0', '9', 'F'); $a = 0; $b = 0; $c=0; $d=0; $e=0; $f=0; foreach ($color_array as $a) //foreach ($color_array as $b) foreach ($color_array as $c) //foreach ($color_array as $d) foreach ($color_array as $e) //foreach ($color_array as $f) echo list_color($a.$b.$c.$d.$e.$f); echo table_close(); adm_footer(); function list_color($color) { return tr_open('', '', '#'.$color). td(linktext("Select", "javascript: selectColor('".$color."');")). tag_close('tr'); } ?> jffnms-0.9.3/htdocs/admin/satellite.php0000644000175000017500000001216611716447477017421 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ header("Content-Type: text/plain"); include_once ("../../conf/config.php"); include_once ("sat_session.inc.php"); //critical errors if ($jffnms_satellite_uri=="none") die("Satellite not configured.\n"); //we are not configured to be a satellite $headers = unsatellize_headers ($HTTP_RAW_POST_DATA, $capabilities); if (is_array($headers)) extract ($headers,EXTR_SKIP); //Extract Headers, but don't overwrite already-set headers if (!$method) die("Method not Specified.\n"); if (!$sat_id) die("Destination Satellite not Specified.\n"); $time_total = time_usec(); //session stuff if (isset($session)) { //session to be used $response = array(); if ($session=="get") { $session = uniqid(""); //start new session $response["session"]=$session; //only send session if it was the first request } $num_sess_vars = sat_session_start($session); //variables we want to save in the session if ($num_sess_varts == 0) sat_session_register ("my_sat_id","satellite","session_vars","satellite_destination","capabilities","jffnms","old_sat_id","old_from_sat_id","decide"); } if (!isset($satellite)) $satellite = $jffnms->get("satellites"); if (!isset($my_sat_id)) $my_sat_id = $satellite->get_id($jffnms_satellite_uri); if (!isset($session_vars)) $session_vars = array(); if (!isset($class)) $class = "satellite"; //default class if (!empty($params)) $params = unsatellize($params,$capabilities); // Everything is ready to go if ($sat_profiling) $time_mode = time_usec(); //profile execution time if (($old_sat_id != $sat_id) || ($old_from_sat_id!=$from_sat_id)) //if source or dest are not the same as earlier in this session $decide = $satellite->decide_mode ($my_sat_id,$sat_id,$from_sat_id); //decide execution mode (relay,direct,error) //if they are the same, just leave the session decide var //store this decide variables for the next call if (!isset($old_sat_id)) $old_sat_id = $sat_id; if (!isset($old_from_sat_id)) $old_from_sat_id = $from_sat_id; if ($decide["mode"]=="error") $response=$decide["error"]; if (($decide["mode"]=="direct") && ($method!="none")) //try to call the method $response = $satellite->callback($method,$params,$class,$response); if ($decide["mode"]=="relay") { //relay message if ($ttl=="") $ttl = 10; if ( $ttl > 0 ) { //if TimeToLive > 0 means we can relay $satellite_destinations = $decide[destinations]; if (!is_array($satellite_destination)) $satellite_destination = $satellite->elect_one($satellite_destinations,$my_sat_id,$sat_id); if (is_array($satellite_destination)) { foreach ($satellite_destination as $parent_sat_id=>$satellite_parent) { $comment = "$my_sat_id-relay"; $message=Array( sat_id=>$sat_id, session=>$satellite_parent[session], ttl=>--$ttl, //decrease TTL to send it "class"=>$class, method=>$method, params=>$params, ); if ($session_destroy) $message["session_destroy"]=$session_destroy; //relay the destroy message $result = $satellite->query($satellite_parent["url"],$message,$comment,0); //FIXME change to GUI or general } } else $response[error][$my_sat_id][]="Source IP ".$_SERVER["REMOTE_ADDR"]." Relay not allowed."; if (is_array($result)) { unset ($result["session"]); //dont mix session information $response = array_merge($result,$response); } else $response = $result; } else //TTL $response[error][$my_sat_id][]="TTL Excedded"; // $response[error]="TTL Excedded"; } //if relay if ($sat_profiling) $time_mode = time_usec_diff($time_mode); if ($sat_profiling) $time_sess = time_usec(); if (isset($session)) //session to be used list ($time_ser, $time_save) = sat_session_close(); if ($session_destroy==1) { //destroy session data (frees memory) $aux = $my_sat_id; //save my_sat_id $aux1 = $capabilities; //save capabilties $response["session_destroy"]=$result["session_destroy"]; //pass data $response["session_destroy"][$aux]=(bool)sat_session_destroy(); $capabilities = $aux1; } if ($sat_profiling) $time_sess = time_usec_diff ($time_sess); if (is_array($response)) { $response[traceroute][]=Array( my_sat_id=>$my_sat_id, mode=>$decide[mode], to_sat_id=>$sat_id, dest=>$satellite_destination ); $response[times][$decide[mode]][$my_sat_id]=$time_mode; $response[times][real_total][$my_sat_id]=time_usec_diff($time_total); $response[times][step_total][$my_sat_id]=$response[times][real_total][$my_sat_id]-$response[times][real_total][$parent_sat_id]; unset ($response[traceroute]); //dont send traceroute data unset ($response[times]); //dont send profiling data } if ($sat_profiling) $time_sat = time_usec(); $final_response = satellize($response,$capabilities); if ($sat_embedded!==true) echo $final_response; if ($sat_profiling) $time_sat = time_usec_diff($time_sat); ?> jffnms-0.9.3/htdocs/admin/event_filter.php0000644000175000017500000002324611533533031020075 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ { require('../auth.php'); // From this form $filter_date_start = $Sanitizer->get_string('filter_date_start'); $date_start = $Sanitizer->get_string('date_start'); $date_start_hour = $Sanitizer->get_string('date_start_hour'); $filter_date_stop = $Sanitizer->get_string('filter_date_stop'); $date_stop = $Sanitizer->get_string('date_stop'); $date_stop_hour = $Sanitizer->get_string('date_stop_hour'); $filter_zone = $Sanitizer->get_string('filter_zone'); $zone_id = $Sanitizer->get_string('zone_id'); $filter_host = $Sanitizer->get_string('filter_host'); $host_id = $Sanitizer->get_string('host_id'); $filter_type = $Sanitizer->get_string('filter_type'); $type_id = $Sanitizer->get_string('type_id'); $filter_severity = $Sanitizer->get_string('filter_severity'); $filter_interfacename = $Sanitizer->get_string('filter_interfacename'); $interfacename = $Sanitizer->get_string('interfacename'); $filter_username = $Sanitizer->get_string('filter_username'); $username= $Sanitizer->get_string('username'); $filter_info = $Sanitizer->get_string('filter_info'); $info = $Sanitizer->get_string('info'); $filter_ack = $Sanitizer->get_string('filter_ack'); $ack = $Sanitizer->get_string('ack'); $viewtype = $Sanitizer->get_string('viewtype'); $express_filter = $Sanitizer->get_string('express_filter'); $filter = $Sanitizer->get_int('filter'); $order_type = $Sanitizer->get_string('order_type'); $view_type = $Sanitizer->get_string('view_type','same'); $refresh=0; adm_header("Event Filter"); $filtered = (profile("MAP") || profile("CUSTOMER"))?true:false; if ($express_filter !== FALSE) { $filter_array = explode('^',$express_filter); for ( $i=0 ; $i < count($filter_array) ; $i++ ) { if ($filter_array[$i]) { $filter_array_items = explode (",",$filter_array[$i]); $filter_row = $filter_array_items[0]; $filter_value = $filter_array_items[1]; $filter_oper = parse_radio_id_inverse($filter_array_items[2]); //Express Filter Fields switch($filter_row) { case 'date': $filter_date_stop = $filter_oper; $date_stop = $filter_value; $date_stop_hour = (60*60*24); break; case 'date_start': $filter_date_start = $filter_oper; $date_start = substr($filter_value,0,10); $date_start_hour = substr($filter_value,11,19); break; case 'date_stop': $filter_date_stop = $filter_oper; $date_stop = substr($filter_value,0,10); $date_stop_hour = substr($filter_value,11,19); break; case 'host': $filter_host = $filter_oper; $host_id = $filter_value; break; case 'zone': $filter_zone = $filter_oper; $zone_id = $filter_value; break; case 'type': $filter_type = $filter_oper; $type_id = $filter_value; break; case 'username': $filter_username = $filter_oper; $username = $filter_value; break; case 'filter_severity': $filter_severity = $filter_oper; $severity_id = $filter_value; break; case 'interface': $filter_interfacename = $filter_oper; $interfacename = $filter_value; break; case 'info': $filter_info = $filter_oper; $info = $filter_value; break; case 'ack': $filter_ack = $filter_oper; $ack = $filter_value; break; case 'types': $filter_type = $filter_oper; $types_filter = explode("!",$filter_value); foreach ($types_filter as $type) if ($type) $type_id[] = $type; }// switch } } }//express filter!=false $filters = array( 'filter_date_start'=>array( 'name'=>'Date Start', 'values'=>select_date('date_start',$date_start,7,true,$date_start_hour,'')), 'filter_date_stop'=>array( 'name'=>'Date Stop', 'values'=>select_date('date_stop',$date_stop,7,true,$date_stop_hour,'')), 'filter_zone'=>array( 'name'=>'Zone', 'hide_on_filter'=>true, 'values'=>select_zones('zone_id',$zone_id)), 'filter_host'=>array( 'name'=>'Host', 'hide_on_filter'=>true, 'values'=>select_hosts('host_id',$host_id)), 'filter_type'=>array( 'name'=>'Event Types', 'values'=>select_event_types('type_id',$type_id,4,NULL,'',array(NULL,array('show_unknown'=>1)))), 'filter_severity'=>array( 'name'=>'Severity', 'values'=>select_severity('severity_id',$severity_id,1)), 'filter_interfacename'=>array( 'name'=>'Interface Name', 'values'=>textbox('interfacename',$interfacename,30)), 'filter_username'=>array( 'name'=>'Username', 'hide_on_filter'=>true, 'values'=>textbox('username',$username,30)), 'filter_info'=>array( 'name'=>'Extra Info '.br().'(also Tacacs+ Commands)', 'hide_on_filter'=>true, 'values'=>textbox('info',$info,30)), 'filter_ack'=>array( 'name'=>'Acknowledged Event', 'values'=>hidden('ack',1).' ') ); echo table("events_filter"). form(). table_row("Event Filter","title", 5, "", false). tr_open("headers"). td("Field"). td("Yes").td("Not").td("Don't"). td("Values"). tag_close("tr"). tag("tbody","filters"); foreach ($filters as $key=>$data) if (is_array($data) && (($filtered==false) || ($data["hide_on_filter"]!==true))) echo tr_open(). td($data["name"], "field"). filter_radio($key,$GLOBALS[$key]). td($data["values"], "value"). tag_close("tr"); echo tag_close("tbody"). table_row( radiobutton("viewtype",(($viewtype=="same")?1:0),"same")." Same Window ". radiobutton("viewtype",(($viewtype=="same")?0:1),"new")." New Window " ,"view_type",5,"",false). hidden("filter",1). hidden("order_type",$order_type). table_row( adm_form_submit("Filter Events"). "  ". control_button("Close","", "javascript: window.close();", "logoff.png") ,"submit",5,"",false). form_close(). table_close(); adm_footer(); if ($filter==1) { if ($filter_date_start>0) { $aux = date("Y-m-d H:i:s",strtotime($date_start)+$date_start_hour); $filter_url.="^date_start,$aux,".parse_radio_id($filter_date_start); } if ($filter_date_stop>0) { $aux = date("Y-m-d H:i:s",strtotime($date_stop)+$date_stop_hour); $filter_url.="^date_stop,$aux,".parse_radio_id($filter_date_stop); } if (($filter_severity>0) && ($severity_id)) $filter_url.="^severity,$severity_id,".parse_radio_id($filter_severity); if (($filter_zone>0) && ($zone_id)) $filter_url.="^zone,$zone_id,".parse_radio_id($filter_zone); if (($filter_host>0) && ($host_id)) $filter_url.="^host,$host_id,".parse_radio_id($filter_host); if (($filter_type>0) && (is_array($type_id))) { $filter_url.="^types,"; foreach ($type_id as $id) $filter_url.="$id!"; $filter_url.=",".parse_radio_id($filter_type); } if (($filter_interfacename>0) && ($interfacename)) $filter_url.="^interface,$interfacename,".parse_radio_id($filter_interfacename); if (($filter_username>0) && ($username)) $filter_url.="^username,$username,".parse_radio_id($filter_username); if (($filter_info>0) && ($info)) $filter_url.="^info,$info,".parse_radio_id($filter_info); if (($filter_ack>0) && ($ack)) $filter_url.="^ack,$ack,".parse_radio_id($filter_ack); $url = $Config->get('jffnms_rel_path')."/events.php?span=25&refresh=0&express_filter=".$filter_url."&order_type=".$order_type; echo script(" if (document.forms[0].viewtype[0].checked) opener.location.href='$url'; else window.open('$url'); "); } }//main function filter_radio ($field,$data) { if ($data==0) $data0=1; if ($data==1) $data1=1; if ($data==2) $data2=1; return td(radiobutton($field,$data1,1,0), "radio"). td(radiobutton($field,$data2,2,0), "radio"). td(radiobutton($field,$data0,0,0), "radio"); } function parse_radio_id($value) { if ($value==1) return "="; if ($value==2) return "!="; } function parse_radio_id_inverse($value) { if ($value=="") return 0; if ($value=="=") return 1; if ($value=="!=") return 2; } ?> jffnms-0.9.3/htdocs/admin/calendar/0002755000175000017500000000000011377440254016454 5ustar csmallcsmalljffnms-0.9.3/htdocs/admin/calendar/calendar-setup_stripped.js0000644000175000017500000001054211377440254023633 0ustar csmallcsmall/* Copyright Mihai Bazon, 2002, 2003 | http://dynarch.com/mishoo/ * --------------------------------------------------------------------------- * * The DHTML Calendar * * Details and latest version at: * http://dynarch.com/mishoo/calendar.epl * * This script is distributed under the GNU Lesser General Public License. * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html * * This file defines helper functions for setting up the calendar. They are * intended to help non-programmers get a working calendar on their site * quickly. This script should not be seen as part of the calendar. It just * shows you what one can do with the calendar, while in the same time * providing a quick and simple method for setting it up. If you need * exhaustive customization of the calendar creation process feel free to * modify this code to suit your needs (this is recommended and much better * than modifying calendar.js itself). */ Calendar.setup=function(params){function param_default(pname,def){if(typeof params[pname]=="undefined"){params[pname]=def;}};param_default("inputField",null);param_default("displayArea",null);param_default("button",null);param_default("eventName","click");param_default("ifFormat","%Y/%m/%d");param_default("daFormat","%Y/%m/%d");param_default("singleClick",true);param_default("disableFunc",null);param_default("dateStatusFunc",params["disableFunc"]);param_default("firstDay",0);param_default("align","Br");param_default("range",[1900,2999]);param_default("weekNumbers",true);param_default("flat",null);param_default("flatCallback",null);param_default("onSelect",null);param_default("onClose",null);param_default("onUpdate",null);param_default("date",null);param_default("showsTime",false);param_default("timeFormat","24");param_default("electric",true);param_default("step",2);param_default("position",null);param_default("cache",false);param_default("showOthers",false);var tmp=["inputField","displayArea","button"];for(var i in tmp){if(typeof params[tmp[i]]=="string"){params[tmp[i]]=document.getElementById(params[tmp[i]]);}}if(!(params.flat||params.inputField||params.displayArea||params.button)){alert("Calendar.setup:\n Nothing to setup (no fields found). Please check your code");return false;}function onSelect(cal){var p=cal.params;var update=(cal.dateClicked||p.electric);if(update&&p.flat){if(typeof p.flatCallback=="function")p.flatCallback(cal);else alert("No flatCallback given -- doing nothing.");return false;}if(update&&p.inputField){p.inputField.value=cal.date.print(p.ifFormat);if(typeof p.inputField.onchange=="function")p.inputField.onchange();}if(update&&p.displayArea)p.displayArea.innerHTML=cal.date.print(p.daFormat);if(update&&p.singleClick&&cal.dateClicked)cal.callCloseHandler();if(update&&typeof p.onUpdate=="function")p.onUpdate(cal);};if(params.flat!=null){if(typeof params.flat=="string")params.flat=document.getElementById(params.flat);if(!params.flat){alert("Calendar.setup:\n Flat specified but can't find parent.");return false;}var cal=new Calendar(params.firstDay,params.date,params.onSelect||onSelect);cal.showsTime=params.showsTime;cal.time24=(params.timeFormat=="24");cal.params=params;cal.weekNumbers=params.weekNumbers;cal.setRange(params.range[0],params.range[1]);cal.setDateStatusHandler(params.dateStatusFunc);cal.create(params.flat);cal.show();return false;}var triggerEl=params.button||params.displayArea||params.inputField;triggerEl["on"+params.eventName]=function(){var dateEl=params.inputField||params.displayArea;var dateFmt=params.inputField?params.ifFormat:params.daFormat;var mustCreate=false;var cal=window.calendar;if(!(cal&¶ms.cache)){window.calendar=cal=new Calendar(params.firstDay,params.date,params.onSelect||onSelect,params.onClose||function(cal){cal.hide();});cal.showsTime=params.showsTime;cal.time24=(params.timeFormat=="24");cal.weekNumbers=params.weekNumbers;mustCreate=true;}else{if(params.date)cal.setDate(params.date);cal.hide();}cal.showsOtherMonths=params.showOthers;cal.yearStep=params.step;cal.setRange(params.range[0],params.range[1]);cal.params=params;cal.setDateStatusHandler(params.dateStatusFunc);cal.setDateFormat(dateFmt);if(mustCreate)cal.create();cal.parseDate(dateEl.value||dateEl.innerHTML);cal.refresh();if(!params.position)cal.showAtElement(params.button||params.displayArea||params.inputField,params.align);else cal.showAt(params.position[0],params.position[1]);return false;};};jffnms-0.9.3/htdocs/admin/calendar/calendar_stripped.js0000644000175000017500000010014511377440254022474 0ustar csmallcsmall/* Copyright Mihai Bazon, 2002, 2003 | http://dynarch.com/mishoo/ * ------------------------------------------------------------------ * * The DHTML Calendar, version 0.9.6 "Keep cool but don't freeze" * * Details and latest version at: * http://dynarch.com/mishoo/calendar.epl * * This script is distributed under the GNU Lesser General Public License. * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html */ Calendar=function(firstDayOfWeek,dateStr,onSelected,onClose){this.activeDiv=null;this.currentDateEl=null;this.getDateStatus=null;this.timeout=null;this.onSelected=onSelected||null;this.onClose=onClose||null;this.dragging=false;this.hidden=false;this.minYear=1970;this.maxYear=2050;this.dateFormat=Calendar._TT["DEF_DATE_FORMAT"];this.ttDateFormat=Calendar._TT["TT_DATE_FORMAT"];this.isPopup=true;this.weekNumbers=true;this.firstDayOfWeek=firstDayOfWeek;this.showsOtherMonths=false;this.dateStr=dateStr;this.ar_days=null;this.showsTime=false;this.time24=true;this.yearStep=2;this.table=null;this.element=null;this.tbody=null;this.firstdayname=null;this.monthsCombo=null;this.yearsCombo=null;this.hilitedMonth=null;this.activeMonth=null;this.hilitedYear=null;this.activeYear=null;this.dateClicked=false;if(typeof Calendar._SDN=="undefined"){if(typeof Calendar._SDN_len=="undefined")Calendar._SDN_len=3;var ar=new Array();for(var i=8;i>0;){ar[--i]=Calendar._DN[i].substr(0,Calendar._SDN_len);}Calendar._SDN=ar;if(typeof Calendar._SMN_len=="undefined")Calendar._SMN_len=3;ar=new Array();for(var i=12;i>0;){ar[--i]=Calendar._MN[i].substr(0,Calendar._SMN_len);}Calendar._SMN=ar;}};Calendar._C=null;Calendar.is_ie=(/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent));Calendar.is_ie5=(Calendar.is_ie&&/msie 5\.0/i.test(navigator.userAgent));Calendar.is_opera=/opera/i.test(navigator.userAgent);Calendar.is_khtml=/Konqueror|Safari|KHTML/i.test(navigator.userAgent);Calendar.getAbsolutePos=function(el){var SL=0,ST=0;var is_div=/^div$/i.test(el.tagName);if(is_div&&el.scrollLeft)SL=el.scrollLeft;if(is_div&&el.scrollTop)ST=el.scrollTop;var r={x:el.offsetLeft-SL,y:el.offsetTop-ST};if(el.offsetParent){var tmp=this.getAbsolutePos(el.offsetParent);r.x+=tmp.x;r.y+=tmp.y;}return r;};Calendar.isRelated=function(el,evt){var related=evt.relatedTarget;if(!related){var type=evt.type;if(type=="mouseover"){related=evt.fromElement;}else if(type=="mouseout"){related=evt.toElement;}}while(related){if(related==el){return true;}related=related.parentNode;}return false;};Calendar.removeClass=function(el,className){if(!(el&&el.className)){return;}var cls=el.className.split(" ");var ar=new Array();for(var i=cls.length;i>0;){if(cls[--i]!=className){ar[ar.length]=cls[i];}}el.className=ar.join(" ");};Calendar.addClass=function(el,className){Calendar.removeClass(el,className);el.className+=" "+className;};Calendar.getElement=function(ev){if(Calendar.is_ie){return window.event.srcElement;}else{return ev.currentTarget;}};Calendar.getTargetElement=function(ev){if(Calendar.is_ie){return window.event.srcElement;}else{return ev.target;}};Calendar.stopEvent=function(ev){ev||(ev=window.event);if(Calendar.is_ie){ev.cancelBubble=true;ev.returnValue=false;}else{ev.preventDefault();ev.stopPropagation();}return false;};Calendar.addEvent=function(el,evname,func){if(el.attachEvent){el.attachEvent("on"+evname,func);}else if(el.addEventListener){el.addEventListener(evname,func,true);}else{el["on"+evname]=func;}};Calendar.removeEvent=function(el,evname,func){if(el.detachEvent){el.detachEvent("on"+evname,func);}else if(el.removeEventListener){el.removeEventListener(evname,func,true);}else{el["on"+evname]=null;}};Calendar.createElement=function(type,parent){var el=null;if(document.createElementNS){el=document.createElementNS("http://www.w3.org/1999/xhtml",type);}else{el=document.createElement(type);}if(typeof parent!="undefined"){parent.appendChild(el);}return el;};Calendar._add_evs=function(el){with(Calendar){addEvent(el,"mouseover",dayMouseOver);addEvent(el,"mousedown",dayMouseDown);addEvent(el,"mouseout",dayMouseOut);if(is_ie){addEvent(el,"dblclick",dayMouseDblClick);el.setAttribute("unselectable",true);}}};Calendar.findMonth=function(el){if(typeof el.month!="undefined"){return el;}else if(typeof el.parentNode.month!="undefined"){return el.parentNode;}return null;};Calendar.findYear=function(el){if(typeof el.year!="undefined"){return el;}else if(typeof el.parentNode.year!="undefined"){return el.parentNode;}return null;};Calendar.showMonthsCombo=function(){var cal=Calendar._C;if(!cal){return false;}var cal=cal;var cd=cal.activeDiv;var mc=cal.monthsCombo;if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}if(cal.activeMonth){Calendar.removeClass(cal.activeMonth,"active");}var mon=cal.monthsCombo.getElementsByTagName("div")[cal.date.getMonth()];Calendar.addClass(mon,"active");cal.activeMonth=mon;var s=mc.style;s.display="block";if(cd.navtype<0)s.left=cd.offsetLeft+"px";else{var mcw=mc.offsetWidth;if(typeof mcw=="undefined")mcw=50;s.left=(cd.offsetLeft+cd.offsetWidth-mcw)+"px";}s.top=(cd.offsetTop+cd.offsetHeight)+"px";};Calendar.showYearsCombo=function(fwd){var cal=Calendar._C;if(!cal){return false;}var cal=cal;var cd=cal.activeDiv;var yc=cal.yearsCombo;if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}if(cal.activeYear){Calendar.removeClass(cal.activeYear,"active");}cal.activeYear=null;var Y=cal.date.getFullYear()+(fwd?1:-1);var yr=yc.firstChild;var show=false;for(var i=12;i>0;--i){if(Y>=cal.minYear&&Y<=cal.maxYear){yr.firstChild.data=Y;yr.year=Y;yr.style.display="block";show=true;}else{yr.style.display="none";}yr=yr.nextSibling;Y+=fwd?cal.yearStep:-cal.yearStep;}if(show){var s=yc.style;s.display="block";if(cd.navtype<0)s.left=cd.offsetLeft+"px";else{var ycw=yc.offsetWidth;if(typeof ycw=="undefined")ycw=50;s.left=(cd.offsetLeft+cd.offsetWidth-ycw)+"px";}s.top=(cd.offsetTop+cd.offsetHeight)+"px";}};Calendar.tableMouseUp=function(ev){var cal=Calendar._C;if(!cal){return false;}if(cal.timeout){clearTimeout(cal.timeout);}var el=cal.activeDiv;if(!el){return false;}var target=Calendar.getTargetElement(ev);ev||(ev=window.event);Calendar.removeClass(el,"active");if(target==el||target.parentNode==el){Calendar.cellClick(el,ev);}var mon=Calendar.findMonth(target);var date=null;if(mon){date=new Date(cal.date);if(mon.month!=date.getMonth()){date.setMonth(mon.month);cal.setDate(date);cal.dateClicked=false;cal.callHandler();}}else{var year=Calendar.findYear(target);if(year){date=new Date(cal.date);if(year.year!=date.getFullYear()){date.setFullYear(year.year);cal.setDate(date);cal.dateClicked=false;cal.callHandler();}}}with(Calendar){removeEvent(document,"mouseup",tableMouseUp);removeEvent(document,"mouseover",tableMouseOver);removeEvent(document,"mousemove",tableMouseOver);cal._hideCombos();_C=null;return stopEvent(ev);}};Calendar.tableMouseOver=function(ev){var cal=Calendar._C;if(!cal){return;}var el=cal.activeDiv;var target=Calendar.getTargetElement(ev);if(target==el||target.parentNode==el){Calendar.addClass(el,"hilite active");Calendar.addClass(el.parentNode,"rowhilite");}else{if(typeof el.navtype=="undefined"||(el.navtype!=50&&(el.navtype==0||Math.abs(el.navtype)>2)))Calendar.removeClass(el,"active");Calendar.removeClass(el,"hilite");Calendar.removeClass(el.parentNode,"rowhilite");}ev||(ev=window.event);if(el.navtype==50&&target!=el){var pos=Calendar.getAbsolutePos(el);var w=el.offsetWidth;var x=ev.clientX;var dx;var decrease=true;if(x>pos.x+w){dx=x-pos.x-w;decrease=false;}else dx=pos.x-x;if(dx<0)dx=0;var range=el._range;var current=el._current;var count=Math.floor(dx/10)%range.length;for(var i=range.length;--i>=0;)if(range[i]==current)break;while(count-->0)if(decrease){if(--i<0)i=range.length-1;}else if(++i>=range.length)i=0;var newval=range[i];el.firstChild.data=newval;cal.onUpdateTime();}var mon=Calendar.findMonth(target);if(mon){if(mon.month!=cal.date.getMonth()){if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}Calendar.addClass(mon,"hilite");cal.hilitedMonth=mon;}else if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}}else{if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}var year=Calendar.findYear(target);if(year){if(year.year!=cal.date.getFullYear()){if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}Calendar.addClass(year,"hilite");cal.hilitedYear=year;}else if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}}else if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}}return Calendar.stopEvent(ev);};Calendar.tableMouseDown=function(ev){if(Calendar.getTargetElement(ev)==Calendar.getElement(ev)){return Calendar.stopEvent(ev);}};Calendar.calDragIt=function(ev){var cal=Calendar._C;if(!(cal&&cal.dragging)){return false;}var posX;var posY;if(Calendar.is_ie){posY=window.event.clientY+document.body.scrollTop;posX=window.event.clientX+document.body.scrollLeft;}else{posX=ev.pageX;posY=ev.pageY;}cal.hideShowCovered();var st=cal.element.style;st.left=(posX-cal.xOffs)+"px";st.top=(posY-cal.yOffs)+"px";return Calendar.stopEvent(ev);};Calendar.calDragEnd=function(ev){var cal=Calendar._C;if(!cal){return false;}cal.dragging=false;with(Calendar){removeEvent(document,"mousemove",calDragIt);removeEvent(document,"mouseup",calDragEnd);tableMouseUp(ev);}cal.hideShowCovered();};Calendar.dayMouseDown=function(ev){var el=Calendar.getElement(ev);if(el.disabled){return false;}var cal=el.calendar;cal.activeDiv=el;Calendar._C=cal;if(el.navtype!=300)with(Calendar){if(el.navtype==50){el._current=el.firstChild.data;addEvent(document,"mousemove",tableMouseOver);}else addEvent(document,Calendar.is_ie5?"mousemove":"mouseover",tableMouseOver);addClass(el,"hilite active");addEvent(document,"mouseup",tableMouseUp);}else if(cal.isPopup){cal._dragStart(ev);}if(el.navtype==-1||el.navtype==1){if(cal.timeout)clearTimeout(cal.timeout);cal.timeout=setTimeout("Calendar.showMonthsCombo()",250);}else if(el.navtype==-2||el.navtype==2){if(cal.timeout)clearTimeout(cal.timeout);cal.timeout=setTimeout((el.navtype>0)?"Calendar.showYearsCombo(true)":"Calendar.showYearsCombo(false)",250);}else{cal.timeout=null;}return Calendar.stopEvent(ev);};Calendar.dayMouseDblClick=function(ev){Calendar.cellClick(Calendar.getElement(ev),ev||window.event);if(Calendar.is_ie){document.selection.empty();}};Calendar.dayMouseOver=function(ev){var el=Calendar.getElement(ev);if(Calendar.isRelated(el,ev)||Calendar._C||el.disabled){return false;}if(el.ttip){if(el.ttip.substr(0,1)=="_"){el.ttip=el.caldate.print(el.calendar.ttDateFormat)+el.ttip.substr(1);}el.calendar.tooltips.firstChild.data=el.ttip;}if(el.navtype!=300){Calendar.addClass(el,"hilite");if(el.caldate){Calendar.addClass(el.parentNode,"rowhilite");}}return Calendar.stopEvent(ev);};Calendar.dayMouseOut=function(ev){with(Calendar){var el=getElement(ev);if(isRelated(el,ev)||_C||el.disabled){return false;}removeClass(el,"hilite");if(el.caldate){removeClass(el.parentNode,"rowhilite");}el.calendar.tooltips.firstChild.data=_TT["SEL_DATE"];return stopEvent(ev);}};Calendar.cellClick=function(el,ev){var cal=el.calendar;var closing=false;var newdate=false;var date=null;if(typeof el.navtype=="undefined"){Calendar.removeClass(cal.currentDateEl,"selected");Calendar.addClass(el,"selected");closing=(cal.currentDateEl==el);if(!closing){cal.currentDateEl=el;}cal.date=new Date(el.caldate);date=cal.date;newdate=true;if(!(cal.dateClicked=!el.otherMonth))cal._init(cal.firstDayOfWeek,date);}else{if(el.navtype==200){Calendar.removeClass(el,"hilite");cal.callCloseHandler();return;}date=(el.navtype==0)?new Date():new Date(cal.date);cal.dateClicked=false;var year=date.getFullYear();var mon=date.getMonth();function setMonth(m){var day=date.getDate();var max=date.getMonthDays(m);if(day>max){date.setDate(max);}date.setMonth(m);};switch(el.navtype){case 400:Calendar.removeClass(el,"hilite");var text=Calendar._TT["ABOUT"];if(typeof text!="undefined"){text+=cal.showsTime?Calendar._TT["ABOUT_TIME"]:"";}else{text="Help and about box text is not translated into this language.\n"+"If you know this language and you feel generous please update\n"+"the corresponding file in \"lang\" subdir to match calendar-en.js\n"+"and send it back to to get it into the distribution ;-)\n\n"+"Thank you!\n"+"http://dynarch.com/mishoo/calendar.epl\n";}alert(text);return;case-2:if(year>cal.minYear){date.setFullYear(year-1);}break;case-1:if(mon>0){setMonth(mon-1);}else if(year-->cal.minYear){date.setFullYear(year);setMonth(11);}break;case 1:if(mon<11){setMonth(mon+1);}else if(year=0;)if(range[i]==current)break;if(ev&&ev.shiftKey){if(--i<0)i=range.length-1;}else if(++i>=range.length)i=0;var newval=range[i];el.firstChild.data=newval;cal.onUpdateTime();return;case 0:if((typeof cal.getDateStatus=="function")&&cal.getDateStatus(date,date.getFullYear(),date.getMonth(),date.getDate())){return false;}break;}if(!date.equalsTo(cal.date)){cal.setDate(date);newdate=true;}}if(newdate){cal.callHandler();}if(closing){Calendar.removeClass(el,"hilite");cal.callCloseHandler();}};Calendar.prototype.create=function(_par){var parent=null;if(!_par){parent=document.getElementsByTagName("body")[0];this.isPopup=true;}else{parent=_par;this.isPopup=false;}this.date=this.dateStr?new Date(this.dateStr):new Date();var table=Calendar.createElement("table");this.table=table;table.cellSpacing=0;table.cellPadding=0;table.calendar=this;Calendar.addEvent(table,"mousedown",Calendar.tableMouseDown);var div=Calendar.createElement("div");this.element=div;div.className="calendar";if(this.isPopup){div.style.position="absolute";div.style.display="none";}div.appendChild(table);var thead=Calendar.createElement("thead",table);var cell=null;var row=null;var cal=this;var hh=function(text,cs,navtype){cell=Calendar.createElement("td",row);cell.colSpan=cs;cell.className="button";if(navtype!=0&&Math.abs(navtype)<=2)cell.className+=" nav";Calendar._add_evs(cell);cell.calendar=cal;cell.navtype=navtype;if(text.substr(0,1)!="&"){cell.appendChild(document.createTextNode(text));}else{cell.innerHTML=text;}return cell;};row=Calendar.createElement("tr",thead);var title_length=6;(this.isPopup)&&--title_length;(this.weekNumbers)&&++title_length;hh("?",1,400).ttip=Calendar._TT["INFO"];this.title=hh("",title_length,300);this.title.className="title";if(this.isPopup){this.title.ttip=Calendar._TT["DRAG_TO_MOVE"];this.title.style.cursor="move";hh("×",1,200).ttip=Calendar._TT["CLOSE"];}row=Calendar.createElement("tr",thead);row.className="headrow";this._nav_py=hh("«",1,-2);this._nav_py.ttip=Calendar._TT["PREV_YEAR"];this._nav_pm=hh("‹",1,-1);this._nav_pm.ttip=Calendar._TT["PREV_MONTH"];this._nav_now=hh(Calendar._TT["TODAY"],this.weekNumbers?4:3,0);this._nav_now.ttip=Calendar._TT["GO_TODAY"];this._nav_nm=hh("›",1,1);this._nav_nm.ttip=Calendar._TT["NEXT_MONTH"];this._nav_ny=hh("»",1,2);this._nav_ny.ttip=Calendar._TT["NEXT_YEAR"];row=Calendar.createElement("tr",thead);row.className="daynames";if(this.weekNumbers){cell=Calendar.createElement("td",row);cell.className="name wn";cell.appendChild(document.createTextNode(Calendar._TT["WK"]));}for(var i=7;i>0;--i){cell=Calendar.createElement("td",row);cell.appendChild(document.createTextNode(""));if(!i){cell.navtype=100;cell.calendar=this;Calendar._add_evs(cell);}}this.firstdayname=(this.weekNumbers)?row.firstChild.nextSibling:row.firstChild;this._displayWeekdays();var tbody=Calendar.createElement("tbody",table);this.tbody=tbody;for(i=6;i>0;--i){row=Calendar.createElement("tr",tbody);if(this.weekNumbers){cell=Calendar.createElement("td",row);cell.appendChild(document.createTextNode(""));}for(var j=7;j>0;--j){cell=Calendar.createElement("td",row);cell.appendChild(document.createTextNode(""));cell.calendar=this;Calendar._add_evs(cell);}}if(this.showsTime){row=Calendar.createElement("tr",tbody);row.className="time";cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=2;cell.innerHTML=Calendar._TT["TIME"]||" ";cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=this.weekNumbers?4:3;(function(){function makeTimePart(className,init,range_start,range_end){var part=Calendar.createElement("span",cell);part.className=className;part.appendChild(document.createTextNode(init));part.calendar=cal;part.ttip=Calendar._TT["TIME_PART"];part.navtype=50;part._range=[];if(typeof range_start!="number")part._range=range_start;else{for(var i=range_start;i<=range_end;++i){var txt;if(i<10&&range_end>=10)txt='0'+i;else txt=''+i;part._range[part._range.length]=txt;}}Calendar._add_evs(part);return part;};var hrs=cal.date.getHours();var mins=cal.date.getMinutes();var t12=!cal.time24;var pm=(hrs>12);if(t12&&pm)hrs-=12;var H=makeTimePart("hour",hrs,t12?1:0,t12?12:23);var span=Calendar.createElement("span",cell);span.appendChild(document.createTextNode(":"));span.className="colon";var M=makeTimePart("minute",mins,0,59);var AP=null;cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=2;if(t12)AP=makeTimePart("ampm",pm?"pm":"am",["am","pm"]);else cell.innerHTML=" ";cal.onSetTime=function(){var hrs=this.date.getHours();var mins=this.date.getMinutes();var pm=(hrs>12);if(pm&&t12)hrs-=12;H.firstChild.data=(hrs<10)?("0"+hrs):hrs;M.firstChild.data=(mins<10)?("0"+mins):mins;if(t12)AP.firstChild.data=pm?"pm":"am";};cal.onUpdateTime=function(){var date=this.date;var h=parseInt(H.firstChild.data,10);if(t12){if(/pm/i.test(AP.firstChild.data)&&h<12)h+=12;else if(/am/i.test(AP.firstChild.data)&&h==12)h=0;}var d=date.getDate();var m=date.getMonth();var y=date.getFullYear();date.setHours(h);date.setMinutes(parseInt(M.firstChild.data,10));date.setFullYear(y);date.setMonth(m);date.setDate(d);this.dateClicked=false;this.callHandler();};})();}else{this.onSetTime=this.onUpdateTime=function(){};}var tfoot=Calendar.createElement("tfoot",table);row=Calendar.createElement("tr",tfoot);row.className="footrow";cell=hh(Calendar._TT["SEL_DATE"],this.weekNumbers?8:7,300);cell.className="ttip";if(this.isPopup){cell.ttip=Calendar._TT["DRAG_TO_MOVE"];cell.style.cursor="move";}this.tooltips=cell;div=Calendar.createElement("div",this.element);this.monthsCombo=div;div.className="combo";for(i=0;i0;--i){var yr=Calendar.createElement("div");yr.className=Calendar.is_ie?"label-IEfix":"label";yr.appendChild(document.createTextNode(""));div.appendChild(yr);}this._init(this.firstDayOfWeek,this.date);parent.appendChild(this.element);};Calendar._keyEvent=function(ev){if(!window.calendar){return false;}(Calendar.is_ie)&&(ev=window.event);var cal=window.calendar;var act=(Calendar.is_ie||ev.type=="keypress");if(ev.ctrlKey){switch(ev.keyCode){case 37:act&&Calendar.cellClick(cal._nav_pm);break;case 38:act&&Calendar.cellClick(cal._nav_py);break;case 39:act&&Calendar.cellClick(cal._nav_nm);break;case 40:act&&Calendar.cellClick(cal._nav_ny);break;default:return false;}}else switch(ev.keyCode){case 32:Calendar.cellClick(cal._nav_now);break;case 27:act&&cal.callCloseHandler();break;case 37:case 38:case 39:case 40:if(act){var date=cal.date.getDate()-1;var el=cal.currentDateEl;var ne=null;var prev=(ev.keyCode==37)||(ev.keyCode==38);switch(ev.keyCode){case 37:(--date>=0)&&(ne=cal.ar_days[date]);break;case 38:date-=7;(date>=0)&&(ne=cal.ar_days[date]);break;case 39:(++datethis.maxYear){year=this.maxYear;date.setFullYear(year);}this.firstDayOfWeek=firstDayOfWeek;this.date=new Date(date);var month=date.getMonth();var mday=date.getDate();var no_days=date.getMonthDays();date.setDate(1);var day1=(date.getDay()-this.firstDayOfWeek)%7;if(day1<0)day1+=7;date.setDate(-day1);date.setDate(date.getDate()+1);var row=this.tbody.firstChild;var MN=Calendar._SMN[month];var ar_days=new Array();var weekend=Calendar._TT["WEEKEND"];for(var i=0;i<6;++i,row=row.nextSibling){var cell=row.firstChild;if(this.weekNumbers){cell.className="day wn";cell.firstChild.data=date.getWeekNumber();cell=cell.nextSibling;}row.className="daysrow";var hasdays=false;for(var j=0;j<7;++j,cell=cell.nextSibling,date.setDate(date.getDate()+1)){var iday=date.getDate();var wday=date.getDay();cell.className="day";var current_month=(date.getMonth()==month);if(!current_month){if(this.showsOtherMonths){cell.className+=" othermonth";cell.otherMonth=true;}else{cell.className="emptycell";cell.innerHTML=" ";cell.disabled=true;continue;}}else{cell.otherMonth=false;hasdays=true;}cell.disabled=false;cell.firstChild.data=iday;if(typeof this.getDateStatus=="function"){var status=this.getDateStatus(date,year,month,iday);if(status===true){cell.className+=" disabled";cell.disabled=true;}else{if(/disabled/i.test(status))cell.disabled=true;cell.className+=" "+status;}}if(!cell.disabled){ar_days[ar_days.length]=cell;cell.caldate=new Date(date);cell.ttip="_";if(current_month&&iday==mday){cell.className+=" selected";this.currentDateEl=cell;}if(date.getFullYear()==today.getFullYear()&&date.getMonth()==today.getMonth()&&iday==today.getDate()){cell.className+=" today";cell.ttip+=Calendar._TT["PART_TODAY"];}if(weekend.indexOf(wday.toString())!=-1){cell.className+=cell.otherMonth?" oweekend":" weekend";}}}if(!(hasdays||this.showsOtherMonths))row.className="emptyrow";}this.ar_days=ar_days;this.title.firstChild.data=Calendar._MN[month]+", "+year;this.onSetTime();this.table.style.visibility="visible";};Calendar.prototype.setDate=function(date){if(!date.equalsTo(this.date)){this._init(this.firstDayOfWeek,date);}};Calendar.prototype.refresh=function(){this._init(this.firstDayOfWeek,this.date);};Calendar.prototype.setFirstDayOfWeek=function(firstDayOfWeek){this._init(firstDayOfWeek,this.date);this._displayWeekdays();};Calendar.prototype.setDateStatusHandler=Calendar.prototype.setDisabledHandler=function(unaryFunction){this.getDateStatus=unaryFunction;};Calendar.prototype.setRange=function(a,z){this.minYear=a;this.maxYear=z;};Calendar.prototype.callHandler=function(){if(this.onSelected){this.onSelected(this,this.date.print(this.dateFormat));}};Calendar.prototype.callCloseHandler=function(){if(this.onClose){this.onClose(this);}this.hideShowCovered();};Calendar.prototype.destroy=function(){var el=this.element.parentNode;el.removeChild(this.element);Calendar._C=null;window.calendar=null;};Calendar.prototype.reparent=function(new_parent){var el=this.element;el.parentNode.removeChild(el);new_parent.appendChild(el);};Calendar._checkCalendar=function(ev){if(!window.calendar){return false;}var el=Calendar.is_ie?Calendar.getElement(ev):Calendar.getTargetElement(ev);for(;el!=null&&el!=calendar.element;el=el.parentNode);if(el==null){window.calendar.callCloseHandler();return Calendar.stopEvent(ev);}};Calendar.prototype.show=function(){var rows=this.table.getElementsByTagName("tr");for(var i=rows.length;i>0;){var row=rows[--i];Calendar.removeClass(row,"rowhilite");var cells=row.getElementsByTagName("td");for(var j=cells.length;j>0;){var cell=cells[--j];Calendar.removeClass(cell,"hilite");Calendar.removeClass(cell,"active");}}this.element.style.display="block";this.hidden=false;if(this.isPopup){window.calendar=this;Calendar.addEvent(document,"keydown",Calendar._keyEvent);Calendar.addEvent(document,"keypress",Calendar._keyEvent);Calendar.addEvent(document,"mousedown",Calendar._checkCalendar);}this.hideShowCovered();};Calendar.prototype.hide=function(){if(this.isPopup){Calendar.removeEvent(document,"keydown",Calendar._keyEvent);Calendar.removeEvent(document,"keypress",Calendar._keyEvent);Calendar.removeEvent(document,"mousedown",Calendar._checkCalendar);}this.element.style.display="none";this.hidden=true;this.hideShowCovered();};Calendar.prototype.showAt=function(x,y){var s=this.element.style;s.left=x+"px";s.top=y+"px";this.show();};Calendar.prototype.showAtElement=function(el,opts){var self=this;var p=Calendar.getAbsolutePos(el);if(!opts||typeof opts!="string"){this.showAt(p.x,p.y+el.offsetHeight);return true;}function fixPosition(box){if(box.x<0)box.x=0;if(box.y<0)box.y=0;var cp=document.createElement("div");var s=cp.style;s.position="absolute";s.right=s.bottom=s.width=s.height="0px";document.body.appendChild(cp);var br=Calendar.getAbsolutePos(cp);document.body.removeChild(cp);if(Calendar.is_ie){br.y+=document.body.scrollTop;br.x+=document.body.scrollLeft;}else{br.y+=window.scrollY;br.x+=window.scrollX;}var tmp=box.x+box.width-br.x;if(tmp>0)box.x-=tmp;tmp=box.y+box.height-br.y;if(tmp>0)box.y-=tmp;};this.element.style.display="block";Calendar.continuation_for_the_fucking_khtml_browser=function(){var w=self.element.offsetWidth;var h=self.element.offsetHeight;self.element.style.display="none";var valign=opts.substr(0,1);var halign="l";if(opts.length>1){halign=opts.substr(1,1);}switch(valign){case "T":p.y-=h;break;case "B":p.y+=el.offsetHeight;break;case "C":p.y+=(el.offsetHeight-h)/2;break;case "t":p.y+=el.offsetHeight-h;break;case "b":break;}switch(halign){case "L":p.x-=w;break;case "R":p.x+=el.offsetWidth;break;case "C":p.x+=(el.offsetWidth-w)/2;break;case "r":p.x+=el.offsetWidth-w;break;case "l":break;}p.width=w;p.height=h+40;self.monthsCombo.style.display="none";fixPosition(p);self.showAt(p.x,p.y);};if(Calendar.is_khtml)setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()",10);else Calendar.continuation_for_the_fucking_khtml_browser();};Calendar.prototype.setDateFormat=function(str){this.dateFormat=str;};Calendar.prototype.setTtDateFormat=function(str){this.ttDateFormat=str;};Calendar.prototype.parseDate=function(str,fmt){var y=0;var m=-1;var d=0;var a=str.split(/\W+/);if(!fmt){fmt=this.dateFormat;}var b=fmt.match(/%./g);var i=0,j=0;var hr=0;var min=0;for(i=0;i29)?1900:2000);break;case "%b":case "%B":for(j=0;j<12;++j){if(Calendar._MN[j].substr(0,a[i].length).toLowerCase()==a[i].toLowerCase()){m=j;break;}}break;case "%H":case "%I":case "%k":case "%l":hr=parseInt(a[i],10);break;case "%P":case "%p":if(/pm/i.test(a[i])&&hr<12)hr+=12;break;case "%M":min=parseInt(a[i],10);break;}}if(y!=0&&m!=-1&&d!=0){this.setDate(new Date(y,m,d,hr,min,0));return;}y=0;m=-1;d=0;for(i=0;i31&&y==0){y=parseInt(a[i],10);(y<100)&&(y+=(y>29)?1900:2000);}else if(d==0){d=a[i];}}if(y==0){var today=new Date();y=today.getFullYear();}if(m!=-1&&d!=0){this.setDate(new Date(y,m,d,hr,min,0));}};Calendar.prototype.hideShowCovered=function(){var self=this;Calendar.continuation_for_the_fucking_khtml_browser=function(){function getVisib(obj){var value=obj.style.visibility;if(!value){if(document.defaultView&&typeof(document.defaultView.getComputedStyle)=="function"){if(!Calendar.is_khtml)value=document.defaultView. getComputedStyle(obj,"").getPropertyValue("visibility");else value='';}else if(obj.currentStyle){value=obj.currentStyle.visibility;}else value='';}return value;};var tags=new Array("applet","iframe","select");var el=self.element;var p=Calendar.getAbsolutePos(el);var EX1=p.x;var EX2=el.offsetWidth+EX1;var EY1=p.y;var EY2=el.offsetHeight+EY1;for(var k=tags.length;k>0;){var ar=document.getElementsByTagName(tags[--k]);var cc=null;for(var i=ar.length;i>0;){cc=ar[--i];p=Calendar.getAbsolutePos(cc);var CX1=p.x;var CX2=cc.offsetWidth+CX1;var CY1=p.y;var CY2=cc.offsetHeight+CY1;if(self.hidden||(CX1>EX2)||(CX2EY2)||(CY2=12);var ir=(pm)?(hr-12):hr;var dy=this.getDayOfYear();if(ir==0)ir=12;var min=this.getMinutes();var sec=this.getSeconds();s["%a"]=Calendar._SDN[w];s["%A"]=Calendar._DN[w];s["%b"]=Calendar._SMN[m];s["%B"]=Calendar._MN[m];s["%C"]=1+Math.floor(y/100);s["%d"]=(d<10)?("0"+d):d;s["%e"]=d;s["%H"]=(hr<10)?("0"+hr):hr;s["%I"]=(ir<10)?("0"+ir):ir;s["%j"]=(dy<100)?((dy<10)?("00"+dy):("0"+dy)):dy;s["%k"]=hr;s["%l"]=ir;s["%m"]=(m<9)?("0"+(1+m)):(1+m);s["%M"]=(min<10)?("0"+min):min;s["%n"]="\n";s["%p"]=pm?"PM":"AM";s["%P"]=pm?"pm":"am";s["%s"]=Math.floor(this.getTime()/1000);s["%S"]=(sec<10)?("0"+sec):sec;s["%t"]="\t";s["%U"]=s["%W"]=s["%V"]=(wn<10)?("0"+wn):wn;s["%u"]=w+1;s["%w"]=w;s["%y"]=(''+y).substr(2,2);s["%Y"]=y;s["%%"]="%";var re=/%./g;if(!Calendar.is_ie5)return str.replace(re,function(par){return s[par]||par;});var a=str.match(re);for(var i=0;i // Encoding: any // Distributed under the same terms as the calendar itself. // For translators: please use UTF-8 if possible. We strongly believe that // Unicode is the answer to a real internationalized world. Also please // include your contact information in the header, as can be seen above. // full day names Calendar._DN = new Array ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"); // Please note that the following array of short day names (and the same goes // for short month names, _SMN) isn't absolutely necessary. We give it here // for exemplification on how one can customize the short day names, but if // they are simply the first N letters of the full name you can simply say: // // Calendar._SDN_len = N; // short day name length // Calendar._SMN_len = N; // short month name length // // If N = 3 then this is not needed either since we assume a value of 3 if not // present, to be compatible with translation files that were written before // this feature. // short day names Calendar._SDN = new Array ("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"); // full month names Calendar._MN = new Array ("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); // short month names Calendar._SMN = new Array ("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"); // tooltips Calendar._TT = {}; Calendar._TT["INFO"] = "About the calendar"; Calendar._TT["ABOUT"] = "DHTML Date/Time Selector\n" + "(c) dynarch.com 2002-2003\n" + // don't translate this this ;-) "For latest version visit: http://dynarch.com/mishoo/calendar.epl\n" + "Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." + "\n\n" + "Date selection:\n" + "- Use the \xab, \xbb buttons to select year\n" + "- Use the " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " buttons to select month\n" + "- Hold mouse button on any of the above buttons for faster selection."; Calendar._TT["ABOUT_TIME"] = "\n\n" + "Time selection:\n" + "- Click on any of the time parts to increase it\n" + "- or Shift-click to decrease it\n" + "- or click and drag for faster selection."; Calendar._TT["PREV_YEAR"] = "Prev. year (hold for menu)"; Calendar._TT["PREV_MONTH"] = "Prev. month (hold for menu)"; Calendar._TT["GO_TODAY"] = "Go Today"; Calendar._TT["NEXT_MONTH"] = "Next month (hold for menu)"; Calendar._TT["NEXT_YEAR"] = "Next year (hold for menu)"; Calendar._TT["SEL_DATE"] = "Select date"; Calendar._TT["DRAG_TO_MOVE"] = "Drag to move"; Calendar._TT["PART_TODAY"] = " (today)"; // the following is to inform that "%s" is to be the first day of week // %s will be replaced with the day name. Calendar._TT["DAY_FIRST"] = "Display %s first"; // This may be locale-dependent. It specifies the week-end days, as an array // of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 // means Monday, etc. Calendar._TT["WEEKEND"] = "0,6"; Calendar._TT["CLOSE"] = "Close"; Calendar._TT["TODAY"] = "Today"; Calendar._TT["TIME_PART"] = "(Shift-)Click or drag to change value"; // date formats Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d"; Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e"; Calendar._TT["WK"] = "wk"; Calendar._TT["TIME"] = "Time:"; jffnms-0.9.3/htdocs/admin/calendar/calendar-blue2.css0000644000175000017500000001161711377440254021752 0ustar csmallcsmall/* The main calendar widget. DIV containing a table. */ div.calendar { position: relative; } .calendar, .calendar table { border: 1px solid #206A9B; font-size: 11px; color: #000; cursor: default; background: #F1F8FC; font-family: tahoma,verdana,sans-serif; width: auto; } /* Header part -- contains navigation buttons and day names. */ .calendar .button { /* "<<", "<", ">", ">>" buttons have this class */ text-align: center; /* They are the navigation buttons */ padding: 2px; /* Make the buttons seem like they're pressing */ } .calendar .nav { background: #007ED1 url(menuarrow2.gif) no-repeat 100% 100%; } .calendar thead .title { /* This holds the current "month, year" */ font-weight: bold; /* Pressing it will take you to the current date */ text-align: center; background: #000; color: #fff; padding: 2px; } .calendar thead tr { /* Row containing navigation buttons */ background: #007ED1; color: #fff; } .calendar thead .daynames { /* Row containing the day names */ background: #C7E1F3; } .calendar thead .name { /* Cells containing the day names */ border-bottom: 1px solid #206A9B; padding: 2px; text-align: center; color: #000; } .calendar thead .weekend { /* How a weekend day name shows in header */ color: #a66; } .calendar thead .hilite { /* How do the buttons in header appear when hover */ background-color: #34ABFA; color: #000; border: 1px solid #016DC5; padding: 1px; } .calendar thead .active { /* Active (pressed) buttons in header */ background-color: #006AA9; border: 1px solid #008AFF; padding: 2px 0px 0px 2px; } /* The body part -- contains all the days in month. */ .calendar tbody .day { /* Cells containing month days dates */ width: 2em; color: #456; text-align: right; padding: 2px 4px 2px 2px; } .calendar tbody .day.othermonth { font-size: 80%; color: #bbb; } .calendar tbody .day.othermonth.oweekend { color: #fbb; } .calendar table .wn { padding: 2px 3px 2px 2px; border-right: 1px solid #000; background: #C7E1F3; } .calendar tbody .rowhilite td { background: #def; } .calendar tbody .rowhilite td.wn { background: #F1F8FC; } .calendar tbody td.hilite { /* Hovered cells */ background: #def; padding: 1px 3px 1px 1px; border: 1px solid #8FC4E8; } .calendar tbody td.active { /* Active (pressed) cells */ background: #cde; padding: 2px 2px 0px 2px; } .calendar tbody td.selected { /* Cell showing today date */ font-weight: bold; border: 1px solid #000; padding: 1px 3px 1px 1px; background: #fff; color: #000; } .calendar tbody td.weekend { /* Cells showing weekend days */ color: #a66; } .calendar tbody td.today { /* Cell showing selected date */ font-weight: bold; color: #D50000; } .calendar tbody .disabled { color: #999; } .calendar tbody .emptycell { /* Empty cells (the best is to hide them) */ visibility: hidden; } .calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */ display: none; } /* The footer part -- status bar and "Close" button */ .calendar tfoot .footrow { /* The in footer (only one right now) */ text-align: center; background: #206A9B; color: #fff; } .calendar tfoot .ttip { /* Tooltip (status bar) cell */ background: #000; color: #fff; border-top: 1px solid #206A9B; padding: 1px; } .calendar tfoot .hilite { /* Hover style for buttons in footer */ background: #B8DAF0; border: 1px solid #178AEB; color: #000; padding: 1px; } .calendar tfoot .active { /* Active (pressed) style for buttons in footer */ background: #006AA9; padding: 2px 0px 0px 2px; } /* Combo boxes (menus that display months/years for direct selection) */ .calendar .combo { position: absolute; display: none; top: 0px; left: 0px; width: 4em; cursor: default; border: 1px solid #655; background: #def; color: #000; font-size: 90%; } .calendar .combo .label, .calendar .combo .label-IEfix { text-align: center; padding: 1px; } .calendar .combo .label-IEfix { width: 4em; } .calendar .combo .hilite { background: #34ABFA; border-top: 1px solid #46a; border-bottom: 1px solid #46a; font-weight: bold; } .calendar .combo .active { border-top: 1px solid #46a; border-bottom: 1px solid #46a; background: #F1F8FC; font-weight: bold; } .calendar td.time { border-top: 1px solid #000; padding: 1px 0px; text-align: center; background-color: #E3F0F9; } .calendar td.time .hour, .calendar td.time .minute, .calendar td.time .ampm { padding: 0px 3px 0px 4px; border: 1px solid #889; font-weight: bold; background-color: #F1F8FC; } .calendar td.time .ampm { text-align: center; } .calendar td.time .colon { padding: 0px 2px 0px 3px; font-weight: bold; } .calendar td.time span.hilite { border-color: #000; background-color: #267DB7; color: #fff; } .calendar td.time span.active { border-color: red; background-color: #000; color: #A5FF00; } jffnms-0.9.3/htdocs/admin/adm/0002755000175000017500000000000011742006767015447 5ustar csmallcsmalljffnms-0.9.3/htdocs/admin/adm/adm_profiles_options.php0000644000175000017500000000722111716447477022407 0ustar csmallcsmall JFFNMS Authors * This program is licensed under the GNU GPL, full terms in the LICENSE file */ require_once ('../../auth.php'); if (!profile('ADMIN_USERS')) die ('

You dont have Permission to access this page.

'); $actionid = $Sanitizer->get_int('actionid'); $action = $Sanitizer->get_string('action','list'); $filter = $Sanitizer->get_string('filter'); $init = $Sanitizer->get_int('init',0); $span = $Sanitizer->get_int('span',10); $editid=''; $ProfilesOptions = new JffnmsProfiles_options(); adm_header('Profiles Options'); switch ($action) { case 'view': adm_frame_menu_split('profiles_values',1); break; case 'update': $options_data = array( 'description', $Sanitizer->get_string('description'), 'tag', $Sanitizer->get_string('tag'), 'editable', $Sanitizer->get_int('editable', 0), 'type' => $Sanitzer->get_string('type'), 'use_default' => $Sanitizer->get_int('use_default', 0), 'default_value' => $Sanitizer->get_string('default_value'), 'show_in_profile' => $Sanitizer->get_int('show_in_profile', 0) ); $ProfilesOptions->update($actionid,$options_data); $action='list'; break; case 'add': $actionid=$ProfilesOptions->add(); $action='edit'; $editid = $actionid; break; case 'delete': $ProfilesOptions->delete($actionid); $action='list'; break; case 'edit': $editid = $actionid; break; } $types = array('select'=>'Select', 'text'=>'Text Box'); $cant = $ProfilesOptions->get(); echo adm_table_header('Profiles Options', $init, $span, 10, $cant, 'admin_profiles_options', true). tag('tr','','header'). td ('Action', 'field', 'action'). td ('ID', 'field'). td ('Description', 'field'). td ('Tag', 'field'). td ('Type', 'field'). td ('Editable?', 'field'). td ('Show?', 'field'). td ('is Default?', 'field'). td ('Default Value', 'field'). tag_close('tr'). tag('tbody'); $ProfilesOptions->slice($init,$span); $row=0; while ($rec = $ProfilesOptions->fetch()) { echo tr_open('row_'.$rec['id'],(($editid==$rec['id'])?'editing':((($row++%2)!=0)?'odd':''))); if ($editid==$rec['id']) { adm_form('update'); echo td(adm_standard_submit_cancel('Save','Discard'), 'action'). td($rec['id'],'field', 'field_id'). td(textbox('description',$rec['description'],20),'field'). td(textbox('tag',$rec['tag'],20),'field'). td(select_custom('type',$types,$rec['type']),'field'). td(checkbox('editable',$rec['editable']),'field'). td(checkbox('show_in_profile',$rec['show_in_profile']),'field'). td(checkbox('use_default',$rec['use_default']), 'field'). td(($rec['type']=='select') ?select_profiles_values('default_value',$rec['id'],$rec['default_value']) :textbox('default_value',$rec['default_value'],20), 'field'). form_close(); } else { $ProfilesValues = new JffnmsProfiles_values(); echo adm_standard_edit_delete($rec['id'],'', 'Values'). td($rec['id'],'field','field_id'). td($rec['description'],'field'). td($rec['tag'],'field'). td($types[$rec['type']],'field'). td(checkbox('editable',$rec['editable'],0),'field'). td(checkbox('show_in_profile',$rec['show_in_profile'],0),'field'). td(checkbox('use_default',$rec['use_default'],0), 'field'). td((($rec['type']=='select') ?$ProfilesValues->description($rec['id'], $rec['default_value']) :$rec['default_value']), 'field'); } echo tag_close('tr'); }//while fetch echo tag_close('tbody'). table_close(); adm_footer(); ?> jffnms-0.9.3/htdocs/admin/adm/adm_hosts.inc.php0000644000175000017500000002422011716447477020717 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ jffnms_load_api('iad'); function hosts_action_view_config() { adm_frame_menu_split('hosts_config'); } function hosts_action_view_interfaces() { adm_frame_menu_split('interfaces'); } function hosts_action_discovery($api, $id) { global $st; $st['after_record_function'] = 'hosts_action_real_discovery'; $st['after_record_id'] = $id; $st['md_type'] = 1; $st['fields'] = array_slice($st['fields'],0,5); $GLOBALS['filter'] = $id; $GLOBALS['init']=0; } function hosts_action_fast_discovery($api, $id) { global $st; $st['after_record_function'] = 'hosts_action_real_discovery'; $st['after_record_id'] = $id; $st['md_type'] = 2; $st['fields'] = array_slice($st['fields'],0,5); $GLOBALS["filter"] = $id; $GLOBALS["init"]=0; } //main GET Interfaces manual discovery code function host_interfaces($host_ip,$rocommunity,$hostid, $md_type = 0) { global $Config; //JS for Checkboxes echo script(" function check(field_aux) { field=document.forms[0].elements[field_aux]; for (i = 0; i < field.length; i++) { if (field[i].checked==true) field[i].checked = false; else field[i].checked = true; } return true; }"); echo table('','manual_discovery'); $GLOBALS["SCRIPT_NAME"]="adm_interfaces.php"; $GLOBALS["init"]=0; adm_form('bulkadd','POST'); $max_fields = 15; $found_interfaces = 0; $types_obj = new JffnmsInterface_Types(); $types_fields_obj = new JffnmsInterface_Types_Fields(); $Interfaces = new JffnmsInterfaces(); //get host data $Hosts = new JffnmsHosts(); $host_db_data = current($Hosts->get_all($hostid)); unset($Hosts); $types_obj->get(); //get pointer to interface types list $bulk_add = array(); $bulk_add_id = 0; while ($itype_row = $types_obj->fetch()) if (($itype_row['id'] > 1) && //avoid Unknown interface type (($md_type!=2) || (($itype_row['id']!=2) && ($itype_row['id']!=23)))) // if MDtype=2 No PortScan (TCP/UDP) { //get interfaces from the database $db = iad_interfaces_from_db($Interfaces, $hostid, $itype_row['id']); //do a discovery and get the interface list $host = iad_interfaces_from_discovery($itype_row['autodiscovery_function'],$host_ip,$rocommunity,$hostid,$itype_row['autodiscovery_parameters']); if (!is_array($db)) $db = array(); if (!is_array($host)) $host = array(); if (!isset($fields) || !is_array($fields)) $fields = array(); //debug ($db); //debug ($host); //merge all keys $interface_ids_list = array_unique(array_merge(array_keys($db),array_keys($host))); asort($interface_ids_list); reset($interface_ids_list); if ((count($interface_ids_list) > 0) || ($itype_row['allow_manual_add']==1)) //key is valid { $fields = $types_fields_obj->get_all(NULL,array('itype'=>$itype_row['id'],'exclude_types'=>20)); //debug ($fields); $internal_fields = array('host','type','client','poll','sla','show_rootmap','make_sound','interface'); foreach ($internal_fields as $fname) $fields[]=array('name'=>$fname,'showable'=>0,'overwritable'=>1); unset ($internal_fields); $showable_fields = 4; echo table_row($itype_row['description']. (($itype_row['allow_manual_add']==1)?"   ". linktext('[Manual Add]','adm_interfaces.php?action=bulkadd'. '&bulk_add_ids[]=0'. '&bulk_add[0][host]='.$hostid. '&bulk_add[0][type]='.$itype_row['id']. '&bulk_add[0][client]='.$host_db_data['autodiscovery_default_customer']. '&bulk_add[0][poll]='.$itype_row['autodiscovery_default_poller']. '&bulk_add[0][sla]='.$itype_row['sla_default'],'','manual_add'):''), 'discovery_title',$max_fields,'', false); if (count($interface_ids_list) > 0) { echo tr_open('','discovery_header'). td ('Add/Edit', 'field_action'). td ('Index', 'field_index'). td ('Name', 'field_interface'). td ('Status', 'field_status'); foreach ($fields as $key=>$fdata) if (array_key_exists('ftype', $fdata) && $fdata['ftype']==3) { $index_field = $fdata['name']; $fields[$key]['showable']=0; } else if (($fdata['showable']==1) && ($fdata['ftype_handler']!='bool')) { echo td($fdata['description'], 'field_'.$fdata['name']); $showable_fields++; } $fields_left = $max_fields - $showable_fields; if ($fields_left > 0) echo td (' ','empty_fields','',$fields_left); echo tag_close('tr'); } foreach ($interface_ids_list as $key) //key is valid { $found_interfaces++; //number of interfaces found on all the host if (array_key_exists($key, $db) && is_array($db[$key])) echo tr_open('', 'discovery_interface_old'); else echo tr_open('', 'discovery_interface_new'); if (array_key_exists($key, $host) and is_array($host[$key])) //interface is in the host { $value = $host[$key]; //get the value from the host returned data $value[$index_field]=$key; //put the KEY as the Index Field (for adding) } else { $value = $db[$key]; //get the value from the interfaces table in the DB $value['admin'] = '(Not Found in Host)'; } ad_set_default ($value['host'],$hostid); ad_set_default ($value['type'],$itype_row['id']); ad_set_default ($value['client'],$host_db_data['autodiscovery_default_customer']); ad_set_default ($value['poll'],$itype_row['autodiscovery_default_poller']); ad_set_default ($value['sla'],$itype_row['sla_default']); foreach ($value as $fname=>$data) $value[$fname] = str_replace("\"","",$value[$fname]); //Update Handler $update_function = $itype_row['update_handler']; $real_function = "handler_".$update_function; $function_file = $Config->get('jffnms_real_path')."/engine/handlers/".$update_function.".inc.php"; if (in_array($function_file,get_included_files()) || (file_exists($function_file) && (include_once($function_file)))) { if (function_exists($real_function)) if (array_key_exists($key, $db)) call_user_func_array($real_function,array(false, &$value,$db[$key])); else call_user_func_array($real_function,array(false, &$value,array())); else echo html("span", "ERROR: Calling Function \"$real_function\" doesn't exist.", "error"); } else echo html("span", "ERROR Loading file \"$function_file\"", "error"); //Show Field Values if (array_key_exists($key, $db) && is_array($db[$key])) //if the interface is in the DB echo td (linktext("Edit","adm_interfaces.php?action=edit&interface_id=".$db[$key]["id"]),"field_action"); //put a edit link else { //if its not, put an ADD link $bulk_add_id++; foreach ($fields as $fdata) //for each field if (array_key_exists($fdata['name'], $value) && (!array_key_exists('default_value',$fdata) ||($fdata['default_value']!=$value[$fdata['name']])) //is not the default && isset($value[$fdata['name']]) && ($value[$fdata['name']]!=='')) //if the value is ok $bulk_add[$bulk_add_id][$fdata['name']]=$value[$fdata['name']]; //store value for multiple add echo td(checkbox_value("bulk_add_ids[]",$bulk_add_id,0),"bulk_add_checkbox"); }//add link if ($value[$index_field]==$value['interface']) //if Index and Inteface name are equal. echo td ($value['interface'],'field_interface','',2); //show only one else { echo td($value[$index_field],"field_index"); echo td($value["interface"],"field_interface"); } //Status unset ($aux); if (isset($value['admin'])) $aux[]=$value['admin']; if (isset($value['oper'])) $aux[]=$value['oper']; echo td(join(' / ',array_unique($aux)),'field_status'); //other fields foreach ($fields as $fdata) if (($fdata['showable']==1) && ($fdata['ftype_handler']!='bool')) echo td(htmlspecialchars(substr($value[$fdata['name']],0,30)),'field_'.$fdata['name']); if ($fields_left > 0) echo td(' ','empty_fields','',$fields_left); echo tag_close('tr'); flush(); } //foreach found interface table_row(" ","separator","",$max_fields); } //count(host) > 0 } //interface types while if ($found_interfaces==0) table_row('No Interfaces Found','no_interfaces_found',$max_fields); else if (is_array($bulk_add) && (count($bulk_add)>0)) { $html = ''; while ( list($key,$data) = each ($bulk_add)) { while ( list($field,$value) = each ($data)) $html.=hidden("bulk_add[".$key."][".$field."]",htmlspecialchars($value),0); $html.="\n"; } echo $html; echo tr_open('add_marked_interfaces'). td(adm_form_submit('Add Marked Interfaces'),'','',2). td( tag("input","",""," type=checkbox onClick=\"this.value=check('bulk_add_ids[]');\""). "Mark All Interfaces"). tag_close('tr'); } echo form_close(). table_close(); } function hosts_action_real_discovery($host) { global $st; if ($host['id'] == $st['after_record_id']) { echo tr_open('','manual_discovery'). tag('td','','','colspan=21'); host_interfaces($host['ip'], $host['rocommunity'], $host['id'], $st['md_type']); echo tag_close('td'). tag_close('tr'); unset ($st['after_record_function']); } } ?> jffnms-0.9.3/htdocs/admin/adm/adm_satellites.inc.php0000644000175000017500000000174011716447477021732 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function satellites_action_update() { global $api, $description, $parent, $url, $sat_group, $sat_type; $old_data = current($api->get_data($_POST["actionid"])); $my_sat_id = $api->get_id($GLOBALS["jffnms_satellite_uri"]); //if local is not configured, configure it if (!$my_sat_id && ($_POST["actionid"]==1) && ($GLOBALS["jffnms_satellite_uri"]!="none") && (!$url) ) $url = $GLOBALS["jffnms_satellite_uri"]; $data = compact("description","parent","url","sat_group","sat_type"); debug ($data); if (!$my_sat_id) $my_sat_id=1; $old_path = $api->get_paths($_POST["actionid"]); $api->update($_POST["actionid"],$data); if ($sat_type!=4) $result = $api->triggered_update($my_sat_id, $_POST["actionid"], $old_path); if ($result["errors"] > 0) debug ($result); } ?> jffnms-0.9.3/htdocs/admin/adm/structures.php0000644000175000017500000010524111741275716020405 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function get_structure($struct_name) { switch($struct_name) { case 'zones': return array( 'title'=>'Zones', 'object'=>'zones', 'show_id'=>1, 'profile'=>'ADMIN_HOSTS', 'action_type'=>2, 'split'=>'nad', 'split_standard'=>0, 'split_view_name'=>'Discovered Networks', 'fields'=>array( 'zone'=>array( 'name'=>'Zone', 'type'=>'textbox', 'size'=>20, 'filter'=>false), 'shortname'=>array( 'name'=>'ShortName', 'type'=>'textbox', 'size'=>20, 'filter'=>false), 'image'=>array( 'name'=>'Image', 'type'=>'textbox', 'size'=>20, 'filter'=>false), 'show_zone'=>array( 'name'=>'Visibility', 'type'=>'select', 'func'=>'select_show_rootmap', 'view_params'=>array(1), 'size'=>30), 'admin_status'=>array('name'=>'Network Discovery Enabled', 'type'=>'checkbox'), 'seeds'=>array( 'name'=>'Network Discovery Seeds CIDR', 'type'=>'textbox', 'size'=>60), 'allow_private'=>array('name'=>'Allow Private IPs', 'type'=>'checkbox'), 'communities'=>array('name'=>'SNMP Communities CSV', 'type'=>'textbox', 'size'=>60), 'max_deep'=>array( 'name'=>'Max Hops to scan', 'type'=>'select', 'func'=>'select_nad_deep', 'view_params'=>array(1)), 'refresh'=>array( 'name'=>'Re-Scan', 'type'=>'select', 'func'=>'select_nad_refresh', 'view_params'=>array(1)), NULL) ); break; case 'graph_types': return array( 'title'=>'Graph Types', 'object'=>'graph_types', 'show_id'=>1, 'hide_record_one'=>1, 'action_type'=>1, 'profile'=>'ADMIN_SYSTEM', 'fields'=>array( 'description'=>array( 'name'=>'Description', 'type'=>'textbox', 'size'=>20), 'type'=>array( 'name'=>'Interface Type', 'type'=>'select', 'func'=>'select_interface_types', 'view'=>'types_description', 'size'=>30), 'allow_aggregation'=>array( 'name'=>'Allow Aggregation', 'type'=>'checkbox'), 'graph1'=>array( 'name'=>'Graph 1', 'type'=>'textbox', 'size'=>20, 'filter'=>false), 'sizex1'=>array( 'name'=>'Width 1', 'type'=>'textbox', 'size'=>20, 'filter'=>false), 'sizey1'=>array( 'name'=>'Height 1', 'type'=>'textbox', 'size'=>20, 'filter'=>false), 'graph2'=>array( 'name'=>'Graph 2', 'type'=>'textbox', 'size'=>20, 'filter'=>false), 'sizex2'=>array( 'name'=>'Width 2', 'type'=>'textbox', 'size'=>20, 'filter'=>false), 'sizey2'=>array( 'name'=>'Height 2', 'type'=>'textbox', 'size'=>20, 'filter'=>false), NULL) ); break; case 'clients': return array( 'title'=>'Customers', 'object'=>'clients', 'show_id'=>1, 'hide_record_one'=>1, 'action_type'=>1, 'profile'=>'ADMIN_HOSTS', 'fields'=>array( 'name'=>array( 'name'=>'Customer Name', 'type'=>'textbox', 'size'=>20, 'filter'=>false), 'shortname'=>array( 'name'=>'Customer ShortName', 'type'=>'textbox', 'size'=>20, 'filter'=>false), 'username'=>array( 'name'=>'Username', 'type'=>'textbox', 'size'=>60, 'filter'=>false), 'password'=>array( 'name'=>'Password', 'type'=>'textbox', 'size'=>20, 'filter'=>false), NULL) ); break; case 'autodiscovery': return array( 'title'=>'Autodiscovery', 'object'=>'autodiscovery', 'show_id'=>1, 'action_type'=>1, 'hide_record_one'=>1, 'profile'=>'ADMIN_HOSTS', 'fields'=>array( 'description'=>array( 'name'=>'Description', 'type'=>'textbox', 'size'=>30), 'poller_default'=>array( 'name'=>'Default Poller', 'type'=>'checkbox'), 'permit_add'=>array( 'name'=>'Permit Add', 'type'=>'checkbox'), 'permit_del'=>array( 'name'=>'Permit Delete', 'type'=>'checkbox'), 'alert_del'=>array( 'name'=>'Alert on Delete', 'type'=>'checkbox'), 'permit_mod'=>array( 'name'=>'Permit Modify', 'type'=>'checkbox'), 'permit_disable'=>array( 'name'=>'Permit Disable', 'type'=>'checkbox'), 'skip_loopback'=>array( 'name'=>'Skip LoopBack', 'type'=>'checkbox'), 'check_state'=>array( 'name'=>'Check State', 'type'=>'checkbox'), 'check_address'=>array( 'name'=>'Check Valid Address', 'type'=>'checkbox'), NULL) ); break; case 'severity': return array( 'title'=>'Severities', 'object'=>'severity', 'show_id'=>0, 'action_type'=>1, 'profile'=>'ADMIN_SYSTEM', 'fields'=>array( 'level'=>array( 'name'=>'Level', 'type'=>'textbox', 'size'=>3), 'severity'=>array( 'name'=>'Description', 'type'=>'textbox', 'size'=>20), 'bgcolor'=>array( 'name'=>'Background Color', 'type'=>'colorbox'), 'fgcolor'=>array( 'name'=>'Foreground Color', 'type'=>'colorbox'), NULL) ); break; case 'syslog_types': return array( 'title'=>'Syslog Events Types', 'object'=>'syslog_types', 'show_id'=>1, 'action_type'=>1, 'profile'=>'ADMIN_SYSTEM', 'fields'=>array( 'match_text'=>array( 'name'=>'Text Match', 'type'=>'textbox', 'size'=>70, 'filter'=>false), 'interface'=>array( 'name'=>'Interface Field', 'type'=>'textbox', 'size'=>10, 'filter'=>false), 'username'=>array( 'name'=>'Username Field', 'type'=>'textbox', 'size'=>10, 'filter'=>false), 'state'=>array( 'name'=>'State Field', 'type'=>'textbox', 'size'=>10, 'filter'=>false), 'info'=>array( 'name'=>'Extra Info Field', 'type'=>'textbox', 'size'=>10, 'filter'=>false), 'type'=>array( 'name'=>'Event Type', 'type'=>'select', 'func'=>'select_event_types', 'view'=>'types_description', 'size'=>30), 'pos'=>array( 'name'=>'Position', 'type'=>'textbox', 'size'=>3, 'filter'=>false), NULL) ); break; case 'event_types': return array( 'title'=>'Event Types', 'object'=>'event_types', 'show_id'=>1, 'action_type'=>1, 'profile'=>'ADMIN_SYSTEM', 'fields'=>array( 'description'=>array( 'name'=>'Description', 'type'=>'textbox', 'size'=>30), 'severity'=>array( 'name'=>'Severity', 'type'=>'select', 'func'=>'select_severity', 'view'=>'severity_description', 'size'=>30), 'text'=>array( 'name'=>'Event Text', 'type'=>'textbox', 'size'=>60, 'filter'=>false), 'show_default'=>array( 'name'=>'Show in Event Viewer?', 'type'=>'select', 'func'=>'select_events_show', 'size'=>10, 'view_params'=>array(1)), 'generate_alarm'=>array( 'name'=>'Event Generates an Alarm?', 'type'=>'checkbox'), 'alarm_up'=>array( 'name'=>'Different Alarm for Up Event', 'type'=>'select', 'func'=>'select_event_types', 'params'=>array(1,NULL,NULL,array(NULL,array('show_unknown'=>1))), 'view'=>'alarm_up_description', 'size'=>30), 'alarm_duration'=>array( 'name'=>'Alarm Duration', 'type'=>'select', 'func'=>'select_alarm_duration', 'size'=>30, 'view_params'=>array(1)), 'show_host'=> array( 'name'=>'Show Host Field?', 'type'=>'checkbox'), NULL) ); break; case 'interface_types': return array( 'title'=>'Interface Types', 'object'=>'interface_types', 'show_id'=>1, 'hide_record_one'=>1, 'action_type'=>2, 'split'=>'interface_types_fields', 'split_standard'=>1, 'split_view_name'=>'Fields', 'profile'=>'ADMIN_SYSTEM', 'fields'=>array( 'description'=>array( 'name'=>'Description', 'type'=>'textbox', 'size'=>30), 'autodiscovery_enabled'=>array( 'name'=>'AD Enabled', 'type'=>'checkbox'), 'autodiscovery_validate'=>array( 'name'=>'Validate in AD', 'type'=>'checkbox'), 'autodiscovery_function'=>array( 'name'=>'Discovery Function (Internal)', 'type'=>'textbox', 'size'=>40), 'autodiscovery_parameters'=>array( 'name'=>'Discovery Parameters', 'type'=>'textbox', 'size'=>30), 'autodiscovery_default_poller'=>array( 'name'=>'Discovery Default Poller', 'type'=>'select', 'func'=>'select_pollers_groups', 'view'=>'poller_default', 'size'=>30, 'filter'=>false), 'snmp_oid' => array( 'name'=> 'Match SysObjectID', 'type'=>'textbox', 'size'=>30), 'update_handler'=> array( 'name'=>'Internal Update Handler','type'=>'textbox', 'size'=>20), 'allow_manual_add'=>array( 'name'=>'Manual Interface Add', 'type'=>'checkbox'), 'break_by_card'=>array( 'name'=>'Break by Card', 'type'=>'checkbox'), 'have_tools'=>array( 'name'=>'Have Tools', 'type'=>'checkbox'), 'have_graph'=>array( 'name'=>'Have Graph', 'type'=>'checkbox'), 'graph_default'=>array( 'name'=>'Default Graph', 'type'=>'select', 'func'=>'select_graph_types', 'view'=>'graph_types_description', 'size'=>30, 'filter'=>false), 'sla_default'=>array( 'name'=>'Default SLA', 'type'=>'select', 'func'=>'select_slas', 'view'=>'slas_description', 'size'=>30), 'rrd_structure_rra'=>array( 'name'=>'RRDTool Structure RRA','type'=>'memobox', 'width'=>40, 'height'=>5, 'size'=>40, 'filter'=>false), 'rrd_structure_res'=>array( 'name'=>'RRDTool Resolution', 'type'=>'textbox', 'size'=>20), 'rrd_structure_step'=>array( 'name'=>'RRDTool Step', 'type'=>'textbox', 'size'=>10), NULL) ); break; case 'filters': return array( 'title'=>'Filters', 'object'=>'filters', 'show_id'=>1, 'profile'=>'ADMIN_SYSTEM', 'action_type'=>2, 'split'=>'filters_cond', 'split_standard'=>1, 'fields'=>array('description'=>array( 'name'=>'Description', 'type'=>'textbox', 'size'=>30)) ); break; case 'filters_cond': return array( 'title'=>'Filters Conditions', 'object'=>'filters_cond', 'show_id'=>1, 'action_type'=>1, 'profile'=>'ADMIN_SYSTEM', 'hidden_fields'=>array('filter_id'), 'add_filter_field'=>'filter_id', 'fields'=>array( //'filter_id'=>array( 'name'=>'Filter', 'type'=>'select', 'func'=>'select_filters', 'size'=>30, 'view'=>'filter_description', 'hidden'=>true), 'pos'=>array( 'name'=>'Position', 'type'=>'textbox', 'size'=>5), 'field_id'=>array( 'name'=>'Field', 'type'=>'select', 'func'=>'select_filters_fields', 'size'=>30, 'view'=>'field_description'), 'op'=>array( 'name'=>'Operator', 'type'=>'select', 'func'=>'select_op', 'size'=>30, 'view_params'=>array(1)), 'value'=>array( 'name'=>'Value', 'type'=>'select', 'func'=>'select_filter_option', 'size'=>30, 'params_field'=>'field_name', 'view_params'=>array(0)), NULL) ); break; case 'filters_fields': return array( 'title'=>'Filter Fields', 'object'=>'filters_fields', 'show_id'=>1, 'action_type'=>1, 'profile'=>'ADMIN_SYSTEM', 'fields'=>array( 'description' =>array( 'name'=>'Description', 'type'=>'textbox', 'size'=>30), 'field' =>array( 'name'=>'Field Name', 'type'=>'textbox', 'size'=>30), NULL) ); break; case 'slas': return array( 'title'=>'SLAs', 'object'=>'slas', 'show_id'=>1, 'action_type'=>2, 'split'=>'slas_sla_cond', 'split_standard'=>1, 'profile'=>'ADMIN_SYSTEM', 'fields'=>array( 'description'=>array( 'name'=>'Description', 'type'=>'textbox', 'size'=>30), 'interface_type'=>array( 'name'=>'Interface Type', 'type'=>'select', 'func'=>'select_interface_types', 'view'=>'interface_type_description', 'size'=>30), 'event_type'=>array( 'name'=>'Event Type', 'type'=>'select', 'func'=>'select_event_types', 'view'=>'types_description', 'size'=>30), 'state'=>array( 'name'=>'Alarm State', 'type'=>'select', 'func'=>'select_alarm_states', 'view'=>'state_description', 'size'=>60), 'info'=>array( 'name'=>'Event Text', 'type'=>'textbox', 'size'=>30, 'filter'=>false), 'threshold'=>array( 'name'=>'Threshold % (for Reports)', 'type'=>'textbox', 'size'=>3, 'filter'=>false), NULL) ); break; case 'slas_cond': return array( 'title'=>'SLA Individual Conditions', 'object'=>'slas_cond', 'show_id'=>1, 'action_type'=>1, 'profile'=>'ADMIN_SYSTEM', 'fields'=>array( 'description'=>array( 'name'=>'Description', 'type'=>'textbox','size'=>30), 'event'=>array( 'name'=>'Show Info', 'type'=>'textbox', 'size'=>30), 'cond'=>array( 'name'=>'Condition', 'type'=>'textbox', 'size'=>100, 'filter'=>false), 'variable_show'=>array( 'name'=>'Show Expression', 'type'=>'textbox', 'size'=>100), 'variable_show_info'=>array( 'name'=>'Show Unit', 'type'=>'textbox', 'size'=>30), NULL) ); break; case 'maps': return array( 'title'=>'SubMaps (Interface Groups)', 'object'=>'maps', 'show_id'=>1, 'action_type'=>2, 'split'=>'maps_interfaces', 'split_standard'=>1, 'profile'=>'ADMIN_HOSTS', 'fields'=>array( 'name'=>array( 'name'=>'Map Name', 'type'=>'textbox', 'size'=>30, 'filter'=>false), 'parent'=>array( 'name'=>'Parent Map', 'type'=>'select', 'func'=>'select_maps', 'view'=>'parent_name', 'size'=>30), 'color'=>array( 'name'=>'Background Color', 'type'=>'colorbox'), NULL) ); break; case 'alarm_states': return array( 'title'=>'Alarm States (and Sounds)', 'object'=>'alarm_states', 'show_id'=>1, 'action_type'=>1, 'profile'=>'ADMIN_SYSTEM', 'fields'=>array( 'description'=>array( 'name'=>'Description', 'type'=>'textbox','size'=>30), 'activate_alarm'=>array( 'name'=>'Alarm Level', 'type'=>'textbox', 'size'=>5), 'sound_in'=>array( 'name'=>'Sound In', 'type'=>'textbox','size'=>30), 'sound_out'=>array( 'name'=>'Sound Out', 'type'=>'textbox','size'=>30), 'state'=>array( 'name'=>'Internal State', 'type'=>'select', 'func'=>'select_alarm_states_states', 'view_params'=>1, 'view_params'=>array(1)), NULL) ); break; case 'maps_interfaces': return array( 'title'=>'SubMaps/Interfaces', 'object'=>'maps_interfaces', 'show_id'=>1, 'action_type'=>1, 'profile'=>'ADMIN_HOSTS', 'no_records_message'=>'No Interfaces Found in this Map.', 'hidden_fields'=>array('map'), 'add_filter_field'=>'map', 'fields'=>array( //'map'=>array( 'name'=>'Map Name', 'type'=>'select', 'func'=>'select_maps', 'view'=>'map_name', 'size'=>30), 'interface'=>array( 'name'=>'Interface', 'type'=>'select', 'func'=>'select_interfaces', 'view'=>'interface_description', 'size'=>60, 'params'=>array(6)), 'x'=> array( 'name'=>'X', 'type'=>'textbox','size'=>5, 'filter'=>false), 'y'=> array( 'name'=>'Y', 'type'=>'textbox','size'=>5, 'filter'=>false), NULL) ); break; case 'pollers': return array( 'title'=>'Pollers', 'object'=>'pollers', 'show_id'=>1, 'action_type'=>1, 'hide_record_one'=>1, 'profile'=>'ADMIN_SYSTEM', 'fields'=>array( 'description'=>array( 'name'=>'Description', 'type'=>'textbox','size'=>30), 'name'=>array( 'name'=>'Name (Match RRD Struct DS)', 'type'=>'textbox', 'size'=>30), 'command'=>array( 'name'=>'Poller Command (file)', 'type'=>'textbox','size'=>30), 'parameters'=>array( 'name'=>'Parameters', 'type'=>'textbox','size'=>100), NULL) ); break; case 'trap_receivers': return array( 'title'=>'SNMP Trap Receivers', 'object'=>'trap_receivers', 'show_id'=>1, 'action_type'=>1, 'hide_record_one'=>0, 'profile'=>'ADMIN_SYSTEM', 'fields'=>array( 'position'=>array( 'name'=>'Position', 'type'=>'textbox', 'size'=>3), 'description'=>array( 'name'=>'Description', 'type'=>'textbox','size'=>30), 'interface_type'=>array( 'name'=>'Interface Type', 'type'=>'select', 'func'=>'select_interface_types', 'view'=>'interface_type_description', 'size'=>30), 'match_oid'=>array( 'name'=>'OID Match', 'type'=>'textbox','size'=>50), 'command'=>array( 'name'=>'Receiver Command (file)', 'type'=>'textbox','size'=>30), 'parameters'=>array( 'name'=>'Parameters', 'type'=>'textbox','size'=>100), 'backend'=>array( 'name'=>'Backend', 'type'=>'select', 'func'=>'select_pollers_backend', 'size'=>30, 'view'=>'backend_description'), 'stop_if_matches'=>array( 'name'=>'Stop if Matches', 'type'=>'checkbox'), NULL) ); break; case 'pollers_backend': return array( 'title'=>'Pollers Backends', 'object'=>'pollers_backend', 'show_id'=>1, 'action_type'=>1, 'hide_record_one'=>1, 'profile'=>'ADMIN_SYSTEM', 'fields'=>array( 'description'=>array( 'name'=>'Description', 'type'=>'textbox','size'=>30), 'command'=>array( 'name'=>'Poller Command (file)', 'type'=>'textbox','size'=>30), 'parameters'=>array( 'name'=>'Parameters', 'type'=>'textbox','size'=>30), 'type'=>array( 'name'=>'Type (is Status?)', 'type'=>'checkbox'), NULL) ); break; case 'pollers_groups': return array( 'title'=>'Poller Groups', 'object'=>'pollers_groups', 'show_id'=>1, 'action_type'=>2, 'split'=>'pollers_poller_groups', 'split_standard'=>1, 'profile'=>'ADMIN_SYSTEM', 'fields'=>array( 'description'=>array( 'name'=>'Description', 'type'=>'textbox','size'=>30), 'interface_type'=>array( 'name'=>'Interface Type', 'type'=>'select', 'func'=>'select_interface_types', 'size'=>30, 'view'=>'type_description'), NULL) ); break; case 'pollers_poller_groups': return array( 'title'=>'Poller Group - Pollers/Backend Relation', 'object'=>'pollers_poller_groups', 'show_id'=>1, 'action_type'=>1, 'profile'=>'ADMIN_SYSTEM', 'fields'=>array( //'poller_group'=>array( 'name'=>'Poller Group', 'type'=>'select', 'func'=>'select_pollers_groups', 'size'=>30, 'view'=>'group_description'), 'pos'=>array( 'name'=>'Position', 'type'=>'textbox', 'size'=>3, 'filter'=>false), 'poller'=>array( 'name'=>'Poller', 'type'=>'select', 'func'=>'select_pollers', 'size'=>30, 'view'=>'poller_description'), 'backend'=>array( 'name'=>'Backend', 'type'=>'select', 'func'=>'select_pollers_backend', 'size'=>30, 'view'=>'backend_description'), NULL) ); break; case 'slas_sla_cond': return array( 'title'=>'SLAs - SLA Conditions Relation', 'object'=>'slas_sla_cond', 'show_id'=>1, 'action_type'=>1, 'profile'=>'ADMIN_SYSTEM', 'fields'=>array( //'sla'=>array( 'name'=>'SLA', 'type'=>'select', 'func'=>'select_slas', 'size'=>30, 'view'=>'sla_description'), 'pos'=>array( 'name'=>'Position', 'type'=>'textbox', 'size'=>3), 'cond'=>array( 'name'=>'Condition', 'type'=>'select', 'func'=>'select_slas_cond', 'size'=>30, 'view'=>'cond_description'), 'show_in_result'=>array( 'name'=>'Show', 'type'=>'checkbox'), NULL) ); break; case 'profiles_values': return array( 'title'=>'Profiles Option Values', 'object'=>'profiles_values', 'show_id'=>1, 'action_type'=>1, 'profile'=>'ADMIN_USERS', 'fields'=>array( 'profile_option'=>array( 'name'=>'Option', 'type'=>'select', 'func'=>'select_profiles_options', 'size'=>30, 'view'=>'option_description'), 'description'=>array( 'name'=>'Description', 'type'=>'textbox', 'size'=>30), 'value'=>array( 'name'=>'Value', 'type'=>'textbox', 'size'=>30), NULL) ); break; case 'actions': return array( 'title'=>'Actions', 'object'=>'actions', 'show_id'=>1, 'action_type'=>1, 'hide_record_one'=>1, 'profile'=>'ADMIN_SYSTEM', 'fields'=>array( 'description' =>array( 'name'=>'Description', 'type'=>'textbox', 'size'=>30), 'command' =>array( 'name'=>'Command', 'type'=>'textbox', 'size'=>30), 'internal_parameters'=>array( 'name'=>'Internal Parameters', 'type'=>'textbox', 'size'=>100, 'filter'=>false), 'user_parameters' =>array( 'name'=>'User Parameters', 'type'=>'textbox', 'size'=>100, 'filter'=>false), NULL) ); break; case 'triggers': return array( 'title'=>'Triggers', 'object'=>'triggers', 'show_id'=>1, 'action_type'=>2, 'hide_record_one'=>1, 'split'=>'triggers_rules', 'split_standard'=>'', 'profile'=>'ADMIN_SYSTEM', 'split_view_name'=>'View Rules', 'fields'=>array( 'description'=>array( 'name'=>'Description', 'type'=>'textbox', 'size'=>30), 'type'=>array( 'name'=>'Type', 'type'=>'select', 'func'=>'select_triggers_types', 'view_params'=>array(1)), NULL) ); break; case 'triggers_users': return array( 'title'=>'User Triggers', 'object'=>'triggers_users', 'show_id'=>0, 'action_type'=>1, 'filter_by_user'=>'user_id', 'filter_field'=>'user_id', 'fields'=>array( 'trigger_id'=>array( 'name'=>'Trigger', 'type'=>'select', 'func'=>'select_triggers', 'size'=>30, 'view'=>'trigger_description'), 'active'=>array( 'name'=>'Active', 'type'=>'checkbox'), NULL) ); break; case 'triggers_users_admin': return array( 'title'=>'User Triggers', 'object'=>'triggers_users', 'show_id'=>1, 'action_type'=>1, 'profile'=>'ADMIN_USERS', 'fields'=>array( 'user_id'=>array( 'name'=>'Username', 'type'=>'select', 'func'=>'select_users', 'size'=>30, 'view'=>'user_description'), 'trigger_id'=>array( 'name'=>'Trigger', 'type'=>'select', 'func'=>'select_triggers', 'size'=>30, 'view'=>'trigger_description'), 'active'=>array( 'name'=>'Active', 'type'=>'checkbox'), NULL) ); break; case 'hosts_config_types': return array( 'title'=>'Host Config Commands', 'object'=>'hosts_config_types', 'show_id'=>1, 'action_type'=>1, 'hide_record_one'=>1, 'profile'=>'ADMIN_SYSTEM', 'fields'=>array( 'description'=>array( 'name'=>'Description', 'type'=>'textbox','size'=>60), 'command'=>array( 'name'=>'Command', 'type'=>'textbox','size'=>30), NULL) ); break; case 'interface_types_field_types': return array( 'title'=>'Interface Field Types', 'object'=>'interface_types_field_types', 'show_id'=>1, 'action_type'=>1, 'hide_record_one'=>1, 'profile'=>'ADMIN_SYSTEM', 'fields'=>array( 'description'=>array( 'name'=>'Description', 'type'=>'textbox','size'=>30), 'handler'=>array( 'name'=>'Handler', 'type'=>'textbox','size'=>30), NULL) ); break; case 'interface_types_fields': return array( 'title'=>'Interface Type Fields', 'object'=>'interface_types_fields', 'show_id'=>1, 'action_type'=>1, 'hide_record_one'=>1, 'profile'=>'ADMIN_SYSTEM', //add filter 'filter_field'=>'itype', 'fields'=>array( 'description'=>array( 'name'=>'Description', 'type'=>'textbox','size'=>30), 'name'=>array( 'name'=>'Internal Name', 'type'=>'textbox','size'=>30, 'filter'=>false), 'pos'=>array( 'name'=>'Position', 'type'=>'textbox','size'=>3), 'itype'=>array( 'name'=>'Interface Type', 'type'=>'select', 'func'=>'select_interface_types', 'view'=>'itype_description', 'size'=>30), 'ftype'=>array( 'name'=>'Field Type', 'type'=>'select', 'func'=>'select_interface_types_field_types', 'view'=>'ftype_description', 'size'=>30), 'showable'=>array( 'name'=>'Show', 'type'=>'select', 'func'=>'select_interface_types_field_show', 'view_params'=>array(true)), 'overwritable'=>array( 'name'=>'Overwritable', 'type'=>'checkbox'), 'tracked'=>array( 'name'=>'Tracked', 'type'=>'checkbox'), 'default_value'=>array( 'name'=>'Default Value', 'type'=>'select', 'func'=>'interface_value_control', 'params_field'=>'ftype_handler', 'view_params'=>array(true), 'size'=>30), 'ftype_handler'=>array( 'name'=>'Field Type Handler', 'type'=>'hidden'), NULL) ); break; case 'tools': return array( 'title'=>'Tools', 'object'=>'tools', 'show_id'=>1, 'action_type'=>1, 'hide_record_one'=>1, 'profile'=>'ADMIN_SYSTEM', //add filter 'filter_field'=>'itype', 'fields'=>array( 'description'=>array( 'name'=>'Description', 'type'=>'textbox','size'=>30), 'name'=>array( 'name'=>'Internal Name', 'type'=>'textbox','size'=>30 , 'filter'=>false), 'pos'=>array( 'name'=>'Position', 'type'=>'textbox','size'=>3), 'itype'=>array( 'name'=>'Interface Type', 'type'=>'select', 'func'=>'select_interface_types', 'view'=>'itype_description', 'size'=>30), 'file_group'=>array( 'name'=>'File Group', 'type'=>'textbox','size'=>30), 'allow_set'=>array( 'name'=>'Allow Set', 'type'=>'checkbox'), 'allow_get'=>array( 'name'=>'Allow Get', 'type'=>'checkbox'), NULL) ); break; case 'hosts': return array( 'title'=>'Hosts', 'object'=>'hosts', 'show_id'=>1, 'action_type'=>3, 'hide_record_one'=>1, 'profile'=>'ADMIN_HOSTS', 'no_records_message'=>'No Hosts Found', 'include'=>'hosts', 'actions'=>array( 'edit'=> array('name'=> 'Edit Host'), 'delete'=> array('name'=> 'Delete Host'), 'view_interfaces'=> array('name'=> 'View Host Interfaces'), 'discovery'=> array('name'=> 'Manual Discovery'), 'fast_discovery'=> array('name'=> 'Manual Discovery w/o PortScan'), 'view_config'=> array('name'=> 'View Stored Configurations'), NULL ), 'fields'=>array( 'name'=>array( 'name'=>'Name', 'type'=>'textbox', 'size'=>20, 'filter'=>false), 'zone'=>array( 'name'=>'Zone', 'type'=>'select', 'func'=>'select_zones', 'view'=>'zone_description', 'size'=>'30'), 'ip'=>array( 'name'=>'IP Address', 'type'=>'textbox', 'size'=>15, 'filter'=>false), 'rocommunity'=>array( 'name'=>'R/O Community','type'=>'select', 'func'=>'snmp_options', 'size'=>20, 'view_params'=>array(1),'filter'=>false), 'rwcommunity'=>array( 'name'=>'R/W Community','type'=>'select', 'func'=>'snmp_options', 'size'=>20, 'view_params'=>array(1),'filter'=>false), 'autodiscovery'=>array( 'name'=>'AutoDiscovery Policy', 'type'=>'select','func'=>'select_autodiscovery', 'view'=>'autodiscovery_description', 'size'=>30), 'autodiscovery_default_customer'=> array( 'name'=>'AD Default Customer', 'type'=>'select','func'=>'select_clients', 'view'=>'default_customer_description', 'size'=>30), 'show_host'=>array( 'name'=>'Visibility', 'type'=>'select','func'=>'select_show_rootmap', 'view_params'=>array(1), 'size'=>30), 'poll'=>array( 'name'=>'Polling', 'type'=>'checkbox'), 'dmii'=>array( 'name'=>'Main Interface(s)', 'type'=>'select','func'=>'select_hosts_dmii', 'params_field'=>'id', 'view_params'=>array(1), 'size'=>30, 'filter'=>false), 'tftp'=>array( 'name'=>'TFTPd Server IP', 'type'=>'textbox', 'size'=>15), 'config_type'=>array( 'name'=>'Config Transfer Mode', 'type'=>'select','func'=>'select_hosts_config_types', 'view'=>'config_type_description', 'size'=>50), 'ip_tacacs'=>array( 'name'=>'Tacacs+ Source IP', 'type'=>'textbox', 'size'=>15, 'filter'=>false), //'satellite'=>array( 'name'=>'Satellite', 'type'=>'select','func'=>'select_satellites', 'view'=>'satellite_description', 'size'=>30), //'lat'=>array( 'name'=>'Latitude', 'type'=>'textbox', 'size'=>20, 'filter'=>false), //'lon'=>array( 'name'=>'Longitude', 'type'=>'textbox', 'size'=>20, 'filter'=>false), 'sysobjectid'=> array('name'=>'SysObjectId', 'type'=>'textbox', 'size'=>20, 'filter'=>false ), 'poll_interval'=>array( 'name'=>'Poll Interval', 'type'=>'select', 'func'=>'select_host_poll_interval', 'view_params'=>array(1)), 'creation_date'=>array( 'name'=>'Creation Date', 'type'=>'select', 'func'=>'show_unix_date', 'size'=>40, 'filter'=>false ), 'modification_date'=>array( 'name'=>'Modification Date', 'type'=>'select', 'func'=>'show_unix_date', 'size'=>40, 'filter'=>false ), 'last_poll_date'=>array( 'name'=>'Last Poll Date', 'type'=>'select', 'func'=>'show_unix_date', 'size'=>40, 'filter'=>false ), 'last_poll_time'=>array( 'name'=>'Last Poll Duration', 'type'=>'select', 'func'=>'time_hms', 'size'=>40, 'filter'=>false), NULL) ); break; case 'users': return array( 'title'=>'Users', 'object'=>'users', 'show_id'=>1, 'action_type'=>3, 'hide_record_one'=>1, 'no_records_message'=>'No Users Found', 'filter_by_user'=>'id', 'include'=>'users', 'actions'=>array( 'edit'=> array('name'=> 'Edit User'), 'delete'=> array('name'=> 'Delete User'), 'view_profile'=> array('name'=> 'View User Profile'), 'view_triggers'=> array('name'=> 'View User Triggers'), NULL ), 'hidden_fields'=>array('old_passwd'), 'fields'=>array( 'usern'=>array( 'name'=>'Username', 'type'=>'select', 'size'=>20, 'func'=>'select_usern', 'filter'=>false, 'view_params'=>array(1)), 'new_passwd'=>array( 'name'=>'Password', 'type'=>'select', 'size'=>20, 'view'=>'(Encrypted)', 'func'=>'textbox', 'filter'=>false), 'fullname'=>array( 'name'=>'Full Name', 'type'=>'textbox', 'size'=>30, 'filter'=>false), 'router'=>array( 'name'=>'Router Access','type'=>'checkbox'), NULL) ); break; case 'journals': return array( 'title'=>'Journals', 'object'=>'journal', 'profile'=>'VIEW_REPORTS', 'no_records_message'=>'No Journals Found', 'include'=>'journals', 'disable_add'=>true, 'action_type'=>3, 'actions'=>array( 'edit'=> array('name'=> 'Edit'), 'delete'=> array('name'=> 'Delete'), 'view'=> array('name'=> 'View'), NULL ), 'fields'=>array( 'subject'=>array( 'name'=>'Subject', 'type'=>'textbox', 'size'=>20, 'filter'=>false), 'ticket'=>array( 'name'=>'Ticket', 'type'=>'textbox', 'size'=>20, 'filter'=>false), 'active'=>array( 'name'=>'Active', 'type'=>'checkbox'), 'date_start'=>array( 'name'=>'Start Date', 'type'=>'textbox', 'size'=>20, 'filter'=>false), 'date_stop'=>array( 'name'=>'Stop Date', 'type'=>'textbox', 'size'=>20, 'filter'=>false), NULL) ); break; /* $structures['satellites'] = array( 'title'=>'Satellites', 'object'=>'satellites', 'show_id'=>1, 'action_type'=>1, 'no_records_message'=>'No Satellites Found', 'profile'=>'ADMIN_HOSTS', 'include'=>'satellites', 'fields'=>array( 'description'=>array( 'name'=>'Description', 'type'=>'textbox', 'size'=>30, 'filter'=>false), 'parent'=>array( 'name'=>'Parent', 'type'=>'select', 'size'=>20, 'view'=>'parent_description', 'func'=>'select_satellites', 'filter'=>false), 'url'=>array( 'name'=>'Satellite URI, Full Path to /admin/satellite.php', 'type'=>'textbox', 'size'=>60, 'filter'=>false), 'sat_group'=>array( 'name'=>'Group', 'type'=>'select', 'size'=>20, 'view'=>'group_description', 'func'=>'select_satellites_groups'), 'sat_type'=>array( 'name'=>'Type', 'type'=>'select', 'size'=>20, 'func'=>'select_satellites_types', 'view_params'=>array(1)), NULL) ); */ case 'logfiles_match_items': return array( 'title'=>'Log File Matches', 'object'=>'logfiles_match_items', 'show_id'=>1, 'action_type'=>1, 'no_records_message'=>'No Log File Match Items Found', 'profile'=>'ADMIN_HOSTS', 'filter_field'=>'logfile_id', 'fields'=>array( 'description'=>array('name'=>'Description', 'type'=>'textbox', 'size'=>30, 'filter'=>false), 'pos'=>array( 'name'=>'Position', 'type'=>'textbox','size'=>3), 'logfile_id'=>array( 'name'=>'Log File', 'type'=>'select', 'func'=>'select_logfiles', 'view'=>'logfile_description', 'size'=>30), 'match_text'=>array('name'=>'Text Match', 'type'=>'textbox', 'size'=>40, 'filter'=>false), 'host'=>array('name'=>'Host Field', 'type'=>'textbox', 'size'=>10, 'filter'=>false), 'interface'=>array('name'=>'Interface Field', 'type'=>'textbox', 'size'=>10, 'filter'=>false), 'username'=>array( 'name'=>'Username Field', 'type'=>'textbox', 'size'=>10, 'filter'=>false), 'state'=>array( 'name'=>'State Field', 'type'=>'textbox', 'size'=>10, 'filter'=>false), 'info'=>array( 'name'=>'Extra Info Field', 'type'=>'textbox', 'size'=>10, 'filter'=>false), 'type'=>array( 'name'=>'Event Type', 'type'=>'select', 'func'=>'select_event_types', 'view'=>'types_description', 'size'=>30), NULL) ); break; case 'logfiles': return array( 'title'=>'Log Files', 'object'=>'logfiles', 'show_id'=>1, 'action_type'=>2, 'hide_record_one'=>0, 'split'=>'logfiles_match_items', 'split_standard'=>1, 'split_view_name'=>'Items', 'no_records_message'=>'No Log Files Found', 'profile'=>'ADMIN_HOSTS', 'fields'=>array( 'description'=>array('name'=>'Description', 'type'=>'textbox', 'size'=>30), 'filename'=>array('name'=>'Filename', 'type'=>'textbox', 'size'=>60, 'filter'=>false), NULL) ); break; default: die(display_error('Admin Structure Not Found',"JFFNMS attempted to find a structure called '$struct_name' but was unable to. This is generally an internal error.")); } } ?> jffnms-0.9.3/htdocs/admin/adm/adm_nad.php0000644000175000017500000002511211716447477017552 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ require_once('../../auth.php'); $Zones = new JffnmsZones(); function nad_graph_get(&$nad, $host_id, $graph_params) { global $Config; $params["get_data"]=true; $graph = $nad->graph($graph_params); if (count($graph) > 1) { list ($graph_data, $cmap, $data) = $graph; $url = $GLOBALS["REQUEST_URI"]; $cmap = preg_replace ("/href=\"N(\d+)\"/", "href='".$url."&nad_type=net&nad_id=\$1'", $cmap); $cmap = preg_replace ("/href=\"H(\d+)\"/", "href='".$url."&nad_type=host&nad_id=\$1'", $cmap); $cmap = preg_replace ("/href=\"I(\d+)\"/", "href='".$url."&view_type=html&nad_type=host&nad_id=\$1'", $cmap); $path_real = $Config->get('images_real_path'); $path_rel = $Config->get('images_rel_path'); $file_name = uniqid('map').'.png'; $file_real = $path_real."/".$file_name; $file_rel = $path_rel."/".$file_name; $fp = fopen($file_real,"w+"); fputs($fp, $graph_data); fclose($fp); return array($cmap, $file_rel); } else return false; } function nad_ip_protocol($protocol_id) { $protocols = array(1=>'ICMP', 6=>'Ethernet', 22=>'Serial', 23=>'PPP', 32=>'Frame Relay', 106=>'ATM', 159=>'ATM', 24=>'Loopback', 53=>'PortChannel'); if (array_key_exists($protocol_id, $protocols)) return $protocols[$protocol_id]; return "Unknown ($protocol_id)"; } function nad_view_host($host_id, $host, &$ips, &$ints) { $host_ips = array(); $ip_types = array(); foreach ($host['ips'] as $net=>$net_ips) foreach ($net_ips as $ip) if (ip2long($ip)!=-1) { $nets .= tr(array( linktext($net, $GLOBALS["REQUEST_URI"]."&nad_type=net&nad_id=".$net), $ip, (!empty($ips[$ip]["dns"])?$ips[$ip]["dns"]:" "), nad_ip_protocol($ips[$ip]["type"])) ); $host_ips[] = $ip; $ip_types[$ip] = $ips[$ip]["type"]; } reset($ints); $found_ips = array(); while (list ($id, $data) = each ($ints)) if (in_array($data['address'], $host_ips)) $found_ips[$data['address']]=array('interface'=>$id, 'host'=>$data['host']); $found_text_aux = array(); foreach ($found_ips as $ip=>$data) $found_text_aux[$data["host"]] = " as Host ". linktext($ints[$data["interface"]]["host_name"]." ".$ints[$data["interface"]]["zone_shortname"] , "adm_standard.php?admin_structure=hosts&filter=".$data["host"]); $found_text = join($found_text_aux, " or "); $best_ip = nad_best_ip($ip_types); $add_url = "adm_standard.php?admin_structure=hosts&action=add". "&ip=".$best_ip. "&zone=".$host["zone"]. "&rocommunity=".$host["snmp_community"]. "&name=". trim(substr(join(" ", array_values(array( $host["snmp_name"], substr($host["description"], 0, 20), $ips[$best_ip]["dns"]))),0,60)); echo tr( table("","host"). tr("Host Information", "header", 2). tr(array("Name", $host["snmp_name"]), array("field", "data")). tr(array("Description", $host["description"]),array("field","data")). tr(array("Date Added", date("Y-m-d H:i:s", $host["date_added"])), array("field", "data")). tr(array("Forwards IP Packets",(($host["forwarding"]==1)?"Yes":"No")), array("field", "data")). tr(array("Already Added",(count($found_ips)==0) ?"No, ".linktext("Add it", $add_url) :"Yes, ".$found_text), array("field", "data")). tr("IP Addresses", "header", 2). tr( table("ips"). tr(array("Network", "IP", "DNS", "Type"), "header"). $nets. table_close(), "", 2). table_close() ); } function nad_view_network ($network, $net, &$hosts, &$ips) { foreach ($net["hosts"] as $host_id) { $host = $hosts[$host_id]; foreach ($host["ips"][$network] as $ip) $hosts_data[$ip] = tr_open("","host"). td (linktext($ip, $GLOBALS["REQUEST_URI"]."&nad_type=host&nad_id=".$host_id), "ip"). td (!empty($ips[$ip]["dns"])?$ips[$ip]["dns"]:" ","dns"). td (!empty($host["snmp_name"])?$host["snmp_name"]:" "). tag_close("tr"); } $host_ips = array_keys($hosts_data); natsort($host_ips); foreach ($host_ips as $ip) $output .= $hosts_data[$ip]; echo tr ( table("net"). table_row("Network ".$network." Hosts", "header" , 3 ,"", false). tr_open("","header"). td("IP","ip").td("DNS").td("SNMP Name"). tag_close("tr"). $output. table_close()); } function nad_view_networks($networks) { $cell_max = 3; $output = table("nets"). table_row("Discovered Networks", "header", $cell_max, "", false); $cant = count($networks); $network_names = array_keys($networks); natsort($network_names); foreach ($network_names as $network) { $net_data = $networks[$network]; if ($cell==0) $output .= tr_open(); $output .= td(linktext( $network, $GLOBALS["REQUEST_URI"]."&nad_type=net&nad_id=".$network). " has ".html("b",count($net_data["hosts"]))." Hosts"); $cell++; $shown ++; if ($cell==$cell_max) { $output .= tag_close("tr"); $cell = 0; } } $output .= table_close(); echo tr($output); return $shown; } function nad_best_ip ($host_ips) { switch (true) { case (false !== ($res = array_search(22, $host_ips))): case (false !== ($res = array_search(23, $host_ips))): case (false !== ($res = array_search(32, $host_ips))): case (false !== ($res = array_search(106, $host_ips))): case (false !== ($res = array_search(156, $host_ips))): case (false !== ($res = array_search(6, $host_ips))): case (false !== ($res = array_search(53, $host_ips))): $ip = $res; break; default: $ip = current(array_keys($host_ips)); break; } return $ip; } { $action = $Sanitizer->get_string('action', 'view'); $view_type = $Sanitizer->get_string('view_type', 'html'); $filter = $Sanitizer->get_string('filter'); $host_id = $Sanitizer->get_string('host_id'); $zone = $Sanitizer->get_string('zone',0); $nad_type = $Sanitizer->get_string('nad_type'); $nad = new JffnmsNad(); $view_all = true; switch ($action) { case 'view' : nad_print_table_header($view_type, $zone); if (!is_numeric($zone) && is_numeric($filter)) $zone = $filter; $params = array(); if ($nad_type=='host') $params['host_id'] = $nad_id; if ($nad_type=='net') $params['net_id'] = $nad_id; if (!empty($view_all)) $params['view_all']= $view_all; if ($zone!=='0') $params['zone']=$zone; $params['bgcolor'] = 'white'; if ($view_type == 'map') { $result = nad_graph_get($nad, $host_id, $params); if (is_array($result)) { list ($cmap, $file_rel) = $result; echo tr( tag("img", "map", "", "src='".$file_rel."' usemap='#map'", false). html("map", $cmap, "", "", "name='map'") ); } else echo tr('Error','error'); } else { $data = $nad->get_data($params); if (empty($nad_type)) { if (!empty($host_id)) { $nad_type = 'host'; $nad_id = $host_id; } if (!empty($net_id)) { $nad_type = 'net'; $nad_id = $net_id; } } list ($hosts, $ips, $networks, $net_ids) = $data; $shown = 0; if (is_array($networks)) switch ($nad_type) { case 'host': $interfaces = $jffnms->get('interfaces'); $ints = $interfaces->get_all(NULL,array('type'=>4)); if (isset($hosts[$nad_id])) { $host = $hosts[$nad_id]; nad_view_host ($nad_id, $host, $ips, $ints); $shown++; } break; case 'hosts': if (is_array($hosts)) { $interfaces = $jffnms->get('interfaces'); $ints = $interfaces->get_all(NULL,array('type'=>4)); foreach ($hosts as $host_id=>$host) if (($only_snmp==0) || !empty($host['snmp_community'])) { echo tr_open("", "hosts"); nad_view_host ($host_id, $host, $ips, $ints); echo tag_close("tr"); $shown++; } } break; case 'net': if (is_numeric($nad_id)) { $nets_id = array_rekey ($networks, 'id', 'network'); $network = $nets_id[$nad_id]['network']; } else { $nets_id = &$networks; $network = $nad_id; } if (isset($nets_id[$nad_id])) { nad_view_network ($network, $networks[$network], $hosts, $ips); $shown++; } break; case "nets": default: $shown += nad_view_networks($networks); break; }//switch nad_type else echo tr ("Error", "error"); if ($shown==0) echo tr("No Items Found", "error"); }//view_type != map echo table_close(); adm_footer(); break; } // switch action adm_footer(); } function nad_print_table_header($view_type, $zone) { global $Sanitizer; $url = $Sanitizer->get_url('', array('filter')); adm_header('Network Discovery'); echo script(" function change_zone(select){ var zone = select.options[select.selectedIndex].value; location.href = location.href+'&zone='+zone; return true; }"). table('nad'). tr('Network Discovery', 'title'). tr( "Zone: ".select_zones("zone", $zone, array(0=>"All Zones"),"javascript: change_zone(this);"). control_button("Networks", "", $url."&nad_type=nets&nad_id=", "world.png"). control_button("All Hosts", "", $url."&nad_type=hosts&view_type=html&only_snmp=0","host.png"). control_button("SNMP Hosts", "", $url."&nad_type=hosts&view_type=html&only_snmp=1","host.png"). (($view_type=="html") ?control_button("Map View", "", $url."&view_type=map","map2.png") :control_button("Text View", "", $url."&view_type=html", "text.png")). control_button("Refresh", "", $url,"refresh2.png"). control_button("Config", "", "adm_standard.php?admin_structure=zones&action=edit&filter=".$zone."&actionid=".$zone,"tool.png") , "options"); } ?> jffnms-0.9.3/htdocs/admin/adm/adm_profiles.php0000644000175000017500000000717111716447477020640 0ustar csmallcsmall JFFNMS Authors * This program is licensed under the GNU GPL, full terms in the LICENSE file */ include ('../../auth.php'); { global $Sanitizer; $Profiles = new JffnmsProfiles(); $ProfilesOptions = new JffnmsProfiles_options(); $ProfilesValues = new JffnmsProfiles_values(); adm_header('Profiles'); $action = $Sanitizer->get_string('action','list'); $actionid = $Sanitizer->get_int('actionid'); $admin = profile('ADMIN_USERS'); $filter = $Sanitizer->get_string('filter'); $init = $Sanitizer->get_int('init'); $profiles_options_id = $Sanitizer->get_int('profiles_options_id'); $profiles_options_id_old = $Sanitizer->get_int('profiles_options_id_old'); $profiles_values_value = $Sanitizer->get_string('profiles_values_value'); $span = $Sanitizer->get_int('span'); $userid = $Sanitizer->get_int('userid'); $editid=0; if ($admin==false) $user_filter = array(array('auth.id','=',$_SESSION['auth_user_id'])); else $user_filter = array(); if ($action=='update') { $new_option_id = $Sanitizer->get_int('profiles_options_id'); $old_option_id = $Sanitizer->get_int('profiles_options_id_old'); $new_value = $Sanitizer->get_string('profiles_values_value'); if (!$ProfilesOptions->get_user($userid,$new_option_id)) { if ($old_option_id == 1) { $ProfilesOptions->del($userid,$old_option_id); //delete old one $Profiles->add($userid,$new_option_id); //add it } } else //the option already exists, modify it $ProfilesValues->modify($userid,$new_option_id,$new_value); $action='list'; } if (($action=='add') && ($admin)) { if (!$filter) $filter =1; $editid = $Profiles->add($filter,1); $action = 'edit'; } if (($action=='delete') && ($admin)) { $Profiles->del($actionid); $action = 'list'; } if ($action=='edit') $editid = $actionid; $cant = $Profiles->get($filter, $user_filter); echo adm_table_header('Profiles', $init, $span, 3, $cant, 'admin_profiles', true). tag('tr','','header'). td ('Action', 'field', 'action'). td ('Option', 'field'). td ('Value', 'field'). tag_close('tr'). tag('tbody'); $Profiles->slice($init,$span); $row=0; while ($rec = $Profiles->fetch()) { echo tr_open("row_".$rec["id"],(($editid==$rec["id"])?"editing":((($row++%2)!=0)?"odd":""))); if (($editid==$rec['id']) && (($rec['editable']==1) || ($admin))) { adm_form('update'); echo hidden('userid',$rec['userid']). hidden('profiles_options_id_old',$rec['profile_option']). td(adm_standard_submit_cancel("Save","Discard"), "action"). td((($rec['profile_option']==1) ?select_profiles_options('profiles_options_id',$rec['profile_option']) :hidden('profiles_options_id',$rec['profile_option']).$rec['description'])). td( (($rec['type']=='select') ?select_profiles_values('profiles_values_value',$rec['profile_option'],$rec['values_value']):''). (($rec["type"]=="text") ?textbox('profiles_values_value',$rec['values_value'],20):'')). form_close(); } else if (($rec['show_in_profile']==1) || ($admin)) echo adm_standard_edit_delete($rec['id'],$filter, false). td ($rec['description'], 'field'). td ( (($rec['type']=='select')?$rec['values_description']:''). (($rec['type']=='text')?$rec['values_value']:''), 'field'); echo tag_close("tr"); } echo tag_close("tbody"). table_close(); adm_footer(); } ?> jffnms-0.9.3/htdocs/admin/adm/adm_interfaces.php0000644000175000017500000004260511721261642021121 0ustar csmallcsmallget_string('action'); $init = $Sanitizer->get_int('init',0); $span = $Sanitizer->get_int('span',20); $host_id = $Sanitizer->get_int('host_id', FALSE); $interface_id = $Sanitizer->get_string('interface_id'); $actionid = $Sanitizer->get_string('actionid',$interface_id, TRUE); $filter = $Sanitizer->get_string('filter', $host_id); $add_to_map_id = $Sanitizer->get_int('add_to_map_id', 1); $use_interfaces = $Sanitizer->get_string('use_interfaces'); $type_id = $Sanitizer->get_int('type_id', FALSE); if (!is_array($use_interfaces)) $use_interfaces = explode(',', $use_interfaces); adm_header('Interfaces'); echo script (" function check(field_aux) { field=document.forms[0].elements[field_aux]; for (i = 0; i < field.length; i++) { if (field[i].checked==true) field[i].checked = false; else field[i].checked = true; } return true; } "); $fields_init = array ( 'action' =>array('description'=>'Action', 'showable'=>1, 'overwritable'=>0), 'id' =>array('description'=>'ID', 'showable'=>1, 'overwritable'=>0), 'host' =>array('description'=>'Host', 'default_value'=>1, 'showable'=>1, 'overwritable'=>1), 'type' =>array('description'=>'Type', 'default_value'=>1, 'showable'=>0, 'overwritable'=>1), 'interface' =>array('description'=>'Interface Name', 'showable'=>1, 'overwritable'=>1) ); $fields_end = array ( 'row_filler' =>array('description'=>'Row Filler', 'showable'=>1, 'overwritable'=>0), 'client' =>array('description'=>'Customer', 'default_value'=>1, 'showable'=>1, 'overwritable'=>1), 'poll' =>array('description'=>'Poller Group', 'default_value'=>1, 'showable'=>1, 'overwritable'=>1), 'check_status' =>array('description'=>'Check Status', 'default_value'=>1, 'showable'=>1, 'overwritable'=>1), 'sla' =>array('description'=>'SLA', 'default_value'=>1, 'showable'=>1, 'overwritable'=>1), 'make_sound' =>array('description'=>'Enable Sound?', 'default_value'=>0, 'showable'=>1, 'overwritable'=>1), 'show_rootmap' =>array('description'=>'Show', 'default_value'=>0, 'showable'=>1, 'overwritable'=>1), 'poll_interval' =>array('description'=>'Polling Interval', 'default_value'=>0, 'showable'=>1, 'overwritable'=>1), 'creation_date' =>array('description'=>'Creation Date', 'showable'=>1, 'overwritable'=>0), 'modification_date'=>array('description'=>'Modification Date', 'showable'=>1, 'overwritable'=>0), 'last_poll_date'=>array('description'=>'Last Poll Date', 'showable'=>1, 'overwritable'=>0) ); $Interfaces = new JffnmsInterfaces(); $Hosts = new JffnmsHosts(); if (!$action) $action_select['update'] = 1; else { $action_select['update'] = ''; $action_select[$action] = 1; } // This doesnt have edit or list, which come later switch ($action) { case 'add': if (!$host_id) $host_id = 1; $interface_id = $Interfaces->add($host_id); $actionid=array($interface_id); $action='edit'; $old_action = 'add'; break; case 'update': adm_interfaces_update_local($Interfaces, $actionid); $action='list'; break; case 'bulkadd': list($action, $actionid, $use_interfaces) = adm_interfaces_bulkadd($Interfaces); $action_select['update']=1; $clean_url = $Sanitizer->get_url('', 'all', array('use_interfaces'=> $use_interfaces), array('bulk_add_ids', 'bulk_add')); break; case 'delete': if (is_array($actionid)) foreach ($actionid as $id) if (is_numeric($id)) $Interfaces->del($id); $action='list'; break; case 'map': if ($add_to_map_id > 1) { $MapsInterfaces = new JffnmsMaps_interfaces(); $map_list = $MapsInterfaces->get_all($add_to_map_id); if (is_array($actionid)) foreach ($actionid as $id) if (is_numeric($id)) { $ok = 1; foreach ($map_list as $aux) if ($aux['interface']==$id) $ok = 0; if ($ok==1) $MapsInterfaces->add($add_to_map_id,$id); } unset($map); $action='list'; } break; } $max_fields = 50; $filters = reports_make_interface_filter($use_interfaces,0); $filters['with_field_type'] = 1; if (isset($filter)) $filters['host'] = $filter; $interface_count = $Interfaces->get($use_interfaces, $filters); echo adm_table_header('Interfaces', $init, $span, $max_fields, $interface_count, 'admin_interfaces', false); if ($interface_count > 0) { $types_fields = $Interfaces->fetch(); $interface_count--; $num_fields = array(); foreach ($types_fields as $it=>$fds) { $num_fields[$it] = 0; foreach ($fds as $fd) if ($fd['showable'] > 0) $num_fields[$it]++; } if (is_array($num_fields)) $fields_end['row_filler']['max'] = max($num_fields); else $fields_end['row_filler']['max'] = 0; unset ($it); unset ($fds); unset ($fd); $Interfaces->slice($init,$span); $old_interface_type = 0; $number_of_types = 0; echo adm_form('update', 'POST', '_self', false). reports_pass_options(); while ($register = $Interfaces->fetch()) { if ($register['type'] != $old_interface_type) { echo tag ('tbody','itype_'.$register['type']); $type_fields = array_merge($fields_init, (is_array($types_fields[$register["type"]])?$types_fields[$register["type"]]:array()), $fields_end); show_header ($type_fields, $register,$num_fields[$register['type']]); $row = 0; $old_interface_type = $register['type']; $number_of_types++; } if ($actionid && in_array($register['id'],$actionid) && $action=='edit') $edit = 1; else $edit = 0; echo tr_open('row_'.$register['id'],($edit)?'editing':((($row++%2)!=0)?'odd':'')); show_values ($type_fields,$register,$edit,$actionid,$interface_count,$num_fields[$register['type']]); echo tag_close("tr"); } echo tag_close('tbody'); if (($action!='edit') && ($interface_count > 1)) //multiple editor { if ($number_of_types > 1) { $multiple_edit_fields = array_merge($fields_init, $fields_end); $old_interface_type=''; //to show all field types (sla, poll) } else $multiple_edit_fields = $type_fields; table_row(' ','',$max_fields); echo tr_open('multi_editor'); show_values ($multiple_edit_fields,array('type'=>$old_interface_type),1,0,0,$num_fields[$old_interface_type]); echo tag_close('tr'). tr_open('multi_editor_checkboxes'); show_multiple_edit_boxes($multiple_edit_fields,$num_fields[$old_interface_type]); echo tag_close('tr'); } if ($interface_count > 0) //if theres an interface listed { if ($action != 'edit') //if we are in edit mode { $action_map = 0; if (array_key_exists('map', $action_select)) $action_map = $action_select['map']; echo tr_open ('options'). td ((($interface_count == 1) //if the other option arent showing, show a Submit button ?adm_form_submit('Add To Map').br().hidden('action','map') :radiobutton('action',$action_map,'map').'Add to Map:'.br()) ,"field","add_to_map"). td(select_maps("add_to_map_id",$add_to_map_id),"field","add_to_map_select",2). td(linktext("View Map", $Config->get('jffnms_rel_path')."/admin/adm/adm_standard.php?admin_structure=maps_interfaces&filter=".$add_to_map_id), "field","view_map"); td(" ","row_filler","",$max_fields-5). tag_close("tr"); } interfaces_print_shortcuts($use_interfaces, $max_fields); } } else table_row('No Interfaces Found','no_records_found',$max_fields); echo table_close(). form_close(); adm_footer(); function show_header($fields,$sample_data = array(),$number_of_showable_fields = 0) { global $Sanitizer; $clean_url = $Sanitizer->get_url('', 'all', FALSE, array('bulk_add_ids', 'bulk_add')); echo tr_open('','header'); if (is_array($fields)) foreach ($fields as $field_name=>$data) if ($data['showable'] > 0) switch ($field_name) { case 'action' : echo td ( (is_numeric($GLOBALS["type_id"]) ?linktext('View all Types',$clean_url.'&type_id=&action=') :linktext($sample_data['type_description'],$clean_url.'&action=&type_id='.$sample_data['type'])) ,'type_filter'); break; case 'row_filler': $rows = $data['max']-$number_of_showable_fields; if ($rows > 0) echo td(' ','row_filler','',$rows); break; default: echo td($data['description'],'field','field_'.$field_name); }//switch echo tag_close('tr'); } function show_values ($fields,$values,$edit = 0, $ids = array(),$interface_count = 1, $number_of_showable_fields = 0) { if (is_array($fields)) foreach ($fields as $field_name=>$data) if ($data['showable'] > 0) { if (isset($values[$field_name])) $value = htmlspecialchars($values[$field_name]); else { if (array_key_exists('default_value', $data)) $value = $data['default_value']; else $value = ' '; } if ($edit) $content = get_interface_field_edit($field_name, $ids, $interface_count, $value, $values, $data, $number_of_showable_fields); else $content = get_interface_field($field_name, $ids, $interface_count, $value, $values, $data ,$number_of_showable_fields); if ($content) echo td($content, "field", "field_".$field_name); if (($edit==1) && ($interface_count!=0) && ($data["overwritable"]==1)) //normal one interface edit echo hidden("update_fields[]",$field_name); } } function show_multiple_edit_boxes ($fields, $number_of_showable_fields) { global $action_select; if (is_array($fields)) { foreach ($fields as $field_name=>$data) if ($data["showable"] > 0) { unset ($content); $rows = 1; switch ($field_name) { case 'action' : $action_delete = 0; if (array_key_exists('delete', $action_select)) $action_delete == $action_select['delete']; $content = radiobutton('action',$action_delete,'delete').'Delete'; break; case 'id': $content = 'Multiple'.br().'Edit'; break; case 'row_filler': $rows = $data['max']-$number_of_showable_fields; case 'creation_date' : case 'modification_date' : case 'last_poll_date' : if ($rows > 0) $content = ' 322'; break; default: $content = ($data['overwritable']==1) ?checkbox_value('update_fields[]',$field_name,0) :' '; }//switch if (!empty($content)) echo td ($content, 'field', 'field_'.$field_name, $rows); } } } function get_interface_field_edit($field_name, $ids, $cant, $value, $values, $data, $number_of_showable_fields) { global $action_select; switch ($field_name) { case 'action' : if ($cant != 0) { echo td (adm_standard_submit_cancel('Save','Discard'), 'action'); return FALSE; } else return adm_form_submit().br(). radiobutton('action',$action_select['update'],'update'). 'Update'; break; case 'id': if ($cant != 0) return checkbox_value('actionid[]',$value,1).' '.$value; return checkbox_value('','',false,true, "this.value=check('actionid[]');").' All'.br(); break; case 'host': return select_hosts('host', $value); break; case 'type': return select_interface_types($field_name,$value); break; case 'poll': return select_pollers_groups($field_name,$value,$values['type']); break; case 'interface': return textbox($field_name,$value,20); break; case 'client': return select_clients($field_name,$value); break; case 'sla': return select_slas($field_name,$value,$values['type']); break; case 'check_status': case 'make_sound': return checkbox($field_name,$value); break; case 'show_rootmap': return select_show_rootmap($field_name,$value,FALSE); break; case 'row_filler': $rows = $data['max']-$number_of_showable_fields; if ($rows > 0) echo td(' ','row_filler','',$rows); return ''; break; case 'poll_interval': return select_poll_interval($field_name,$value,FALSE); break; case 'creation_date' : case 'modification_date' : case 'last_poll_date' : if ($cant == 0) return ' '; return show_unix_date($values[$field_name]); break; default: switch ($data['type_handler']) { case 'bool' : //check box return checkbox($field_name,$value,1); break; case "text" : //text is the pseudo-default default: if ($data['overwritable'] == 1) return textbox($field_name, $value, 20); if (empty($value)) return ' '; return $value; break; } }//switch field_name return $value; } function get_interface_field($field_name, $ids, $cant, $value, $values, $data, $number_of_showable_fields) { global $filter; switch($field_name) { case 'action' : if ($cant != 0) { echo adm_standard_edit_delete($values['id'],$filter, false); return FALSE; } return adm_form_submit().br(). radiobutton('action',$GLOBALS['action_select']['update'],'update'). 'Update'; break; case 'id': if ($cant != 0) { $check = ((is_array($ids) && in_array($value,$ids) || ($cant==1))?1:0); return checkbox_value('actionid[]', $value, $check).' '.$value; } return checkbox_value('','',false,true, "this.value=check('actionid[]');").' All'.br(); break; case 'host': return $values['host_name'].' '.$values['zone_shortname']; break; case 'type': return $values['type_description']; break; case 'poll': return $values['poller_group_description']; break; case 'interface': return $values['interface']; break; case 'client': return $values['client_name']; break; case 'sla': return $values['sla_description']; break; case 'check_status': case 'make_sound': return checkbox($field_name,$value,0); break; case 'show_rootmap': return select_show_rootmap($field_name,$value,TRUE); break; case 'row_filler': $rows = $data['max']-$number_of_showable_fields; if ($rows > 0) echo td(' ','row_filler','',$rows); return ''; break; case 'poll_interval': return select_poll_interval($field_name,$value,TRUE); break; case 'creation_date' : case 'modification_date' : case 'last_poll_date' : if ($cant == 0) return ' '; return show_unix_date($values[$field_name]); break; default: switch ($data['type_handler']) { case 'bool' : //check box return checkbox($field_name,$value,FALSE); break; case 'text': //text is the pseudo-default default: if (empty($value)) return ' '; return $value; break; } } return $value; } function interfaces_print_shortcuts($use_interfaces, $max_fields) { global $Config, $Sanitizer; $jffnms_rel_path = $Config->get('jffnms_rel_path'); $copy_tags = array('host_id', 'name', 'actionid'); if (is_array($use_interfaces) && !$_SERVER["QUERY_STRING"]) $interfaces_url = "&use_interfaces[]=".join("&use_interfaces[]=",$use_interfaces); else $interfaces_url = ''; $shortcuts = array( array('graph.png', 'Performance', '/view_performance.php'), array('text.png', 'Report', '/admin/reports/state_report.php'), array('text.png', 'Alarms', '/admin/adm/adm_alarms.php'), ); $output = tr_open('shortcuts'); foreach($shortcuts as $shortcut) { $output .= td(linktext(image($shortcut[0], '', '', $shortcut[1]) . ' '.$shortcut[1], $Sanitizer->get_url($jffnms_rel_path.$shortcut[2],$copy_tags).$interfaces_url), '', '', 2); } echo $output. td(' ','row_filler','',$max_fields-4). tag_close('tr'); } function adm_interfaces_update_local(&$Interfaces, $actionid) { global $Sanitizer; if (!is_array($actionid)) return; $update_fields = $Sanitizer->get_string('update_fields'); if (!is_array($update_fields)) return; $data = array(); foreach ($update_fields as $field) $data[$field]=trim($Sanitizer->get_string($field)); foreach ($actionid as $id) if (is_numeric($id)) $Interfaces->update($id,$data); } function adm_interfaces_bulkadd(&$Interfaces) { global $Sanitizer; $use_interfaces = array(); $actionid = array(); $action = 'list'; $bulk_add_ids = $Sanitizer->get_int('bulk_add_ids'); $bulk_add = $Sanitizer->get_special('bulk_add'); #var_dump($bulk_add);echo "
that was sanitized
"; #var_dump($_POST['bulk_add']); if (is_array($bulk_add_ids) && is_array($bulk_add)) { foreach($bulk_add as $key => $data) if (in_array($key,$bulk_add_ids)) { $new_id = $Interfaces->add(array('host'=>$data['host'],'type'=>$data['type'])); //add $result = $Interfaces->update($new_id,$data); //update $use_interfaces[]=$new_id; $actionid[]=$new_id; } if (count($bulk_add_ids)==1) $action = 'edit'; } return array($action, $actionid, $use_interfaces); } // adm_interfaces_bulkadd ?> jffnms-0.9.3/htdocs/admin/adm/adm_users.inc.php0000644000175000017500000000204111735044260020675 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function users_action_view_profile() { adm_frame_menu_split('profiles'); } function users_action_view_triggers() { adm_frame_menu_split('triggers_users',1); } function users_action_update($api, $actionid) { global $Sanitizer; $usern = $Sanitizer->get_string('usern'); $router = $Sanitizer->get_string('router', '0'); $old_passwd = $Sanitizer->get_string('old_passwd'); $new_passwd = $Sanitizer->get_string('new_passwd'); $fullname = $Sanitizer->get_string('fullname'); if (profile('ADMIN_USERS') != 1) { $router = ''; $usern = ''; } if ($actionid == 'new' && !empty($usern)) $actionid = $api->add($usern); $api->modify($actionid, $usern, $old_passwd, $new_passwd, $fullname, $router); $GLOBALS['action']='list'; } function users_action_delete($api, $actionid) { if (profile('ADMIN_USERS')) $api->del($actionid); } ?> jffnms-0.9.3/htdocs/admin/adm/adm_standard.php0000644000175000017500000004541111716447477020614 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ // Get from _GET include ('../../auth.php'); require ('structures.php'); { $adm_view_type = $Sanitizer->get_string('adm_view_type','html'); $st_name = $Sanitizer->get_string('admin_structure'); $so = $Sanitizer->get_string('so'); $sf = $Sanitizer->get_string('sf'); $init = round($Sanitizer->get_int('init'),0); $span = round($Sanitizer->get_int('span'),20); $action = $Sanitizer->get_string('action'); $filter = $Sanitizer->get_string('filter'); $editid = $Sanitizer->get_string('editid'); $actionid = $Sanitizer->get_string('actionid'); $old_passwd = $Sanitizer->get_string('old_passwd'); $new_passwd = $Sanitizer->get_string('new_passwd'); $st = get_structure($st_name); $admin_users = profile('ADMIN_USERS'); $clean_url = $Sanitizer->get_url('','all', FALSE, array_merge(array_keys($st['fields']), array('action','actionid'))); $column_header_url = $Sanitizer->get_url('','all', FALSE, array_merge($st['fields'], array('action','sf','so'))); if ($adm_view_type!='html') $action = 'list'; if (array_key_exists('profile', $st) && $st['profile']) //Authorization { if (!array_key_exists('deny', $st) || !$st['deny']) $st['deny']='You dont have Permission to access this page.'; if (!profile($st["profile"])) die ('

'.$st['deny'].'

'); } if (!array_key_exists('no_records_message', $st)) $st['no_records_message'] = 'No Records Found'; if (array_key_exists('include',$st)) include_once('adm_'.$st['include'].'.inc.php'); $object_name = 'Jffnms'.$st['object']; $api = new $object_name(); if (function_exists($st_name.'_action_'.$action)) call_user_func_array($st_name.'_action_'.$action, array($api, $actionid)); switch ($action) { case 'list': unset ($actionid); break; case 'view': if ($st['action_type']==2) adm_frame_menu_split($st['split'],$st['split_standard']); break; case 'update' : if ($actionid=='new') { if (!array_key_exists('disable_add', $st)) { if (array_key_exists('filter_by_user', $st) && $st['filter_by_user'] && !$admin_users) $actionid = $api->add($_SESSION['auth_user_id']); else $actionid = $api->add($filter); } else die ('Add not Allowed'); } foreach($st['fields'] as $field_name=>$field_data) { if ($field_name == '') continue; switch ($field_data['type']) { case 'checkbox': if (isset($_POST[$field_name])) $data[$field_name] = $Sanitizer->get_string($field_name); else $data[$field_name] = 0; break; // FIXME This is not right case 'select': if (array_key_exists('params', $field_data) && $field_data['params'] > 1 && is_array($_POST[$field_name])) //size > 1 and array result { foreach ($_POST[$field_name] as $key=>$aux_value) if ($aux_value > 1) { if ($key==0) //Why ??? $api->update($actionid,array($field_name=>$aux_value)); else $api->add($filter,$aux_value); } } else { $data[$field_name] = $Sanitizer->get_string($field_name); if ($field_name == 'rocommunity' || $field_name == 'rwcommunity') $data[$field_name] = snmp_options_parse($Sanitizer->get_string($field_name)); } break; default: if (isset($_POST[$field_name])) { $data[$field_name] = $Sanitizer->get_special($field_name); if (is_string($data[$field_name])) $data[$field_name] = trim($data[$field_name]); } break; }//switch if (array_key_exists('filter_by_user',$st) && $field_name == $st['filter_by_user'] && !$admin_users) $data[$field_name]=$_SESSION['auth_user_id']; //filter by user }//foreach field //debug ($data); //debug ($actionid); $api->update($actionid, $data); $action='list'; break; case 'delete': if (isset($st['profile']) && !isset($st['filter_by_user'])) $api->del($actionid); $action='list'; break; case 'add': $record = $api->get_empty_record(); if (isset($st['add_filter_field'])) $record[$st["add_filter_field"]] = $filter; if (isset($st['filter_field'])) $record[$st['filter_field']] = $filter; $record['id'] = 'new'; foreach ($record as $field_name=>$aux) if (isset($_REQUEST[$field_name])) $record[$field_name]=$_REQUEST[$field_name]; $records = array($record); $actionid = $record["id"]; unset ($filter_field); unset ($filter_value); unset ($record); case 'edit': $editid = $actionid; break; default: $action = 'list'; } // switch action // Main Code $rows = 1; if ($st['show_id']) //add ID Field $st['fields'] = array_merge(array('id'=>array('name'=>'ID', 'type'=>'id')), $st['fields']); $rows += count($st['fields']); if (!isset($actionid) || $actionid!='new') { // OLD Filter handling if (isset($st['filter_field'])) $records = $api->get_all(NULL,array($st['filter_field']=>$filter)); else $records = $api->get_all($filter); } if (($action=='list') && ($adm_view_type=='html')) { // Filters // Get Filters Values $filter_fields = ''; while (list ($field, $data) = each ($st['fields'])) if ($data != NULL && array_key_exists('filter', $data) && $data['filter']!==false) $filter_fields[$field]=(isset($data['view'])?$data['view']:$field); $field_values = $api->field_values($filter_fields); // Render Filters HTML while (list($field, $values) = each ($field_values)) if (count($values) > 2) switch ($st['fields'][$field]['type']) { case 'checkbox': $filters[$field] = select_custom ('filter_'.$field, array(''=>'', '0'=>'Not Set', '1'=>'Set'), '-1',' javascript: filter(this);', 1, false, 'filter'); break; case 'colorbox': //Disable Color Box Filter break; case 'select': //Selects that does not have a View field (ie not from DB, like show_rootmap) //$filters[$field] = call_user_func_array($st["fields"][$field]["func"], array($field,$record[$field_name])); if (!isset($st['fields'][$field]['view'])) break; default: if ($field!='description') $filters[$field] = select_custom ('filter_'.$field, $values, (($field==$filter_field)?$filter_value:""), ' javascript: filter(this);', 1, false, 'filter'); break; } } //if its not new record or edit //Filter the Records if (!empty($filter_field) && ($filter_value!=="")) $records = array_record_search($records, $filter_field, $filter_value); // SORT Records if (!isset($sf) || !isset($so)) { if (isset($st['default_sort_field'])) $sf = $st['default_sort_field']; if (isset($st['default_sort_order'])) $so = $st['default_sort_order']; } if (isset($sf) && isset($so)) array_key_sort($records, array($sf=>(($so=='asc')?SORT_ASC:SORT_DESC))); $cant = count($records); $show_add = TRUE; if (array_key_exists('disable_add', $st) && $st['disable_add']) $show_add = FALSE; $adm_table_header = adm_table_header($st['title'], $init, $span, $rows, $cant, 'admin_'.$st_name, $show_add); if ($adm_view_type=='html') { //Draw Header adm_header($st['title']); echo $adm_table_header; if ($st['action_type']==3) echo script (" function go_action(select_name, link) { field = document.getElementById(link); if (field) { select = document.getElementById(select_name); value = select.options[select.selectedIndex].value; field.href = '".$clean_url."'+value; } }"); echo script (" function filter (select) { field = select.name.substr(7); value = select.options[select.selectedIndex].value; location.href = '".$clean_url."' + '&action=list&init=0&filter_field=' + field + '&filter_value=' + value; } function toggle_filter(field) { filter_field = document.getElementById('filter_'+field); filter_field.style.visibility = ((filter_field.style.visibility=='visible')?'hidden':'visible'); }"); echo tag('tr','','header'). td ('Action', 'field', 'action'); } //show only the init and span the user asked for if ($cant > 0 && isset($actionid) && $actionid!='new') $records = array_slice($records,$init,$span); foreach ($st['fields'] as $field_name=>$field_data) { if (!is_array($field_data) || ($field_data['type']=='hidden')) continue; switch ($adm_view_type) { case 'html': echo td( //ordering (($action=='list') ?linktext($field_data['name'], $column_header_url."&action=list&sf=".$field_name."&so=".((($sf==$field_name) && ($so=="asc"))?"desc":"asc") ,"","field") :$field_data['name']). //filter (((array_key_exists('filter', $field_data) && $field_data['filter']!==false) && ($field_name!=='id') && ($action=='list') && (isset($filters[$field_name]))) ?" ".linktext( image("filter3.png"),"javascript: toggle_filter('".$field_name."');"). " ".$filters[$field_name] :""), 'field','field_'.$field_name); break; case 'ascii': $ascii['fields'][$field_name]=$field_data['name']; break; }//switch }//foreach fields if ($adm_view_type=='html') echo tag_close('tr'). tag('tbody'); $shown = 0; $row=0; if ($cant > 0) { foreach($records as $record) { if (array_key_exists('hide_record_one', $st) && $st['hide_record_one'] == 1 && $record['id'] == 1) continue; if (isset($st['filter_by_user'])) { if ($record[$st['filter_by_user']] != $_SESSION['auth_user_id'] && !$admin_users) continue; if ($admin_users && (!empty($filter) && $record[$st['filter_by_user']] != $filter)) continue; } //debug ($record); $shown++; if ($adm_view_type=='html') echo tr_open('row_'.$record['id'],(($editid==$record['id'])?'editing':((($row++%2)!=0)?'odd':''))); if ($editid!=$record['id']) { if ($adm_view_type=='html') { switch($st['action_type']) { case 2: if (array_key_exists('split_view', $st)) $view_name = $st['split_view']; else $view_name = ''; echo adm_standard_edit_delete($record['id'],$filter, $view_name); break; case 3: echo td (action_dropdown('action_host', $record['id'], $st['actions'], $action), 'action'); break; default: echo adm_standard_edit_delete($record['id'],$filter, FALSE); break; } } if ($adm_view_type=='ascii') $ascii['data']['id'][$record['id']]=$record['id']; foreach ($st['fields'] as $field_name=>$field_data) if ($field_name) { unset ($control_value); $control_value = ''; switch ($field_data['type']) { case 'id': if ($adm_view_type == 'html') $control_value = linktext($record[$field_name], $clean_url."&action=list&init=0&filter=".$record[$field_name],"","field_id"); else $control_value = $record[$field_name]; break; case 'memobox': case 'textbox': if ($adm_view_type == 'html') $control_value = htmlspecialchars(substr($record[$field_name],0,$field_data["size"])); else $control_value = $record[$field_name]; break; case 'checkbox': if ($adm_view_type == 'html') $control_value = checkbox($field_name,$record[$field_name],0); else $control_value = (($record[$field_name]=="0")?"O":"X"); break; case 'select': if (!array_key_exists('params', $field_data)) $field_data['params'] = array(); if (!array_key_exists('view_params', $field_data)) $field_data['view_params'] = array(); if (array_key_exists('params_field', $field_data)) { if (!is_array($record[$field_data['params_field']])) $params_field = array($record[$field_data['params_field']]); else $params_field = $record[$field_data['params_field']]; } else $params_field = array(); if (isset($field_data["view"])) $control_value = (isset($record[$field_data["view"]]) ?(($adm_view_type=="html") ?htmlspecialchars(substr($record[$field_data["view"]],0,$field_data["size"])) :$record[$field_data["view"]]) :$field_data["view"]); else { if (isset($field_data['view_func'])) $view_function = $field_data['view_func']; else $view_function = $field_data['func']; $params = array_merge( array($field_name,$record[$field_name]), $params_field, $field_data['params'], $field_data['view_params']); //debug ($view_function); //debug ($params); $control_value = call_user_func_array ($view_function, $params); } break; case 'colorbox': if ($adm_view_type == 'html') $control_value = select_color($field_name,$record[$field_name],0); else $control_value = '#'.$record[$field_name]; break; default: if ($field_data['type']!='hidden') $control_value = $record[$field_name]; break; } //switch if ($adm_view_type=='html') echo td ($control_value, 'field',"field_$field_name"); elseif ($adm_view_type=='ascii') $ascii['data'][$field_name][$record['id']]=$control_value; } //foreach-if } else { //edit adm_form('update'); echo td (adm_standard_submit_cancel('Save','Discard'), 'action'); if (array_key_exists('hidden_fields',$st)) foreach ($st['hidden_fields'] as $hidden_field) echo hidden ($hidden_field, (array_key_exists($hidden_field,$record)?$record[$hidden_field]:'')); foreach ($st["fields"] as $field_name=>$field_data) if ($field_name) { unset ($control_value); switch ($field_data['type']) { case 'textbox': $control_value = textbox($field_name,$record[$field_name],$field_data["size"]); break; case 'memobox': $control_value = memobox($field_name,$field_data['height'],$field_data['width'],$record[$field_name]); break; case 'checkbox': $control_value = checkbox($field_name,$record[$field_name],1); break; case "select": // Don't execute Selects with params fields on new records if (($record['id']!='new') || !array_key_exists('params_field', $field_data) || !isset($record[$field_data['params_field']])) { if (!array_key_exists('params', $field_data) || !is_array($field_data['params'])) $field_data['params'] = array(); if (isset($field_data['params_field']) and array_key_exists($field_data['params_field'], $record)) { if (!is_array($record[$field_data['params_field']])) $params_field = array($record[$field_data['params_field']]); else $params_field = $record[$field_data["params_field"]]; } else $params_field = array(); if (array_key_exists($field_name, $record)) $aux_param = array_merge(array($field_name,$record[$field_name]),$field_data['params'],$params_field); else $aux_param = array_merge(array($field_name),$field_data['params'],$params_field); //debug ($aux_param); $control_value = call_user_func_array($field_data['func'],$aux_param); } else $control_value = 'Not Available'; break; case 'colorbox': $control_value = select_color($field_name,$record[$field_name],1); break; case 'hidden': $control_value = hidden($field_name, (array_key_exists($field_name, $record)?$record[$field_name]:'')); break; default: if ($field_data['type']!='hidden') $control_value = $record[$field_name]; break; } //switch echo td ($control_value, "field_$field_name"); } //foreach-if echo form_close(); } //edit if ($adm_view_type=='html') echo tag_close('tr'); if (array_key_exists('after_record_function', $st) && function_exists($st['after_record_function'])) call_user_func_array($st['after_record_function'], array($record)); } //if } // cant if ($shown==0) if ($adm_view_type=='html') table_row($st['no_records_message'],'no_records_found', $rows); if ($adm_view_type=='html') { echo tag_close('tbody'). table_close(); adm_footer(); } // ASCII Table Draw if (($adm_view_type=='ascii') && (is_array($ascii))) { echo header('Content-Type: text/plain'); $ascii_table = array(0=>'', 1=>''); while (list($field, $name) = each ($ascii['fields'])) { $max_size[$field] = 0; if (is_array($ascii['data'][$field])) foreach ($ascii['data'][$field] as $data) $max_size[$field] = (strlen($data) > $max_size[$field])?strlen($data):$max_size[$field]; $max_size[$field] = (strlen($name) > $max_size[$field])?strlen($name):$max_size[$field]; $ascii_table[0] .= "-+-".str_repeat("-",$max_size[$field]); $ascii_table[1] .= " | ".str_pad($name, $max_size[$field]," "); } $ascii_table[0] .= "-+"; $ascii_table[1] .= " |"; $ascii_table[3] = $ascii_table[0]; if (is_array($ascii['data'])) { $id_field = current(array_keys($ascii['data'])); foreach ($ascii['data'][$id_field] as $id) { $row++; $ascii_table[(3+$row)]=''; foreach ($ascii['fields'] as $field=>$aux) $ascii_table[(3+$row)] .= " | ".str_pad($ascii["data"][$field][$id], $max_size[$field]," "); $ascii_table[(3+$row)] .= " |"; } $ascii_table[] = $ascii_table[0]; } foreach ($ascii_table as $data) echo substr($data,1)."\n"; } } ?> jffnms-0.9.3/htdocs/admin/adm/adm_triggers_rules.php0000644000175000017500000001115211740444640022031 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ { require_once('../../auth.php'); $action = $Sanitizer->get_string('action'); $actionid = $Sanitizer->get_string('actionid'); $filter = $Sanitizer->get_string('filter'); $init = $Sanitizer->get_int('init',0); $span = $Sanitizer->get_int('span',20); if (!profile('ADMIN_SYSTEM')) die ('

You dont have Permission to access this page.

'); $TriggersRules = new JffnmsTriggers_rules(); adm_header('Triggers Rules'); $editid=0; switch ($action) { case 'update': $value = $Sanitizer->get_string('value',array(),TRUE); if (is_array($value)) $value = join($value,','); $update_data = array( //'trigger_id' => $Sanitizer->get_int('trigger_id'), 'pos' => $Sanitizer->get_int('pos'), 'field' => $Sanitizer->get_string('field'), 'operator' => $Sanitizer->get_string('operator'), 'value' => $value, 'action_id' => $Sanitizer->get_int('action_id',1), 'stop' => $Sanitizer->get_int('stop',0)); $action_params = $Sanitizer->get_string('action_params'); if (is_array($action_params)) { foreach ($action_params as $key=>$data) $aux[]="$key:$data"; $update_data['action_parameters']=join(",",$aux); } $TriggersRules->update($actionid,$update_data); $action="list"; break; case 'add': $actionid=$TriggersRules->add($filter); $action="edit"; break; case 'delete': $TriggersRules->delete($actionid); $action='list'; break; case 'edit': $editid = $actionid; break; } $cant = $TriggersRules->get($filter); echo adm_table_header("Triggers Rules", $init, $span, 13, $cant, "admin_triggers_rules", true). tag("tr","","header"). td ("Action", "field", "action"). td ("ID", "field"). td ("Position", "field"). td ("Field", "field","",2). td ("Operator", "field","",2). td ("Value", "field"). td ("Action", "field","",2). td ("Parameters", "field"). td ("if Match", "field"). td (" ", "field"). tag_close("tr"). tag("tbody"); $TriggersRules->slice($init,$span); $row=0; while ($rec = $TriggersRules->fetch()) { echo tr_open("row_".$rec["id"],(($editid==$rec["id"])?"editing":((($row++%2)!=0)?"odd":""))); if ($editid==$rec["id"]) { adm_form("update"); echo td(adm_standard_submit_cancel("Save","Discard"), "action"). td($rec["id"],"field", "field_id"). td(textbox("pos",$rec["pos"],5),"field"). td("if","field"). td(select_trigger_fields("field",$rec["field"],$rec["trigger_type"]),"field"). td("is","field"). ((($rec["field"]!="none") && ($rec["field"]!="any")) ?td(select_trigger_operator("operator",$rec["operator"]),"field"). td(select_trigger_fields_value("value",$rec["value"],$rec["trigger_type"],$rec["field"]),"field") :td(" ","field","",2)). td("then","field"). td(select_actions("action_id",$rec["action_id"]),"field"). td(($rec["action_id"]!=1) ?select_action_parameters("action_params",$rec["action_parameters"],$rec["action_parameters_def"],0) :" ","field"). td(select_stop_continue("stop",$rec["stop"]),"field"). td(select_and_or("and_or",$rec["and_or"]),"field"). form_close(); } else echo adm_standard_edit_delete($rec["id"],$filter, false). td($rec["id"],"field", "field_id"). td($rec["pos"],"field"). ((($rec["field"]!="none") && ($rec["field"]!="any")) ?td("if","field"). td(select_trigger_fields("field",$rec["field"],$rec["trigger_type"],1),"field"). td("is","field"). td(select_trigger_operator("operator",$rec["operator"],1),"field"). td(select_trigger_fields_value("value",$rec["value"],$rec["trigger_type"],$rec["field"]),"field") :(($rec["field"]=="any") ?td(" ","field","",5) :"")). ((($rec["field"]!="none") && ($rec["action_id"]!=1)) ?td("then","field"). td($rec["action_description"],"field"). td(select_action_parameters("action_params",$rec["action_parameters"],$rec["action_parameters_def"],1),"field") :td(" ","field","",3)). td(select_stop_continue("stop",$rec["stop"],1),"field"). td(select_and_or("and_or",$rec["and_or"],1),"field"); echo tag_close("tr"); } echo tag_close("tbody"). table_close(); adm_footer(); } ?> jffnms-0.9.3/htdocs/admin/adm/adm_journals.inc.php0000644000175000017500000000302011716447477021407 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ if (!empty($journal_button) && is_array($checkedid)) { $event_obj = $jffnms->get("events"); foreach ($checkedid as $event) $event_obj->set_ack($event,0); unset($event_obj); } function journals_action_view ($id) { $GLOBALS["st"]["after_record_function"] = "journals_action_real_view"; $GLOBALS["st"]["after_record_id"] = $id; $GLOBALS["filter"] = $id; } function journals_action_real_view($journal) { if ($journal["id"] == $GLOBALS["st"]["after_record_id"]) { echo tr_open("",""). tag("td","","","colspan=6"). table("journal_view"). table_row("Comments", "comments", "", 1, "", false). table_row(html("pre", $journal["comment"]), "", 1, "", false); $events_obj = $GLOBALS["jffnms"]->get("events"); $events = $events_obj->get_all(NULL,"",1,"",0,100,"desc", 1 ,1, $journal["id"]); if (count($events) > 0) { echo table_row("Events", "events", "", 1, "", false). tr_open("events"). tag("td"). table("body"); $GLOBALS["view_type"]="html"; foreach ($events as $event) show_event ($event, "", "", "" ,""); echo table_close(). tag_close("td"). tag_close("tr"); } echo table_close(). tag_close("td"). tag_close("tr"); unset ($GLOBALS["st"]["after_record_function"]); } } ?> jffnms-0.9.3/htdocs/admin/adm/adm_hosts_config.php0000644000175000017500000000510311730207153021450 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ require_once('../../auth.php'); if (!profile('ADMIN_HOSTS')) die ('

You dont have Permission to access this page.

'); adm_header('Hosts Config'); $api = new JffnmsHosts_configs(); $span = $Sanitizer->get_int('span', 30); $init = $Sanitizer->get_int('init', 0); $filter = $Sanitizer->get_string('filter'); $action = $Sanitizer->get_string('action'); $actionid = $Sanitizer->get_int('actionid'); $diff1 = $Sanitizer->get_int('diff1'); $diff2 = $Sanitizer->get_int('diff2'); $fields = 6; $cant = $api->get(NULL, $filter, $init, $span); echo adm_table_header("Hosts Config (Cisco running-config) Viewer", $init, $span, $fields, $cant, "hosts_config", false); if ($action != 'diff') echo form(). hidden('action','diff'). tag('tr','','header'). td ('Action', 'field', 'action'). td ('ID', 'field', 'field_id'). td ('Date', 'field'). td ('Host', 'field'). td ('Config', 'field'). td ('Size', 'field'). tag_close('tr'); echo tag('tbody'); $row = 0; while ($rec = $api->fetch()) { if ($action!='diff') { echo tr_open('row_'.$rec['id'],(($row++%2)!=0)?'odd':''). td( radiobutton('diff1', ($diff1==$rec['id'])?1:0, $rec['id']). radiobutton('diff2', ($diff2==$rec['id'])?1:0, $rec['id']). linktext('Read', $Sanitizer->get_url('','all', array('action' => 'read', 'actionid' => $rec['id'], 'init' => $init)), 'action')). td($rec['id'], 'field_id'). td($rec["date"], "field"). td($rec['host_description'].' '.$rec['zone_description'], 'field'). td(substr($rec['config'], 0, 50), 'field'). td(strlen($rec['config']), 'field'). tag_close('tr'); } if (($actionid==$rec['id']) && ($action=='read')) { echo tr_open(). td(memobox('', 20, 80, $rec['config']), 'field', 'field_config', $fields, '', true). tag_close("tr"); } } //while if ($action == 'diff') { $clean_url = $Sanitizer->get_url('','all', array('diff1', $diff1, 'diff2', $diff2, 'filter', $filter), array('action')); echo tr(linktext('Go Back',$clean_url), 'action', $fields). tr('Difference Between Configurations','header',$fields). tr_open(). td(memobox('', 20, 80, $api->diff($diff1, $diff2)), 'field', 'field_config', $fields, '', true); } else echo tr(adm_form_submit('View Diff'), 'action', $fields). form_close(); adm_footer(); ?> jffnms-0.9.3/htdocs/admin/adm/adm_alarms.php0000644000175000017500000001000411716447477020261 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ include ("../../auth.php"); if (!profile("ADMIN_HOSTS")) die ("

You dont have Permission to access this page.

"); $action = $Sanitizer->get_string('action'); $actionid = $Sanitizer->get_int('actionid'); $alarm_filters = $Sanitizer->get_string('alarm_filters',FALSE,TRUE); $init = $Sanitizer->get_int('init', 0); $span = $Sanitizer->get_int('span',20); adm_header("Alarm Editor"); $Interfaces = new JffnmsInterfaces(); $Alarms = new JffnmsAlarms(); $id = $actionid; if (!is_array($actionid)) $actionid=array($actionid); if ($action=="update") { if (empty($triggered)) $triggered = 0; $data = compact("date_start","date_stop","interface","active","referer_start","referer_stop","triggered","type"); $Alarms->update($id,$data); $action="list"; } if ($action=="delete") { foreach ($actionid as $id) if (is_numeric($id)) $Alarms->delete($id); $action="list"; } $fields = 10; $interface_filters = reports_make_interface_filter(); $interfaces_list = $Interfaces->get_all($use_interfaces, $interface_filters); $interfaces_ids_list = array_keys($interfaces_list); if (is_array($alarm_filters)) foreach ($alarm_filters as $key=>$value) if (empty($value) || !is_string($key)) unset($alarm_filters[$key]); $alarms_list_cant = $Alarms->get($interfaces_ids_list,$alarm_filters); echo adm_table_header("Alarm Editor", $init, $span, $fields, $alarms_list_cant, "admin_alarms", false). tag("tr","","header"). td ("Action", "field", "action"). td ("ID", "field", "field_id"). td ("Start Date", "field"). td ("Stop Date", "field"). td ("Duration", "field"). td ("Type", "field"). td ("State", "field"). td ("Interface", "field"). td ("Triggered", "field"). td ("Start/Stop Ref", "field"). tag_close("tr"). tag("tbody"); adm_form("update"); echo reports_pass_options(); $Alarms->slice($init,$span); if ($alarms_list_cant > 0) { while ($r = $Alarms->fetch()) { echo tr_open("row_".$rec["id"], ((in_array($r["id"],$actionid) && ($action=="edit")) ?"editing" :((($row++%2)!=0)?"odd":""))); if (in_array($r["id"],$actionid) && ($action=="edit")) echo td(adm_standard_submit_cancel("Save","Discard"), "action"). td($r["id"],"field", "field_id"). td(textbox("date_start",$r["date_start"],20),"field"). td(textbox("date_stop",$r["date_stop"],20),"field"). td(time_hms($r["duration"]),"field"). td(select_event_types("type",$r["type"]),"field"). td(select_alarm_states("active",$r["active"]), "field"). td(select_interfaces("interface",$r["interface"]), "field"). td(checkbox("triggered",$r["triggered"]),"field"). td(textbox("referer_start",$r["referer_start"],5)." / ".textbox("referer_stop",$r["referer_stop"],5), "field"); else echo adm_standard_edit_delete($r["id"],'', FALSE). td($r["id"],"field","field_id"). td($r["date_start"],"field"). td($r["date_stop"],"field"). td(time_hms($r["duration"]),"field"). td(linktext($r["type_description"], $REQUEST_URI."&alarm_filters[type]=".$r["type"]),"field"). td( linktext($r["state_description"], $REQUEST_URI."&alarm_filters[state]=".$r["active"])."   ". linktext("(".$r["alarm_state"].")", $REQUEST_URI."&alarm_filters[alarm_state]=".$r["alarm_state"]), "field"). td(linktext($r["interface_description"], $REQUEST_URI."&interface_id=".$r["interface"]),"field"). td(checkbox("triggered",$r["triggered"],false),"field"). td($r["referer_start"]." / ".$r["referer_stop"],"field"); echo tag_close("tr"); } } else table_row("No Alarms Found.","no_records_found", $fields); echo form_close(). tag_close("tbody"). table_close(); adm_footer(); ?> jffnms-0.9.3/htdocs/admin/sat_session.inc.php0000644000175000017500000000332511716447477020532 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function sat_session_start ($session_id) { $temp_dir = get_config_option("engine_temp_path"); $file_name = $temp_dir."/sess_".$session_id; $sess_data_keys = array(); if (file_exists($file_name)) { $sess_raw_data = join("",file($file_name)); $sess_data = unserialize($sess_raw_data); $sess_data_keys = array_keys($sess_data); foreach ($sess_data_keys as $key) $GLOBALS[$key]=$sess_data[$key]; } $GLOBALS["sat_session"]=array("filename"=>$file_name,"vars"=>$sess_data_keys,"vars_ser"=>$sess_raw_data); return count ($ses_data_keys); } function sat_session_register() { $variables = func_get_args(); $GLOBALS["sat_session"]["vars"] = array_merge($GLOBALS["sat_session"]["vars"],$variables); return count($GLOBALS["sat_session"]["vars"]); } function sat_session_close() { foreach ($GLOBALS["sat_session"]["vars"] as $key) $sess_data[$key] = &$GLOBALS[$key]; $time_ser = time_usec(); $sess_data_raw = serialize($sess_data); $time_ser = time_usec_diff($time_ser); if ($sess_data_raw != $GLOBALS["sat_session"]["vars_ser"]) { $time_save = time_usec(); $file_name = $GLOBALS["sat_session"]["filename"]; $fp = fopen($file_name,"w+"); fwrite($fp,$sess_data_raw); fclose($fp); $time_save = time_usec_diff ($time_save); } else $time_save = 0; return array($time_ser,$time_save); } function sat_session_destroy() { $a = unlink ($GLOBALS["sat_session"]["filename"]); unset ($GLOBALS["sat_session"]); return $a; } ?> jffnms-0.9.3/htdocs/admin/menu.php0000644000175000017500000002160411571347513016361 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ require_once('../auth.php'); $menu = $Sanitizer->get_string('menu', 'administration'); $menus = get_admin_menus(); if (!array_key_exists($menu, $menus)) die("Cannot find menu item \"$menu\""); if (!array_key_exists('items', $menus["$menu"]) || !is_array($menus[$menu]['items'])) // Direct Menu { if (array_key_exists('link', $menus[$menu])) $link = $menus[$menu]['link']; else $link = ''; header ('Location: '.process_url ($menus[$menu]['type'],$link)); die(); } if (!profile('ADMIN_ACCESS')) die ('

You dont have Permission to access this page.

'); adm_header('Menu'); echo script(" function open_menu (url) { parent.work.location.href = url; } function show_submenu(id, caller_name) { submenu = document.getElementById (id); caller = document.getElementById (caller_name); submenu.className = (submenu.className=='selected_submenu')?'submenu':'selected_submenu'; caller.className = (caller.className=='selected_option')?'option':'selected_option'; }"). tag('div', 'menu'). table(). table_row('Menu', 'title', 2,'','',false). show_menu ($menus, 'administration'). table_close(). tag_close('div'); adm_footer(); function get_admin_menus() { return array( 'administration' => array('title'=>'Administration', 'items' => array('users_cust','host_int','reports','internal','setup')), 'internal' => array('title'=>'Internal Configuration', 'items' => array('events','polling','sla_def','trig_filters','int_others')), 'users_cust' => array('title'=>'Users and Customers', 'image'=>'users', 'items' =>array('customers','users','triggers_users_admin')), 'customers' => array('title'=>'Customers', 'type'=>'standard', 'link'=>'clients', 'image'=>'user2'), 'users' => array('title'=>'Users', 'type'=>'standard', 'link'=>'users', 'image'=>'users'), 'triggers_users_admin' => array('title'=>'Triggers Users', 'type'=>'standard', 'image'=>'event'), 'host_int' => array('title'=>'Hosts and Interfaces', 'image'=>'host', 'items' =>array('zones','hosts','interfaces','nad','hosts_config','maps')), # had satellites 'zones' =>array('title'=>'Zones', 'type'=>'standard', 'image'=>'world'), 'hosts' =>array('title'=>'Hosts', 'type'=>'standard', 'image'=>'host' ), 'interfaces' =>array('title'=>'Interfaces', 'type'=>'intframe', 'image'=>'int1' ), 'hosts_config' =>array('title'=>'Hosts Saved Configs', 'type'=>'admin', 'image'=>'config'), 'maps' =>array('title'=>'SubMaps', 'type'=>'stdframe', 'image'=>'map2' ), 'satellites' =>array('title'=>'Satellites', 'type'=>'standard', 'image'=>'' ), 'nad' =>array('title'=>'Network Discovery', 'type'=>'admframe', 'image'=>'world'), 'events' => array('title'=>'Event Analyzer', 'image'=>'event', 'items' =>array('severity','event_types','syslog_types','trap_receivers','receiver_backends','alarm_states', 'logfiles','logfiles_match_items')), 'severity' =>array('title'=>'Severities', 'type'=>'standard', 'image'=>'' ), 'event_types' =>array('title'=>'Event Types', 'type'=>'standard', 'image'=>'event'), 'syslog_types' =>array('title'=>'Syslog Message Rules','type'=>'standard', 'image'=>'' ), 'trap_receivers' =>array('title'=>'SNMP Trap Receivers', 'type'=>'standard', 'image'=>'' ), 'alarm_states' =>array('title'=>'Alarm States & Sounds','type'=>'standard', 'image'=>'alert'), 'logfiles' =>array('title'=>'Log Files','type'=>'standard', 'image'=>''), 'logfiles_match_items' =>array('title'=>'Log Files Match Items','type'=>'standard', 'image'=>''), 'polling' =>array('title'=>'Polling & Discovery', 'image'=>'', 'items' =>array('interface_types','pollers_groups','pollers','pollers_backend','graph_types','autodiscovery')), 'interface_types' =>array('title'=>'Interface Types', 'type'=>'standard', 'image'=>'' ), 'pollers_groups' =>array('title'=>'Poller Grouping', 'type'=>'stdframe', 'image'=>'' ), 'pollers' =>array('title'=>'Poller Items', 'type'=>'standard', 'image'=>'' ), 'pollers_backend' =>array('title'=>'Poller Backends', 'type'=>'standard', 'image'=>'' ), 'graph_types' =>array('title'=>'Graph Types', 'type'=>'standard', 'image'=>'graph'), 'autodiscovery' =>array('title'=>'Autodiscovery Policy', 'type'=>'standard', 'image'=>'' ), 'setup' =>array('title'=>'System Setup', 'type'=>'raw', 'link'=>'/admin/setup.php', 'image'=>'' ), 'sla_def' =>array('title'=>'SLA Definitions', 'image'=>'pen', 'items' =>array('slas','slas_cond')), 'slas' =>array('title'=>'Conditions Groups', 'type'=>'stdframe', 'image'=>'pen' ), 'slas_cond' =>array('title'=>'Individual Definitions','type'=>'standard', 'image'=>'' ), 'reports' =>array('title'=>'Reports', 'image'=>'text', 'items' =>array('state_report','performance','alarms')), 'state_report' =>array('title'=>'State & Availability','type'=>'intframe', 'image'=>'text' ), 'performance' =>array('title'=>'Performance Graphs', 'type'=>'intframe', 'image'=>'graph'), 'alarms' =>array('title'=>'Alarm Editor', 'type'=>'intframe', 'image'=>'text'), 'trig_filters' =>array('title'=>'Triggers & Filters', 'image'=>'query', 'items' =>array('triggers','actions','filters','filters_fields')), 'triggers' =>array('title'=>'Triggers Configuration', 'type'=>'stdframe', 'image'=>'' ), 'actions' =>array('title'=>'Actions Definition', 'type'=>'standard', 'image'=>'' ), 'filters' =>array('title'=>'Event Filters', 'type'=>'stdframe', 'image'=>'query'), 'filters_fields' =>array('title'=>'Filter Fields', 'type'=>'standard', 'image'=>'' ), 'int_others' =>array('title'=>'Other Configurations', 'image'=>'', 'items' =>array('hosts_config_types','profiles_options','tools','interface_types_field_types')), 'hosts_config_types' =>array('title'=>'Host Config', 'type'=>'standard', 'image'=>'' ), 'profiles_options' =>array('title'=>'Profiles Options', 'type'=>'admframe', 'image'=>'tag' ), 'tools' =>array('title'=>'Interface/Host Tools', 'type'=>'standard', 'image'=>'tool' ), 'interface_types_field_types'=>array('title'=>'Int. Types Fields Types', 'type'=>'standard', 'image'=>'' ), NULL ); # menus } function process_url ($type, $link) { global $Sanitizer, $Config; $jffnms_rel_path = $Config->get('jffnms_rel_path'); switch ($type) { case 'raw': $url = $jffnms_rel_path.$link; break; case 'standard': $url = $jffnms_rel_path.'/admin/adm/adm_standard.php?admin_structure='.$link; break; case 'admin': $url = $jffnms_rel_path.'/admin/adm/adm_'.$link.'.php'; break; case 'admframe': $url = $jffnms_rel_path.'/admin/menu_frame.php?name1='.urlencode('adm/adm_'.$link.'.php?'); break; case 'stdframe': $url = $jffnms_rel_path.'/admin/menu_frame.php?name1='.urlencode('adm/adm_standard.php?admin_structure='.$link); break; case 'intframe': $url = $jffnms_rel_path.'/admin/menu_frame.php?menu=interface_list&size1=200&scroll1=no&type=vertical&menu_type='.$link; break; default: $url = $Sanitizer->get_url('','', array('menu' => $link, 'show_frame' => 1)); break; } # switch return $url; } function show_option($menu, $id) { if (array_key_exists($id, $menu)) { $sub_menu = $menu[$id]; if (!isset($sub_menu['link'])) $sub_menu['link']=$id; if (!isset($sub_menu['type'])) $sub_menu['type']=''; if (!isset($sub_menu['image'])) $sub_menu['image']=''; $url = (isset($sub_menu['items'])) ?"javascript: show_submenu('".$id."', 'option_".$id."');" :process_url ($sub_menu['type'],$sub_menu['link']); return tr_open('option_'.$id). td( image((empty($sub_menu['image'])?'bullet2':$sub_menu['image']).'.png'),'image'). td(linktext($sub_menu['title'], $url, (isset($sub_menu['items'])?'_self':'work'))). tag_close('tr'). ((isset($sub_menu['items'])) ?tr_open($id,'submenu'). td( table(). show_menu ($menu, $id). table_close() ,'','',2). tag_close('tr') :''); } return ''; } function show_menu ($menu, $id) { $sub_menu = $menu[$id]; $output = ''; if (!is_array($sub_menu['items'])) return $output; foreach ($sub_menu['items'] as $item) $output .= show_option ($menu, $item); return $output; } ?> jffnms-0.9.3/htdocs/sounds/0002755000175000017500000000000011377440254015126 5ustar csmallcsmalljffnms-0.9.3/htdocs/sounds/down.wav0000644000175000017500000002366411377440254016625 0ustar csmallcsmallRIFF¬'WAVEfmt ++data‡'u~ƒ“†{nlxŠ’“}_cm„šŸ‹r^ao‡›‹tgjzŒœŸ’z^Uc„œ¤gR_z•¢—ƒqkw~ˆ–†vkam›¥—t^N`ˆ£®“gVV£¢s`l€“ŽŽ~mihz ©œvOKh’¦¡€_`j‰¦¨–wi\gŠ”’ƒvnx•¬­nQPa~“Š{ypsˆ–‘‘zxq|‹‡wwv‰™œ™‡unfsxqpp}‚‰ŒƒzЉ|wtpw„’¡›hSU{ˆˆ€s|ˆ‰Šˆtmtt†~pty˜¥žƒtWZl…‰„sbtŒŸ©™yztv€~zy{zy…‘¤¤‡nfr…“†bLVu‹¡—zqk{“”‡|jt›£“‡p_Rb†ž€Q@L‡ªµ¢vY^s…“‡{zu€ˆ“š“|ok‡œ¡ˆm\Vi‚“™‰~wp‰‘‡|‹¡šŠyp}Š£›ƒsXSd‡Šw{€qrr‚™Ÿ§£‰jhi“Ÿ}bCWjv‹vwys‰Šrfgv‹—ƒnkyšª¤›ƒitmjdZ\f„¤­‡gUf”©©o_i’§¼²›ydjn…„iQLi˜¡vcj|’—“‡”§¯¢€\^gw}aXdt{s|‰ŽŒsftƒy‚Š›¸º•jVJa‚|lfgsltˆ†Œ™ƒwny‡‚Ž“ °©‡qpn~ƒn`]kƒ€}Œ›˜mtŽ¥´¾cVd|‡‰tMPcq“y]iŠœ—‡g`‡­Ç³ƒ[Xiƒ‰^GH`xŠ‘’vp€Œš›…x€š§´•mioxŒrcojmtpx}|‘Šy}u†Ÿ¹·š}\_}ƒŠ\Sdz}|ukxŒ„xps¤©·septsj][k…Žmaiw•·²qU`|¡º¹™p]kv…}iWZt€vtw’ ª¢‹†„–¢§”wny‹Ž}jRNdk`o|†’››š˜¤£˜žž›‚^TQfz~kTUWI\ƒŒˆ—” ›¨šš {giMc{x„oP\TRyƒ€‡–Œ‘–•ª²¹¹—o]Q_„`ZTZlrsdw𢍧’°µµ wVPiƒž›z]8:|Šywem‘—¤˜—®¹¤aP_m~‹ŒvcQEd}qrzw— ¹¿©Š`Sjz‡‹~tztkUP]q–ƒ{qt­ÉÄ­uJPy–Ÿ‰xkuŒ…f[Kb”¢•Šrj‘¸Æªz`Ut”‚uvŽ—xdPYŽŸŸˆht”¨®•tP\‚}~qg†Ž…ql{Œ††ue‡¦ub]swŒ€c{zZp€†‘yz{…‰ygmt|™‘_Q[¦¬ž‹‡}‘¯žrjVCS\u¢ ¢Š{jw‘–ˆŒ“zu„œš{^B]]VVh„’rƒœ©ª©¡Œwnur‰‡o\QTqqwofo|}‘—Ÿ¹Æ³¤›Œ’~gPKS^ql]Sawˆ¡®ºÆ¬‡ƒ—´T30c‰ž‹_HBScpxµÅÓ´~u|¸­b<)[•©›eB8R_sx³È¸›‡u·®ƒM=Dx— …UHMit{ƒ˜­³œ‰Ž±ºˆS3F‚§¬ŠaJBInˆŠœ«œ~tx›²´œ^88u˜®¡zcSKTm…žªžyjr“«¶“`H?a†™¤˜vb^q‡¤©œhkŒ¥¥‹iYTgtŽ•’’}eg‡§³¯ŠqrƒŠjZOYmv~‰††•“ˆŸ§¤™„|Œ”ŒmF'5Sg|~lky€Š“¬¶³©“ŠŽ‡¢™iB$ B\lr\\p|†š²´´±¢˜›¥­¡{M/(FeriVBbŒ›£´µ«©®£š¯³±ŒM+%H€}pW5?‚¡ª«­‘”¡š²±µ‘T7-H}‚eL;>ˆª¹¹š~z‡›­³±¨pJHO{„vQ+$^—´ÇÀž{nz¡»Á¬zM;VФ›g9 0r™¸ÌµŠynv©Âº‚T;C‰¯©|J)!T‹±Ê¾œ„iy¥º®xO:=zª¬‡Z>%D}©Å½s§Â¹ƒQ6._•Ÿ™jG*;lžÀεsn˜ºÁŸ_>-U’ª›nR-4pŸÀ¾¥—y}©¶¶˜dPGKx’„iWH@w¥·¯˜“‹˜»±œ{`Yiq|qHABU…¨±£Œ|¥½¶’kJWr‡’ƒvQ55T‡¬´­š„©¸µ“e@Zm˜n[NDd‰¨²¥˜‰–­±ŒeMSiz~zQLhfxž«§¤‘—ž©˜vXHMnruT/Nw|˜š¦¨±¥Ÿ¡¦‹hQBUd^P9;W~’¨¦¨£«¯»¸­¥‚_a_[dU!Dx±¡…š­¯Ãͽ¤q_qg}l4?u”°´–Œ‰™¸ÏͶ‰fpuznL"&Bt¥´³£€t—·ÐΫoprkT7*C[‚¦­°€¥À̯‡……ŠwO)A]kŠ–›¡Š‘šºÆ«†ƒŠ’p@#Dk•ª±¥ƒy ·¿¤sn|Œ ‡Q)-Q‚¢³¸–{‚§¼i[lz”_5:$1Prv}Œ…‰|t‹³Å¾”wj’ž`4.z›™¢vVhx–¾Ì˨ulp„”jD&4g–£¢‰fcƒ¥¿Æ±•‡•tH!-]†•–zcdt¢ÂÌÀŒ`_ˆ¨®{F)m›«©wPDY¤ÄζvU^‹£—a3)Y‰ž®§ƒjd[Œ²Ã¿|hip‰~Q-F…š¨¢‘…’އƒy”’ЇubXQIS}‹–œ•‰³¯žnmx‡…lN96Mz“£œruž¾È¡udX„‰zb<4Ac”¨¦”‚‘³¼¸m]€€wdBC_lz‹¢ªŠ‘³Æ¼œubrzknK?azv‡¢žˆ…©¿Á—s[emfcIP^…†…¤ž‚–«·–t]YWbKK_]€™§¾·‚kw‘®¼’eSX[aFBXkƒ¬ÆÆœ€~£¼–ZKVUfS@Bc…˜ÉÑÁ¤…{}¥Ã±gF=>ciSSVº®©¡ŠŸÁǯ„[jT:ADPcku‹®³µ¨¤¥²Ã›aRveWL7:p’’ƒ¡ª°ÍÁ°­‹[^ORH=0K†¢¦ŒˆŽ¡ÆÛÀ¤ƒjtk]U2/&C’¢ Žpf©ÌÔ±žzg{sT92;HsŽ‘…vi“ÅÈÁ­…{‹nF58K{•”ŒjSd¤ÆÈ¹˜w…nL4N~™–šZ\†¢ª´³”|ƒobS>e”‹„‚uq”tˆ~‚’jPTEYŠ¥ yzŽ¡­zZ{ny“q>;RfŒ­«–ˆ‡™Á¿fhf€yfD2U|“¡¢š ÏÖ¤Šve~qV2+Ce‘ œˆ”šËß¾¡rbvmzL+-7k˜ˆz}o²ÐÌ¿ŠslD]cYN.T††‚`bknƒ¤»Ð¹iTC7t™’…oinY„¸»Ê©^YIGw£™†‰†s`Sƒµµ»UQD]}žšƒ|“{^j’®²¨lYD=p•–¦‰z“y€’“¡’m^LW`v’š©‹~ŒŽ—†„gHITytx€›¡~z¦«›ŠycGAI`Ž{‚•…s µ½²ujG2TWfœª˜‘Žxƒ¹ÀʬzK2EZX{°Å¡‚€v”°·­n1AhRZ~±Às|y¡©³Œ‚B'dcWi€¹§j€‹§°œc'Ji^mt†»‚W£º´†|N)OfYu‰ždb‰ª¸Á¦‡bDK^gKw –qvtŠ´¼¹©zOlWjm^‘¡ni{n¢¹³¯ždavppq}‡{dqiz­­¹¬wfqqwr„ziki_i¯¹¦“Œsn{x‡{fbf^dn¡¤wŽžyŒaWkehjq”“h‹¥Œ–‹•{jd_omgx˜kj“˜±§‰Œ“qbmYrˆqlz”¶¾¥{w…‡z‰ZR\kxkµ¿»”pvm~¦›pF?JXpˆ£»¸›}|Yg—­™cEFC_Š–°Àžz‰pJ{›¥gNO:r©Ä¢w‡V\‚™¢“[B=a’™Ã·€xpeb~›š[.Dzš Á¿™xkqpŠŽƒQ.X‰’›²Â¤n{xvtŽB0z•€†¡Á¦‚x{w‚u†YAo©r‡¼¨us{z€p‰YKn¯Ÿb€³‡m„}mpq’{JlЍœij£‡p|osywme‡®tk‡hmv…|dK~Ÿª§uv“‰cou‚vRD’®µ¡…oŒˆgr{‰nCBœµ¸¦œˆgƒ…rrns„T2g¬²­¢¡tn‹~irvzl32|¬¤»­‹tk‡”xe@*CŽ©£Ä«ƒj]ˆž~‰ŠW%0h¨ ªÎ—xtr‰‹• t>)Eƒ© »ÇweƒŽ£±T,.e£¨®Ü¥`mrx ´³l=?ƒ¨¯ÅÇŠ\a`v™®¥X)Z˜¤¸Õ®oT\S‡¡µŠK'{–žÓÊŽxVVY‘¦¯s7E’·æ¬ŠjLU|™¢™d "j›«ÑÙ²€GGm™”ƒ8L… ÁØÀZJS‘ªš‰b.j»Ë³ŒqMO‘¾¤va<*S{«Ñ¸}cF„¼¶zW<@Wsª½±­ŽnSo¦·[0/jo“ÅÁ¦ygc•£œpERwŠ´Ð¾¢~kZ‘¥¡Y"9k‡§·Á­m[~¨©†d6%Y¡¥¶­wRT}¡¢kF(N‰¥§¯­„W:h««¤rP5Qeš¶Ÿ¥§wLN˜«§yU:Tl¬¢™¦]Zƒ«§‹\FDrx™£„ˆ¦ugƒœ›qP:k€•ozš†x™”¢‡[>W‡“—lNv‚v¤«’Œ^PRˆš{HPw{ž®ªœƒTUbŒ˜ŸŒV:_‰¤§ª®AS€”¡²’a8‹°°—`+/p²Ë»©e55h³·´xK)I‰Ç˹S99‘´»Ÿ_92p¥ÐȧlL2U±ºÀ‡R.LžÁп}C8;¿¾·jB3}´¿Ã“G+At³½ÉE4I¢¸Å¤]+,_ŸÃĵf?9q¹Â½pD"G‹ºÅ¬†B/=¿È¶d?#p­Ã¾‰N2n¼ÈЙQ,AŸ°Â¢]"N ËÐÅq?(i®ºÂ<,sÂÑÓQ28˜¸Å®c'BžÏÔÍzE%T®¾Ê™N!$fºÌÖ¯Z;/…³ÃÂr9%,‚ÁÏÓN8<°Ä©Y;(E–ÇÉȃQ7a¬¯¯qK4I‰ÆÆ»]GD”¨¯‰Q;M€¬Ê¶‹eNFsž«¢_EAržÃÄŒ`TGpœ¨°tNHZ™¶Ê¬fQFf ®·ŽG@LŒ±Ä¼uEBX𲶍X7Co­»Ã‰J9T®´­m3EW˜¹Ä¬^B:t¦µ®†?6N¶º¸tE4e§­œV(PŽº´°‚U7_¦³“„c5G‡º²°ƒXA_—¬šxW>S¸º²™^BP‘¨¨[4Iƒ»É±œd:G‘¨¬a>C„½É´“hAI—§šŠd8Sˆ³Ì¿˜eJD¤€^.R–«ÈÏ“VS=ƒª¨‚V-=‘ÂÍÔ JF5~³³•]/,l»Òм_=1dµ¼¢t9"UªØÑÄq71\§»§DN”ÏÕˆ;)R¡²¢|KLËÖÏ•G'F™©–|QVªÈÏÊŽN'<…¡‹‰Z%[ªÃÒ¾ƒX5Ly—~‚Y3f¥ÃÏÀvWGe”£h_CC¶ÔƸpLLpœ°jU+;Ž·ÝΩl?EŸ®xY,/ÀÚØ¨l9E¥®‚T)*†¼Öà´qB7~¤«R##‡ÂÔà°`@=Ž¡ qG0ŠË×Ü®[=G™¥¦pA,}ÇÖÚ¬_>D£±²}E%p¼ÖÛ½eA8°µ‘L f­Ò×ÃpH;„®¹•T(aÏÏÃ{O?„§³—\-dšÌÏÄ~T@}¢´–O6a›ÌλrVPˆ ¢ˆ@Od£ÍάcRh•t6 j|£ÅÇ¡]Yr•ž‰d1-yœ°Å¾ŠUU‚›¤‚U$FŒ±ÉèkMQ–ª¨wFX›ºÙ¼‚U@U§°¨p@[ŸÂݺvM1T§±©r>T£ÂßÊyH1M£±ªr;OžÀÛÍ}I8Hž²©y?R¥ÄÜÒ‚G7H­§t<b°ËßÈ~C4S¢ª¢m;"n·ÎÙ­j>6q¦©”^/,~»ÓÓe?1‡¯¦’]+/ƒ½ÓÌ]73©¤’W(4‰À×ÉX4=¨«’Q-<ŽÃÔÃŽ_7DŠ«’YB<†Äο“d9XŒ”©ƒXKL“È˵‘];n~ŒšnVPg§ÍÇZC‚o‚ŒZ`Xu®ÑÀ‹‡VUŠl‚gSbZ’¸Ì¹ŒlHj€‹V\Sm¥Âdz•hNkk~€W]Bb¤´º±šng[W„zt{Mp¨Â·¬tcKKhawyY£»Æ´™h8OHKŒh†ˆ²²§¥eCQ(Y¡‹ˆv‡ž»ÀªXF9s¬œ¤ˆnv¬ËÒ¡UF£¢™r^o¥ÐÊŠO95‡«¯p^}»ÝÀQ$$\½¯ŠsTØß¬o9G}³Ä¡w[OµÝМf#!\‰¸ºƒgRj¾Òµy@ >j—¸¥e[I†Ä̦r+Qnš±‘`U]®ÈÈ–i ?n€ oXa˜ÄΪvE6kˆtMY½ÎÂ~QF§¼ÆžK&*zÁȼ|I4zÁÉÂr5F¥ÇÆž`0S¢ÆÈ¤V(/}³Å°rB=zµÄ²q<-f£´¯zLFnŸÁ²†S9O’©«\Gr“´´‰`DQ‹¤£ƒ]Hz«¶†[MR‡¡¢†`>k¥­º“XDY’ª¬Šd6T›±»£_BM®ºŒa9<ƒ­¸®qHF€©º›iB5k¤´¹ˆTDn¤¸­vL3W‹ª·fMX˜´µ‡U3O™²³yWM‡±¼Že4F†›§²…ZX…­¹iBH†¤££€[Wˆ²¶‘iKNƒ¨ž•wTY‚³´–jMR‚¥¦‡dNQ{²½¡iOLƒŸ©…YJOu³Â±|VJ‚¤ª‚XBMx°Ä³ƒ\Q‚ ©‰L7Fu­Æ¯~ZP†¤¬ŽM/@m§È¶‡aO§±˜S+7i¡Â¸ŽhLy¦²¦a4-`š·²ŒjIw¦±²xC1X—±°’lFq¡°¹ŒT3IŠª°–nHa³º–^=L‘¨ªŠf?e¢³·”cBQœª¦ƒY8dœ±¹›iHJ–¬§W5V“«µqRC®­†Z5Mެ±›v[G±°„X7V­¯“p]O•´­‚]:[“­©}jaX¢·³†X?Š¹Æ¿{KEr–®fFD†µ½¼ƒMMƒŸƒa=K™µº¹‡SMŽ™–yYV”•—SJl—´Ÿ¥vIH•——iN`‰¬¤ª…W?n—’¡~Td…¤ª´ƒ[C\‰Œ©ŠYj‚“¥°|\K^{Œ«hv‡£¦pQTeq–©Šq}xƒª•bLWkw¨®„tzm†³ŒkP]g{³°…xy`†²‰tRb\…´µŽxoX†´Šd`I‡¶¶”|bNˆ«—se\C‹´®‹€\Oª“goN>”´§€UP—ªŒjwFBœ¯­—yI^š«xs=M£¸¸£oIW‰±•{n9X©¿À¥gJS¬š~`6j­¼ÁŸ\GV„¢~SA‚°¾·ˆNIYš‡{NKŠ´Â¯€TGa””nINбÁ­|QOt’‹‰]>b˜¼Á¤tVOƒ”‰JBs˜Æ¾ŸrYW‰Š{IKw Å«{Zats8Zƒ£Î²¤z]gzr‚a6t‘®Ê©ndmujzXD‰“³Â™utyvlorGV››¼µƒpu†‚ksS;o¥¨»ªwl…Š„whC5k¡¦·¨wj‘„tYA;z¢·¡n¡ŠƒzH7A¤§±nŠªŽƒn:1X¤§¢~Ÿ§wX(@y•Ÿ•š{Ž­¨„_D%Q—Œr¦´¨zUsˆQs¸¬®™jK_‘lo\A§¾Ÿ¡~QU‹Ÿ]X:bÀ³ ‰i@q©¥{YB9•DzwOIš»˜fV1`²Ê¢ueHs²¹xXE:˜Ê»ˆeS`¿¥]R:eµÇ­n_M~©µ„UDC”ü“eMO›²ªpN0a®Æ²|_Ad®¸šbB4ƒ·ÄšfQGŒ·­{W/Q¡Á¹\EYª¼œlK3}±É¤kKD€¸¯‡^9Y¡Â¹ƒXAb«µšsI>ޏ¾˜lGS¼¦Y8c¥¾¬v_Iv®³‰cFCŒµµ‹mXa¢µŸnLBi¥·¡ufU†³«ˆY>P«®idmš¶—tP@hŸ«™~qh…µ§{_\p‚˜¬ª¬°˜ˆ|pVTVTZn|„˜¤¢¢¢–€zj\X^^dz†Žš¤ š˜ˆzrj^^fjr~ˆŒ’’€nf”ª®ª¢zl^LH\\h€˜˜¦°¤š–ŠlhbXXfpvŽœž¢ªžŒ†vf``Z\px‚žœžž„zp`^bbjv„ˆ–š–”’ˆxtjddhnt‚Š’˜œš–˜–€TDBBZn†˜®®°°šˆznVRTT\l~†š¦¤¤¢–€xhZVZ^f|ˆ’œ¦¢œ˜ˆznh`\bhn~ˆŽ’’ˆph˜¤ª¤˜~hbNN`drˆšš¤¬œ”Ž‚jfb\^lv|’œœ ¢˜†€pd``^dv~ˆ’œš˜–ˆ~tl``fhr~ˆŒ–˜’Š€tphfhntzˆŒ’––”Ž‚\JDFZl†˜®°°®œŠxlXRTV^l€Šœ¦¦¤¢”†tlZVZ^hvˆ’ž¤¢ž–Œzpf`\bjr€Š”’ˆrl”¢¦ ”|j`RRdhvŠšš¤¨š’Š€hfb^bnx€”œœžž”‚~nd`bbhx€Š”š˜–”„zrj`bhjv€ŠŽ–˜Ž†~rnhfjpv~ˆŽ’–”ŒŠŠ†dRHJXhz’¢¬®¬¦Ž€nbTTVZjxˆ’¢¦¤ –ˆvl^VZ^ht†œ¢¢ž–Ž|rhb^bjr~ˆ’’Švn¢¤ ”~j`TRbhxŠœž¤¨šˆ~hdb^bnz‚”žžžž’‚|lb`bbjz‚Œ–œš–’„zph`bhlx‚Œ–˜Œ„|plhfhpt~†’––І„ˆ|ZNNPdvŽœ¬¬ª¦’‚pfVTX\hv†ž¦¤ –ŒxnbZX^hr„Ž˜ ¢ž”Ž~thd^`jp|†’ŠxpŠ¢¤¢–‚lbVRbfv†šœ¢¨ž”Š€lfb^`lx€’œžžž–„~nd`bbhx€Š”œš˜”Œ|tjdbfjr€ˆŽ”˜”ŽŠ~vnjdfnr|†Ž’––Œ†‚‚‚dVPR^nˆ”¨¬ª¦šˆtj\TVZdn‚Œ˜¢¤ ˜|rf^X\fn~Š–œ  –‚xlf``fnx€ŒŒ|r†¢¦¤šŠpdXP\bp~–œ¤¨¢˜Ž†pfb\\fr|ˆšž ¢šŽ‚xh``^dl|‚˜œš˜€xld`bfl|„Œ”š˜’Ž‚xpjddjnx‚Œ––’Žˆ„€„n\RRVf€Œ ªª¨ž’zpbXVZ`h|†”œ¤ š”‚vjbZZdjx„–ž š’ˆ~pjb`flt|ˆŒŽŽ€t€ž¦¤žzf^RT`hzŒšž¨¨œ”ˆ|hd^Zdnx„–œž¢œ’„|jb`^`jx€Ž–ššš”„|pf`bfjx‚Š˜˜”†|rlfdjnv€Š”–”І€„|dRPP\v†š¨¬¬¦œ‚vh\TV\bt‚š¦¦žšŒ~nfZX^dp|Ž”ž¢ž˜’„xlf`^flv€ŒŽŽ~x” žšŽ|hbVVdjzŠšž¤¦š’†|jd`^dp|„”œœžš‚|ldbbdl|‚Ž–š˜–‚xnh`bhnz„Œ––Œ‚zplfflpz‚Œ’””Œ†‚~‚ŠrVNPRl~’¦°°¬¦ˆzh^PRX^n€Š˜¢ª¤œ–~rf^TXdj|Š˜œ¤¤š’„xhd^\fnx‚”–’†z†–”Žˆzjf``nv‚Žœœšš„|vjfhjpz†Œ”˜”’ކvrjfhntz†ŒŽ’’ކ‚vpljhnv|†ŒŒ‚|vrlnprz€†ŠŽŽŒˆ‚~zz~„–ŠnXRNZv†œ¬¬ª¢–znbVTZbh€Œ–ž¦ ”Ž|nd`X\jr‚šž žˆzpdbddpz†Œ–˜’Ž‚vv††„‚~trvt|€†ˆŽˆˆ‚|xxttxz|‚ˆˆŠŠ†‚€~vvvvx|€€†ˆ„„„€|zxtvxx|€„„†„‚~~zxvxxz~€€„„‚‚€~|||~‚†Ž˜œ‚\RHJfz”¦°®¨œ€r`VPT`j€Žš ¦ ’ˆvh\ZZ`r~Ž˜¢ œ–„xlf^blr€Œ–˜š–Š‚vpnrvx~„ˆŠŽŒŠ†€|xvtvz~„ˆŒŠˆ†€|xvtvx|‚†ˆŠˆ„€|xtttvz~„†Šˆ„€|xtrtv|€„†ˆˆ„‚~zvvvx|~‚„ˆˆ†„€€€‚ˆ’¤’`L>6(þðéíö  ÿúõëáÚÕÔÙáèîïëâ×ÍÅÂÃÉÖãéåÞÚÞãæìíçàßæìòÿ   #)'   !+.(&3;<5+ üòîíéãáæï÷öòìçæçëòøý #-1+  õíèãÜÓÌÌÕâéîïìîù  (395&ÿñäÙÑÉÉÐÔÕÙßæìðïìæàäï÷øõòòõõðéäÞÚáæâÚÖ×ÝâæèãÙÌÁ¸´¸ÂÏÙ×ǵ«¬¯²¹¾ÀÅÍ;°®²´¶¶µ¹¼¹»½½ÃÎßò !)**& (0342-( $*)+-$úêàÖÔæôûÿúÿ%.48DJIDE@;EWfpwtqnmeVG?DOOLHIFDDA6+'(,240,%   üêáÜÓÎÕÞÜÚãðøöóð÷úú÷þ  ÿ ïèóý ÷âÓÑÑÉ»³¸ÅÑÜäåÙÍý±¡Ÿ¬¹ÀÉÖ×ÎËÍɽ¬¤°¿ÇÐê$36/$)45,'% $1/"  ,34+!!ùý   $úøý !  ýêãéôù &8@=2$$9IRUUTWY[V>"öñíðý!)( ùæÞßÙÊÃÍ×Ùй¢›ž «ÃÔÝæðôîåØÓÚâèòöòííëâÙÕÓÔÙâêóüüüÿüñêãÞÚÖź½ÆÑ×ÎÀ´±·ÅÚìõù $ üõóìäÛàô"# 5JOB83221+*..2;EG<, !)*%"&04)ìÚàêïðøôïëì÷&  ûû   ýúúù #5@A>=73/% ôä×ËÀ°¢š™š›žžœ›Ÿª¬ª«²½ÍÛâçíïòùü÷ïëó-2,$úùüúøñæàãæíöóèààãéëâÑÊÈÅÁ¹ª Ÿ£¥££¥¦¨®½ÐÙÝëÿ ùäí +378/'3DD0(*2ASWQKHFC4üîææãÓÅÅÒáòõï÷ #-# ùùÿ õ& +AC)íáñ %%  93 ÷ö çÑÑÖØÙ×ÇÆÐÛâ×ÇÀÈÒ×ÙÕÐç ÷ôýùøùüòÓÃÐÞêüýüûþùçÎËÜêðõôù ùêÞÖ×àßàçü+!  üô÷&'$7GD8)+>>.  '"$íãñøâÜòüñëè÷!ûëõ'%8GNG/úú,FG;5226) ïëðùúì×ÊÊÓØÑ¾«²ÔâÄ¡˜œ©ÉÙÖȶ¿Þß¾©¨²Îèèèõ4='-MXJ-&ý;5 0)ùæÝõôñþ* õûööêγÁâýùÜÒâíëÞÆ¹ÅÐÑÒÙÖÛêôìîø+>.<I3 "" ãÐÕÙÝÛÉÇí ôåÐÌäöïàÌÊáèÒËÒÚæðãÉÇà+6þ &>9#çä&.0//EcbK8,&)!!*-7òð4=4-4,5%÷ÕÇËäú÷ÞÏÎé5433#õÓÇÉÔéûñì ,8?%ÿ"ø üéÜàöößàû çÎÜíóðáËÃÊÖßâÓÈßøöïôõøöäÓÓÙàãÚ쫹ÈÓÄ´±Åäúöðïý üêÝáíèÞ×ÒÛù ä˶´ÀÀ«±ÄÍ×åÛÖï ûáÞòüòñéí*CI>??LN:$'=ZdW7"íêñþ (* 6SD#'C\[J5088$1P`J!þ ÞÎç ãÛëéÓÓÞø"ûæçò诓•¡³° šŸ·ËĽ¿Ëæþòʰ´ÕõõØÀ¸ÐõìͺÈÜæÕÈÝðÊÅèö׳´ÑÚξ­¶ØæÜÕæüüÒÊãèÐÍãýöâàëëàÐÑðGcL0$#9:+(:A?>.!?ejYC28JO.éÞåóøöø ÷äÖå9EB?I]hZ. ÷öçÔÌÛõíÌ·¸Ñü õìäáâãÞÝâåÕ±Ÿ¤¯ÁÐÔÔâþóêääÛÄÃÕãèݾ°Éæèéñ÷$373"ÿàØò-1óèììçãèû46,!çÖÝüìÁ±Îùîë 03! ?WO:&,Tol`L.2LL8.BdlfbWFDPP7:M@þ!65& ;VUC*#><õãì # ýü üàà&*ýîý&EC% 6:ðû6,áí1$òÐÝ'$þÕÉÞ÷ùÞÙõ ùز¸åîÝÆ¿Õî˺¯¬¶°•Œ©ÄÍÅ®¹áæäñòüüßÌËÔÔĺÃÖìøîØÒãô÷îàÞêøþûäÐçòæàîðò÷õèþ77 óâÛë  ñÞã÷ý !:Vb_ZVP>ößâôóàæÿ&<HKC5,%#ôÿ'LWH,$("ÿïíú /+%$ íÙé5II6% ÿîæï úðÙÄ»Åä øëÚÆ·´¹ÇÝëíëãÜÓÀ§—— µÅÂ¥‹‰‘™ž¡©ÀßëðèÉ­®²³³­½÷ïìóéÙÙàÝÞãàÖÓÖÖÓÒÅÄß" ÷ëÛÒÛéû .9.!úÙÉÔç  øÔºµ»Éì .JJ%öÙÚ+4ÿý ß¿Í&0$íôùÙ¹Ìû"+" %! 5=(ôö%/*#&.* 72 /EVU. #23# òäì7.÷ë%5òíõý #á¾Ææøúôçë ÷åÛÚãñý ')íö*1àÖðýùôáÖßàÎÃÃÍåü÷ßÉÅÑìüéÉÆÖãìé˵»´£ª´ºÍÙͳ§¬±»ÏÔÌÆÇÒãêêõóÛÕÒØþ íêöòëäÒÔôüòøýéĨ­Ö!$ äê(1( $&9:äÅÃÞýæãïý 3JLC67IS=!$SijW;3JS<(%.BWT;.<LXF ÞòEWV?+8IB$ñþ-D, ,!üÙÕç÷ ðÙñ"ù ýïçø" ⸪¿ÛâÔËØîûüïÞçæÞý$áËÚíøúëÙÝêêÚ¹£¨»ÇŶ­ÅîóÕÇÐßæãçÿò$4.ø!7A??GMHJOJIRTQI6,)$ùàßðþÿ÷ìîøôíêÞâ)-$$0÷ö ô÷ ðÔÇßüñØ¿ÃáõöîååññáȹÀÓàÞ˺Ëð úåãìññáÍÒíûüðÕÍèûùôíçðÿùëâéöóÝÅÅÝ÷ÿóÓ¹Âßùû,770!%>MD)9I=ø  ÷ü07$25'(>>+ý /& ú'7/, âÙêþøýCUI)2=3# ìì  ìÑÍÝéÞÊ´¨³Ç̽¬²Ñõ ÿßÊÑâèÜ¿¬¹ÓÚʶª±ÆÐ¦–™«¼¹¦œ˜›®¼³¤®ÏêòìÝÖàêåÖÁ»× òÖÇÃź¨¡²ÒäÛ»¨¤¥©®³³¼ÞíÕÕÜèîåæ(ñëíø $KjqbMA<95'0CKC74.)')'.>GHF=2,,,+%"+9ABBHLD8+ .41*õÙÈÁÅÏÝíóòõõêßÚÕ×àíþüá˼ºÄÎÖ×ÐÊÆ¾³«¨¨¦£¬ÁÌÖæëÝË¿¶»ÊÚêùûùôâÏËØïÿ þþîßè÷ùþÿóæÙØð  ìàãó  û!,*"#(*+))..*   $##   ýèÓÍÏØñöñíìîïóü%! &,)ÿòêèòöîåÞÛáñüúîÚÊÆÌÒÛéôúþùæÕÐÑ×äçØÊÍÖáíîäÚÖÓÑÔÕÞø&#õêîõöòëíöþüñáÓÎÖçñîñûÿ !'/7;87<=6+!!+4/(3;>6.4;@GFAGYa_\ZVTTVXVTY[ZO9&%)3?<:<5*' .9=3 -.$$/52(óõùÔ±¯ÆÖÚÔÇËÞáÒÈÇÏÛßϵ¤§¾ßìÛÃÁÏÞéëãáôýðèðÿüäÉÂÒâæÞÐÆÉÑÑÀ§˜˜£±»ÆÓÛÞÜʬ›¥½ÚïïéðùòäÓÄÉâñîæâêüþèÛéëçû!))+B<ûåî %" ðí÷ßÙêÿñÝÝù*ü !."ð 9@,ð÷ ;E6 ü",ûÚÕçûýéÕØåîïàÉÊáóñåØÙêüýæÇ¿Î×ÓÊËÞôûãÉÇÎÌǽ¶ÅêìØÛåæÝÕÜñ  íàïæÓÖåôþ÷äÜåóû÷íö4:* öòÿ 6E>"ðî÷ïëøúæàíÿþíãäëôôììôý ýûüûóæáí  úðæÙÞñ úòüþïàßëóóëß×ÕÓʾ·ÀÕó öâ××ÜÚÑÓë$ôëãàÖÆÅÕæìæÜÛåô üøööïáÞèîðïàÏÊÎÚñþúøùøùúù*/21% #!ýúðßÓÑÛìù÷èÜÜàéø  þêÏÈÚäåëðôðÝ×Ýãâáåðÿ $&$ úû   #)')/+ üùùüþúòðîíø ''##$þý!9@?9,# %5BNWZZO3ûÿ &)*$ ùûþõóñêàÒÄÂÎãõÿÿüûøöòæÛÛãðööøÿûëÚËÆÌßóòõÿüúòåØÖâñùöïíñóñîêäâæëèãê÷ûÿ  ÷ëåæëôúùóìí÷ùìàÛØÜêø*46* &.0) ùïôûýôñðòöùû '%  þôõþúú*3*ýÿùïéï üúû  ! ýöðéäßÜßì ýòçÚ×ßëÿùíáÓÆÃÎßïùüûùøüùïîý,3& þíÞØâõòçäææßÕÒÝø!üéããà×ÏÎÚîÿ   ÿ(-#øëâÚÓÑÕåü!ñèæåï ,.'ñÞÖ×ÞèïññôöôìàÔÏÐÛëõ÷øöðèßÛáæí÷ÿ ÷çßâíý úåÏÂÃÔåíõþóßÍÆÎâïøùëÚËÄÈÑÚãëðôýüû÷ïïöùÿüõæ×Ô×××ÙÝßÜÕÍÍÖÜÚÚÛÚâô ëàßäêîêëô÷ñëëìéäÝÔÌÐàù ùñíîðíìõ"($ !ýêßæññîòöù '/1,$ #'%! (&"" ÿúïèíõúúôñùøæäòü÷÷ùöíàÚàñþþõéãæëäØÖáô îÝÕØÛÖÓÜæííèáÛÞìúüüÿ *+)' üèÞßàãòþúöòóû ôïôøÿþøø $+  1;5ø    ýù$ ý÷óïáÈ·³½ÐÜ×ÐÔÝèóôèßä÷ ! þû ".,'!òíïóôù úìãáæïðåÞÞÝÜÜÝÜÝßâèð÷îçìöúüÿüìããæëìí÷#!ùëåçêæààèøôèãéö  &/, "06674.*)%%&+3=BCDGC:302<DFFC<:<6+" $%$$ #,.'" úñïöùöõôñññìåßÚÚäëçãåæãÞÔÉÈÓÜàÝÕÆº´°¯ª§¯¼ÂÀ¼¶¯ª¤¡¤­»ÊÓÒËÅÈÏÑɺµÀÓãììèíúöêêôýýóäßçòú÷êãëøÿý ÿõõûûñâãô õèèïõøü *770/0./)        %$!%! ÿùðïôøõðçáäæãâß×ÕÛÝØÔÓÙç÷þü÷îîý ÿ÷ùÿ þóðöþúöõðêæáÝâíô÷ûýóçáæóþ ùöõïéëððììïùÿûôíñø÷ñîëäàÝØÕ×Ýçôûý úêÙÌËÔÞââÜרÛÝáåéïñìæèîô÷õïîõÿþüÿýøòòïåÜÞëùùêÝ×Ûçñö÷ýúïæàãìîéáÛÛáäÞÔÎÑÖÚÚØÛè÷ÿüóåÝâëìíòú öíçéìîóÿ ýý  "&$!   üóëí÷  &)&(.46- !! ôèâçõýúúûþÿýõéåçðý  ÷ìèïûÿûúþ ýñíòþ þîß×Ûãçã×ÈÅÐ×ÑÁ³¯·ÄÍÐÐÐÕÞÜÍÀ¾ÊÝíóðëëòù÷îèçêïòôøþ þý   ùòñ÷ÿ'&%)-021.('-6;=;>JWUI?72230+)*/2+ ùôû    ýñëïü!$('#ûöö÷öòïïñööòëæçëíïôúýýúöôôøÿ   ÿóìîóôòòõúûöíéðùþùþ ìÝÛáèíêæêòõóíèäæììçæéðööîäÝÛßåèåäçîôüüøôóóõôïèæèçåáÝÝäëîëéêîòôñíïôúüóãÝäëìèááçîòñìêîöøòìëîôûúóíëéæâÛÕÕÙÞàÜÔÔßìöþÿþüöïéåçìðïíéåäàÕÌÊÍÒØàèîòôñëæèï÷÷ööùýýû )9B?5+$$)-*"  ýôôüþúü        þùõðéåâààåéëíððîììïóøþ þ ÿøòîïñîêêèåãßÙÙÝáåëìêîö ú÷õòïíëèæáÛÖÒÐÓÖÑËÉÉÌÓÚßåæçèéæäåçæãáÞßäèéçããéïïêäÚÓÑÑÑÕÚâéëåßÛØØÝááàâçïùÿþýûýüø÷øôîéêô #%&"  üÿ  ÿýþ þ÷óñðñõý ÷óòôòíæááààâçìó÷øùùöõöõðñù "+38:71*" #,340)   ÿû ÷îñü ÿøëãæò úðïòîçàÛÚÞâáÜ×ÖÛßßÛÙÞçììêéëòöõíæäêòö÷ø    &$!"$$"üñéèëíïïíðöøóëéîøÿÿ  üùöôðèáßâèïòóø  ýüüúôîíô   ÷ìéîöÿ     '($  .:<96/' û÷õ÷ý  þòíïõÿ ÿ÷ñçÞÙÚÛßæìðïèßÚÔÊÃÄÈÍÕÛÝÙÐÈÄÂÀÂÇÐÜèëèãàÞÞÞÝÝàâàÙÏÆ¿º¶³µ¹ÁÉÒÖÕÔÔÔÔÔÖÝèñ÷ùõîéâÕÊÇÊÒàìôøøõöøøúþ úôòòôù  ÿý "*042," "'++% ÿ÷ú   þóíëðù  þø÷ùüÿþûõñðññìêìòùÿüøõóññô÷ûüùóëãÝÚÛÞãêòüûõðîìëîòõõñìéèæàÚÖÖØÜáàÝÛÝáäãÞÜÞàáãåçéêéæãâãåçèëíììïòòòñðñôöøüþüúõðííïõþ  þü÷ñîòúúõø  ûúý  üøøüþýüúöóòñòöø÷öôòôúýøúûùùøõôú ýúùöïìîôõóîêééæââçñýúõô÷úúöòòø þîäàáæìôýûöõôòñðòøýùõõöóôÿ!.3/% &--&  $    ùïæßÛÜàçîòòíçáÝÜÜÞáââáâäãÝÚÛßâéòü þøøÿ   ûöóîêìó÷ùûý !')$ ýýÿ     þøñëèèèéêçããåçèèççåãâäéïñóôõööøùù÷öõóòññóôòìéêíòööööôñïìêìîíìéææèíðñïêèëñòïëçæèìóùþÿýúôîëíóùúùúþ üóìéææçëñóðêãÝÙÕÓÑÑÑÔÛáãäâàÝÜÝãëðíëèäââãçíòöúÿý÷ïçáÝÜßãèíðïìéæåååéîôøúúúü þÿÿ ÿýúú   ùðìïóöùýû÷ôòóõõôôøýý÷óñòôôóðìêéèäßÜÜÜÝßáåêìîðìäàãéíðòòñîêéêëëìîîìíïòöúüÿ  þúü ûôìèêðõùúúúýÿüý  ý÷òñòòññõ÷úú÷óñõþ   ÿþ ÿúööøúý ÿüþ ÿùúûûüþÿÿûõðêåâááâäãáßÛ×Úàçîóôôöõïìíîñ÷ýüù÷õöûýûýûúù÷ôóñìèèéìò÷úüÿ    ûôìéëîðñöûûúûúõòñîíïîïññíêëîôúüúöõõöúü  ÿýýÿþÿ   üøû  þýÿþùóïïòôöøø÷õñïò÷ûÿýÿ û÷ôóöþýúøøùúùúý   ýüûùúý  "(+)(%  ÿþ  ýüþÿÿûøùüüöðîñõûþ÷òîéâÝßâäæçåããçêìííïñðîìêéëîîîíììíïðôúÿÿùðìéæååæçéçåߨÔÓÕ×ÖÚÞàáààãèíîìéæèîòðëçäãâàÜÛÜàåçâÚÔÑÒ×Üãéðõöôðííñôö÷ûýýÿÿüþ ÿþÿúõðïõü       ýý  ûöñîîðïííìèãàÞÝÛÛÛßããáàààãçéêêëîóôòìåââåççååææåáÚÕÔÒÐÍÍÎÏÐÓ×ÚÜÜÝàáãèðøýýùõòòóòññôúüøö÷ûÿ#*.-(!"$$   þúûüûúúú÷óñòðíæàÜÜÞàáßÜÜàãååçêíðòóô÷ûÿýüüÿ   üùùùüÿþùôó÷ûýþþÿÿþþþüúúûüýüüþþ  üúúûüúõîêìóø÷ñëèééæáÞáèïóõõöùûúùùþ     ýùøøöóòòôöøùùùü   ÿþýýÿùõóòðîíëëìììëêèçæçèèìðöûüúù÷ôððñððòõ÷úúúù÷òñòôøý úöòïïòùÿüûûûüÿ ýù÷øúüüÿÿýüüúöòïðöþÿþÿ  $*152( ýÿ ûÿ ûøúøòóõöóïðöþüýùòñõø÷òíëëêåÛÒÎÔÜãåäãáßÛÔÎÌÎ×áåâÞÜÝÞÜÙÚàèîóòîìììéãÜÚÜäêíëêêíïìæáâæìðòöûüø÷ùýÿüúúüÿÿüûþÿþÿýùöóòñíéåââæëíñóóñíéæèíôúÿÿüúùúÿ       ýýýþÿþú÷ùý   üøôòòôöø÷öõõõøù÷õõõóóõ÷öôðìêëïõúüüûûúùùùùùúúúøõóðîíìììïóôñëãÝÜÝáæëðóøúøöõõõõóñðó÷úüùõòðððñðïïïñóòòöü ""   û÷öøûýþþüúù÷ôïëìñ÷úûüýûù÷óîçãáåéëìííïôøùùùúý  ÿþÿ  þýþ ýüýüüþÿþýûûüûù÷÷ùþýûúüýýûúúûüûùúþ  ùôô÷üþüøöööõóïëëìîííîðñíèåäæëñóóóõöôòððóõóòññó÷ùõïëëíðîêçèêéééèèêëìëëð÷ÿþ÷òñõøùùùýýýÿ #$  üù÷õòñóö÷úþÿûøùü "#      ÿýú÷ôöû ýüýþÿûöòòöùúûüþþýûøøúüúøö÷ùùôìæâßÝÝÞáæíô÷öôôöôñíëëðöûû÷òïððîîïòö÷öóïìíðñîêçèëëèåääåäääæèèæãáãêðòñîíïòóñïìêçߨÖÙàåçèêîôø÷òîíîîîïîîñóñíéèëïñóóóõùûöñííîïíëêìñôôòñöþüõóøýýüýþüýÿüø÷ûüý   ÿýýý   üøøøúûû     üøõôôòñðñòòïìèçåäãããçëðòñññòóôóóóóôôôõôóðìéèééèççéëêèçêîòõõôòñññïêçåãâãäçëïòôõõöùûüûúúûûùöóóôõõóòó÷úüüûý           þüûùöõöùûûüý  ýùùýÿú÷÷õòëçæêíìèäâãææåãæêîíêæåçéêçãäéïóôóóöúûúùøúÿþûúûÿ ÿüûûùöõôö÷öõöùÿÿÿ  ÿýþþÿþýÿÿúøûþÿüøõ÷û  ÿû÷öõóñðîíìêéèëïòóòññóôôóóôö÷÷÷õòïîíêèèéìîïñóóòðððóö÷øùüÿ  ýüýÿþþþüú÷õôõöøúù÷óîéçêðõøùø÷öôñïïðòóóóôöùùöðììîðòñððòõöôññòòñðïñõúýüúøùüÿ    ýûúúúûþþú÷÷øúþþûø÷÷ûþþÿÿüûûûúùùüÿûúùù÷õñïîíëëíñóóïëêêëììëìïõùûûùõñðñóõùýüöòîííîïïïñõ÷ôðìëëëìíïðïíëêêíñô÷ùûüûøöóïìììîòõøù÷õôôôõöö÷øøúýþýûøøûÿ ÿ ÿûúü !$$! ÿüúûÿ    ûùø÷öö÷ø÷õòíéççèêìïòõ÷ùûûùöóóô÷úüýüûùùùûÿÿÿþþþýýýþÿüúùùùûüýýýüüüúø÷õôôøüþýûù÷ôóóöøûüþÿüûûýû÷óóôö÷øùûýýûúùùøøøøøùúúù÷÷ùýþþýýþÿÿþþÿýüýÿþüûûûûúúüþýûùøøû  ÿ  ûùûÿÿüüÿÿüüÿÿüûý þú÷÷÷÷øùýÿýúõñïñôõõö÷øúûûù÷öö÷ööö÷öòíèææêìïñõøûüúø÷øùúùùûþüøôóôö÷÷úþ    üüýýýþþþþÿýúùøöóòòôôôóññññïìëìðóõõõôôõõòîííïðñó÷úýþýûûüþýû÷õõõõôóòòõ÷õóóô÷ùùöôôöùúù÷ôóóôõõõö÷ööö÷øøøøøøùûüûûüýýýþÿÿýýýþþþþüüýÿüûûüüýþÿýýýÿýýþýúùúúùø÷÷úüþþýüüýþÿÿÿÿýüüýýýüúúúúùøöôôôóñððñóóòòòóôóñîëêêéèççèèæãÞÛÛÞáãââãåèéééìðõùûúúýÿýÿÿþ     þÿþÿÿýýÿþýþÿýúöõöùûûúûüýüûùùùùùùùùúûúøõñððòôöøùøöôñððóöøùúýÿÿüù÷÷÷øùúûýþýüûûüýýýüüýÿ    ÿüûúúùø÷÷úüýûù÷õôóóôöùûýþýûøõóòòóöøúùöóðïïïðòôö÷öôóóóóôôõøúýÿýûúùùùúüÿýûùøøöõôôöùüþþýüûúùùûþÿþýþüú÷ö÷ùüÿþûø÷õôõ÷ûþÿýûúúýÿüüüýþüúùùûýþþþÿýýý ÿüüÿþþþüüüýûù÷÷ùüýüûúúúù÷ôôõ÷øùúûüýüúø÷÷ùûûúúúûúùø÷øúüüüüüýþýûúùúúûûüüýþþýüûûûù÷÷÷úýÿýüûúùùúüþþûøööööõôôö÷÷ôðïðñóôôöùûüú÷öõöøøøùüÿÿýúøøøøøøøøùûúøöööööõö÷úþ   ýú÷÷øûýþýýýýûù÷ö÷ùûûúúúüüûúùùúûûúúúûüúùùúüþþþþüûûüýýýýýþýüúùùüþþþþÿÿþýþþýüüýÿýúùùùúûûüÿþþýýÿÿýüüýüüüýþþýüûûûúúúø÷÷øùùùúüÿÿþÿ þýüúø÷öõôóñïîîïññññòóõöõõõõõö÷÷÷øùûûùùøøø÷öõõö÷øøøøùúûüüýþþþýýýýþÿþýýýþÿÿþýüüûúù÷÷øùúûûûýÿþþýýüüýýýýýüûûúûýþÿþþþþþþþÿÿþþþþýýýýüûúûüüýÿÿýüúùùùùùù÷ööö÷øùúüÿÿþþÿÿÿþüüýþüûûüýýþþÿþþþýüüýýüüüýýÿþüüüýþÿýûúúùøøø÷øøùúúûüÿþüûûûüûùùøøùúúûüüüûûûýþþýýýýÿÿýýýþþþþþýüüüþþüûûüþÿþþþÿÿýûüýýûúø÷÷øøùø÷÷÷õõôóóóóôôö÷÷öõôõøúûýýýþýüüüýýýÿýüüüüûûûýþýýýþþýýÿÿýýýÿÿþþþýüûûûüýýýüúùø÷ø÷öö÷øúûûúùøöõóóôöøúüýýýþýýýüýþÿþþÿþýüûûüýþþÿþýûøöõõö÷øùúúù÷õóóóôõõõõõ÷ùúø÷ööö÷øùùúüüûù÷÷÷÷öõõõ÷ùúúù÷õõõö÷øùûüýýüûúúùùùúúüýþýûúúûýÿÿþþþþÿýüûúúúúûüüüýýüûúúúûûûûúùøø÷÷÷÷øùûüüüüüûúøøùûýÿÿþþþ ÿþþþþýûù÷õôôôô÷ùûüüúùø÷öõõõ÷ùûüüüûûúùøöö÷øùùùùøùùø÷öö÷ùùø÷÷÷÷øø÷÷÷÷÷÷ööö÷øùùùúûûûûûúùùøöõôõöö÷÷øøøø÷÷÷øùúùùùûýÿÿþþÿÿýýþÿþþþÿþþüûûüýÿýýýþþýüüüýýýýþþýýþþþýýþÿüûûûüýýýþýýýýüüýýýýýýþþýüúùùúúúûûüýüûúúúûüûûûüýüûù÷÷ööõôôôõõôôóóóòòòóóôöøø÷ööö÷÷÷÷øúüüüüüýüûûüýÿÿüûûúúùùúûüýþýýýüüüüýþýþÿÿþþþýýüûùùùùúüÿÿþþþþþýüûúúùùøøøø÷öõôôôôõ÷øùúúúúùúúûûüýýýýþýýüüüüúùùùùøöôôôõõö÷÷÷øø÷öõõõõõö÷øùûûúúúûüýýþÿÿÿÿýýýýýýþþÿÿþþýüüýþþýýýüûúúûýþþýýýýýýýüýþþýüûûúúúùøøøúûûúùøøùúúúûûüüûûûûûüýýþÿÿþýýýýüüýýüüûúúùø÷ööö÷ùúûûüûûûúúúúúúúúúúúùù÷÷÷øùúüüüüüûûüüýýýýþþþýüûûûüýþÿþÿÿþÿÿÿýýÿÿþýýýýüüûûúùùùøøùúûûûûûúø÷÷÷÷øø÷÷÷÷÷÷÷÷÷ùúûüýýýýüüûûûûûûüüýýýýþþÿþþþþþþÿÿÿÿþþýüüüûûûûüüýýþþþýýýýýýûûúúùùùùúûûüûúúúúúúúûüýüüûúúúúúúûûüüûúúúûûüüüýýýýýüüüúùùùùúúúúúúûüüüüüýýüüüüýýýýýýþþþýýýþþÿþþÿþýýþÿþýþÿþþýÿþþþþýûûûüýýüüüýýüûûûüüûûúúûûúùøøùúúùøøùúúùø÷øùùùùùúüüûùøøùúùùùúûýüúúúúúûúúúüýüûûûûüüüûûüþþþþþþþþýýýýþþýüüýþþýüüýþþþýýýþþþýýýþÿþýýýýþþýýþþþþþþýýýþþþþÿýüýþþýýýýþþþýýýþÿþþþþþþýýþÿþþþÿÿÿþýþÿýýþÿÿþþÿþýýýþþýüýýþþýýýýýýýýüýýþþýüüüýýüüüýþýüüûüüüüüüüýþýýýýþÿþýýýýýýüüýþÿÿÿÿþþþþÿLISTINFOICRD 1995-04-28\factFILTjffnms-0.9.3/htdocs/sounds/tling.wav0000644000175000017500000004065411377440254016771 0ustar csmallcsmallRIFF¤AWAVEfmt ++data€A€‚†ˆ‡‡ˆˆˆ„‡‚Œ†ˆ„ƒ††ˆ…ƒƒŠƒ†‚‚ƒƒ‚‚ƒ†‹Œ‹Œ‹‹ŠŠ‡Š‰†‹‹‹†„†…………„ƒ…‡ƒ€‹†„}}„…ƒ€~€}‡‚‰†ˆ‡‚Œˆ„ƒ‚Ї‰‚€ƒ……„‚€‰€‚‚€{~„‚}}€{~{‚{}ƒ{x~‚|v|{‡z}wyzzyy}|}~€~{ƒ‡„zz‚ƒƒ{|{‡ƒ}}€Œ„…‡ˆŠˆ„ˆŠ’ˆ‹‹Œ‹Ž‡Œ‡ŽˆŠ‡‡‹Œ’Ž——˜•žžš˜Ÿ¡£ž”›˜©œ—™¢¤£¤¦§©¢ª«°«©ª§­°²²¤®°¹¼®·²À³³³¶¹°µ±¸·¸µ¶°¯²µ±®¨¦ªª®¥¡š˜£›¡šš“’”Ÿž–›œ—Ž˜›™…‘’”›‹ˆ’Œ’Œ‘‡ŠŽ’ˆ€ƒƒupx||prrntinjld`dhhgc`]W\__[ZYWUYcQPKYRTTSQHMNOTONKJILNUGA@QMOHIE@MHKCKK@CJPKGBACLLNGDACJHNBHEH@KRJB>FLKSNFDFNJIPJKCQMSPHIDVOUPQMDPSWNSTLIUWZPOMSWX`PTRWVX]ZYSTW`b]SSVc\`aVZXi\]bb_Vaahc_\Uggke_`^cgcfdg_ajjqaeacjntf`bimnmohdfmnqmdjdxlvrjjhtnqtskeryvtoniqvxulopttp}uwloy}}soop|}tnsy{v{€vvt€y~}yvp}‡|wty|„€zt…}{|wx„†ˆ|~}~„‡ˆ…{vŒ†„|}~†ˆŒ~~‡†„€~}‡ˆŠƒƒ|Š‹”„…‡†ˆ‡’„„~‹‡†‹‡…{€•‹‡†‹Š‘ˆƒ}‹‹Œ‡…‡Š€†”ˆ†…„…Š“„ГދЄ„ŒŽŽ†‡ˆˆ†‡‹™‰…}”ˆ†„†…Š„„Šˆ‰Œ•‡†‰Š†ŠŒ†ƒ}Š’„‡‡‰‹“”†‚‰’„†ˆ†ƒ„Ž‘‰ˆ†ˆ•–‘‡ˆŽŒ„‰„†…ŽŽŽ†ˆ‡‹Œ—“‚…†……‹Ž‡Œ”ŒŠ‡‰“Œ…„†ŽŒ„‘‰…Š…™ŽŠŠ‰‘‹—ŽŒ…„’…‹Œ‘‚’†•‘………›‡Œ…Š‘‹Œ‹‰‹††Œˆ‡†„†’–ƒ„‰Š’†ˆ…‘€‰‹††~”†‰‡ŒƒˆŒ~ˆ|†‹…‡‡„˜‹‹†‡‰†ƒƒ„ˆƒˆˆ•ƒ‚‡Š™‡†„Š’„„…ˆƒ…†Ž†ˆˆ‚‰Šˆ€†‚‰€ˆ„‹}ˆ…“…ŒŠŠ‡…€‹{ˆƒ€Œ‚…}…ˆ…Š~Œ…•‚ƒ~Їˆ„}‡ƒŒ~}Їˆ‰{Š~~„‚Š‹€€„ˆ†„ƒƒ‹ƒ}‰t”~„‰…‡‚|ˆŠ‚ˆw†ˆ„‡vŽ€’€†‡‹‚{|ƒ†u{Žs‚ˆ‰†…‰ˆ~xƒtzˆŒ|ƒ††Œx…ˆ…Žx|~ƒ€‚x€€ˆ…‚‚ˆ€‘}~}‰‡z|p„‚~~zŽ‚‰{‹†~}‡†{u}Œ}~‚†€Žzކƒz„‡ƒv|‚„~|~…ƒ‹vŠ€z‚‡…z…„}„{ˆ‚|†x‹†‚|sŠƒˆz{ƒ„„|ŠvŽw‹Š€ƒw††}wyy‚yrŽq†}{Œwƒƒ„~{w~}x†s†qz…y{„~|„€{}yw‚v…||€~‰}ˆ„{‚zx„uw}wuy‡‹z‡Œ~{v€u‡zw}i†}…‚{y†}Œ|}~u‚y~~st‚~€€x…w‚y{€‡hƒ{r……ƒ|||z„€u‰tˆz‰vq€Šouƒ|‚…ŽtŠ}|†y„€|}‚sƒ{{p‡{w‘~vŒwƒ„“„‚v‡|pw…w‹}‚x€’r‚|{‚y€x‘w”ˆzŽ‚‡‚~v‹r‡…rƒmšƒŒ|…ŒŒˆ†z…~‚{k”v†‡‚ƒŒ…ƒ–‚ˆ…‚„}ˆƒ‡€}ˆ‘y‹’tŽŽ‚‡‚€v‹€„|†‡…ƒŽƒ…ˆƒ€y‡{•w~w…‰‰…‚†€€‡ƒ„Œv„~w‰w“vމtš|…„Œƒ…Œy‰†~~€‚u—€Œl‹}މ‹ƒuƒ|‹‹q€”nŒŽpІ‰‹†ƒ„y~Š|Ž€h—zqŒƒ~†‡…‚Œ‹|ƒy‹}„ƒizƒy…‚z|‰ˆ|–p„~}‡zq|†~…€y‡r–rˆŠxr‡zs‡ƒr~|~~‡…uƒp~‰yˆpr„upr{ƒy†‹nz…oœu~zxr…ˆt†€nyys—u‚{t‚|‚€{~yƒyƒtn€~~‹x}pn‚}~‘yi†q{urƒ~€‰qyvn’tŒfs‚ouŒ}m‚pˆ|x}~|†‰v†wh‡|zƒqpxyxŽvs‡y‚}lˆr†xlus~ˆz~„ls€€r„fƒ„c~‚mwz|€x‚two‚xˆmkor…„tt|f}qx€vˆw€umxw{yxrhlrrk†lu{xx~vpunw~gŒ|j„rfsvj‡zˆi{hiso}Šq}€erxgm†n‡tnnnh{wƒ€wxrsk~{u‚wm‚hyqxuzuuyouu{z}€pym_Šp}‡lvmkxvxˆx{ppf`†Š€|…giukyŒ‹zyslykƒ||vrf~xyŽ‹…r|~p{‚€yyˆz|€yx„z}‚}zˆƒ€xn‰„…ˆŠ€twyt~ˆ‰ƒ‹…|vp|j‡˜Œ{fvztz“‰‡ˆypsˆpmš‰‡w…vu}wv’Œw†‡€ou„…€ƒwu}u‚w„Žoƒˆld‰|†‡twyfx~|xŒ…jmxnp–p„•oiytuˆ|xwiw}l†‹…vvsr^™‹trˆsp|uvyŒl†|tk‚vu{u„‹hq’oqf”w†w€wsmxuƒƒz‚…o}npp{a¥‡lksszƒ†ƒ‚nwzswo˜y{„wl}fƒ’wŽrmo‚xƒ|u€xuz|€x}yŒig›†ekˆˆq{‚€{|wx|xŠ~w|†knƒ†oŒ‘~j‡ws‰|‡tww‰ul|Œ‰~†|uz‡zp‘•o…uz€…zyŒ‡~Œ~t…y‰…r”rŠ˜iy”f—z”v†Œ}‹o„|ž|{’ƒ‡q€”‹u kŒƒ‡~t€™ˆm•zy…~–…ˆ•fˆ˜w‹w¤†žs—‡w‹‡†ˆ|šs}ŸŠ‹w{˜ƒŽ|~ŽŒo‡‡•|Šu˜‰v‰€ŒŒ•x|‰}p‚‰‹ f€¢ƒxt‡ˆ‘ymˆ‚t……„‡|‹sq‹Š„j‰˜†mŽr‚„yƒ‚‹qt—…~yrŠwn‰†‰t……‚sˆc…Šyry’ŒvvŠ…wxznŽ~q–s|’}yvt‰upxtz{|kn…‡‹stœ‹„x|ІyƒyzŒy‡zo™‹xl„”sk…{yŒˆt‡w€i‚Žsvi•Šyy{}{Œ_„•kŠyx¡}y„r–‡f‚Š|o‰s†|‰ƒk€ƒ‡…az¥|s‰u‚‡tq‹ˆowu‹lt‚q‘}Y‘lw‡vu‚z‚zp}…‚{i}•zv{{|Šud~’}hq‰w|t|ƒ€rvŒƒb}v~ptˆzyym‘ŠioŽ‘wv{y‚gj‡ˆwmy‡ux|„po‰}f†™xr€x†„uw{ˆyd‚†ˆhmŠš„iuŒqv’“ty~y…v|l…‹‚xs…|†‚nЉ‚i~›{zq‰tu{—wb‘ˆt„~v‡|t{†‰um„šŒbru}Šor‚xs~‡†so˜vnx‹iˆo€„€opŒ}^w“„vyww‚‰xj‚ds–•unt}„onv‚|z†sq|…~\|›}uss‡ƒtrxІud}œˆou{€“Škhƒƒvsˆ€lœqlƒ‡‚tv‰„it‰{Š^l“’€ijz‘ykn…¡}[„‰r…v„„w}r‘•j`~…“o`xŠcs˜‡€{g˜gŠ“zp‡}{…z~•ˆtryŒv‡yf‘§zm€†Žn}œqa”„sŠZmŽ–ka†Œƒ™pA„¶‚pwm“™wp{“‘mynŒ„zor‰Œsy•‘ziz’‘w†‘pr”’ƒ}xz…† €Ytœy‹pfœ§pf‰‡ƒo›‹j‚•y}Š…}p~•wnt‘ŸŽow|‰‹„wv„‹y|€~‰…~ˆt„†zu‡‹uo“jt‘ˆw~‰|Šix‹|‡…ds–xx–gr‹‘šgtŽ™…ƒ…eg±¨jfŒ†‚t~œ˜tq}„…Šui˜—jkŠlxyt”¨zipx| °sB±†a†ˆhz‘†x›‰ef’“ƒŒƒiuœ‡k|„~|„†‹ˆŠo„¨šl[‡‡uŠŠoowj€²šjg~ŽŸeS„•~k†zbh…˜‘qe©Ze‡„vnh‚Žxp…š€s]g§§eW}ziˆ x]k†‰…Œ€urqjš|Zko|™šgZ|u‡—ltqn”rc‚us’jjxn|“pqp^z¨›wlr€‚njtw~‚Œmcd†±˜moƒv|’‘o`jv†‚ywsz„‚“‘jl~‚ˆyejtmu‚‡tn‰Œˆ~sx~pdml‘Œzt€†~„suƒsnt†ys}—†my‹tiž‘sf|ƒzx€†ooƒ˜|eu–~^t¦˜i`w‘€wu[w™~]v˜…frxvŽ‚}w†€\SŠjg“•[bŸ‡z|Œthu…o[rŠ{j€eX°}l}Œydr‰n]x‹mc‚™zc€£šˆhat~v||df…|g}œ•ru“‚{snzt~€yulek…Š’†|g{ƒ€snŒ‹sik{yw…}‘‰zmht‹†uzŒzkaqЬ‹{kq‹‹uv~„}inr„‰}z—rhu†‰‰”Œnv„qrŽŸˆqn|~nqБކ•Šwcqˆ‘’—sSj„އŠ~{vtƒ”˜}xq^c†£›shx}}Œ“•†y_hy†…n}‘˜u[Wp‘¥¬•wbf}sl‰™Žnhsvme›œš{[YpˆŒ‡ˆ”z[Phz’’”ƒxt|{eq…–‹‚swYS`†¦¦s\]‰“•uw€‡oX_m‚˜~fY]k•š„ˆ„g[dn†¤Š`Riƒ‚rf€š¬\S^yœ¦ŒeS^w‹Ž}t„ˆ{o^n’©¢–aOYpŒ‹„‰‰‘tWXrФ§š‡d\ep‡x‰Ž—…XMZuª¸­‘bMiˆŽv~zŠ“†f^[qš£ŸŸfa{Ž„v‡Žzciky£¤œyViŒš‹{~Š‘uWRi´¡™~bS^ƒ›™yž‚dI[wª±ª{WJ{–~l{­Žug]jv¬¤›ƒpd{…™‡ed‘­“VUz«‹}ev“—“{w‹l_ci‚±¨¢vIV‚ª¬{pŠ©ŸwNIa“´¥š|_kj~Š|y‚¢ª‹d`\uŒ¥ªwVxˆ€be›mjy“‘†‚tdj¯r`t‰ul[x ·¨HFbˆ Š{|‹™‚VWX‚¤·¦lTOgƒŠƒ|†¢™wU;c…§²Ÿ„tq‡‡nYl˜¢‘…w[mv‰€“‹vbj‡‘ƒcho™…Œpegu„“ ”Š€rkZle„”®µ…bEOpŽŠ§´oEPIŒ™¢©•Šud_Yd{¡µ³ŠonV~oŸ‚ˆ‘‘‚vo_qŒ›ŽŒ€e‰ƒ–“afa~ž¦’n|vnjnty¥™§“hhVdm{¤²™€H=Tjš£¸ª€t`aUf}‚¥¬§oI*b‹³Âš~got|fY}›“‰k]}ax‡v˜˜†lyƒ‹€n]]x‘“›~–sN_by˜¥˜Š{qdaS^·Ì£rG.My‘«¢˜ˆxkfOXy‹°¯œvO/Rˆ¤¹¨xfldqhlƒŒŠ”‹ztvd_o–¬ŠXb{ž‡][n†—›ŽƒpWMcu‘ž“‚€{~qNW‰¯Ä°ƒJCCa‰§¶¢p]iYjuƒ–œ£œˆN1L|µÄ¶wir]uvz~~‰„‰qhcprެ]gs–ŠfPs{Šœ˜‡ij\fˆŒ–•‚{ƒzvKX†±Ïº‰FDa`‹¦°Ÿ‘€`eQarž§½µ‘bBcœµ§‡mk_jyƒ|~¦—Œ™“{mfk}©£ˆij€•’Œƒau–— ¥‚`^kYvŒŽ œ„†”†vcn–²±«…UBSVw©©ž™šxdmwuŠ——š¤T?Tw—®±®Žyq\j~€€Žxi„lr}kv®« ’€|vwhfwz{y›‘myye{› ¡šŠ_VllVj¡¡¥¢|mhe}§¤ŸƒobCDbi£“›­¢vmqmz£—‰€lXK[toz˜žŒ}™ŽtzjY†wqypkw‡…“šŽpdXM\}އŒwkˆtn–›Ÿ YSN9W†‘’igxy‹§†‰€N>UTl™——œ–Œyxwit}‡nigXda_”«Ÿ•¢¨|oBOu}†„nWdal‹’£°—©‰\]G;`…¢¢¡[in_Œ£›£‘r]J@Vk{¢¡§ªxhvi‡¤’Š‚„vS]TOrz‰­©¥’zm_hŒˆ‡{z‰nkmbn† «œ­žl]JJkd„›~‡‹~un~„„µÀ­ŠeWH4cvy–œœ€uƒikŠ‹žž™bFNNn„‹©Ÿ¨wmuv|k{Š‚†w_MD~™‚ª®”™–“rVlij‚‘}dsVUŽ™ Ÿš¦ŠsrYU\m˜–£€dhsƒ¤¿ƒy\\Val^ƒ·©–‰…fcž©Ž¡ŒzqXcfZr‰‡¡­€k|t€’•p…m…†rj€˜”ŸkZdnk’¤|y—š…o†wˆ¾´Œ{mD;h†‘š˜“„x’’hp‘—¢¨†aR_ikx¨º“w†{wœ™{msˆŠupcIZˆ’Ф²Š™›£qeBM„ˆqhrek‰£Ÿ˜•–•“š}QXihx‹˜tabhm‹´¸›‹ˆzy†jNNf’xkaz“• ´¨yZi„vmjWq–”v_rr——……ƒ…~†«˜ke_as˜gczyjw“–zs—œ ƒg_ˆ¡Ž…y_OSbs‡›¨‡{—¡›„uf\y•„_Octv™š›Œu€•¯›ncdolima^oz~’¢¡£¸¨•|Z=Rikjhp{€„‡£©Œ†¢§ŽnYL^wthnurjl„¦¯ª˜‹›¡‰taLP`kolnu{˜Ÿ¨¡w™˜„bJ]uj\av‰†„Ž ˜’Š—«—qQBV_`v‹Ž†„…’›Ÿ“ƒ™jEJ_~{yƒƒ~wt€œ¡–˜¡›‰{nSYlndg€€„Ž‰Ž˜ž•‹€zŒt_ww`[{†„ux”¡Š–Ÿ™kDWk\a€‡z~‹‚‚…‡–µ©…}‚jH`†ufvƒƒsgZm¢«¾¶ˆt€{d\hcXt‚k]o|“©§œ¡¤‰{‹bTm}c`iovz…‰‡…¦Ë´ƒ|jZTSGU{Ž”‡xyŒ”¡·À ~sxjK?Zpƒ™™~eby›¡•¦¼½ŸydZYVd~wcq~€ˆ‘¡©£¨®¢€ZTi€zjosw‡šng‰ž™‘•˜œŠT@iŒ}|nƒž“y³¶™matk_~‘ws‡‘yX]‰Ÿ“žÂ®xkެŽSLprbnƒpTm­Ð·~“™”tPYvtYYu†zyŸ¢‚u›Æ¿‹’[GXWHXЍ“_k¦¾µ§™‰u€‡|T@Sqy…™„ZYˆÂ¹ˆ€“žŠˆˆ{`]oykKT€”––©£’“‰ro€zƒ‹cIZ“ºœk_ƒ—~y…ˆ|«¥[V^fw‡Œqu‹‘}……‰œ}Rdœ£vcvŒ‰i`s…y~ ±”v‘””’{E=i{yqw‰ž¡™Šit›¦}dylMi•žzevŒŽqo¦ ž•tewƒkQd‰‘†‚‰’§­hbqlTg”‘fj˜ªgb€Ÿ›‚{wrr|‡}`]|ˆ~Ž—˜rvrfj…‡z|‘–ub~¤³—iX`th^q”Œ“Žne~–Ž|bYd|Š“’‚r|~s{†‘št†ƒ|]G]œ…yŠ„€Œ„’¦–uZJ[elv~ˆ‘¢‚xyr…~ƒ‚o^Q`ˆ©¤wfy‰†{q†‚{u`R]~“™š‡i{š–‡re]\]_gz’–Œ£¨•jiŒ‚rdV[bjƒ§¨Ž}s|Œ€w|„‰pVRk‰¤¥zj¯°¥‹p^fp_^d]d‰´µ¬¡}bh~„~}tfct~„‹ŒŽŠ†}‡šbYt‰ˆ‰qTVr…š­ª€Œ›˜™mA9Pd`fxx‚­Ë»§¡~wwbciT?;Z‚”žŸ¥¬¨•œ•zafkknK1:ZŠ«À´Ÿ¡´º§“lOTWJ:R]P\‹¾Éý¤œ›‘f\ojYKUez†{x}Œ¡²¿£„u…‚riTQY]k‡¦“ws•½Æ¬t\oz^FYhk…›¢š ™ƒqw|x„Žu]dy}€Ž’¢—|x•¥†RCe“šƒ`Tm‹™©Ÿ•™—›™€N:ES]p}|w™ÄÉ®œ¦XB\nQ,4c—ª§£´¸¦—¦–fT_h^;*BjÊÌ® ´ÌÆqWlyP-6T[Ul—¼ÓȬ¨¼´ƒY]kmcID\s„…‚€‰´Ñ¾™‹ˆ†zdQKbeWl’ Šp|¢ÊÅ‹gy’R?L_…‹““Š}‚|sŒŠsrwugjН±ƒg~œ™iNNjœ—hWn‘’™§¡‡Ž~cKFNSd}so”ÆÈ±•‡š° gHO_`>.Fn” °Á¶šŽ˜”zRRgbJ47W†¼Í¸§¬À¼œt`mrP13IOObƒ§ÌÕ¹©»È¬x\^rjG05Ur€{zžÄǧœœ˜‰n[\bXTd„“‘wl„¥·¢||‹ˆqQERy’Š…ŽŠ„||Ž‘ƒ~~p[]{ ¥…gl†Št]Ue…~sv‰››“¨¢Švnoi\MCE`rjl‘¹Ç·œ‹®šr[W][SFKv«¾ÂÈÈ̺™xrR5$-4A]oƒ¨³°¹ÆÅ³—|lxuZ@)@k‚…~z¤£š›ž—wfSW^UXez—˜ŒŠ•Ÿ žœ‚gWICWlvlm}‚‡…‡¡¨ž˜”Ž|glƒ“ŠzgZfg\XXam|}}Œ–¢°°¤¥ “€dX`faNAB\pn†¨¯£Ÿ›—‘‰xkiid\QMQe“´¹¸®Ÿ—Žzc]ZS@79DVc§ÂÊÍÓϱ“wujN5 ,<_|„œ¼ÉÊÇ«›tdOA68Tz‰†|‘¦¦˜˜–ƒo_PT^ey‰‚•£›†|…¡²¦ƒcSUORgxvi`r‘¡•~…Ÿ¯­œ…ngtƒŽ|okf`afqp_\oŒ—ŸŸª¸²ž—šŽrQDa…|V87`ŒŸ§§Ÿ”’–›–„qkkgqs]EGsµØÌ§‘•›‰h^ggI+,Px‰ƒ‚ ÏßÙÅ«”suzfK0&J{”‰sržÕçË£”˜˜}l`SLDIhš¯Šel–®°ŽŠu[Q]qwrnx“©¸«Œtz®«|\NEGUpˆ~V_н}[y£·©zakprw‹“}ja]p‰”ƒ\IX~¦¡Š‰’ §š˜˜ŠoP^…’o=,?g–¥¢¡‘t{ž³£{d`o…ŒrRM]~ªÃ±„~sot‡€X12[›r}¢ÊÓÀ§–‚qoprcF*)Nz–‘xp—ÎÕ®…vx~{wdWVay‘£žˆxmu’¥§‹[=AXŽ}o‚®Ã¸ªŸŠuo…–ŽrI*2Sw—–‚p¨º©—…€†”Œub[`q…™’‚y|Š‘†‹~bGGe‰”Š{ƒ•¡³²œŠ…Ž”}oiS52V„š”tas”ª¨”ˆ‘ž¢qmmjit†Žˆ{f\m‹ƒurz€xi~›ˆ}‰¨«”wfm{„~qb\f{„‰Œ|ox…“—Œwp|Œƒvx“¬¤„n~yebluud[brwy¯ºº§–› r][greI:N¡ •‹ž±®–Šˆ€~qef^Yw•—‡“¤¨¡”vyomk_LSr‰‘™’–²¾º§Žyr~sV@?\~dVvœ«ž–®½±•umee„iUTco{…‡Š“˜¥¤Žjbxˆ”‡cUav‡‹ƒˆ› |yˆ‘„aSjwseWd‚œœ’„„Ž£»°Žmiqli^YaYSb€‹|~™½Î±‰svƒytkWRV\dghyš¦œŒ˜¯¨‰mo{~r[SST\ušŠœ£¤˜…voi]`\UMM`‹˜Ž‘š §²­pfpeQ@Fbn]^v’–—®¿³‹kdmg_`]^d_fq~¡›˜œ¤—sYbwvcSYmi`o‹£©¡ŽŽš¡vnmqhZTUbhdz”š“•’’¦­tntlXJRj}qgj€”˜Š‰™¬²•wlgd_clwxaYk~ˆ–™’œ¨ª“rfiovo_UcfYa˜Ÿ¨Ÿ›¦˜}w~zgNNW^_Za€ž¥ž‘™¨¯ ‹v][]WS[chu‚”“‹Ÿµ³‹dc_]b`\b}tv‹–˜›¦¬ž‹€l`UVdno`dnu~Šž¯¬‘‘’‹sc[d~zfRQ_l‚™†‘™”Ž~xvw|s_Pg†„xw|{„‘‘›—{nit†}tmo{~ƒ€xz‹¡ª¡s`[g‹”uPE]wŠŠ}˜²·­¢–{dn~‰ƒ`=1Jp„ˆŠ‘˜ §¦ —‚vux}iP@Muš¥’ƒˆ‘›¥§’lQTj‡€_Ng–®®˜}¦® sS?Mh~…wcdœ£™Š¡¬©“…tiTSo’¡„YK_„ž¢~~ƒˆ‰”Œwl{—§«Œ\Ng”¦˜yYTj‡‡‰Œ…}…“™yfqŽžo`m™¢¤vag™}VLYy|s‹²Æ½©‰wq{Ž–f1#Dw„x„™«²ª š‡‡Š‹|aHEYw–£•„}‡—¡ “ob]n„‡oTg˜¾Á™{{“¬®—{[ECSq€yoipŠ£±Ž™©¨ŽlUZlrs‡”‹lUb£Ÿ‚vpv€~{qrŒ¡°¬n`w‘œ‘jOFSxzem‚™œ˜—–xyŠ‹…eUd}‰‚€}yv|[LXe{„|w~£¿½žv‰›š‡r]=)@f}|go‡¦·«‘ˆ™œ”~iXTWmz{ˆ‡Žš’~ohkjgouxpt§¹¨„˜³ª‡cQDH`npfcj˜Ÿž”˜¡¦ ‰dV^r‰‰xs}…zvy‰–„lmuvupsyƒ•¦­§”ˆ…•™‰~rVITmzrdap–¯¤‰—ž’„zrhhx’€w|ƒ‚unlpkadtƒ‡Œš«³§•Ѝ¨‚d[UWVV[erpx–­¨š“–š¢£ˆh_jx||pmŒ…‡‘{a^q~q^^s’›••¡©œ”ž›ƒoUIUhfSP^v–‹€Š£¯ ‘’zgbn†Œtaj…•‰tjr}widfuzlg€¢¯œ‡ƒ–®±™r[gn]TR[fh_c‚¢›‚~•´¶—v^cƒ„tkyˆ„pmyxgcl€sXR]x‡‘••ž£•‹š³°TQarqN15d„„yx‹¥šœ£¥Žf_{Œm]ar†ˆvl{ŽŠhUeuzh[c‚ª¨Œw€™®¯ž‹tcT]ngG8S}–‹ody¡¸²”}„‡|zwxojz‡ƒrfhqspaVj€‚ln—®¦Œ{Ž´Æ©y[WbmhYMKVhs„†~zƒžºÀ¢u_iˆšŽiYvŒ‹wmuxjpyq_[eqv„”˜ž›–˜¨¸¬oYdx}fB+:fˆˆrnƒ ³µ¯›ƒuy“¨špS^uket‡Œ}nhgmxwt”¢›‰€†Ÿ±®ž‰{ieltjQ?Htš•tYh´¿£‰y|‘¤ ˆjcxˆŽˆumhmspp]Wj†€}‡™¥ ”–­¾º“l]YgnjbLETw‘‰qj€¥ÆÅ©‚ag‰§žw^b~•zhgv‡Š}rc\]lvw{}¤¡š›¨¶¯–~topwtP..Jx‹zgjаĻ™}q…­º¤zYOkˆ‰tZ[p†ŠzhSUnˆ–ŽŠ‹•–—©¬›ŠyrnnlcSBPmŒ”|a\}§À³†os±¸”dXeŒ¨œz_^fqtm`JMm‹–„~‘¤ª±µ¸¯aW_hbMBCWx‰}lk~ªÒѱ‰nj£†UIh”¨’eN`–œ]QYlu~€‚…˜«¸¸«›…|ƒ~k]PC6Go€x^_…ºÚÆ—so‰³Â§{ZYi|Š{`GRžšvKBX~£«“…Œ–›šŸ££“wr}‚xXBBLc…yrr£À´Œ]`‘¶ºYIc”³§`[n{xp]J=Ixž©‘ty’¹Ô̱ž•‰n[\\O9*<`ˆ–t^k¿ÚÓ¬…qtŒsPA]¬¦vLQ|§ª…`NS`lv}zy‡«ÍЬ‚{„“}bL@>=Hfwobk‹¹ÚÊŽho–¸¯ŒjXaqy}ymWVmŸ‡W?Ouœ¡Ž…ˆ•Ÿ¢©§šƒwrw…}X3-Ci……ƒ{~‘—¡¨¤†mo‡Ÿ£QHd’®›…zpvsplaTHPj†•‹z|”µÔÒ·‡yg\RF50=Y{ˆ|n€¥ÈͳŸŽ†„~yr_LOg…“…ur~Œ’…rb^gjkmpy‰˜©½Å¶–yxŠ‹u\KB@AOguqy•¬¸¸¨™‰…Œ–‘cR[r}vuy†‚v|‚ye`q‚Œ˜ž§³³¢„w{|qaYQEAQjˆƒ‡ µ½ª‘†Ž}|vaOUz‘Œ…ƒˆ€w`^qyulw‹˜–™¯ÃȬ~lv„tXABOIJa‚“Žž¼È¿«{†~ZALd{|…ŠŠz‡”nU`~‚qsŒ››¦³¶Ÿ|fjtsiR86Kn‡‡{~˜®½¾´¡‰rkyŒ‰e94]œƒpt‡‰Š‰}f[_q†“wq…«ÊÄ¡~ptspeZG71Ah‘Ÿ…n†½çà·Špq‡…lH29Tz‹vfwš¸³iYe|ˆ‹|kjt‘¶À¡udtŒ‘xU73Lm…ˆoh~«Ùå¾|Xnž³šb53S|Šk]_t‘ª¨ˆcXqš²³˜tev•§¨Ÿ‡iWXj}rO2!+`˜©h^‡Ëúüш`hŸˆ`9'5`ƒ„cGTŽÐèÑ›ha|˜£™Žy`P_~–”„w”œ—…^EKk”¤—uKAd¨ÛÙ©q`†´¿¡c@Ow‘†b@,Ev¨¸oXi™Âȼ …€ƒ…„{ug^^eedXKKg˜Àα{cq•ÁÒ»‚MDa|…jFBi¤¸žtMO~ªÁ³‡S9Mz‘„}„ž£Ÿ—‰„‹‰~jW?-3Op‰•€gl’ÃåëËš}x†~S'&T~tQ67a¢ÒÝË¢xo… £“yf`kl_TWh† ¬ŸˆuhhnvŠc=In“Ž“¡£{af€Ž|P&C|˜yij‡°ÇÁ³¨¤‹yoaPGUnsZ<8S|˜£®¾ºœ}v‡¤ªp_chbZTUi®«”ygj~’Ÿ|TBY|‰zkzž·±™ŠŽ”ˆ…|lJ14Odknu|‚Ž¡²ÁÈöš„xwlR;>YndH7O€©µ²´±£…™oakulUJPkŠ¢¥•‰†‰Š‚z||hTQfx~yƒ›«®œ’›Ÿ’~x}tU33Kcmjfl…°µ²¯´¸®–}g_WQRUWNIKe‹¢¡œ¥¸¸‚‹‰xd_af\V\n…™£‹Œ‡€zmdZY]hpmj{ »¹Ÿ•¨¨qe[SLHOUWXgz¢©¬¯³µ­ ~oe_TMMWVTWhˆ£¦š›§§•ˆtlhmpiXR`{•™†‡›Ÿugdlkcaadju|‹¡©£ž ¤¦–|ma]XMNYWLOe…¡°±«¥¨¶»¢icggYI@=Ga{™™šœ¤¯³¥‰vsqeWUYZ^m~—¡–›¡šƒfVUXZ^ee`h€š¯±««¤¥¬z[QY`ZQORU]v¢±²°¥œ¤¤“{mqocVPU^^j~Ÿž—„•¥¢umnnkfbhrz†”™¡˜„leigdchomgo~’¥©©£ §¢“{mjif`SMRV[pŽ©®¦œ«±¦Ž…€jSJJR`hq~‘žŸš’—¡ª¤uc\ZY\huuvƒ˜©¥›“ž¬¨‹k^ZRU]aahox‰œ§¬²·²¤‘‡xkkf\QNUemgj‚©Á´—ˆ’Ÿ”†}ofdfdbej|‘›•‰‚ˆ™£›€mmqsmae‹~}‹•–”—™‡ylZR^q{recpˆ©«¢™¤©•wdblrcOJT_k~—£›‘˜§¯§“…†‰ybUTYdszz{Šš‘…‡›ªv[Wbokjq|~€¢¥–ŠŽŸ¨—v[QW^ilfZe’”’–¢®¯’Šzjhkl\SZjpmnƒ ¨“ƒ„š«¤~snu|ud^hx‡‹‚{y~„Ž ¥Žk`r‡ˆm[gˆ–ˆz{–•““™”†wf^_hkjddmz‹’–ž¢¡›¢±¨ˆcUc|wU>Hfy‚„ŠŒ“¢®³Ÿ„su~}taXbu‚„w|Œ“Ž„—”xZZtŒƒkiy”’‹ˆ‰––}`QYm{g\c}™¡“}‘§¦—‹ƒrjozw`T`s{rpŠŒ—¦¥”|s|‰Ž€h^eu€oak‚‘•’‰|os‰—ˆgVgŠ–Švm~•œ˜Ž‰ƒzphmrj`\_m‚’’„„“¢¬§ž–‡vc`qwcIGa€Œ…sq‰¨¬Ÿ•†vqyqa^mŠ‚tl~”˜”‚uz|odp‡Ž}il„œž‘}|‹‡|sjdcl{~n\c~œ£”€u𦛄{~|sntyufbmˆ|jh{Ž–™”…zx‡–u`cs‚‚r`f~’‹€|y|€‹•y`^z•”nrŠ—–ˆz}ƒrkwyj[Yi…–’„}‹—Ÿ¡ž–‡ypgpymWMYwŒzix•¨«‰}ut}†}g]cyŒ‡vo‘Їxtrns†Œ~pktŽ¥¢‹xŠ‹„{rkgdfw…w``w™« ‰}„‹’”Œ|rlmrwvpmrry†Žptˆ‡zq~–˜ƒois„{nltu{…‡xmq›—„vqs‹ppx……zsy}yv€‡yjhkx‡Œ‡‚€€š“ˆ|uvyzpeeffnˆ~txˆ›¤šƒzv|†‚tf`ity{}~}Š‘Œ~uno}ˆ„vstuw‚—‘{…€urrkjryvqpt~‰™ ™‡|ˆ‰|nbhuzspsx‚‡ŽŒ~tz‡‡ztpvŠˆ…†~|{}€torv{zurwˆš‘‰„…~ƒˆ†ugfo{|zz‹‘Žˆ€yy~‚„€vrv|‰“•ƒ„ŒŠ|rpsxrgju|{‡– šŒ“wwtme^exˆŽŠŽ˜Ž€~ˆ‹zljqz{}‹˜–‡}†Š€vxƒƒra_m}’Љ𛄀…‡€wqmfbj~Ž„vzœ•‚v}Їsioˆ††‰Š‰†x|…‡tjfddk™ }~ žvt…€aNP^s†“•‹}v…˜œ‘‚xx}}s`^r‡‘Š…‹ŽŒ€|‚‹gVWfw„ˆ‚~„•©«™}u‚†jLBW}˜’ykoz‘ ¥Ž~wyzvhamƒ”’ƒvv€‚…‰•‰mURc‘Œ~u}›™„xzŠ”ŒpREYœ›|bf~š¤•vuw}€|rnu„“’‡zqxƒ‹‰zqbSXp‹œ•s}•¢‰xw„‰rXHG_†¢¡‚ijƒ£®›|jsƒ…we^cn’–’ˆ~}‡’“‰wcY]grx|ws‚¬©—|Š˜lK@Rn…~kdoЍµ¥Šw{‰‹|fYYpŒ‘†vru~‰”˜“„rcgs|zvrt€Ž”‡Š•x_Tawˆˆvdf}—¡š‡{v}†‰‚vliz„vmq‚”–‡tnjhmu‚‡„~‹”‘Œƒ}Œ‡o^Z]jyˆƒww‰™š“‚uwƒ‹ƒm_cnŠŒ‹ƒ~‰’Žqggr|}ulnx‚’˜—Œ…‡Š~i\\hw€znmw€•˜™Ž~‚…€o`apŠ„wq|†ŒŠƒwosx{xlhr†••‰~ˆ‡~yqhktzukkv‡––ˆ‚ˆ‰†ƒzvrsx}ztz„Œ…|wx}}z{~xw’ˆ{w„’’qnouyxvu{€†ŒŒ„€€„‰Š‚vrv|xv~‡‡€|~…†~trz€z{{z€‡ŽŽ‡~€ˆ‰ogir~~vqv‚Š„†Œ†ƒ€|rmrz€zv}†ˆ†€|ŠŠusx{zvvv€ŽŽ‰‡‹…yqnqxyqis€Œ’‹‚„‘†~z|xuvyuqt…‚~€„‹‡|xy}‚~uq~ŠŠ„|yˆŽ‡~ywvwyyxst~‰‚y{…ŽŒˆ{}}{vrx}~}}}}|€ƒ‚}z|„‡w|†‰yq|‹Š|rnty{€|z}ƒ„††€ˆ‹„vptz€€~y}ƒˆ‚xx€„ƒ|z|}wy|~~„‹ŽŒ‚|~‡‹€qhny€{rqt‚‹ŒŠ…ˆŽŠƒ€ztqv~ƒ|qsw€„€†Ž„zw{€~xx|‚†€€~z€‹Œ‚ysry€~unq~ŠŒ‚y{…‘‘ˆ€€€€}~€}rmp{ƒ€}|€ƒ‚}‡Ž‡|€„€|us~}omqz‚‚ƒ€z}…‹‚vu‚’‡vlq…„€|~~zz~€|yy€…€|z~ƒ†…ƒ‡Š€u{ŠŠwgdlˆƒvqx‡Šˆ‡‡ˆ‰‰‰ƒshjyˆ‹€rjp€†ƒ~ŒŠ€|~|yx|†Œ†zux€‡‰‚€zsnv„ƒtlp€…xv„‰xwx~‚ƒ~ndiz‰‰yz‡†€z€ŠŠ„‚€wqns‚‰yooty€ƒƒ€€~„€tq{‹”yiiw…‹ƒxuuy~|yvsy‚‰ƒyv|†Š‰ƒ{z~{|}ukhmz…„|v{‡‡„€‚†ˆ…~sgeqƒ†ulnyƒƒ{|‚ˆ‡~ttuz€ˆ‹†xsv|€ƒ€|xvvvvvz|wv~†‰ƒ}|ˆŠˆvpu}‚€xrllu€ˆƒ{x€‡‰xw~‡ŽŒ‚wstsv€…‚{utvw{}‚…‡‡zx}~…‹‰~spu}ƒƒ~xwx{wyz{‚ˆ„|x~†Œ†}wx|€‚{ussqsy~€€‚…†‡„€~‡‰Š„zspos}ƒ„€xxy}~€€€‚„‡„zsuy‹Ž‡~xy{€‚€{yyzzyxvy‚†‰…~}‚‰‹‰‚{yyy{}}zwuwy|~€€‚„ƒ||‚‡Œ‹€ursy€…€yuyzyyx{€‡‡‡‡€ts}‰Œ‰€yxz|yyz€€~yyzyy}‚€~|…†ˆ†‚€{xy€„qmt{|{yz†ˆ†…€~€†‹‹‡|qnw}yy}€wuyƒŠ†€‚zuzƒ‡‡…ƒ|zy|ƒusv~€zsvƒŠ‹…}{ŠŠ…~{zz|}zuu}€zwzƒŠ‡€z~„†ƒ}}…І~uuy|~}zvu{€„‚{{‡‰zpy‡‹ˆ€x{€€xuz€ƒ~y{€|{|€ƒ€€€ƒ„„€}ƒ‰Š€rr€…€wqpw€}ƒ€ƒ‰‹„}{€‰sow~~{xx€ywˆˆ€{€††€yz€„‚€€„{vw€„‚wnu„‡€zw{‚ˆ‰ƒ~€„„‚‚}ywz‚{sr{€€{{€…ƒ€|‡‡‚}}ƒ„€~zxy{}||}zux~ƒ‡ywŒ‚xx……€xx}}|}~}xvyƒ~|{}€€€€ƒ‚€€€}xx€~xttx|€€€|y€ˆŠƒ|y€‡‡~vtx€yuu{|~€€€€||†ƒ€}€ƒƒ€yx}€}y|}|yvuzƒƒ€{y~ƒ…ƒ€€€ƒ|xxy€…ƒztsy€~{|~€€€‚‚€€‚„†‚zxz€}yvvy|||€ƒƒ€||††‚}|ƒ€yvx|€~yvw|‚…|y|€ƒ|{€„ˆ†ƒ}xy}€€|wvy~}||€ƒ‚ƒ‚€€€‚ƒ€{wx~ƒ}wvy}ƒ‚{|}…ƒ€|~…‰†}uu|‚…‚}xtw|€€€€€€ƒ„ƒ~|}…†ƒ|wx{€ƒ~zw{‚~zz}€ƒ‚€||€…ˆ…}zw}ƒ…}usu|‚€~}}€ƒ…„€}~……€wvx}€‚‚{xz}€€~}}~€‚€}z|€…‡‡ƒ}ww|‚}wuv}‚€zy}€…‡†„€|{€„ƒ€xuz}€}xz}‚‚€~}{}€€€}z}‚……‚||}‚‚zttz€€}y{‚…†ƒ€}}€„‡†€yvw{€~xw~‚‚€{z}ƒ‚‚€}|€‚„‚{}€}}~}{xy}‚‚€}{}‚‡…€z{‚„„‚}yz|€€{y{€{y|„…€~}€ƒ„„„‚}zz{}}|yy|}~~}€€‚…ˆˆ‚{y{‚†zux€}}}}€‚‚{|€‚€}|{|‚„‚€ƒ‚~}{~‚€zvw|€}{{€„††„‚€}ƒ†…}vvy}}zy}ƒƒ€}|‚„„‚‚}{{€}|}}||ƒ€{z~ƒƒ{{€„…‚}y{€ƒ…}{{}~~{z}€€}zy„…~€‚€€€‚…ƒ~zwx{|}}{{|€…‰‡wuyƒxvz~€€€€€‚‚|yz~€~|{|€‚ƒ‚ƒ€|{|€€}xvz€€~|~…‡‡„}|~…ztuz~~}z|€ƒ„~~€‚ƒƒ‚~yw{€€}|~~}}~€€~~€{y|…ƒ{z|€ƒƒ~|}|~€{x{€ƒyx|……ƒ€€€€€€~zxxz||{|~€€€ƒ‚ƒ…„€yvw}|z{}€€€ƒƒ~zxz|€‚€{|~€‚ƒƒ€|z|}|zz|~||ƒ…†„||~€€}zxz~€|{~€ƒ„ƒ|‚ƒ€}{z|~~~€€~~}~€€~~}}}~€‚€~}|~€€€~~~~}|}~€€}zy|€‚‚‚€€~~~~~|{yz{~€€€‚‚€|{{{{}}}~~€€€‚‚|zz|~~~~}~€€‚ƒ~{yz{~~~|{|~€€‚ƒƒ‚€~}}|||}~}||~~€~~€€€~~}}~€€}|~€€~|}~~€€~||~€~€€~||}€€€€~~~~~€€~||}~~}~‚~|~€€~{y{}~~}}‚‚‚‚€~~~~}|zz}€€}{~‚ƒ‚|{}€€}{|~€~}~‚‚‚€~}|||~€}{}‚~~ƒ‚€~~|z{~€}|~‚~}€€~~}}}~}~€‚|{}‚€~~€€~~€‚ƒ~}~€}{}~€€€€€€€€‚ƒ~||~~z{~‚€€€||}~}{{‚ƒ‚‚‚‚}}€~|{|~~||€‚ƒƒƒ‚€}|~€}{{}}~‚ƒƒ‚€~€~}}~~~‚‚€~}|}€€~~‚~}~€€~~}}‚ƒ~~€‚}{|€‚€}~€€€~~~}||}~€€€‚€€‚ƒ‚~{{}€~{z{}€€~{}€~zz|€‚€‚‚}~€€}|{|~~}€ƒƒƒ€~~€€{yz}€€}ƒƒ€€€€€~|{}€€€~~€€€€€€}}€€€~‚€}|~€€~}}~~€€}}}~€‚~~€€€€€€}}}~~~~}~€€‚ƒ‚€|{|~~{z{~€‚‚€‚‚€~}}~}||}€‚‚‚€€~|||~€€€€‚„„ƒ€~}€€~|zz|~€€€€‚ƒƒ‚€€€€}||}}~€€€~~€}~€€€|||{|€€~€€€€€€~€€~}~€€€~~}}~€€||€‚‚€€‚‚€~~}}}~~~}{|‚‚‚‚~€~}~~~}}‚€€~~}}}€€~‚„‚€}~€~}|}}|}€€€€‚ƒ‚€€€~}}}~~}~€€~}‚€~~~}~€€€€€~}~||~~~~€€€€€~€€~}~€~~€€~~€€~~€€€€€€€€~~~~||~€€€€~€€~~}}~€€~~~€€€~~€€€€€~~}}~~~}~€€€€€€€€~}~~~~~€€~~€€€€€~~€€€€€~}~~~~}}}~€€€€€€~€~~~}}}~€€~~€€€€~€€€€€~€€~~~~}}~~€€€€€€€€€€~|}~€€~~~~€€€€€~~~€€~}}}}~€€~~~€€€€€€€€€€~}~€€~}~€€€€€€€€€~}}}~€€~~~~‚€€€€€€~~€€~}}}€€~€€€€€€€€€€€~~€€~~~€€€€€€€€€~}|~€€€~~}~€€€€€€€€~€€€~}}}€€€€€~€€€jffnms-0.9.3/htdocs/.check0000644000175000017500000000004111377440254014662 0ustar csmallcsmalldo not delete. setup verificationjffnms-0.9.3/htdocs/index.php0000644000175000017500000000163011716447477015444 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ require ("auth.php"); echo tag("!DOCTYPE", "", "","HTML PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\" \"http://www.w3.org/TR/html4/frameset.dtd\"", false); adm_header("","","",true); echo tag("frameset", "", "", "rows='20,*' frameborder='no' framespacing='0'"). tag("frame", "controls", "", "name='controls' noresize scrolling='no' src='controls.php?'", false). tag("frameset", "menu_frame", "", "cols='*,0' frameborder='no' framespacing='1'"). tag ("frame", "", "", "name='work' noresize scrolling='yes' src='blank.php?'", false). tag ("frame", "", "", "name='menu' scrolling='no' src='admin/menu.php?'", false). tag_close("frameset"). tag_close("frameset"). tag_close("html"); ?> jffnms-0.9.3/htdocs/auth.php0000644000175000017500000001045311535643773015275 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ # NOTE client_id is auth_user_id for customers define ('AUTH_TYPE_USER', 1); define ('AUTH_TYPE_CUSTOMER', 2); find_auth_config(); $Config = new JffnmsConfig(); config_load_libs('gui', (isset($jffnms_init_classes)?$jffnms_init_classes:0)); check_authentication(); function check_authentication() { global $Config, $Sanitizer; $jffnms_rel_path = $Config->get('jffnms_rel_path'); $client_pages = array( //pages the customer is allowed to see $jffnms_rel_path.'/admin/calendar.php', $jffnms_rel_path.'/view_performance.php', $jffnms_rel_path.'/admin/reports/state_report.php' ); ini_set('session.save_handler', 'files'); session_name('jffnms'); session_start(); switch ($Config->get('jffnms_auth_method')) { case 'http': if (!isset($_SESSION['auth_user_id'])) { $auth = jffnms_authenticate ($_SERVER["PHP_AUTH_USER"],$_SERVER["PHP_AUTH_PW"],false); if ($auth === FALSE || ($_GET['logout'] == 1 && $_GET['OldAuth'] == $_SERVER['PHP_AUTH_USER'])) http_authenticate(); if ($auth !== FALSE) { foreach($auth as $key => $value) $_SESSION[$key] = $value; } } session_write_close(); break; case 'login': if (isset($_REQUEST['logout']) && ($_REQUEST['logout']==1)) { session_destroy(); session_start(); } if (!isset($_SESSION['auth_user_id'])) { $auth = jffnms_authenticate ($Sanitizer->get_string('user'), $Sanitizer->get_string('pass',''),true,'from '.$_SERVER['REMOTE_ADDR']); if ($auth === FALSE) { if (!empty($_REQUEST['pass'])) $error = 'Invalid Username or Password'; else $error = ' '; include ('login.php'); die(); } else { // Register the session variables foreach($auth as $key => $value) $_SESSION[$key] = $value; } } session_write_close(); break; default: die('Bad Authentication Method.'); } # switch if ($_SESSION['auth_type']== AUTH_TYPE_CUSTOMER) { if (!in_array($_SERVER['SCRIPT_NAME'], $client_pages)) { $url_limit = $jffnms_rel_path."/view_performance.php"; Header("Location: $url_limit"); die(); } } } function find_auth_config() { $auth_configuration_file = 'config.php'; $auth_dirs = array('../conf','../../../conf','../../conf'); foreach ($auth_dirs as $auth_dir) { if (file_exists($auth_dir.'/'.$auth_configuration_file)) { require_once($auth_dir."/".$auth_configuration_file); break; } } } function jffnms_authenticate($user, $pass, $log_event = false, $log_event_info = '') { global $Config; $retval = FALSE; $auth = 0; $auth_type = 1; $auth_count = 0; if (preg_match('/^[\w\@\.]{0,20}$/', $user) && !empty($pass)) { $query_auth = "select id, usern, passwd, fullname FROM auth WHERE usern = '$user'"; $result_auth = db_query ($query_auth); if (db_num_rows($result_auth) == 1) { $row = db_fetch_array ($result_auth); $passwd= trim($row['passwd']); $encrypt = trim(crypt($pass,$passwd)); if ($encrypt == $passwd) { $retval = array( 'auth_type' => AUTH_TYPE_USER, 'auth_user_id' => $row['id'], 'auth_user_name' => $row['usern'], 'auth_user_fullname' => $row['fullname']); } } else { // Didn't find user in DB $query_auth = "select id, username, name FROM clients where username= '$user' and password = '$pass'"; $result_auth = db_query ($query_auth); if (db_num_rows($result_auth) == 1) { $row = db_fetch_array($result_auth); $retval = array( 'auth_type' => AUTH_TYPE_CUSTOMER, 'auth_user_id' => $row['id'], 'auth_user_name' => $row['username'], 'auth_user_fullname' => $row['name']); } } if ($log_event==true) { $Events = new JffnmsEvents(); $Events->add(date('Y-m-d H:i:s',time()), $Config->get('jffnms_internal_type'),1,'Login', (($retval !== FALSE)?'successful':'failed'),$user,$log_event_info,'',0); } } //valid username and password return $retval; } ?> jffnms-0.9.3/htdocs/frame_interfaces_events.php0000644000175000017500000000126711450557072021210 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ require ('auth.php'); echo tag("!DOCTYPE", "", "","HTML PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\" \"http://www.w3.org/TR/html4/frameset.dtd\"", false); adm_header('Interfaces & Events','','',true); echo tag('frameset', '', '', "rows='*,39%' frameborder='no' framespacing='0'"). tag ('frame', '', '', "name='map' src='frame_interfaces.php?".$_SERVER['QUERY_STRING']."'", false). tag ('frame', '', '', "name='events' src='blank.php'", false). tag_close('frameset'). tag_close('html'); ?> jffnms-0.9.3/htdocs/scripts/0002755000175000017500000000000011716447477015315 5ustar csmallcsmalljffnms-0.9.3/htdocs/scripts/menu_interface_list.js0000644000175000017500000000067411716447477021677 0ustar csmallcsmall function add (name, value) { select = document.getElementById('use_interfaces'); if (!select) select = document.getElementById('use_interfaces[]'); size = select.length; already_added = false; for (i=0; i < size; i++) if (select.options[i] && select.options[i].value == value) already_added = true; if (!already_added) { select[size] = new Option(name, value); select[size].selected = true; } } jffnms-0.9.3/htdocs/scripts/interface_selector.js0000644000175000017500000000331211522770733021475 0ustar csmallcsmallfunction operation (op) { orig = document.getElementById('selector[]'); size = orig.length; for (i=0; i < size; i++) if (orig.options[i] && orig.options[i].selected == true) { if (op=='add') { opener.add(orig.options[i].text, orig.options[i].value); orig.options[i].className='select_mark'; } else { opener.del(orig.options[i].value); orig.options[i].className=''; } } } function view_now (field) { if (document.getElementById('selector[]').selectedIndex==-1) // Nothing selected opener.go_select(field); // Show all host interfaces else { operation('add'); // add selected interface opener.document.getElementById('selector_form').submit(); // submit form close_popup(); } } function close_popup() { opener.popups[window.name] = null; // remove myself from the popups list this.close(); // close this window } function add (name, value) { select = document.getElementById('use_interfaces[]'); size = select.length; already_added = false; for (i=0; i < size; i++) if (select.options[i] && select.options[i].value == value) already_added = true; if (!already_added) { select[size] = new Option(name, value); select[size].selected = true; } } function del (value) { select = document.getElementById('use_interfaces[]'); size = select.length; for (i=0; i < size; i++) if (select.options[i] && select.options[i].value == value) select.options[i]=null; } function select_all(field_aux) { field = document.getElementById(field_aux); for (i = 0; i < field.length; i++) field[i].selected = ! field[i].selected; } jffnms-0.9.3/htdocs/events.php0000644000175000017500000003746111571347271015642 0ustar csmallcsmall JFFNMS Authors * This program is licensed under the GNU GPL, full terms in the LICENSE file */ require_once ('auth.php'); // This is used for most urls $client_id = $Sanitizer->get_int('client_id', 0); $events_last = $Sanitizer->get_string('events_last'); $express_filter = $Sanitizer->get_string('express_filter'); $filter_id = $Sanitizer->get_string('filter_id'); $init = $Sanitizer->get_int('init', 0); $journal_button = $Sanitizer->get_string('journal_button', FALSE); $journal_id = $Sanitizer->get_int('journal_id', -1, FALSE); $map_id = $Sanitizer->get_int('map_id', 0); $order_type = $Sanitizer->get_string('order_type', 'desc'); $refresh = $Sanitizer->get_int('refresh',FALSE); $show_all = 0; $span = $Sanitizer->get_int('span', 15); $sound = $Sanitizer->get_int('sound'); $view_type = $Sanitizer->get_string('view_type', 'html'); $view_mode = $Sanitizer->get_string('view_mode', 'normal'); $view_all = $Sanitizer->get_int('view_all', 0); $sound = profile('EVENTS_SOUND', $sound); if ($map_profile = profile('MAP')) $map_id = $map_profile; //fixed map if ($client_id_profile = profile('CUSTOMER')) $client_id = $client_id_profile; //fixed customer if ($refresh!='0') { //if refresh is not set to disable (0) if (!$refresh) $refresh=profile('EVENTS_REFRESH'); //get refresh from profile if (!$refresh) $refresh=$Config->get('events_refresh'); //if it was not set use the default } else $refresh=''; $Events = new JffnmsEvents(); if ($journal_button !== FALSE) $journal_id = add_journal($Events, $journal_id); list($header_html,$filter_aux) = event_table_header ($refresh, $express_filter, $filter_id, $init, $span, $sound); if ($view_type=='html') { //Disable Refresh in adm_header() $refresh_aux = $refresh; $refresh=''; adm_header ('Event Viewer'); $refresh=$refresh_aux; list($have_filter,$filter) = $filter_aux; echo script ( " function go_filter(select) { var id = select.options[select.selectedIndex].value; location.href = location.href + '&express_filter=&filter_id='+id; return true; } function check(field_aux) { fields=document.forms[0].elements; for (i = 0; i < fields.length; i++) if (fields[i].name==field_aux) { if (fields[i].checked==true) fields[i].checked = false; else fields[i].checked = true; } return true; } function popUp(URL) { day = new Date(); id = day.getTime(); eval(\"window1 = window.open(URL, '\" + id + \"', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=600,height=380');\"); if (!window1.opener) window1.opener = self; }"). form(). table('events'); // main table } echo $header_html; if ($view_type=='html') echo tag('tbody', 'body'); //list events $span_extended = $span * 2; //expanded for summary $events_raw = $Events->get_all(NULL,$map_id,$have_filter,$filter,$init,$span_extended,'desc',$view_all,$show_all, 0, $client_id); $cant_events = count($events_raw); if ($cant_events > 0) { //if there are events to be shown //events summary (identical events) $events=array(); $events_summary = array(); foreach ($events_raw as $event) if ($summary = events_verify_summary($event)) $events[]=$summary; if ($events_summary['count'] > 0) //take care of the last event $events[] = events_verify_summary(NULL); //debug ($events); unset($events_summary); unset($events_raw); $first = true; $cant_events = count($events); if ($cant_events > $span) $cant_events = $span; if ($order_type=='desc') $event_pos=0; else $event_pos=$cant_events-1; for ($i = 0; ($i < $cant_events) || (($view_all==1) && (is_array($events[$event_pos]))) ; $i++) if (is_array($events[$event_pos])) { $event = $events[$event_pos]; if ($first) { //save first event id for sound comparation $events_actual=$event['id']; $first=false; } show_event ($event, $map_id, $filter_id); if ($order_type=='desc') $event_pos++; else $event_pos--; flush(); } if ($view_type=='html') { echo tr_open('general'). td ('General'). td (tag('input','','',"type='checkbox' onClick=\"this.value=check('checkedid[]');\"",false).'All'). td (show_journal($journal_id),'', '', 4, TRUE). tag_close('tr'); echo tag_close('tbody'). (($view_mode=='normal') ?(current(event_table_header($refresh, $express_filter, $filter_id, $init, $span, $sound))):''). table_close(). form_close(); } //html } else { //if we didn't find any events $no_events_found = 'No Events Found'; switch ($view_type) { case 'html': table_row($no_events_found,'no_events_found',6); break; case 'csv': echo $no_events_found.'\n'; break; case 'rss': case 'rdf': default: echo html('item', html('title', $no_events_found, '', '', '', false, true). html('pubDate', date('Y-m-d H:i:s'), '', '', '',false, true). html('link', htmlspecialchars(current_host().$REQUEST_URI.'&view_type=html'), '', '', '',false, true) ); break; } } // Page End switch ($view_type) { case 'html': // Sound Execution if ($sound==1) if (isset($events_actual) && ($events_actual > $events_last) && ($events_last)) echo play_sound($events_sound); if (isset($events_actual)) $url = get_events_url(array('events_latest' => $events_actual)); else $url = get_events_url(FALSE); echo javascript_refresh("if (self.no_refresh!=1) location.href=\'$url\';",$refresh); adm_footer(); break; case 'rss': case 'rdf': echo tag_close('channel'). tag_close('rss'); break; } function generate_filter() { global $filter_id,$express_filter,$jffnms; $filter = ' and 1=1 '; $have_filter = 0; //Express Filter Processing if ($express_filter) { $filtro_array = explode('^',$express_filter); for ( $i=0 ; $i < count($filtro_array) ; $i++ ) { if ($filtro_array[$i]) { list ($filtrorow, $filtrovalue, $filtrooper) = explode (',',$filtro_array[$i]); if ($filtrooper=='!=') $oper = 'NOT'; else $oper = ''; //Express Filter Fields if ($filtrorow=='date') $filter = "$filter and $oper (.date >= '$filtrovalue 00:00:00' and .date <= '$filtrovalue 23:59:59')"; if ($filtrorow=='date_start') $filter = "$filter and $oper (.date >= '$filtrovalue')"; if ($filtrorow=='date_stop') $filter = "$filter and $oper (.date <= '$filtrovalue')"; if ($filtrorow=='host') $filter = "$filter and $oper (.host = $filtrovalue)"; if ($filtrorow=='zone') $filter = "$filter and $oper (hosts.zone = $filtrovalue)"; if ($filtrorow=='type') $filter = "$filter and $oper (.type = $filtrovalue)"; if ($filtrorow=='username') $filter = "$filter and $oper (.username LIKE '%$filtrovalue')"; if ($filtrorow=='severity') $filter = "$filter and $oper (types.severity = $filtrovalue)"; if ($filtrorow=='interface') $filter = "$filter and $oper (.interface LIKE '%$filtrovalue')"; if ($filtrorow=='info') $filter = "$filter and $oper (.info LIKE '%$filtrovalue')"; if ($filtrorow=='ack') $filter = "$filter and $oper (.ack > 0)"; if ($filtrorow=='types') { $types_filter = explode('!',$filtrovalue); foreach ($types_filter as $type) if ($type) $filtro_value_aux[] =" (.type = $type) "; $filtro_value_aux2=join(' or ',$filtro_value_aux); $filter = "$filter and $oper ($filtro_value_aux2)"; } } } $filter_options[0] = 'Express Filter'; $have_filter = 1; } // Static Filters Processing $filter_obj = new JffnmsFilters(); $filter_obj->get(); if (!$filter_id) $filter_id = profile('EVENTS_DEFAULT_FILTER'); while ($reg = $filter_obj->fetch()) { if ($filter_id == $reg['id']) { // this is the choosen filter if ($aux = $filter_obj->generate_sql($reg['id'])) $filter .= " and $aux"; if ($express_filter) $reg['description'] .= htmlentities(' '); // to show this filter is applied even that the Express filter is shown selected } $filter_options[$reg['id']]=$reg['description']; } if (is_numeric($filter_id) && ($filter_id!=1)) $have_filter = 1; return array($have_filter, $filter, 'options'=>$filter_options); } // function generate_filter function event_table_header ($refresh, $express_filter, $filter_id, $init, $span, $sound) { global $Config, $Sanitizer, $url_delete_tags; global $order_type, $view_type, $view_all; if ($order_type=='desc') { $order_change='asc'; $order_image='a-up.png'; } else { $order_change = 'desc'; $order_image = 'a-down.png'; } $filter = generate_filter(); switch ($view_type) { case 'html': $output = tr_open ('','header'). td ('Date'. linktext(image($order_image), get_events_url(array('order_type' => $order_change))). html('span',date('H:i:s',time()),'','hour'),'date'). td ('Ack', 'ack'). td ('Type', 'type'). td ('Host & Zone', 'host', '', 2). tag ('td'). table ('','buttons'). tr_open (). td (linktext(image('a-top.png'), get_events_url(array('init'=>0)))). td (($init > 0) ?linktext(image('a-left.png'), get_events_url(array('init'=>($init-$span),'refresh=0'))):''). td (linktext(image('a-right.png'), get_events_url(array('init'=>($init+$span),'refresh'=>0)))). td ((empty($refresh) ?linktext(image('refresh.png'), get_events_url(array('refresh'=>1))) :image('refresh2.png', NULL, NULL,'Refresh','','', 'if (self.no_refresh!=1) { self.no_refresh = 1; this.src = \'images/refresh.png\'; } else document.location = \''.htmlspecialchars(get_events_url(FALSE)).'\'; '))). td (linktext(image('plus.png'), get_events_url(array('span'=>$span*2)), array('span'))). td (linktext(image('minus.png'), get_events_url(array('span'=>$span/2)), array('span'))). td ((($view_all==0) ?linktext(image('all.png'), get_events_url(array('view_all'=>1,'refresh'=>0))) :linktext('- '.image('all.png'), get_events_url(array('view_all'=>0))))). td ((($sound==1) ?linktext(image('sound.png'), get_events_url(array('sound'=>0))) :linktext(image('nosound.png'), get_events_url(array('sound'=>1))))). td ('Event', 'detail'). td ( linktext(image('csv.png'), get_events_url(array('view_type'=>'csv', 'view_all'=>1)), '_new'). linktext(image('filter4.png'), "javascript: popUp('".$Config->get('jffnms_rel_path')."/admin/event_filter.php?order_type=". $order_type."&express_filter=".$express_filter."');"). select_custom('filter_list',$filter['options'],(isset($filter['options'][0])?'':$filter_id),'go_filter(this);'), 'filters'). tag_close('tr'). table_close(). tag_close('td'). tag_close('tr'); unset ($filter['options']); break; case 'csv': $output = tag('pre'); $output .= '# Save this file as .txt and then open it on your Spreadsheet, import it as CSV (Comma Separated Values)\n'; $output .= 'Day,Hour,Host,Zone,Username,Interface,Event Type,State,Info,Severity\n'; break; case 'rss': case 'rdf': header ('Content-Type: text/xml'); $output .= "\n". tag ('rss', '', '', "version='2.0'"). tag ('channel'). html('title', 'JFFNMS', '', '', '', false, true). html('link', current_host().$Config->get('jffnms_rel_path'), '', '', '', false, true). html('description', 'JFFNMS Events', '', '', '', false, true). html('ttl',$refresh, '', '', '', false, true); break; } return array($output, $filter); } //function event_table_header function events_verify_summary ($event) { $result = NULL; $summary = &$GLOBALS['events_summary']; if (!is_array($summary)) return NULL; $index = $event['host_id'].'-'. $event['type_id'].'-'. $event['user'].'-'. $event['interface'].'-'. $event['state'].'-'. $event['info'].'-'. $event['ack']; if (array_key_exists('index', $summary) && $summary['index']==$index) { $summary['count']++; //count 1 more $summary_ids = $summary['event']['summary_ids']; $summary_ids[] = $event['id']; $summary['event'] = $event; $summary['event']['summary_ids'] = $summary_ids ; } else { if (array_key_exists('event', $summary) && is_array($summary['event'])) { $result = $summary['event']; //old event if ($summary['count'] > 1) $result['text'].=' (Message repeated '.$summary['count'].' times)'; } $summary['index'] = $index; //save event $summary['event'] = $event; $summary['event']['summary_ids'][] = $event['id']; $summary['count'] = 1; } return $result; //return event } function get_events_url($new_tags) { global $Sanitizer; $delete_tags = array('ticket_button','comment','subject', 'checkedid','filter_list', 'journal_id', 'journal_button'); return $Sanitizer->get_url('', 'all', $new_tags, $delete_tags); } function add_journal (&$Events, $journal_id) { global $Sanitizer; $checked_ids = $Sanitizer->get_string('checkedid'); $subject = $Sanitizer->get_string('subject', ''); $comment = $Sanitizer->get_string('comment', ''); $Journals = new JffnmsJournals(); $event_ids = array(); foreach ($checked_ids as $aux) { $aux2 = explode (',',$aux); foreach ($aux2 as $checked_id) if (is_numeric($checked_id)) $event_ids[]=$checked_id; } $event_ids = array_unique($event_ids); if (!empty($comment)) { $comment = trim($comment); $now = date('Y-m-d H:i:s',time()); $timed_comment = "|".$now.",".$_SESSION['auth_user_id']."|\n".$comment."\n"; if (($journal_id==1) && (!empty($subject))) //new journal { $journal_data = array('date_start'=>$now, 'subject'=>$subject); $journal_id = $Journals->add(); } elseif ($journal_id > 2) //update journal { unset($journal_data); $journal_data = array('date_stop' => $now); } if (is_array($journal_data) && ($journal_id > 1)) $Journals->update($journal_id,$journal_data,$timed_comment); } if (($journal_id > -1) && is_array($event_ids) && (count($event_ids) > 0)) { foreach ($event_ids as $event_id) $Events->set_ack($event_id, $journal_id); } return $journal_id; } //add_journal() function show_journal($journal_id) { $Journals = new JffnmsJournals(); if ($journal_id > 1) $journal_active = current($Journals->get_all($journal_id,1)); else $journal_active = array('subject'=>'','comment'=>''); return table('journal'). table_row('Journal','title', 3, '', false). tr_open('selector'). td (select_journal('journal_id',$journal_id,1, array(1=>'New Journal'))). td (adm_form_submit('View','view_button')). td (adm_form_submit('Acknowledge','journal_button')). tag_close("tr"). tr_open(). td('Subject: '.textbox('subject',$journal_active['subject'],30),'','',4). tag_close("tr"). tr_open (). (($journal_id > 1) ?td(nl2br($journal_active['comment']), '', '', 2, true):''). td(memobox('comment',7,40,''),'text','',($journal_id > 1)?2:4). tag_close('tr'). table_close(); } ?> jffnms-0.9.3/htdocs/frame_interfaces.php0000644000175000017500000000133211401450103017574 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ { require ('auth.php'); echo tag("!DOCTYPE", "", "","HTML PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\" \"http://www.w3.org/TR/html4/frameset.dtd\"", false); adm_header('Interfaces','','',true); echo tag('frameset', '', '', "rows='21,*' frameborder='no' framespacing='0'"). tag ("frame", "", "", "name='map_list' noresize scrolling='no' src='view_interfaces_map_list.php?".$_SERVER['QUERY_STRING']."'", false). tag ('frame', '', '', "name='map_viewer' src='blank.php'", false). tag_close('frameset'). tag_close('html'); } ?> jffnms-0.9.3/htdocs/default.css0000644000175000017500000005154311576243143015756 0ustar csmallcsmall html, body { width: 100%; height: 100%; margin: 0px 0px 0px 0px; text-align: center; padding: 0px 0px 0px 0px; font-family: tahoma, arial, sans-serif; color: black; } body { background-color: #fbfbfb; color: black; } html>body, html>body #contents { height: auto; } pre { text-align: left; } input, textarea, select { font-size: 11px; font-family: tahoma, arial, sans-serif; background-color: inherit; color: black; } input[type="text"], input[type="password"], input[type="submit"], input[type="button"], textarea, select { border: 2px solid black; background-color: #f5f5f5; color: black; } input[type="submit"] { background-color: #aaa; color: black; } input:hover { background-color: #ddd; border-color: #55a; color: black; } select { border-color: white; } input[type="text"] { padding-left: 1px; } img { border: 0px solid black; } a { text-decoration: none; } a:hover { text-decoration: none; } table { border-collapse: collapse; } td { font-size: 10px; white-space: nowrap;} /* Buttons */ .controlbutton { color: #444; text-decoration: none; text-align: center; font-size: 12px; padding: 2px 15px 2px 15px; } .controlbutton:hover { background-color: #ddd; } .controlbutton img { vertical-align: middle; } /* Login Screen */ #login { background-color: #ddd; position: absolute; width: 100%; height: 100%; top:0; left:0; color: black; } #login #box { position: absolute; left: 50%; top: 50%; border: 2px solid #bbb; padding: 10px; background-color: #fbfbfb; color: black; } #login #box .title a { padding-left: 10px; font-weight: bold; font-size: 25px; color: #55a; } #login #box #controls { padding-top: 10px; width: 210px; } #login #box label { margin-top: 5px; display: block; font-weight: bold; font-size: 11px; text-transform: uppercase; color: #999; text-align: left; } #login #box input { font-size: 16px; width: 100%; } #login #box #error { margin: 0px 10px 0px 10px; text-align: center; color: #f00; } #login .author { position: absolute; top: 85%; left: 10px; color: #bfbfbf; } /* Top Control (Main Menu & Map List) */ #mainmenu, #map_list, #startpage, #startpage #news, #startpage #stats { width: 100%; height: 100%; border-collapse: collapse; vertical-align: top; color: black; } #mainmenu td { text-align: center; } #mainmenu .logo { font: italic small-caps bold 15px arial, sans-serif; padding-left: 10px; color: #555; letter-spacing: 3px; } #mainmenu .logout { text-align: right; } #mainmenu .logout { text-align: right; } #startpage td { text-align: center; font-size: 12px; } #startpage .title { font-size: 20px; background-color: #55a; color: #fff; height: 20px;} #startpage .subtitle { font-size: 15px; background-color: #aaa; height: 15px; } #startpage .sectitle { font-size: 13px; text-decoration: underline; font-weight: bold; height: 20px; padding: 20px; } #startpage #data td { width: 50%; } #startpage #stats td { border-bottom: 1px dashed #888; } #startpage #stats .spacer { border-bottom: 0px; padding-left: 30px; width:1%; } #startpage #stats .cat { text-align: left; padding-left: 20px; } #startpage #stats .data { text-align: right; padding-right: 20px; } #startpage .author { text-align: right; background-color: #55a; color: #fff; height: 12px; } /* Events */ /* ------ */ #events { width: 100%; } #events td a { text-decoration: none; } #events .header { background-color: #aaa; height: 20px; font-weight: bold; text-align: center; border-top: 1px solid black; border-bottom: 1px solid black; color: black; } #events .header td { font-size: 12px; } #events .header .date { text-align: left; width: 5%; } #events .header .hour { padding-left: 2px; font-size: 11px; color: white; } #events .header .ack { width: 2%; } #events .header .type { width: 8%; } #events .header .host { width: 10%; } #events .header .buttons { width: 100%; vertical-align: top; } #events .header .buttons td { width: 10px; text-align: center; } #events .header .buttons .detail { width: 100px; font-weight: bold; text-align: right; } /* Filters */ #events .header .buttons .filters { text-align: right; } /* IE Fixes */ #events .header .buttons .filters * { white-space: nowrap; border: 1px solid #aaa; } /* Filters Images*/ #events .header .buttons .filters img { vertical-align: middle; border: 0px; } /* Normal Event Rows */ #events #body .event, #events #body .event td { border-bottom: 1px dashed #aaa; color: inherit; font-size: 11px; } /* Ack'd Rows */ #events #body .ack, #events #body .ack td { border-bottom: 1px dashed #aaa; font-style: italic; font-size: 9px; } /* Date & Ack Checkbox*/ #events #body .date, #events #body .date a, #events #body .ack_check { color: black; background-color: #ccc; font-style: normal; font-size: 11px; } #events #body .ack_check { padding-left: 5px; } #events #body .date a { padding-left: 3px; } /* ACK Image */ #events #body .ack_check img { padding-top: 5px; } /* Zone */ #events #body .zone, #events #body .zone a, #events #body .type, #events #body .type a { color: inherit; text-align: center; } #events #body .host, #events #body .host a { color: inherit; } #events #body .detail { padding-left: 5px; } #events #body .no_events_found { text-align: center; font-size: 120%; font-weight: bold; } #events #journal { width: 200px; vertical-align: top; } #events #journal .title { font-weight: bold; text-align: center; } /* Events Filter */ /* ------------- */ #events_filter { width: 100%; height: 100%; } #events_filter #filters td { border-bottom: 1px dashed #999;} #events_filter .title { font-size: 16px; color: #fff; text-align: center; background-color: #55a;} #events_filter #headers { font-weight: bold; text-align: center; background-color: #aaa; } #events_filter #headers td { font-size: 14px; } #events_filter .radio { text-align: center; } #events_filter .field { text-align: left; font-size: 13px; font-weight: bold; padding-left: 20px; } #events_filter .value { padding-left: 20px; } #events_filter .view_type, #events_filter .submit { text-align: center; font-size: 15px; } /* View Interfaces */ /* --------------- */ #view_interfaces { width: 100%; } #view_interfaces #no_interfaces_found { font: bold 15px arial, sans-serif; text-align: center; width: 100%; } /* Interface Selector */ /* ------------------ */ select#use_interfaces { height: 48px; } #interface_selector { width: 100%; height: 100%; vertical-align: top; border-right: 1px solid black; text-align: left; } #interface_selector #header td { background-color: #55a; } #interface_selector .title { font-size: 16px; color: #fff; text-align: center; } #interface_selector .select { height: 25px; padding-left: 0px; } #interface_selector .action { text-align: center; width: 1%; } #interface_selector .back { text-align: left; width: 1px; } #interface_selector .spacer { height: 100%; } #interface_selector .selected_header { font: bold 12px arial, sans-serif; text-align: center; } #interface_selector .buttons, #interface_selector .view_selected, #interface_selector .show_only_top, #interface_selector .view_all { text-align: center; } #interface_selector .controlbutton { padding: 0px 2px 0px 2px; } #interface_selector select { width: 100%; } #interface_selector select option { overflow: hidden; width: 150px; } #interface_selector .selector option { overflow: hidden; width: 165px; } table#popup_selector { width: 100%; text-align: center; } #popup_selector .title { font: small-caps bold 15px arial, sans-serif; width: 100%; overflow: hidden; white-space: nowrap; color: #fff; background-color: #55a; float:left; } #popup_selector select { width: 100%; } #popup_selector #no_interfaces_found { font: bold 13px arial, sans-serif; text-align: center; width: 100%; float: left; } #popup_selector .select_mark { background-color: #aaa; } #popup_selector .controlbutton { padding: 3px 5px 3px 5px; } /* Performance */ /* ----------- */ #performance { width: 100%; height: 100%; } #performance td { font-size: 13px; } #performance #header, #performance #header #time_span, #performance #graphs { width: 100%; text-align: center; } #performance #header { border-bottom: 1px solid black; height: 16px; } #performance #header #top { background-color: #55a; } #performance #header #options_header { background-color: #aaa; } #performance #header #options { background-color: #ddd; } #performance #header .title a { font: 16px arial, sans-serif; color: #fff; } #performance #header #shortcuts { width: 120px; border: 1px dashed #bbb; background-color: #eee; padding-right: 5px; } #performance #header #shortcuts img { vertical-align: middle; } #performance #options .graph_types { padding-left: 30px; } #performance #options .graph_types select { float: left; } #performance #options .graph_types div#aggr_only { padding-left: 5px; overflow: hidden; text-align: left; font-size: 10px; } #performance #current_date { font-size: 10px; } #performance #time_span .labels { text-align: right; } #performance #time_span .labels { text-align: right; } #performance #graphs .graph { padding-top: 3px; padding-bottom: 2px;} #performance #error, #performance .error { font-weight: bold; color: red; } /* Setup Page */ /* ---------- */ #setup { width: 100%; text-align: center; } #setup .setup_options { width: 300px; padding-left: 15%; } #setup .title { font-size: 16px; background-color: #55a; color: #fff; } #setup .help { font-size: 13px; background-color: #aaa; text-align: right; padding-right: 20px;} #setup .config_file { font-size: 12px; background-color: #ddd; text-align: right; padding-right: 20px;} #setup #options td { border-bottom: 1px dashed #bbb; font-size: 12px; } #setup #options input { font-size: 12px; } #setup #options .field_menu { text-align: center; font-size: 15px; text-decoration: underline; padding-top: 10px; padding-bottom: 5px; } #setup #options .result_yes, #setup #options .result_ok { color: green; text-transform: uppercase; font-weight: bold; font-size: 13px; text-align: center; } #setup #options .result_no, #setup #options .result_error { color: red; text-transform: uppercase; font-weight: bold; font-size: 13px; text-align: center; } /* Menu */ /* ---- */ #menu { height: 100%; border-left: 1px solid black; } #menu table { width: 100%; border-bottom: 1px dashed #aaa; text-align: left; } #menu table table { border-top: 1px dashed #aaa; } #menu .title { text-align: center; font-size: 16px; background-color: #55a; color: #fff; } #menu td.image { width: 16px; } #menu td a { color: black; font-size: 12px; } #menu .submenu { display: none; } #menu .selected_submenu { background-color: #eee; } #menu .selected_option { background-color: #ccc; } #menu #administration { display: block; background-color: transparent; } /* Color Selector For Maps */ #color_select { width: 100%; height: 100%; text-align: center; } #color_select a { color: white; } /* Tools */ /* ----- */ #tools { width: 100%; text-align: center; } #tools td { font-size: 13px; } #tools table { width: 100%; height: 100%; } #tools .title { font: small-caps bold 16px arial, sans-serif; width: 100%; color: white; background-color: #55a; text-align: left; padding-left: 30px; } #tools tr.top { background-color: #aaa; } #tools tr.header { background-color: #ddd; font-weight: bold; } #tools .interface { font-weight: bold; padding-top: 10px; border-bottom: 2px dotted #aaa; text-align: left; } #tools tr { background-color: #eee; } #tools .no_records_found { font-size: 120%; font-weight: bold; } #tools iframe { visibility: hidden; position: absolute; } /* State Report */ /* ------------ */ #state_report { width: 100%; height: 100%; } #state_report table { width: 100%; } #state_report table td { font-size: 12px; } #state_report .title { font: small-caps bold 16px arial, sans-serif; width: 100%; color: white; background-color: #55a; text-align: left; padding-left: 30px; } #state_report #options { background-color: #aaa; text-align:center; } #state_report #report #header { background-color: #ddd; font-weight: bold; text-align: center; border-top: 1px solid black; } #state_report #report #header td { font-size: 15px } #state_report #report .interface { border-top: 1px dashed #ddd; } #state_report #report .interface .info { text-align: center; } #state_report #report #details td { text-align: center; } #state_report #report #totals { background-color: #ddd; font-weight: bold; } //#state_report * { border: 1px solid red; } #state_report #summary { background-color: #aaa; } #state_report #summary td { font-size: 15px; font-weight: bold; } #state_report .no_records_found { font-size: 120%; font-weight: bold; } /* NAD */ /* ------------ */ #nad { width: 100%; } #nad td { font-size: 12px; } #nad .title { font: small-caps bold 16px arial, sans-serif; width: 100%; color: white; background-color: #55a; text-align: left; padding-left: 30px; } #nad .controlbutton { padding-top: 0px; padding-bottom: 0px; color: black; } #nad .options { background-color: #aaa; height: 23px; vertical-align: top; padding-left: 10px; } #nad .options select { font-size: 10px; height: 15px; } #nad .host .header, #nad #nets .header, #nad #net .header { background-color: #ddd; font-weight: bold; text-align: center; border-bottom: 0px; border-top: 0px; font-size: 13px; } #nad #nets { width: 100%; } #nad #nets td { text-align: right; padding-right: 50px;} #nad #net { width: 100%; } #nad #net tr.host { border-bottom: 1px dashed #aaa; } #nad #net td.ip { text-align: right; padding-right: 50px; } #nad .hosts { border-bottom: 5px solid black ; } #nad .host { width: 100%; } #nad .host td { border-bottom: 1px dashed #aaa; } #nad .host td.field { width: 200px; font-weight: bold; } #nad .host td.data { white-space: normal; } #nad .host #ips { width: 100%; text-align: right; } #nad .host #ips td.header { text-align: right; } #nad .error { font-size: 120%; font-weight: bold; text-align: center; } /* Administration */ /* -------------- */ .admintable { background-color: #eee; width: 100%; border-top: 1px solid black; } .admintable td { text-align: center; white-space: nowrap; border-bottom: 1px dashed #888; font-size: 11px; } /* Navigation Bar */ .admintable #navigation { background-color: #55a; border-bottom: 1px solid black; height: 16px; } /* Navigation Buttons Under the Admin Table */ .admintable #navigation .controlbutton { padding: 0px 0px 0px 0px; width: 70px; float:left; height: 16px; color: white; } .admintable #navigation .controlbutton:hover { background-color: #777; } .admintable #navigation .controlbutton img { vertical-align: middle; } /* Administration Title */ .admintable #navigation #title { float: left; font: small-caps bold 16px arial, sans-serif; width: 200px; height: 16px; vertical-align: top; color: white; } /* Field Names Bar (Header) */ .admintable .header { background-color: #9e9e9e; color: #fff; } /* All Header Fields */ .admintable .header td { font-weight: bold; font-size: 12px; padding: 0px 10px 0px 10px; text-decoration: none; height: 20px; } /* Remove padding of the A inside the TD */ .admintable .header td .field { padding: 0px 0px 0px 0px; } /* Action Field Header */ .admintable .header #action { background-color: #cecece; color: black; } /* ID Field Header + Sort Link */ .admintable .header #field_id, .admintable .header #field_id a { background-color: #888; text-align: right; } /* Filter + Img*/ .admintable .header td .filter { position: absolute; visibility: hidden; } .admintable .header td img { vertical-align: middle; } /* Other Fields Header */ .admintable .header .field { color: inherit; } /* Action Field Data */ .admintable tbody .action { background-color: #cecece; border-bottom: 1px dotted #888; width: 10%; } .admintable tbody .controlbutton { padding: 0px 0px 0px 0px; } .admintable tbody .action_button img { padding: 0px 10px 0px 5px; vertical-align: middle; } /* ID Field Data */ .admintable tbody #field_id { border-left: 1px dashed #888; font-weight: bold; padding-right: 5px; text-align: right; } .admintable tbody .field_id { color: black; font-weight: bold; padding-right: 5px; } /* Other Fields Data */ .admintable .field { } /* Data Rows Odd/Even/Editing */ .admintable tbody tr { background-color: #eee; } .admintable tbody tr.odd { background-color: #ddd; } .admintable tbody tr.editing { background-color: #aad; border-top: 2px dotted #fff; border-bottom: 2px dotted #fff; } /* No Records Found Banner */ .admintable tbody .no_records_found { font-size: 120%; font-weight: bold; text-align: left; padding-left: 100px; } /* Administration Field Exceptions */ .admintable#admin_interfaces #field_interface, .admintable#admin_interfaces #field_host, .admintable#admin_hosts #field_zone, .admintable#admin_hosts #field_name, .admintable#admin_zones #field_zone, .admintable#admin_event_types #field_text, .admintable#admin_interface_types_fields #field_default_value, .admintable#admin_interface_types #field_autodiscovery_function, .admintable#admin_interface_types #field_autodiscovery_parameters { padding-left: 3px; text-align: left; } .admintable#admin_interfaces #itype_4 #field_interface, .admintable#admin_interfaces #field_address, .admintable#admin_interfaces #field_peer, .admintable#admin_interfaces #field_mask, .admintable#admin_interfaces #field_bandwidthin, .admintable#admin_interfaces #field_bandwidthout, .admintable#admin_hosts #field_ip, .admintable#admin_hosts #field_ip_tacacs, .admintable#admin_hosts #field_tftp { text-align: right; font-family: monospace; } .admintable #field_description { text-align: left; padding-left: 5px; } .admintable#admin_interfaces #itype_4 #field_interface, .admintable#admin_pollers #field_parameters, .admintable#admin_pollers_backend #field_parameters, .admintable#admin_trap_receivers #field_parameters, .admintable#admin_trap_receivers #field_match_oid, .admintable#admin_receiver_backends #field_parameters, .admintable#admin_event_types #field_text, .admintable#admin_syslog_types #field_match_text { font-family: monospace; text-align:left; } /* Administration Interfaces */ .admintable#admin_interfaces .header .type_filter, .admintable#admin_interfaces .header .type_filter a { background-color: #cecece; color: black; font-size: 11px; } /* Administration Host Discovery */ .admintable tbody .manual_discovery { border: 0px solid black; padding: 0px 0px 0px 0px; width: 100%; } .admintable tbody .manual_discovery .discovery_title { font-size: 13px; font-weight: bold; background-color: #77c; color: #eee; text-align: left; padding-left: 50px; } .admintable tbody .manual_discovery .manual_add { font-size: 11px; color: inherit; text-align: right; padding-left: 100px; } .admintable tbody .manual_discovery .discovery_header { font-size: 105%; background-color: #aaa; } .admintable tbody .manual_discovery .discovery_header td { border-right: 1px solid #888; padding-left: 5px; } .admintable tbody .manual_discovery td { border: 0px; font-size: 11px; height: 18px; } .admintable tbody .manual_discovery .discovery_interface_new, .admintable tbody .manual_discovery .discovery_interface_old { font-family: monospace; } .admintable tbody .manual_discovery .discovery_interface_new { font-weight: bold; } .admintable tbody .manual_discovery .field_index { text-align: right; padding-right: 5px;} .admintable tbody .manual_discovery .field_status, .admintable tbody .manual_discovery .field_interface { text-align: left; } /* Manual Discovery Field Exceptions */ .admintable tbody .manual_discovery .field_rate, .admintable tbody .manual_discovery .field_ceil, .admintable tbody .manual_discovery .field_size, .admintable tbody .manual_discovery .field_bandwidthin, .admintable tbody .manual_discovery .field_address, .admintable tbody .manual_discovery .field_peer { text-align: right; } .admintable tbody .manual_discovery .field_description { text-align: left; } /* Hosts Diff */ .admintable#hosts_config #field_config textarea { font-family: monospace; } #generic_error { background-color: #ffdddd; border: solid 1px black; margin: 5px; padding: 5px; color: red; font-weight: bold; font-size: 13px; text-align: center; } jffnms-0.9.3/LICENSE0000644000175000017500000004325511760060424013334 0ustar csmallcsmall GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 Lesser 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 Lesser General Public License instead of this License. jffnms-0.9.3/lib/0002755000175000017500000000000011742007023013062 5ustar csmallcsmalljffnms-0.9.3/lib/api.rrdtool.inc.php0000644000175000017500000003700111741745356016620 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ // Set the following to TRUE to not use a rrdtool pipe define('RRDTOOL_NOT_USE_PIPE', FALSE); // Set the following to the socket to use rrdcached, leave '' for no cached use define ('RRDCACHED_SOCKET', ''); //define ('RRDCACHED_SOCKET', '/var/run/rrdcached.sock'); function rrdtool($method,$file,$opts,$force_no_module = 0) { global $Config; $rrdtool_executable = $Config->get('rrdtool_executable'); $os_type = $Config->get('os_type'); $error=0; $ret = 1; if ($os_type == 'windows') if (is_array($opts)) foreach ($opts as $key=>$data) { $opts[$key] = str_replace("'","\"",$opts[$key]); if ($key!="font") $opts[$key] = str_replace(":/","\:/",$opts[$key]); //font does not need this } if (is_array($opts)) $aux = join($opts," "); else $aux = $opts; $use_pipe = FALSE; if ($os_type =='windows') $command = $rrdtool_executable." ".$method." \"".$file."\" ".$aux; else { $command = $rrdtool_executable." ".$method." '".$file."' ".$aux; //Check if we can use the new Piped/Managed RRDTool method if (RRDTOOL_NOT_USE_PIPE && RRDCACHED_SOCKET == '' && function_exists('proc_open') && strlen($command) < 10000) $use_pipe = TRUE; } if (RRDCACHED_SOCKET != '') $command .= ' --daemon '.RRDCACHED_SOCKET; //debug($command); $command .= ' 2>&1'; if ($use_pipe) list ($ret1, $ret2) = rrd_pipe($method." '".$file."' ".$aux); else $ret3 = exec($command,$ret1,$ret2); //debug($ret1); //debug($ret2); if ($method=='fetch') { $start=0; reset ($ret1); $ret = false; if (count($ret1) > 1) while (list ($key,$line) = each ($ret1)) if (!empty($line)) { $line1 = explode(' ',$line); if (strpos($line,":") > 0) { for ($i = 1; $i < count($line1); $i++) // Part 1 is timestamp if ($line1[$i]!=="") // Part 2 maybe is a space $value[] = ($line1[$i]=="nan")?0:str2f($line1[$i]); // Part 3 (or 2) has the data $date = (int)$line1[0]; // Time Stamp if (!isset($stop)) $stop=0; if ($date > $stop) $stop = $date; if (($date < $start) or ($start==0)) $start = $date; } else { foreach ($line1 as $aux) if (!empty($aux) && ($aux!="timestamp")) // Avoid the timestamp as a DS (rrdtool >= 1.0.49) $ds_namv[]=trim($aux); $ds_cnt = count($ds_namv); } unset($ret1[$key]); } $ret = array("start"=>$start,"end"=>$stop,"step"=>300,"ds_cnt"=>$ds_cnt,"ds_namv"=>$ds_namv,"data"=>$value); //var_dump($ret); } $info = ''; if (file_exists($file)==TRUE) switch ($method) { case 'graph': if (count($ret1) < 1 ) { $error=1; $ret = $ret1; $info = $command; } else $ret = $ret1; break; case 'update': case 'create': case 'fetch': case 'tune': if ($ret2 != 0 ) { $error=1; $ret = 0; $info .+ $ret3; } break; case 'last': if ($ret2 != 0) { $error=1; $ret = 0; } else $ret = $ret1[0]; break; }//switc else { $error=1; $ret = 0; } if ($error==1) { if (array_key_exists('Child', $GLOBALS)) { $GLOBALS['Child']->send_error("rrd_$method(): $ret3"); } else echo("rrd_$method() ERROR: $info"); } return $ret; } function rrdtool_graph($file,$opts) { return rrdtool("graph",$file,$opts); } function rrdtool_tune($file,$opts) { if (file_exists($file)===TRUE) return rrdtool("tune",$file,$opts,1); return FALSE; } function rrdtool_fetch($file,$opts) { return rrdtool("fetch",$file,$opts); } function rrdtool_last($file) { return rrdtool("last",$file,NULL); } function rrdtool_update($file,$opts) { return rrdtool("update",$file,$opts); } function rrdtool_create($file,$opts) { global $Config; if ($result = rrdtool('create', $file, $opts) && ($Config->get('os_type')=='unix')) chmod ($file, 0660); return $result; } function rrdtool_dump($file,$to) { return rrdtool('dump',$file," > $to"); } function rrdtool_restore($file,$from) { return rrdtool('restore',$from,$file); } function rrdtool_error($info = NULL) { if (extension_loaded("RRDTool")) return rrd_error(); else return $info; } function rrd_grapher($id, $graph_function, $sizex, $sizey, $title, $graph_time_start, $graph_time_stop, $aux = '') { global $Interfaces, $Config; if (!$graph_function || !$id) return FALSE; if (!isset($Interfaces)) $Interfaces = new JffnmsInterfaces(); $interface_data = $Interfaces->get_all($id); $rrd_path = $Config->get('rrd_real_path'); foreach ($interface_data as $int_id=>$aux1) $interface_data[$int_id]['filename'] = $rrd_path."/interface-$int_id.rrd"; if (count($interface_data)==1) $interface_data=current($interface_data); $function_data=$interface_data; $function_data["id"]=$id; $title = str_replace("'",'',$title); // ' fix $start = $graph_time_start; $end = $graph_time_stop; if ($end==0) $end -= (7*60); //if it was 0, then substract 7 minutes to be sure there's data //debug ($graph_time_stop." = ".date("Y-m-d H:i:s", $graph_time_stop)); //debug ($end." = ".date("Y-m-d H:i:s", $end)); //This is only used for N Percentile calculation if ($aux == 'get_graph_data') //if we were asked for the extra data (Export to CSV data points) $function_data['other_data'] = $aux; //pass the request to the graph (traffic.inc.php) $function_data['rrd_grapher_time_start'] = $start; $function_data['rrd_grapher_time_stop'] = $end; $opts_header = array( '--imgformat=PNG', '--start='.$start, '--end='.$end, '--base=1000', '--lower-limit=1', '--title=\''.$title.'\'', '--alt-autoscale-max', '--color=GRID#CCCCCC', '--color=MGRID#777777', '--height='.$sizey, '--width='.$sizex ); $real_function = 'graph_'.$graph_function; $function_file = $Config->get('jffnms_real_path').'/engine/graphs/'.$graph_function.'.inc.php'; if (in_array($function_file,get_included_files()) || (file_exists($function_file) && (include_once($function_file))) ) { if (!function_exists($real_function)) { logger("ERROR: Calling Function '$real_function' doesn't exists in '$function_file'.
\n"); return FALSE; } else { $graph_plugin_ret = call_user_func_array($real_function,array($function_data)); $graph_header = $graph_plugin_ret[0]; $graph_definition = $graph_plugin_ret[1]; if (array_key_exists(2, $graph_plugin_ret)) $other_data = $graph_plugin_ret[2]; else $other_data = ''; } } else { logger ("ERROR Loading file $function_file.
\n"); return FALSE; } $rrdtool_font = $Config->get('rrdtool_font'); if (is_readable($rrdtool_font)) $opts_header['font'] = "--font=DEFAULT:7:$rrdtool_font"; if (is_array($graph_definition)) foreach ($graph_definition as $k=>$v) if (strpos($v, "COMMENT")!==false) //RRDTool 1.2.x needs the : (colons) inside COMMENTs to be escaped with \ as \: $graph_definition[$k] = substr($v, 0, strpos($v, ":")+1). str_replace(":","\:",substr($v, strpos($v, ":")+1)); $opts = @array_merge($opts_header, (($aux=="MINI") ?array("--no-legend", '') :$graph_header), $graph_definition); // Clear out empty opts array items, because it causes problems with some RRDTools if (is_array($opts)) foreach ($opts as $k=>$v) if (empty($v)) unset ($opts[$k]); $graph_filename = $Config->get('engine_temp_path').'/'.uniqid('').'.dat'; $ret = rrdtool_graph($graph_filename, $opts); if (($aux!="MINI") && ($ret!=FALSE)) rrdtool_add_legend($graph_filename, $sizey); if ($aux != 'get_graph_data') //if we were not asked for the extra data (currently 95 percentile data points) unset ($other_data); // do not return it. $other_data = FALSE; if (!file_exists($graph_filename)) { logger ("ERROR Graph file '$graph_filename' does not exist.
\n"); return FALSE; } $fp = fopen($graph_filename,"rb"); $graph_data = fread($fp,filesize($graph_filename)); fclose($fp); unlink ($graph_filename); //delete file $graph_data = base64_encode ($graph_data); return array($ret, $graph_data, $other_data); } //rrd_grapher() function rrdtool_add_legend ($file, $sizey) { global $Config; if (! ($im = ImageCreateFromPNG($file))) return FALSE; $legend = $Config->get('jffnms_site'); $legend1 = 'JFFNMS'; $posy = $sizey+25; ImageStringUP($im,3,imagesx($im)-26,$posy,$legend ,ImageColorAllocate($im,150,150,150)); ImageStringUP($im,3,imagesx($im)-16,$posy,$legend1,ImageColorAllocate($im,100,100,100)); ImagePNG($im,$file); ImageDestroy($im); } function rrdtool_fetch_ds ($id,$dsnames,$from,$to) { global $Config; $Interfaces = new JffnmsInterfaces(); if (!is_array($dsnames)) $dsnames = array($dsnames); $file = $Config->get("rrd_real_path")."/interface-$id.rrd"; $interface=current($Interfaces->get_all($id)); $type_info = $Interfaces->get_type_info($id); $all_dss = $Interfaces->parse_rrd_structure($type_info["rrd_structure_def"]); $rra = rrdtool_parse_rra($type_info["rrd_structure_rra"]); $opts = array ( $rra, "--start=$from", "--end=$to" ); if ( ($interface["rrd_mode"] == 1) && (file_exists($file)===TRUE) ) { $ret = rrdtool_fetch($file, $opts); for ($i = 0; $i < count($ret["data"]);$i+=$ret["ds_cnt"]) foreach ($dsnames as $dsname) if (strlen($all_dss[$dsname]) > 0) $values[$dsname][]=round((int)($ret[data][$i+$all_dss[$dsname]]),2); } if ($interface["rrd_mode"]==2) { foreach ($dsnames as $dsname) { $dsn = $all_dss[$dsname]; $file_ds = str_replace(".rrd","-$dsn.rrd",$file); if (file_exists($file_ds)===TRUE) { $ret = rrdtool_fetch($file_ds, $opts); for ($i = 0; $i < count($ret["data"])-1;$i+=$ret["ds_cnt"]) if (isset($ret["data"][$i])) $values[$dsname][]=round((int)($ret["data"][$i]),2); } } } if (is_array($values)) { $values["information"]["start"]=$ret["start"]; $values["information"]["stop"]=$ret["end"]; } return $values; } //FIXME this is too specific for Physical Interfaces function get_rrd_rtt_pl ($id,$from,$to,$threshold,$bwin_db,$bwout_db,$flipinout) { $values = rrdtool_fetch_ds($id,array('input','output','rtt','packetloss','bandwidthin','bandwidthout'),$from,$to); $result=array(); $rtt_final_avg = 0; $pl_final_avg = 0; $cant_pings=50; if ( is_array($values) ) { if ($flipinout==1) { //flip in/out $tmp = $values['input']; $values['input']=$values['output']; $values['output']=$tmp; unset($tmp); } $values_count = count ($values['input']); for ($i = 0; $i < $values_count ; $i++) { $in = $values['input'][$i]*8; //convert to bits (same as bandwidth) $out = $values['output'][$i]*8; //convert to bits (same as bandwidth) $rtt = $values['rtt'][$i]; $pl_orig = $values['packetloss'][$i]; //0 - 50 $pl = round($pl_orig*(100/$cant_pings)); $bwin_rrd = $values['bandwidthin'][$i]*8; $bwout_rrd = $values['bandwidthout'][$i]*8; if ($rtt > 100000) $rtt = 0; // if data was not valid (100sec RTT is not posible) //if we have bandwidth ds's then use then, otherwise take the parameters. $bwin=($bwin_rrd>0?$bwin_rrd:$bwin_db); $bwout=($bwout_rrd>0?$bwout_rrd:$bwout_db); //if is lower than the max threshold if ( ($rtt > 0) and ($in >0) and ($out > 0) ) { //valid values $parsed++; if (($in < ($threshold*$bwin/100)) and ($out < ($threshold*$bwout/100))) { //in threshold $result[]=Array('rtt'=>$rtt,'pl'=>$pl); $counted=1; } else $counted = 0; } //debug("$id \t $in \t $out \t $rtt \t $pl \t ($bwin($bwin_rrd) - $bwout($bwout_rrd) - $threshold) \t $counted"); unset($values['input'][$i]); unset($values['output'][$i]); unset($values['rtt'][$i]); unset($values['packetloss'][$i]); } if (count($result) > 0) { while (list ($key,$value) = each ($result)) { $rtt_final += $value["rtt"]; $pl_final += $value["pl"]; unset ($result[$key]); } $rtt_final_avg = round($rtt_final/$cant); $pl_final_avg = round($pl_final/$cant,2); } } //debug ("Total in Result: $values_count"); //debug ("Total Parsed: $parsed"); //debug ("Total in Threshold: $cant"); return array('id'=>$id, 'rtt'=>$rtt_final_avg, 'pl'=>$pl_final_avg); } function rrdtool_parse_rra($info) { $aux = explode (':',$info); return $aux[1]; } function rrdtool_get_def($interface,$dss) { global $Interfaces; $dss_def = array(); if (!is_array($dss)) $dss = array($dss); $id = $interface['id']; $type_info = $Interfaces->get_type_info($id); $all_dss = $Interfaces->parse_rrd_structure($type_info['rrd_structure_def']); $rra = rrdtool_parse_rra($type_info['rrd_structure_rra']); foreach ($dss as $dsname => $ds) { if (is_integer($dsname)) $dsname = $ds; $dsn = $all_dss[$ds]; if ($dsn!==NULL) //if DS exists { $filename_ds = str_replace(".rrd","-$dsn.rrd",$interface["filename"]); if ($interface["rrd_mode"]==1) $dss_def[$dsname]="DEF:$dsname=".$interface["filename"].":$ds:$rra"; if ($interface["rrd_mode"]==2) { if (!file_exists($filename_ds)) { echo html('p', "Error: RRD file \"$filename_ds\" does not exist.", 'generic_error'); return $dss_def; } if (!is_readable($filename_ds)) { echo html('p', "Error: RRD file \"$filename_ds\" exists, but is not readable.", 'generic_error'); return $dss_def; } $dss_def[$dsname]="DEF:$dsname=$filename_ds:data:$rra"; } } } return $dss_def; } function rrdtool_create_file($filename,$def,$rra,$res,$step) { $step = "--step $step"; //replace data $opts = trim("$step $def $rra"); $opts = str_replace("\n","", $opts); $opts = str_replace(" "," ",$opts); $opts = str_replace("",$res,$opts); $ret = rrdtool_create($filename, explode(" ",$opts)); return $ret; } function rrd_pipe ($command) { if (!is_array($GLOBALS['rrd_pipe'])) { $GLOBALS['rrd_pipe']['resource'] = proc_open($Config->get('rrdtool_executable'). ' -', array(0=> array('pipe','r'), 1=>array('pipe','w')), $GLOBALS['rrd_pipe']['pipe']); $GLOBALS['gc_save_vars']['rrd_pipe']=true; } fwrite($GLOBALS['rrd_pipe']['pipe'][0], $command."\n"); stream_set_blocking($GLOBALS['rrd_pipe']['pipe'][1], false); while (($ret1!==false) || empty($ret)) { usleep(10); $ret1 = fgets($GLOBALS['rrd_pipe']['pipe'][1]); if ($ret1!=false) $ret[] = rtrim($ret1,"\n"); } unset ($ret[count($ret)-1]); //echo "
RRD: ".substr($command,0)." => ".vd($ret)."
\n"; return array($ret, 1); } ?> jffnms-0.9.3/lib/interface_types_fields.class.php0000644000175000017500000000471111525221306021413 0ustar csmallcsmall$value) switch ($field) { case 'itype': $where[]=array('interface_types_fields.itype','=',$value); break; case 'exclude_types': $where[]=array('interface_types_fields.ftype','!=',$value); break; } return get_db_list( array("interface_types_fields","interface_types","interface_types_field_types"), $ids, array("interface_types_fields.*", "itype_description"=>"interface_types.description", "ftype_description"=>"interface_types_field_types.description", "ftype_handler"=>"interface_types_field_types.handler" ) , array_merge( array( array("interface_types_fields.itype","=","interface_types.id"), array("interface_types_fields.ftype","=","interface_types_field_types.id"), array("interface_types_fields.id",">",1)), $where ), array( array("interface_types_fields.itype","asc"), array("interface_types_fields.ftype","asc"), array("interface_types_fields.pos","asc"), array("interface_types_fields.description","desc"), array("interface_types_fields.id","desc") )); } function update($id, $data) { global $Config; //call the update handler and then do a standard update $update_function = $data['ftype_handler']; $real_function = 'handler_$update_function'; $function_file = $Config->get('jffnms_real_path')."/engine/handlers/$update_function.inc.php"; if (in_array($function_file,get_included_files()) || (file_exists($function_file) && (include_once($function_file)))) { if (function_exists($real_function)) call_user_func_array($real_function,array($data['name'],&$data['default_value'])); else logger("ERROR: Calling Function '$real_function' doesn't exists.
\n"); } unset ($data['ftype_handler']); return parent::update($id,$data); } function add($itype=NULL) { if ($itype=NULL) $itype=1; return db_insert('interface_types_fields',array('description'=>'New Field','itype'=>$itype)); } } jffnms-0.9.3/lib/triggers_rules.class.php0000644000175000017500000000323411571315330017742 0ustar csmallcsmall JFFNMS Authors * Licensed under GNU GPL v2, full terms in the LICENSE file */ class JffnmsTriggers_rules extends basic { public function add($trigger_id) { $data = array( 'action_id' => '1', 'stop' => 0, 'trigger_id' => $trigger_id); return db_insert('triggers_rules',$data); } //add_rule() public function get_all($ids = NULL, $trigger_id = NULL) { $where = array( array('triggers_rules.id','>',0), array('triggers_rules.trigger_id','=','triggers.id'), array('triggers_rules.action_id','=','actions.id') ); if (is_numeric($trigger_id)) $where[] = array('triggers.id', '=', $trigger_id); return get_db_list( array('triggers','triggers_rules','actions'),$ids, array( 'triggers_rules.*', 'action_description'=>'actions.description', 'action_parameters_def'=>'actions.user_parameters', 'trigger_description'=>'triggers.description', 'trigger_type'=>'triggers.type'), $where, array( array('triggers.id','asc'), array('triggers_rules.pos','asc'), array('triggers_rules.id','asc')) ); //order } // list_rules() public function del($trigger_rule_id) { return db_delete('triggers_rules',$trigger_rule_id); } //del() public function del_trigger($trigger_id) { if (!is_numeric($trigger_id)) return FALSE; $query = "DELETE FROM triggers_rules WHERE trigger_id = $trigger_id"; return db_query($query) or die('Query Failed TriggersRules::del_all_truger() - '.db_error()); } // delete() } ?> jffnms-0.9.3/lib/actions.class.php0000644000175000017500000000101711571156375016353 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ class JffnmsActions extends basic { private $jffnms_insert = array('description' => 'New Action', 'command' => 'none'); public function get_all($ids = NULL) { return get_db_list('actions', $ids, array('actions.*'), array(array('actions.id','>',0)), //where array(array('actions.id','desc')) ); //order } } // class jffnms-0.9.3/lib/gui.controls.inc.php0000644000175000017500000007124611741270755017016 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function select_general($control_name,$table,$where="(1=1)",$order = "id" ,$match_field = "id" ,$match_value, $show_field = "id", $size = 1, $add_data = NULL, $onchange = "") { $query = "Select $match_field as match_aux, $show_field as show_aux from $table where (1=1) and $where order by $order"; //debug ($query); $result_aux = db_query ($query) or die ("Query failed - select_general($table) - ".db_error()); if (!is_array($match_value)) $match_value=array($match_value); if (is_array($add_data)) $select_data = $add_data; else $select_data = array(); while ($reg = db_fetch_array($result_aux)) $select_data[$reg["match_aux"]]=$reg["show_aux"]; unset ($result_aux); return select_custom($control_name, $select_data, $match_value,$onchange,$size); } function select_object (&$Object, $control_name, $selected_values, $add_data = NULL, $match_field, $show_fields, $params=array(), $size = 1, $onchange = '', $ondblclick = '',$option_size = NULL) { $obj_data = call_user_func_array(array($Object,'get_all'),$params); if (is_array($add_data)) $select_data = $add_data; else $select_data = array(); if (!is_array($show_fields)) $show_fields=array($show_fields); if (is_array($obj_data)) foreach ($obj_data as $key=>$value) { $aux=''; foreach ($show_fields as $field_aux) $aux.=$value[$field_aux]. ' '; $select_data[$value[$match_field]] = (is_numeric($option_size)?substr($aux,0,$option_size):$aux); } if ($size > 0) return select_custom($control_name, $select_data, $selected_values,$onchange,$size,0,"",$ondblclick); else if (array_key_exists($selected_values, $select_data)) return $select_data[$selected_values]; else return ''; } //INTERFACES function select_interfaces ($name,$interface_id,$size = 1,$add_data = NULL, $onchange = "", $params = array()) { $Interfaces = new JffnmsInterfaces(); return select_object($Interfaces,$name,$interface_id,$add_data,'id',array('client_shortname','interface','description'),$params, $size,$onchange); } function select_interfaces_host ($name,$interface_id,$size = 1,$add_data = NULL, $onchange = "", $params = array()) { $Interfaces = new JffnmsInterfaces(); return select_object($Interfaces,$name,$interface_id,$add_data,"id",array("host_name","zone_shortname","interface","description"),$params,$size,$onchange); } function select_maps ($name, $map_id,$size = 1, $add_data = NULL, $onchange = "", $params = array()) //FIXME option to hide RootMap { $Maps = new JffnmsMaps(); return select_object($Maps,$name,$map_id,$add_data,'id','name',$params,$size,$onchange); } function select_hosts ($name,$host_id,$size = 1, $add_data = NULL, $onchange = "", $char_size = 50) { $Hosts = new JffnmsHosts(); return select_object($Hosts,$name,$host_id,$add_data,"id",array("name","zone_description"),array(NULL,NULL,array('show_host=1')),$size,$onchange,"",$char_size); } function select_hosts_filtered ($name,$host_id,$size = 1, $add_data = NULL, $onchange = "", $filters = array()) { $Hosts = new JffnmsHosts(); return select_object($Hosts,$name,$host_id,$add_data,'id',array('name','zone_description'),array(NULL,$filters), $size,$onchange,'',50); } function select_clients ($name, $client_id, $size = 1, $add_data = NULL, $onchange = "", $params = array()) { $Clients = new JffnmsClients(); return select_object($Clients,$name,$client_id,$add_data,'id','name',$params,$size,$onchange); } function select_journal ($name, $journal_id, $size=1, $add_data = NULL, $onchange = "", $params = array()) { $Journals = new JffnmsJournals(); return select_object($Journals,$name,$journal_id,$add_data,'id','subject',$params,$size,$onchange); } function select_interface_types ($name,$type_id,$size = 1, $add_data = NULL,$onchange = "", $params = array()) { $Interface_types = new JffnmsInterface_types(); return select_object($Interface_types,$name,$type_id,$add_data,"id","description",$params,$size,$onchange); } function select_triggers ($name,$trigger_id,$add_data = NULL,$onchange = "", $params = array()) { $Triggers = new JffnmsTriggers(); return select_object($Triggers,$name,$trigger_id,$add_data,'id','description',$params,1,$onchange); } function select_users ($name,$user_id,$add_data = NULL,$onchange = "", $params = array()) { $Users = new JffnmsUsers(); return select_object($Users,$name,$user_id,$add_data,"id","fullname",$params,1,$onchange); } function select_actions ($name,$id,$add_data = NULL,$onchange = "", $params = array()) { $Actions = new JffnmsActions(); return select_object($Actions,$name,$id,$add_data,'id','description',$params,1,$onchange); } function select_event_types ($name,$id,$size = 1,$add_data = NULL, $onchange = "", $params = array()) { $EventTypes = new JffnmsEvent_types(); return select_object($EventTypes,$name,$id,$add_data,"id",array("description"),$params,$size,$onchange); } function select_event_types_alarms ($name,$id,$size = 1,$add_data = NULL, $onchange = "") { $EventTypes = new JffnmsEvent_types(); return select_object($EventTypes,$name,$id,$add_data,'id',array('description'),array(NULL,array('generate_alarm=>1')),$size,$onchange); } function select_zones ($name,$id,$add_data = NULL,$onchange = "", $params = array()) { $Zones = new JffnmsZones(); return select_object($Zones,$name,$id,$add_data,'id','zone',$params,1,$onchange); } function select_severity ($name,$id,$add_data = NULL,$onchange = '', $params = array()) { $Severity = new JffnmsSeverity(); return select_object($Severity,$name,$id,$add_data,'id',array('level','severity'),$params,1,$onchange); } function select_severity_level ($name,$id, $size, $add_data = NULL,$onchange = "", $params = array()) { global $Severity; return select_object($Severity,$name,$id,$add_data,"level",array("level","severity"),$params,$size,$onchange); } function select_profiles_options ($name,$id,$add_data = NULL,$onchange = "", $params = array()) { $ProfilesOptions = new JffnmsProfiles_options(); return select_object($ProfilesOptions,$name,$id,$add_data,'id','description',$params,1,$onchange); } function select_hosts_config_types ($name,$id, $add_data = NULL, $onchange = "", $params = array()) { $CTypes = new JffnmsHosts_config_types(); return select_object($CTypes,$name,$id,$add_data,"id","description",$params,1,$onchange); } function select_graph_types ($name, $id, $add_data = NULL, $onchange = "", $params = array()) { $GraphTypes = new JffnmsGraph_types(); return select_object($GraphTypes,$name,$id,$add_data,"id",array("types_description","description"),$params,1,$onchange); } function select_alarm_states ($name,$id, $add_data = NULL, $onchange = "", $params = array()) { $States = new JffnmsAlarm_states; return select_object($States,$name,$id,$add_data,"id","description",$params,1,$onchange); } function select_pollers ($name,$id, $add_data = NULL, $onchange = "", $params = array()) { $Pollers = new JffnmsPollers(); return select_object($Pollers,$name,$id,$add_data,'id','description',$params,1,$onchange); } function select_pollers_backend ($name,$id, $add_data = NULL, $onchange = "", $params = array()) { $Backends = new JffnmsPollers_backend; return select_object($Backends,$name,$id,$add_data,'id','description',$params,1,$onchange); } function select_autodiscovery ($name,$id, $add_data = NULL, $onchange = "", $params = array()) { $ADS = new JffnmsAutodiscovery(); return select_object($ADS,$name,$id,$add_data,'id','description',$params,1,$onchange); } function select_filters ($name,$id, $add_data = NULL, $onchange = '', $params = array()) { $Filters = new JffnmsFilters(); return select_object($Filters,$name,$id,$add_data,'id','description',$params,1,$onchange); } function select_filters_fields ($name,$id, $add_data = NULL, $onchange = "", $params = array()) { $FFields = new JffnmsFilters_fields(); return select_object($FFields,$name,$id,$add_data,'id','description',$params,1,$onchange); } function select_slas_cond ($name,$id, $add_data = NULL, $onchange = "", $params = array()) { $SLAs_cond = new JffnmsSlas_cond(); return select_object($SLAs_cond,$name,$id,$add_data,'id','description',$params,1,$onchange); } function select_profiles_values ($name,$option_id, $value_id) { $ProfilesValues = new JffnmsProfiles_values(); return select_object($ProfilesValues,$name,$value_id,NULL,'value','description',array(NULL,array('option'=>$option_id)),1,''); } function select_interface_types_field_types ($name,$id,$add_data = NULL,$onchange = "", $params = array()) { if ($id==1) $id = 8; $Obj = new JffnmsInterface_types_field_types(); return select_object($Obj,$name,$id,$add_data,"id","description",array(NULL,1),1,$onchange); } // FIXME CONVERT TO select_object function select_slas ($name,$sla_id,$interface_type = 0) { if ($interface_type > 0) $filter = "(interface_type = $interface_type or interface_type = 1) "; else $filter = '(1=1)'; return select_general($name,'slas',$filter,'description','id',$sla_id,'description'); } function select_pollers_groups ($name,$poller_group_id,$type = 0) { if ($type > 1) $filter = "((interface_type = '$type') OR (id = 1))"; else $filter = '(1=1)'; return select_general($name,'pollers_groups', $filter, 'description','id',$poller_group_id,'description'); } function select_alarm_duration($name, $value, $text = 0) { $alarm_duration_options = array(0=>"Default",300=>"5 Minutes",600=>"10 Minutes",900=>"15 Minutes",1800=>"30 Minutes",3600=>"60 Minutes"); if ($text==0) return select_custom($name,$alarm_duration_options,$value); else return $alarm_duration_options[$value]; } function select_triggers_types($name, $value, $text = 0) { $triggers_types_options = array("alarm"=>"Match Alarms","event"=>"Match Events"); if ($text==0) return select_custom($name,$triggers_types_options,$value); else return $triggers_types_options[$value]; } function select_show_rootmap($name, $value, $text = 0) { $show_rootmap_options = array(0=>"Dont Show",1=>"Show",2=>"Mark Disabled"); if ($text==0) return select_custom($name,$show_rootmap_options,$value); else return $show_rootmap_options[$value]; } function select_satellites_types($name,$value,$text = 0) { $satellite_types = array(0=>"Satellite",1=>"Master",2=>"Master Backup",3=>"Group",4=>"Client",5=>"Local Master"); if ($text==0) return select_custom($name,$satellite_types,$value); else return $satellite_types[$value]; } function select_alarm_states_states($name, $value, $text = 0) { $alarm_states = array(ALARM_DOWN=>"Down",ALARM_UP=>"Up",ALARM_ALERT=>"Alert",ALARM_TESTING=>"Testing"); if ($text==0) return select_custom($name,$alarm_states,$value); else return $alarm_states[$value]; } function select_trigger_operator($name,$value,$text = 0) { $trigger_op = array( "="=>"Equal to", "!="=>"Not Equal to", ">"=>"Greater Than", "<"=>"Less Than", ">="=>"Greater Than or Equal to", "<="=>"Less Than or Equal to", "IN"=>"In", "!IN"=>"Not In", "C"=>"Contains", "!C"=>"Not Contains" ); if ($text==0) return select_custom($name,$trigger_op,$value); if (array_key_exists($value, $trigger_op)) return $trigger_op[$value]; return ''; } function get_trigger_fields($type) { switch ($type) { case 'event': return array( 'any' => array('name'=>'Any'), 'date' => array('name'=>'Hour', 'function'=>'select_hours', 'params'=>array()), "host_id"=> array("name"=>"Host", "function"=>"select_hosts", "params"=>array(3)), "zone_id"=> array("name"=>"Zone", "function"=>"select_zones", "params"=>array()), "type_id"=> array("name"=>"Type", "function"=>"select_event_types", "params"=>array(3)), "text"=> array("name"=>"Event Text", "function"=>"textbox", "params"=>array(30)), "interface_id"=> array("name"=>"Interface", "function"=>"select_interfaces", "params"=>array(6)), "map"=> array("name"=>"Interface Maps", "function"=>"select_maps", "params"=>array()), "interface_client_id"=> array("name"=>"Client", "function"=>"select_clients", "params"=>array(3)), "none"=> array("name"=>"None") ); break; case 'alarm': return array( "any"=> array("name"=>"Any"), "date"=> array("name"=>"Hour", "function"=>"select_hours", "params"=>array()), "type"=> array("name"=>"Type", "function"=>"select_event_types_alarms","params"=>array(3)), "duration"=> array("name"=>"Duration", "function"=>"select_alarm_duration", "params"=>array()), "active"=> array("name"=>"State", "function"=>"select_alarm_states", "params"=>array()), "interface_host"=> array("name"=>"Host", "function"=>"select_hosts", "params"=>array(3)), "interface_type"=> array("name"=>"Interface Type", "function"=>"select_interface_types", "params"=>array(3)), "interface"=> array("name"=>"Interface", "function"=>"select_interfaces_host", "params"=>array(6)), "map"=> array("name"=>"Interface Maps", "function"=>"select_maps", "params"=>array()), "interface_client_id"=> array("name"=>"Client", "function"=>"select_clients", "params"=>array(3)), "interface_interface"=> array("name"=>"Interface Name", "function"=>"textbox", "params"=>array(30)), "none"=> array("name"=>"None") ); } return NULL; } function select_trigger_fields($name,$value,$type,$text = 0) { $temp = array(); $trigger_fields = get_trigger_fields($type); foreach ($trigger_fields as $key=> $aux) $temp[$key]=$aux['name']; if ($text==0) return select_custom($name,$temp,$value); else if (array_key_exists($value, $temp)) return $temp[$value]; else return ''; } function select_trigger_fields_value($name,$value,$type,$field) { $trigger_fields = get_trigger_fields($type); if ((!$field) || ($field=='any') || ($field=='none')) return ''; else return call_user_func_array($trigger_fields[$field]['function'], array_merge(array($name, $value), $trigger_fields[$field]['params'])); } function select_action_parameters($name,$value,$field_struct,$text = 0) { $fields = array(); $fields_final = array(); $values = array(); if (!empty($value)) $values = explode(",",$value); if (!empty($field_struct)) $fields = explode(",",$field_struct); foreach ($values as $aux) { list ($key,$value) = explode (":",$aux); $values_final[$key]=$value; } foreach ($fields as $field) { list ($key,$description) = explode (":",$field); $fields_final[$key]=array('name'=>$description,'value'=>$values_final[$key]); } $retval = ''; if ($text==0) { foreach ($fields_final as $key=>$data) $retval .= $data['name'].": ".textbox($name."[$key]",$data['value'],30)."
"; } else { foreach ($fields_final as $key=>$data) $retval .= $data['name'].": ".htmlspecialchars(substr($data['value'],0,30))."
"; } return $retval; } function select_hosts_dmii($name, $id, $host_id, $text = 0) { $Maps = new JffnmsMaps(); $Interfaces = new JffnmsInterfaces(); if ($text==0) { $list[1]="None Set"; $list_int = $Interfaces->get_all(NULL,array('host'=>$host_id)); $list_map = $Maps->get_all(); unset($list_map[1]); $list[]=''; $list[]='==== Host Interfaces ===='; foreach ($list_int as $key=>$data) $list["I$key"]=$data['interface'].' '.substr($data['description'],0,30); $list[]=''; $list[]='==== Maps ===='; foreach ($list_map as $key=>$data) $list["M$key"]=$data['name']; return select_custom($name,$list,$id); } else return (($id!=1)?'Set':'(None Set)'); } function show_unix_date () { //Find the first numeric parameter $args = func_get_args(); while (($unixtime = current($args)) && !is_numeric($unixtime) && ($aux = next($args))); if (is_numeric($unixtime) && ($unixtime!=0)) { $result = date ("Y-m-d H:i:s",$unixtime); } else $result = "Not Set"; return $result; } function interface_value_control ($name, $value, $type = "text", $text = false) { switch ($type) { case "bool" : //check box $result = ($GLOBALS["adm_view_type"]=="ascii")?(($value==0)?"O":"X"):checkbox($name, $value, !$text); break; case "rrd_ds": // RRDTool DS $result = rrdtool_ds_control($name, $value, $text); break; case "text" : //text is the pseudo-default default : $result = ($text)?substr($value,0,20):textbox($name,$value,20); break; } return $result; } function rrdtool_ds_control ($name, $value = "", $text = false) { list ($ds, $ds_name, $ds_type, $hb, $min, $max) = explode (":",$value); if ($max[0]=="<") { //variable $auto_max = 1; $max_field = substr($max,1,strlen($max)-2); } else $auto_max = 0; if (empty($min)) $min = 0; $ds_types = array("COUNTER"=>"Counter","GAUGE"=>"Gauge", "ABSOLUTE"=>"Absolute"); if ($text) $result = "Type: ".$ds_types[$ds_type]." Min: ".$min." ".(($auto_max==0)?"Max: ".$max:"Using ".$max_field." for Max"); else { if (!empty($value)) $result .= hidden($name,$value); $result .= "Type: ".select_custom($name."[type]",$ds_types,$ds_type); $result .= "Min: ".textbox($name."[min]",$min,5); if ($auto_max==0) $result .= "Max: ".textbox($name."[max]",$max,10)." or "; $result .= "Use "; $result .= textbox ($name."[max_field]",$max_field,10); $result .= " for Max: ".checkbox($name."[auto_max]",$auto_max,1); } return $result; } function select_interface_types_field_show ($name, $value, $text = false) { $show_options = array(0=>"Never",1=>"Always",2=>"Not in Discovery"); if ($text==false) return select_custom($name,$show_options,$value); else return $show_options[$value]; } function select_events_show ($name,$value,$text = 0) { $show_options = array(0=>"Never",1=>"Always",2=>"Only when Filtering"); if ($text==0) return select_custom($name,$show_options,$value); else return $show_options[$value]; } function select_and_or ($name,$value,$text = 0) { $and_or_options = array(0=>"Or",1=>"And"); if ($text==0) return select_custom($name,$and_or_options,$value); else return $and_or_options[$value]; } function select_stop_continue ($name,$value,$text = 0) { $stop_continue_options = array(0=>"Continue",1=>"Stop this Trigger"); if ($text==0) return select_custom($name,$stop_continue_options,$value); else return $stop_continue_options[$value]; } function select_poll_interval ($name,$value,$text = 0) { $poll_interval_options = array(0=>'When Poller Runs'); for ($i = 5; $i <= 60; $i += 5) $poll_interval_options[$i*60] = "Every $i Minutes"; for ($i = 2; $i <= 24; $i ++) $poll_interval_options[$i*60*60] = "Every $i Hours"; if ($text==0) return select_custom($name,$poll_interval_options,$value); else return $poll_interval_options[$value]; } function select_host_poll_interval ($name, $value, $text = 0) { $poll_interval_options = array(); for ($i = 1; $i <= 60; $i++) $poll_interval_options[$i*60] = "Every ".$i." Minutes"; if ($text==0) return select_custom($name,$poll_interval_options,$value); else return $poll_interval_options[$value]; } function select_nad_refresh ($name, $value, $text = 0) { $hour = 60*60; $nad_refresh_options = array( $hour=>"Every Hour", $hour*3=>"Every 3 Hours", $hour*6=>"Every 6 Hours", $hour*12=>"Every 12 Hours", $hour*24=>"Every 24 Hours", $hour*36=>"Every 36 Hours", $hour*48=>"Every 48 Hours"); if ($text==0) return select_custom($name,$nad_refresh_options,$value); else return $nad_refresh_options[$value]; } function select_nad_deep ($name, $value, $text = 0) { $nad_deep_options = array( 1=>"1 - Just the specified Subnets", 2=>"2 - Include Subnets directly connected to the Seeds", 3=>"3 - Include Subnets 3 Hops away from the Seeds", 4=>"4 - Include Subnets 4 Hops away from the Seeds", 5=>"5 - Include Subnets 5 Hops away from the Seeds", 10=>"10 - Include Subnets 10 Hops away from the Seeds" ); if ($text==0) return select_custom($name,$nad_deep_options,$value); else return $nad_deep_options[$value]; } function select_logfiles_match_items ($name,$id, $add_data = NULL, $onchange = "", $params = array()) { return select_object($logfiles_match_items,$name,$id,$add_data,"id","description",$params,1,$onchange); } function action_dropdown ($name, $id, $actions, $selected_action = '') { global $Config; foreach ($actions as $action=>$data) if (is_array($data)) $actions_urls['&action='.$action.'&actionid='.$id] = $data['name']; if (empty($selected_action)) $selected_action = current($actions_urls); $action_keys = array_keys($actions_urls); $action_sel = $action_keys[array_search_partial("action=$selected_action",$action_keys)]; $result = select_custom($name.$id, $actions_urls, $action_sel, "javascript: go_action('".$name.$id."','".$name."_link".$id."')", 1, false, "action_dropdown"). linktext( image($Config->get('jffnms_rel_path').'/images/bullet6.png'), $_SERVER['REQUEST_URI'].$action_sel,'','action_button','',$name.'_link'.$id); return $result; } function select_community ($name,$value,$text = 0) { return ((!empty($value))?"Set":"Not Set"); } function select_op ($name, $value, $text = 0) { $filter_op = array( "="=>"Equal to", "!="=>"Not Equal to", ">"=>"Greater Than", "<"=>"Less Than" ); if ($text==0) return select_custom($name, $filter_op, $value); else return $filter_op[$value]; } function select_filter_option($name, $value, $field, $size = 1) { $fields = array ( 'types.id'=> array('function'=>'select_event_types', 'events_var'=>'type_id'), 'severity.level'=> array('function'=>'select_severity_level','events_var'=>'severity_level'), 'hosts.id'=> array('function'=>'select_hosts', 'events_var'=>'host_id'), 'zones.id'=> array('function'=>'select_zones', 'events_var'=>'zone_id'), 'interfaces.id'=> array('function'=>'select_interfaces', 'events_var'=>'interfaceid'), 'events.ack'=> array('function'=>'checkbox', 'events_var'=>'ack') ); if (array_key_exists($field, $fields)) { $field_row = $fields["$field"]; if ($name) return call_user_func_array($field_row['function'], array($name, $value, $size)); else return $field_row['events_var']; } return $value; } function select_usern ($name, $value, $text = 0) { if (($text==0) && ($GLOBALS["admin_users"])) //if requesting text input and the user is admin return textbox($name, $value, 20); else return $value; } function select_color($name, $color, $modify) { global $Config; if ($modify == 1) { return script(" function popupColor(URL,option) { day = new Date(); id = day.getTime(); eval(\"color\"+id+\" = window.open(URL, '\" + id + \"', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=100,height=200');\"); eval(\"color\"+id+\".opener = self; \"); self.select = option; }" ). tag('input', '', '', "style='background-color: #".$color."' type='text'". " id='".$name."' name='".$name."'". " value='".$color."' size='8'"). linktext (image('color.png'), "javascript:popupColor('".$Config->get('jffnms_rel_path')."/admin/color_select.php?actual_color=".$color."','".$name."');"); } return tag("input", "", "", "style='background-color: #".$color."' type='text'". " value='".$color."' size='8'"); } function select_date($name, $date, $cant, $show_hour = false,$hour_actual = 0, $onchange_hour ="") { global $Config; echo script ( " function popupCalendar(URL,option) { day = new Date(); id = day.getTime(); eval(\"calendar\"+id+\" = window.open(URL, '\" + id + \"', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=215,height=185');\"); eval(\"if (!calendar\"+id+\".opener) calendar\"+id+\".opener = self; \"); self.dateselect = option; } function SetDate(option, date) { select = document.getElementById(option); select.options[select.options.length] = new Option(date, date); select.selectedIndex = select.options.length-1; }"); $today = date('Y-m-d',time()); if (strpos($date," ") > 0) $date = substr($date,0,10); if (!$date) $date = $today; $date_unix = strtotime($date); if ($date==$today) $date_unix -= 60*60*24; $select = "get('jffnms_rel_path')."/admin/calendar.php?','$name')\">". image("calendar.png")."\n"; if ($show_hour==true) $select.= select_hours($name."_hour",$hour_actual,$onchange_hour); return $select; } function select_hours($name,$actual,$onchange = NULL) { for ($i=0; $i < 24; $i++) { $hours[(string)(60*(60*$i))]=str_pad($i,2,"0",STR_PAD_LEFT).":00"; $hours[(string)(60*((60*$i)+30))]=str_pad($i,2,"0",STR_PAD_LEFT).":30"; } $hours[(60*60*24)]="24:00"; if (!empty($actual) && (!isset($hours[$actual]))) //if a time is set, but its not round at 30 minutes $hours[$actual] = substr(time_hms($actual),0,-3); //add it return select_custom($name,$hours,$actual,$onchange); } function snmp_options ($name, $value = '', $text = false) { global $Config; if (empty($value)) { $version = ''; $community = ''; } elseif (preg_match('/^(v[123]):(\S+)/', $value, $regs)) { $version = $regs[1]; $community = $regs[2]; } else { $version = 'v1'; $community = $value; } $snmp_versions = array(''=>'Not Set', 'v1'=>'SNMPv1'); if ($Config->get('os_type')=='unix') //only Unix has SNMPv2 support $snmp_versions['v2'] = 'SNMPv2c'; $snmp_versions['v3'] = 'SNMPv3'; $snmpv3_levels = array( 'noAuthNoPriv'=>'No Authentication, No Privacy', 'authNoPriv'=>'Authentication, No Privacy', 'authPriv'=>'Authentication and Privacy'); $snmpv3_auth = array('md5'=>'MD5', 'sha'=>'SHA'); $snmpv3_priv = array('des'=>'DES', 'aes128'=>'AES128'); if ($text) $result = (empty($community)?'Not Set':'SNMP'.$version.' Set'); else { $result = select_custom($name.'[version]', $snmp_versions, $version); switch ($version) { case 'v3': list ($user, $level, $auth_protocol, $auth_key, $priv_proto, $priv_key) = explode("|", $community); $result .= select_custom($name."[level]", $snmpv3_levels, $level).br(); $result .= "User: ".textbox ($name."[user]", $user,10); $result .= "Pass: ".textbox ($name."[pass]", $auth_key,10).br(); $result .= select_custom($name."[auth]", $snmpv3_auth, $auth_protocol); $result .= select_custom($name."[priv]", $snmpv3_priv, $priv_proto); $result .= "Key: ".textbox ($name."[priv_key]", $priv_key,10); break; case 'v1': case 'v2': default: $result .= textbox($name.'[community]', $community); break; } } return $result; } function snmp_options_parse ($value) { if (is_array($value)) switch ($value["version"]) { case '': return ''; case "v1": case "v2": return $value["version"].":".$value["community"]; break; case "v3": return $value["version"].":". $value["user"]."|".$value["level"]."|".$value["auth"]."|". $value["pass"]."|".$value["priv"]."|".$value["priv_key"]; break; } return $value; } function select_logfiles ($name,$interface_id,$size = 1,$add_data = NULL, $onchange = "", $params = array()) { $Logfiles = new JffnmsLogfiles(); return select_object($Logfiles,$name,$interface_id,$add_data,'id',array('description'),$params, $size,$onchange); } ?> jffnms-0.9.3/lib/profiles_options.class.php0000644000175000017500000001136411525126353020307 0ustar csmallcsmall JFFNMS Authors * This program is licensed under the GNU GPL, full terms in the LICENSE file */ class JffnmsProfiles_options extends basic { var $jffnms_insert = array('tag'=>'New Tag','description'=>'New Option','type'=>'text'); function get_all($ids = NULL,$where_special = NULL) { return get_db_list('profiles_options', $ids, array('profiles_options.*'), //table,ids,fields array(array('profiles_options.id','>',0)), //where array(array('profiles_options.id','desc')) ); //order } // get_options() function add($user_id, $option) { $id = ''; if (!is_numeric($option)) $option = $this->get_id ($option); if (is_numeric($option) and ($option > 0)) { $query = "INSERT INTO profiles (userid,profile_option,value) VALUES ($user_id, $option, 1)"; $result = db_query ($query) or die ('Query Failed - AZ15 - '.db_error()); $id = db_insert_id(); $this->update($user_id,$option,$this->get_default_value($option)); if (!isset($value) or $value=='') $value=1; } return $id; } function del($user_id, $option) { if (!is_numeric($user_id) || !is_numeric($option)) return FALSE; $query = "DELETE FROM profiles WHERE userid = $user_id AND profile_option = $option"; return db_query ($query) or die ("Query Failed - AZ14 - ".db_error()); } function del_user($user_id) { $query = "DELETE FROM profiles WHERE userid = $user_id"; $result = db_query ($query) or die ("Query Failed - Profiles del_user_options() - ".db_error()); } function get_user( $user_id, $option) { $query = "SELECT value FROM profiles WHERE userid = $user_id AND profile_option = $option"; $result = db_query ($query) or die ('Query Failed - AZ17 - '.db_error()); $num_rows = db_num_rows($result); if ($num_rows == 1) { $row = db_fetch_array($result); return $row['value']; } return 0; } function list_users( $user_id) { return get_db_list( array('profiles'), NULL, array('*'), array( array('profiles.id','>',1), array('profiles.userid','=',$user_id), ), NULL); } function get_type ($option) { //find out the type of the option $query = "SELECT type FROM profiles_options WHERE id = $option"; $result = db_query ($query) or die ('Query Failed - profile_get_option_type() - '.db_error()); if (db_num_rows($result) == 1) { $row = db_fetch_array($result); return $row['type']; } return ''; } #get_option_type() function get_id ($tag) { $query = "SELECT id FROM profiles_options WHERE tag = '$tag'"; $result = db_query ($query) or die ('Query Failed - Profiles-> get_option_id() - '.db_error()); if (db_num_rows($result) == 1) { $row = db_fetch_array($result); return $row['id']; } return 0; } #get_option_id() function get_default_value ($option) { $query = "SELECT default_value FROM profiles_options WHERE id = $option"; $result = db_query ($query) or die ('Query Failed - Profiles get_option_default_value() - '.db_error()); if (db_num_rows($result) == 1) { $row = db_fetch_array($result); return $row['default_value']; } return ''; } #get_option_default_value() function update($user_id, $option, $value) { $value_id = 0; if (!is_numeric($option)) $option = $this->get_id ($option); if ($type = $this->get_type($option)){ if ($type=="text") { //if its text modify the value $value_id = $this->get_user($user_id,$option); //get the actual value of this option for this user if (($value_id=="0") or ($value_id==1)) { // didnt have that option //we didnt have any value there so add a new one $query = "insert into profiles_values (profile_option) values ($option)"; $result = db_query($query) or die ("Query Failed - AZ12 - ".db_error()); $value_id = db_insert_id(); } if ($value_id > 1) db_update("profiles_values",$value_id,array("value"=>$value)); //update the value } if ($type=="select") { //if its select, find out the ID of the value $query = " Select id from profiles_values where profile_option = $option and value = '$value'"; //echo $query; $result = db_query ($query) or die ("Query Failed - AZ10 - ".db_error()); if (db_num_rows($result) == 1) { $row = db_fetch_array($result); $value_id = $row["id"]; } } } if ($value_id > 0) { $query="Update profiles set value = '$value_id' where profile_option = '$option' and userid = $user_id"; //echo "$query\n"; $result = db_query ($query) or die ("Query failed - profiles_modify_value() - ".db_error()); return true; } return false; } }//class jffnms-0.9.3/lib/maps.class.php0000644000175000017500000000346111533544137015653 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ class JffnmsMaps extends basic { function get_all($ids = NULL, $parent = NULL, $where_special = NULL) { if (!is_array($where_special)) $where_special = array(); if ($parent) $where_special[]=array('maps.parent','=',$parent); if ($ids != 1) $where_special[]=array('maps.id','>','0'); return get_db_list( array('maps','parent'=>'maps'), $ids, array( 'maps.*', 'parent_name'=>'parent.name'), array_merge( array(array('maps.parent','=','parent.id')), $where_special), array ( array('maps.name','asc') ), 'maps.id', NULL); } // get_all() function status(&$Interfaces, $map_id) { return $Interfaces->status(NULL,array('map'=>$map_id)); } // status() function status_all_down(&$Interfaces, $map_id) { $result = $this->status($Interfaces, $map_id); if (is_array($result) && ($result['down']['qty'] == $result['total']['qty']) && $result['total']['qty'] > 0) return TRUE; return FALSE; } // maps_status_all_down() function add($parent = 1) { return db_insert('maps',array('name'=>'New Map '.rand(1,999),'parent'=>1)); } function update($map_id,$data) { return db_update('maps',$map_id,$data); } function del($map_id) { $Interfaces = new JffnmsInterfaces(); $interfaces = $Interfaces->get_all($map_id); foreach ($interfaces as $int) $Interfaces->del($int[id]); $interfaces = $Interfaces->get_all($map_id); if (count($interfaces) == 0) return db_delete('maps',$map_id); else return FALSE; } } //class ?> jffnms-0.9.3/lib/gui.inc.php0000644000175000017500000004017511716447477015162 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ class jffnms_access_api { var $session; function jffnms_access_api ($init_type = NULL) { if (isset($init_type)) $this->init_type = $init_type; } function get($class_name) { $new_class_name = "jffnms_remote_$class_name"; $obj = NULL; if (!class_exists($new_class_name)) { $methods = $this->_call($class_name,"get_methods",NULL); $class_code.=" class $new_class_name extends jffnms_access_api {\n"; if (is_array($methods)) { foreach ($methods as $meth) if (!(($class_name=="jffnms") and ($meth=="get"))) { //don't overwrite the jffnms->get method $class_code.=" function $meth() {\n"; $class_code.=" \$params = func_get_args();\n"; $class_code.=" return parent::_call('$class_name','$meth',\$params);\n"; $class_code.=" }\n"; } $class_code.=" }\n"; eval ($class_code); } } if (class_exists($new_class_name)) { //class created $obj = new $new_class_name; $obj->session = &$this->session; if ($class_name=="jffnms") { //special mail class $jffnms_classes = $obj->jffnms ($this->init_type); if ($this->init_type==1) //init all classes foreach ($jffnms_classes as $aux) if ($aux!="access_api") $obj->$aux = $this->get($aux); } } return $obj; } /* function _call ($class,$method,$params) { $server = get_config_option("jffnms_satellite_server_uri"); if (empty($this->session)) $this->session = "get"; $message = array( "sat_id"=>1, "class"=>$class, "method"=>$method, "params"=>$params, "session"=>$this->session ); $ret = satellite_query ($server,$message,"GUIClient",0); //debug (array(request=>$message,response=>$ret)); if (is_array($ret) && (isset($ret["session"]))) { $this->session = $ret["session"]; unset ($ret["session"]); } return $ret; } */ } function clean_url_array (&$list, $key,$value,$deep = 0) { if (is_array($value)) foreach ($value as $k=>$v) { //debug ("DEEP $deep - $key - $k - $v"); $key_aux = (is_array($value)&&!empty($key))?"[$k]":$k; clean_url_array($list,$key.$key_aux,$v,$deep+1); } else { //debug ("VALUE $deep - $key - $value"); $list[] = urlencode($key)."=".urlencode($value); } } /* function clean_url($extra_vars = array(),$no_vars = array()) { var_dump($extra_vars, $no_vars); die("Cannot clean url, use sanitizer"); if ($GLOBALS["_GET"]) $REQUEST_URI_VARS = @array_merge($GLOBALS["_GET"],$GLOBALS["_POST"],$extra_vars); //suport for PHP 4.1.0 and older else $REQUEST_URI_VARS = @array_merge($GLOBALS["HTTP_GET_VARS"],$GLOBALS["HTTP_POST_VARS"],$extra_vars); foreach ($no_vars as $delete) unset($REQUEST_URI_VARS[$delete]); $url_aux=array(); clean_url_array($url_aux,"",$REQUEST_URI_VARS); $REQUEST_URI_CLEAN = $GLOBALS["SCRIPT_NAME"]."?".join("&",$url_aux); $GLOBALS["REQUEST_URI"]=$REQUEST_URI_CLEAN; //cleaning up the URL } */ function http_authenticate() { global $Config; header( "WWW-Authenticate: Basic realm=\"JFFNMS ".JFFNMS_VERSION."\""); header( "HTTP/1.0 401 Unauthorized"); include($Config->get('jffnms_real_path').'/htdocs/logout.php'); exit; } function show_license($title) { return "\n"; } function adm_header($title = "", $bgcolor = "", $body_others="", $just_head = false) { global $refresh,$REQUEST_URI; global $Config; $jffnms_rel_path = $Config->get('jffnms_rel_path'); echo ((!$just_head)?tag("!DOCTYPE", "", "","HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"", false):""). show_license($title). tag("html","","","",false). tag("head"). html("title", (!empty($title)?$title." - ":"")."JFFNMS"). tag("meta","","","HTTP-EQUIV='Pragma' CONTENT='no-cache'", false). tag("meta","","","HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=iso-8859-1'", false). tag("meta","","","HTTP-EQUIV='Content-language' CONTENT='en'", false). tag("meta","","","HTTP-EQUIV='Content-Style-Type' CONTENT='text/css'", false). tag("meta","","","HTTP-EQUIV='Content-Script-Type' CONTENT='text/javascript'", false). (($refresh) ?tag("meta","","","HTTP-EQUIV='Refresh' CONTENT='".$refresh.";".$REQUEST_URI."'", false) :""). tag("link","","","rel='shortcut icon' type='image/x-icon' href='$jffnms_rel_path/images/jffnms.ico'", false). tag("link","","","rel='icon' type='image/x-icon' href='$jffnms_rel_path/images/jffnms.ico'", false). tag("link","","","rel='stylesheet' href='$jffnms_rel_path/default.css'", false). (!empty($GLOBALS["jffnms_custom_css"])?tag("link","","","rel='stylesheet' href='".$GLOBALS["jffnms_custom_css"]."'", false):""). tag("link","","","rel='alternate' type='application/rss+xml' title='".$Config->get('jffnms_site')." Events Feed' href='$jffnms_rel_path/events.php?view_type=rss'", false). tag_close("head"). ((!$just_head) ?tag ("body","","", (!empty($bgcolor)?" style='background-color: #$bgcolor;'":""). (!empty($body_others)?" ".$body_others:"") ,false) :""); } function adm_footer () { echo tag_close("body"). tag_close("html"); } function news_get ($news_url) { $news = http_post_message($news_url,array()); if (!empty($news)) return @explode("\n",$news); else return false; } function control_button ($text, $frame = "", $url = "" ,$image = "", $control_name = "", $onclick = "") { if (empty($image)) $image = "bullet3.png"; // So people call it with an empty value $result = linktext ("\n". (($image!="none")?image($image)." ":"") .$text."\n" ,$url, $frame, "controlbutton", $onclick, $control_name); return $result; } function javascript_refresh($url,$time) { $time_msec = $time*1000; if (($url) && ($time > 1)) return script("refresh_timeout = window.setTimeout ('$url',$time_msec);"); return ''; } function play_sound($file) { global $Config; $file = $Config->get('jffnms_rel_path').'/sounds/'.$file; return html("embed", "", "", "", "src='".$file."' autostart='true' hidden='true' loop='false'"). // MOZ html ("object", tag("param", "", "", "name='Filename' value='".$file."'") ,"", "", "hidden='true' classid='clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95' style='display: none;'"); // IE } function show_event (&$event, $map_id,$filter_id) { global $Sanitizer, $Config; global $REQUEST_URI, $express_filter, $view_type, $journal_id; $jffnms_rel_path = $Config->get('jffnms_rel_path'); $image_ack = (($event['ack']>0)?'ok.png':'alert2.gif'); $filter_url = $Sanitizer->get_url('','all',array('filter_id'=>$filter_id)); $date_unix = strtotime($event['date']); $day = date ('j M',$date_unix); $hour = date ('H:i:s',$date_unix); $event_text = $event['text']; switch ($view_type) { case 'html': $day_filter = date ('Y-m-d',$date_unix-(60*60*24)); $fgcolor = $event['fgcolor']; $bgcolor = $event['bgcolor']; $id = $event['id']; $ack_image = image($image_ack); $summary_ids = (is_array($event['summary_ids'])?join(',',$event['summary_ids']):$event['id']); $ack_url = $Sanitizer->get_url('','all', array('journal_id'=>($event['ack']==0?1:0), 'journal_button' => 'Ack', 'checkedid[]' => $summary_ids)); $output = tr_open("event$id", (($event["ack"]!=0)?"ack":"event"), $bgcolor, "", "color: ".$fgcolor). //Date + Hour td(linktext($day, $filter_url."&express_filter=date,$day_filter,=")." ".html("a",$hour), "date"). // Checkbox + Detail td( checkbox_value('checkedid[]', $summary_ids, ((($event["ack"]!=0) && ($journal_id > 1) &&($journal_id==$event["ack"]))?1:0)). //check linktext($ack_image, $ack_url), 'ack_check'). // Type td (linktext($event["type_description"], $filter_url."&express_filter=".$express_filter."^type,".$event["type_id"].",=&map_id=".$map_id), "type", "", (($event["show_host"]==0)?3:"")); if ($event["show_host"] == 1) //Host + Zone $output .= td( linktext(" ".substr($event["host_name"],0,20)." ".$event["zone"]." ", $filter_url."&express_filter=".$express_filter."^host,".$event["host_id"].",=&map_id=".$map_id), "host", "", (empty($event["zone_image"])?2:"")). (!empty($event["zone_image"]) ?td(linktext(image($event["zone_image"]), $filter_url."&express_filter=".$express_filter."^zone,".$event["zone_id"].",=&map_id=".$map_id), "zone"):""); // Event Text $output .= td($event_text, "detail"); //closing $output .= tag_close("tr"); break; case "csv": $day_only = date ("Y-m-d",$date_unix); $fields = array($day_only,$hour,$event["host_name"],$event["zone_name"],$event["user"],$event["interface"], $event["type_description"],$event["state"],$event["info"],$event["severity"]); foreach ($fields as $key=>$aux) $fields[$key] = "\"".$aux."\""; $output = join(",",$fields)."\n"; break; case "rss": case "rdf": $output .= html("item", html("title", $event["severity"]." - ".$event["host_name"]." ".$event["zone"].": ".$event_text, "", "", "", false, true). html("pubDate", $event["date"], "", "", "",false, true). html("link", htmlspecialchars(current_host().$REQUEST_URI."&view_type=html"), "", "", "",false, true) ); break; } echo $output; } // show_event() function interface_shortname_and_card ($interface,$type_description,$break_by_card) { $interface_len = strlen($interface); for ($pos = 0; ($pos < $interface_len) && (!is_numeric($interface[$pos])); $pos++) /* nothing */ ; $space_pos = strpos($interface," "); if ($interface_len > 9) { if ($pos <= 0) $pos = 1; if ($pos == $interface_len) $pos = 1; //if there was no numbers in the interface name if ($space_pos!==FALSE) //if the interface has a space in it { $int = substr($interface,0,$space_pos)." ".$interface[$space_pos+1]; // from Real Memory take Real M $pos = $space_pos; } else $int = $interface[0].substr($interface,$pos,$interface_len); //from Serial9/3/4 take S9/3/4 } else $int = $interface; if (strpos($interface,"/")===FALSE) $pos--; //if the interface is not part of a card Serial3/4 | Tunnel0 then pos-- because card will not include the number if ($break_by_card==1) { if (is_numeric($interface[$pos])) //Card Number Numeric Serial9 interface[pos]="9" $card = substr(substr($interface,0,$pos),0,8).$interface[$pos]; //use Serial9 else $card = substr(substr($interface,0,$pos+1),0,9); //interface[pos] not numeric, use all 9 chars from interface name } else $card = substr($type_description,0,9); $int = trim($int); $card = trim ($card); //debug ("inter: $interface -- int: $int -- card: $card -- len: $interface_len -- pos: $pos -- pos1: $pos1");// continue; return array($int, $card); } //Get the Graph File from object and store it in a local (public) place function performance_graph ($id, $graph_filename, $graph_function, $sizex, $sizey, $title, $graph_time_start, $graph_time_stop, $other_data = "") { jffnms_load_api('rrdtool'); $retval = rrd_grapher($id, $graph_function, $sizex,$sizey, $title,$graph_time_start,$graph_time_stop, $other_data); if ($retval == FALSE) return FALSE; list ($value, $graph_data, $other_data) = $retval; $graph_data = base64_decode ($graph_data); $fp = fopen ($graph_filename, "wb+"); fputs($fp,$graph_data); fclose ($fp); return $value; } function news_parse () { global $jffnms_site, $info; $i_info = (is_array($info) && array_key_exists('interfaces', $info)?$info['interfaces']['data']:''); return array('site'=>$jffnms_site, 'version'=>JFFNMS_VERSION, 'h'=>$info['hosts']['data'], 'i'=>$i_info, 'f'=>$_SERVER['REMOTE_ADDR'], 'php'=>phpversion(), 'apache'=>$_SERVER['SERVER_SOFTWARE']); } function alarms_get_status ($alarms) { $lower_alarm=256; $lower_alarm_id = 2; $bgcolor = NULL; $fgcolor = NULL; $lower_alarm_name=NULL; if (is_array($alarms)) foreach ($alarms as $alarm_name=>$data) if ($data['alarm_level'] < $lower_alarm) { $lower_alarm = $data['alarm_level']; $lower_alarm_name = $alarm_name; $bgcolor = $data['bgcolor']; $fgcolor = $data['fgcolor']; } $alarms_parsed = array(); $alarms_long = array(); if (is_array($alarms)) foreach($alarms as $key=>$alarm) { if ($key=='total') $alarms_parsed[$key]='T='.$alarm['qty']; else $alarms_parsed[$key]=strtoupper($key[0]).$alarm['qty']; $alarms_long[$key]=$alarm['qty']; } $status = join('/',$alarms_parsed); return array($status,$bgcolor,$fgcolor,$alarms_long,$lower_alarm_name); } function profile ($tag, $set_value = NULL) { $Profiles = new JffnmsProfiles(); $ProfilesValues = new JffnmsProfiles_values(); if ($set_value != NULL) $ProfilesValues->modify($_SESSION['auth_user_id'], $tag, $set_value); $value = $ProfilesValues->get_value($tag,$_SESSION['auth_user_id']); return $value; } function cookie ($tag, $set_value = NULL) { $value = ''; session_start(); if ($set_value !== NULL) $_SESSION[$tag] = $set_value; if (array_key_exists($tag, $_SESSION)) $value = $_SESSION[$tag]; session_write_close(); return $value; } function ImageStringCenter($im,$color,$y,$text,$big = 0) { if (!is_array($text)) $text = array($text); if ($big==0) { $size = 2; $charsize = 6; $line_span = 9; } if ($big==1) { $size = 4; $charsize = 8; $line_span = 13; } //$len = (strlen($text)*$charsize); $sizex = imagesx($im); $sizey = imagesy($im); $cant_lines = count($text); $lines_space = ($cant_lines * $line_span); $space_left = ($sizey - $lines_space); $y_span = floor(($space_left/($cant_lines*2))); //echo "$sizey $lines_space $space_left $cant_lines $y_span ----"; $line_number = 0; foreach ($text as $align=>$aux) { $aux = substr($aux,0,($sizex/$charsize)); $len = (strlen($aux)*$charsize); if (is_numeric($align)) $align = "center"; switch ($align) { case "center" : $x=($sizex/2)-($len/2); break; case "left" : $x=($sizex-$len); break; case "right" : $x=0; break; } ImageString ($im, $size, $x, $y+$y_span+($line_number*($line_span+$y_span)), $aux,$color); $line_number++; } } function current_host() { return "http".(isset($_SERVER["HTTPS"])?"s":"")."://".$_SERVER["HTTP_HOST"]; } function display_error($errtitle,$errmsg="") { return('

'.$errtitle.'

'.$errmsg.'

'); } ?> jffnms-0.9.3/lib/gui.toolkit.inc.php0000644000175000017500000002060711717643475016641 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ /* Basic HTML Structures */ function tag ($name, $id = "", $class = "", $others = "", $indent = true, $keep_lines = false) { return html_indenter(). "<".$name. (!empty($id)?" id='".$id."'":""). (!empty($class)?" class='".$class."'":""). (!empty($others)?" ".trim($others):""). ">". (($keep_lines)?"":"\n"). (($indent)?html_indent_more():""); } function tag_close($name, $indent = true, $indent_after = true) { return (($indent)?html_indent_less():""). (($indent_after)?html_indenter():""). "\n"; } function html ($name, $content, $id = "", $class = "", $others = "", $indent = true, $keep_lines = false) { return tag ($name, $id, $class, $others, $indent, $keep_lines). (!empty($content) ?re_indent($content,$keep_lines) :""). tag_close($name, $indent, $indent); } function re_indent($text, $keep_lines = false) { if ($keep_lines) return $text; $ind = html_indenter(); return preg_replace("/\t/", $ind, $text); } /* Complex HTML Structures */ function table ($id="", $class = "") { return tag("table", $id, $class, "", false); } function table_close() { return tag_close ("table", false); } function tr_open($id = "", $class = "", $bgcolor = "", $rowspan = "", $style = "") { return tag("tr", $id, $class, (!empty($bgcolor)?" bgcolor='$bgcolor'":""). (!empty($rowspan)?" rowspan=$rowspan":""). (!empty($style)?" style='$style'":"")); } function td ($content="", $class = "", $id = "", $colspan = "", $rowspan = "", $keep_lines = false) { return html ("td", $content, $id, $class, (is_numeric($colspan)?" colspan='$colspan'":""). (is_numeric($rowspan)?" rowspan='$rowspan'":""), true, $keep_lines); } function table_row($text = "", $class = "", $colspan="", $rowspan="", $echo = true) { $result = tr_open("", "", "", $rowspan). td($text, $class, "", $colspan). tag_close("tr"); if ($echo) echo $result; return $result; } function tr ($tds = "", $classes = "", $colspans="", $rowspan="") { $tds = !is_array($tds)?array($tds):$tds; $classes = !is_array($classes)?array($classes):$classes; $colspans = !is_array($colspans)?array($colspans):$colspans; $result = tr_open("", "", "", $rowspan); foreach ($tds as $key=>$td_content) $result .= td ($td_content, (isset($classes[$key])?$classes[$key]:current($classes)), "", (isset($colspans[$key])?$colspans[$key]:current($colspans))); $result .= tag_close("tr"); return $result; } function script ($content) { return tag ("script","","","type='text/javascript'"). re_indent($content,true)."\n". tag_close("script"); } function br() { return tag ("br","","","",false); } function memobox($name,$rows,$cols,$value) { return html ("textarea", $value, "", "", "rows='$rows' cols='$cols' name='$name'", false, true); } function checkbox($name, $var, $form = true) { return checkbox_value($name,1,$var,$form); } function checkbox_value($name,$value, $check = false, $form = true, $onclick="") { if ($form==false) { $name = 'checkbox_'.rand(1000,9999); #$disabled = ' disabled'; $disabled = ''; $onclick = 'return false;'; } else $disabled = ''; if ($check==true) $checked = ' checked'; else $checked = ''; if (!empty($onclick)) $js = " onClick=\"$onclick\""; else $js = ''; return tag('input', $name, '', "type='checkbox' name='$name' value='$value'".$checked.$js.$disabled, false); } function textbox($name, $var='', $len = 0, $maxsize = 0, $disabled = 0) { return tag("input", $name, "", "type='text' name='$name' value='$var' size='".(($len==0)?strlen($var):$len)."'". (($maxsize>0)?" maxsize='$maxsize'":""). (($disabled==1)?" disabled":""), false); } function form ($id = "", $action = "", $method = "POST", $target = "_self", $class = "") { return tag ("form", $id, $class, (!empty($action)?" action='".$action."'":""). (!empty($method)?" method='".$method."'":""). (!empty($target)?" target='".$target."'":"") ,false); } function adm_form_submit($value = "Submit", $name = "") { return tag ("input", "" ,"", (!empty($name)?"name='$name'":""). " type='submit' value='$value'", false); } function form_close() { return tag_close("form", false); } function image($src, $w = '', $h = '', $title = '', $class='', $id = '', $onclick='', $others = '') { global $Config; if (!empty($src) && (strpos($src,'/')===false)) //when we were given a file without a path { if (($w==='') && ($h==='')) //only when w and h are not set, but if you use NULL you will avoid the w/h fields list($w, $h) = getimagesize($Config->get('jffnms_real_path').'/htdocs/images/'.$src); $src = $Config->get('jffnms_rel_path').'/images/'.$src; //add default path } return tag ("img", $id, $class, "src='".$src."'". " title='".$title."' alt='".$title."'". (!empty($w)?" width='".$w."'":""). (!empty($h)?" height='".$h."'":""). (!empty($onclick)?" OnClick='javascript: ".$onclick."'":""). (!empty($others)?" ".$others:"") , false); } function linktext ($text, $url, $target="" ,$class = "", $on_click = "", $id = "", $style = "") { if (is_array($target)) $target = $target[0]; return html ("a", $text, $id, $class, (!empty($target)?" target='".$target."'":""). (!empty($url)?" href=\"".htmlspecialchars($url)."\"":""). (!empty($on_click)?" onClick=\"".$on_click."\"":""). (!empty($style)?" style='".$style."'":"") ); } function radiobutton($name, $selected, $value) { return tag ("input", $name, ""," type='radio' name='".$name."' value='".$value."'". (($selected==1)?" checked":""), false); } function hidden($name,$value) { if (is_array($value)) $value = $value[0]; return tag ("input","","","type='hidden' name='".$name."' value='".$value."'", false); } function select_custom ($control_name,$options,$mark_values,$onclick="", $size = 1, $echo = false, $class = "", $ondblclick = "") { if ($size > 1) { $multi = "multiple size='".$size."'"; $control_name.="[]"; } if (!is_array($mark_values)) $mark_values=explode(",",$mark_values); $result = tag ("select", $control_name, $class, "name='".$control_name."'". (($onclick)?" onChange=\"".$onclick."\"":""). (($ondblclick)?" onDblClick=\"".$ondblclick."\"":""). (!empty($multi)?" ".$multi:"")); foreach ($options as $key=>$value){ //debug ($key." - ".in_array($key,$mark_values)." - ".$mark_values[0]." - ".($mark_values[0]==="SELECT_ALL")); $encoded_key = ((strpos($key,"=")===false) && (strlen($key) > 3))?urlencode($key):$key; $result .= html("option",$value,"","","value='".$encoded_key."'". ((in_array($key,$mark_values) or ($mark_values[0]==="SELECT_ALL"))?" selected":"") , false, true); } $result .= tag_close("select"); if ($echo) echo $result; return $result; } /* HTML Automatic Indenting Functions */ function html_indent_none() { html_indent_init(); $GLOBALS["html_indents"][$GLOBALS["html_indent"]]=0; } function html_indent_more () { $GLOBALS["html_indent"]++; return html_indent_none(); } function html_indent_less () { $GLOBALS["html_indent"]--; return html_indent_none(); } function html_indent_init () { if (!isset($GLOBALS["html_indent"]) || !isset($GLOBALS["html_indents"])) { $GLOBALS["html_indent"] = 0; $GLOBALS["html_indents"] = array($GLOBALS["html_indent"]=>0); } } function html_indent_already() { html_indent_init(); return $GLOBALS["html_indents"][$GLOBALS["html_indent"]]; } function html_indenter ($verify = 0, $count = 1) { if ((html_indent_already()==0) || (!$verify)) { $result = ""; for ($i = 0; $i < $GLOBALS["html_indent"]; $i++) $result .= "\t"; if ($count) $GLOBALS["html_indents"][$GLOBALS["html_indent"]]=1; return $result; } else echo "!"; } ?> jffnms-0.9.3/lib/api.inc.php0000644000175000017500000004111311742003371015114 0ustar csmallcsmall JFFNMS Authors * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //hard-coded alarm state IDs define ('ALARM_DOWN',1); define ('ALARM_UP',2); define ('ALARM_ALERT',3); define ('ALARM_TESTING',4); define ('ENTERPRISES_OID', '.1.3.6.1.4.1'); //DEBUG //----------------------------------------- function logger($text, $show_date = true) { global $Config, $method; $old_error_reporting = error_reporting(7); $text = (($show_date==true)?date('H:i:s')." ":"").$text; error_reporting($old_error_reporting); if ($Config->get('jffnms_debug')==1) { if (array_key_exists('Child', $GLOBALS)) { $GLOBALS['Child']->logger($text); return; } $file = str_replace('.php','',basename($Config->get('logging_file'))); $filename = $Config->get('log_path').'/'.$file.'-'.date('Y-m-d').'.log'; if ( ($log = fopen($filename,'a+')) === FALSE) { print "Unable to open log file $filename.\n"; return; } fputs($log, $text); fclose($log); } echo $text; } function debug($text) { echo "\n
";
  print_r($text);
  echo "
\n"; flush(); } function d($text) { echo "\n
";
  var_dump($text);
  echo "
\n"; flush(); } function vd_tab ($count) { return @str_repeat("\t",$count); } function vd($data,$pos = 1) { $result = vd_tab($pos-2).gettype($data)."("; if (is_array($data)) { $result .= count($data).") { \n"; foreach ($data as $key=>$value) $result.= vd_tab($pos)."[$key] => ".vd($value,$pos+1)."\n"; $result .= vd_tab($pos)."} \n"; } else $result.= strlen(strval($data)).") \"$data\""; return $result; } // Youre kidding me right? the float and floatvar are not locale // aware? Really? // Lucky for us rrdtool exports things as scientific notation so we don't // need to worry about thousand separators function str2f($str) { $linfo = localeconv(); $str = str_replace(',','.',$str); return floatval($str); } // TIME FUNCTIONS //----------------------------------------- // // Return Unix timestamp in milliseconds function time_msec() { return microtime(TRUE) * 1000; } function time_msec_diff($from, $to=FALSE) { if (!$to) $to = time_msec(); return round($to-$from,2); } //MISC //--------------------------------------------- function dec2hex($dec) { $hex=dechex($dec); if (strlen($hex)==1) $hex="0$hex"; return $hex; } function str_encode($str,$decode = 0) { $from = "ab'cdefghij1:234567890kl=mnozABCDEWXY{Zpqrstuvwxy"; $to = "nopq34'56tuvwxyr;sWX2zaTU:VY01789=ZABCDEFbcdeNOPQRS}GHIJKLM"; if ($decode==1) return strtr($str, $to, $from); else return strtr($str, $from, $to); } /* Function: object2array Purpose: Convert an object to an array recursively: all object children will be converted to arrays too */ function object2array ( $object ) { if ( !is_object ( $object ) && !is_array($object) ) // if $object is not an object nor an array return $object; // return it as is $ret = array (); // create return array if (is_array($object)) $v = $object; //take it as an array else $v = get_object_vars ( $object ); // retrieve all object properties and values while ( list ( $prop, $value ) = each ( $v ) ) // create key=>value pairs for all $prop=>value pairs $ret [ $prop ] = object2array ( $value ); return $ret; } function satellize($data_to_send,$capabilities = NULL) { if (isset($data_to_send)) { if (!$capabilities) $capabilities = unsatellize(); //default if (strlen($capabilities)==1) $only_one = TRUE; else $only_one = FALSE; if (strpos($capabilities,"V")!==FALSE) { if (!$only_one) $data_header .= "V"; $data_to_send = vd($data_to_send); } if (strpos($capabilities,"S")!==FALSE) { if (!$only_one) $data_header .= "S"; $data_to_send = serialize($data_to_send); } if (strpos($capabilities,"W")!==FALSE) if (strpos($capabilities,"S")===FALSE) { //not using Serialize if (!$only_one) $data_header .= "W"; //only if other capabilties are support, add the tag $data_to_send = wddx_serialize_value($data_to_send); } if (strpos($capabilities,"R")!==FALSE) if (is_string($data_to_send)) { if (!$only_one) $data_header .= "R"; $data_to_send = str_encode($data_to_send); } if (strpos($capabilities,"O")!==FALSE) { //soap if (!$only_one) $data_header .= "O"; //create SOAP Response require_once 'SOAP/Server.php'; $server = new SOAP_Server; $return_val = $server->buildResult($data_to_send, $a); $qn = new QName($GLOBALS["method"].'Response',"urn:JFFNMS"); $methodValue = new SOAP_Value($qn->fqn(), 'Struct', $return_val); header("Content-Type: text/xml; charset=UTF-8"); $data_to_send = $server->_makeEnvelope($methodValue, $header_results, "UTF-8"); unset($server); } if ($data_header) $data_ready = $data_header."|"; $data_ready .= $data_to_send; } return $data_ready; } function unsatellize($data = NULL, $capabilities = NULL) { if (($data) && (strpos(substr($data,0,10),"|")===FALSE)) { //if no header recived add the default capabilties, probably only one is there like W if (!$capabilities) $capabilities = unsatellize(); $header = $capabilities; $data_to_recv = $data; } else { $pos = strpos($data,"|"); $header = substr($data,0,$pos); $data_to_recv = substr($data,$pos+1,strlen($data)-$pos); } for ($i=strlen($header); $i >= 0 ; $i--) //des satellize in reverse order switch ($header[$i]) { case "S": $data_to_recv = unserialize(stripslashes($data_to_recv)); break; case "W": $data_to_recv = wddx_deserialize(stripslashes($data_to_recv)); break; case "R": $data_to_recv = str_encode($data_to_recv,1); break; case "O": if (is_string($data_to_recv)) { //because it may be already decoded //SOAP Server Request Decoding require_once 'SOAP/Server.php'; $server = new SOAP_Server; $parser = new SOAP_Parser($data_to_recv,"UTF-8",$attachments); $data_to_recv = $server->_decode($parser->getResponse()); $data_to_recv = object2array($data_to_recv); unset($server); } break; } $data_ready = $data_to_recv; if (!$data) { //send capabilties $data_ready = "S"; if (extension_loaded("wddx")) $data_ready.="W"; //$data_ready .= "R"; } return $data_ready; } function unsatellize_headers ($raw_headers, $capabilities) { $headers = array(); for ($i=strlen($capabilities); $i >= 0 ; $i--) //des satellize in reverse order switch ($capabilities[$i]) { case "O": //SOAP $data = unsatellize($raw_headers,$capabilities); $raw_headers = preg_replace("/(\r|\n|\(\?\#.*\))/", "", $raw_headers); //take the \r\n's out $headers["sat_id"] = $data["sat_id"]; $headers["class"] = $data["class"]; if (preg_match("/(\s*|)<\S+:(\S+)(>| xmlns)/",$raw_headers,$parts)) $headers["method"] = $parts[2]; $headers["session"] = $data["session"]; $headers["params"] = $data["params"]; unset($data); break; case "W": //WDDX if ($raw_headers!==NULL) { $headers = unsatellize($raw_headers,$capabilities); $headers["params"] = satellize ($headers["params"],$capabilities); //Re-satellize parameters } break; default : //FIXME get data from _SERVER //OR do Nothing, because the values will be already decoded break; } return $headers; } function array_copy_value_to_key($array){ foreach($array as $value) $result[$value]=$value; return $result; } function ad_set_default(&$var,$value) { if (!isset($var)) $var = $value; } function is_process_running ($process_name = NULL, $number_of_instances = 1) { global $Config; if (!isset($process_name)) //if process name is not set $process_name = $_SERVER['PHP_SELF']; //use the current process name $process_name_len = strlen($process_name); $found = 0; if ($process_name_len > 1) //if name is rigth if ($Config->get ('os_type')=='unix') //if we are on a Unix OS { //exec('ps axo args',$ps_list); //call 'ps' exec('ps --no-headers -C php -o args',$ps_list); //call 'ps' if (count($ps_list) > 0) foreach ($ps_list as $process) { $pos = strpos($process,$process_name); if (($pos!==false) && (($pos+$process_name_len)==strlen($process))) //if proc_name is at the end of the process string $found++; if ($found >= $number_of_instances) //if we have found enogh instances return true; } } return FALSE; } function create_command_line ($command_line) { global $Config; if ($Config->get('os_type') == 'windows') return "start /MIN $command_line"; return $command_line.' &'; } function jffnms_shared ($module) { global $Config; return $Config->get('jffnms_real_path').'/engine/shared/'.$module.'.inc.php'; } function spawn ($command = false, $parameters = "", $max_instances = 2) { global $Config; if (!$command) $command = $Config->get('php_executable').' -q '.$_SERVER['argv'][0]; $command_line = "$command $parameters"; if (is_process_running($command_line,$max_instances) === false) { $open = create_command_line($command_line); echo "Executing: $open\n"; $p = popen($open,'w'); } else logger ($command_line." is already running $max_instances times.\n"); } function array_key_sort(&$arr, $keys) { $sort_columns = array(); reset ($arr); $params = array(); foreach ($arr as $row_key => $row) foreach ($keys as $sortk=>$sort_type) if (array_key_exists($sortk, $row)) $sort_columns[$sortk][$row_key] = $row[$sortk]; foreach ($keys as $sortk=>$sort_type) { if (array_key_exists($sortk, $sort_columns)) { $params[]=&$sort_columns[$sortk]; $params[]=&$sort_type; } } $params[]=&$arr; call_user_func_array('array_multisort',$params); } function convert_sql_sort ($fields, $sorts) { $result = array(); foreach ($sorts as $sort) { $sort_field = $sort[0]; $field_name = array_search($sort_field, $fields); if (is_numeric($field_name)) { if (preg_match('/\.([^.]+)$/', $sort_field, $regs)) $field_name = $regs[1]; } if (array_key_exists(1, $sort) && $sort[1] == 'desc') $sort_order = SORT_DESC; else $sort_order = SORT_ASC; if ($field_name=='interface') $order = SORT_NUMERIC; $result[$field_name]=$sort_order; } //debug ($result); return $result; } function array_rekey($array, $key, $old_key_name = false) { reset($array); while (list($old_key,$data) = each ($array)) { $new_key = $data[$key]; $new[$new_key]=$data; if ($old_key_name!==false) $new[$new_key][$old_key_name]=$old_key; } return $new; } function array_search_partial($search, $array_in) { foreach ($array_in as $key => $value) if (strpos($value, $search) !== false) return $key; return false; } function arristr($haystack='', $needle=array()) { foreach($needle as $n) if (stristr($haystack, $n) !== false) return true; return false; } function time_hms () { //Find the first numeric parameter $args = func_get_args(); if (!is_array($args)) { return '00:00'; } foreach ($args as $arg) if (is_numeric($arg)) return str_pad(floor($arg/(60*60)),2,"0",STR_PAD_LEFT).date(":i:s",$arg); return '00:00'; } function array_record_search ($rows, $needle_field, $needle_value) { $result = array(); if (is_array($rows)) { reset($rows); while (list ($id, $row) = each ($rows)) if ($row[$needle_field] == $needle_value) $result[$id]=$row; } return $result; } function byte_format($input, $dec = 0) { $prefix_arr = array("", "K", "M", "G", "T"); $value = round($input, $dec); while ($value > 1024) { $value /= 1024; $i++; } $return_str = round($value, $dec)." ".$prefix_arr[$i]; return $return_str; } function detach() { if (function_exists('pcntl_fork') && array_key_exists('start_debug',$GLOBALS) && ($GLOBALS['start_debug']!=1)) { if (($launcher_forkpid = pcntl_fork()) == -1) die("could not fork\n"); else if ($launcher_forkpid) // we are the parent exit(); return true; } return false; } function array_item_blank(&$arr, $key) { return array_fetch($arr, $key, ''); } function array_fetch(&$arr, $key, $default) { if (is_array($arr) and array_key_exists($key, $arr)) return $arr[$key]; return $default; } /* */ function __autoload($class_name) { global $Config; if (isset($Config)) $jffnms_real_path = $Config->get('jffnms_real_path'); else $jffnms_real_path = '..'; $class_filename = $jffnms_real_path . '/lib/'.strtolower(str_replace('Jffnms', '', $class_name)).'.class.php'; if (!is_readable($class_filename)) die ("Class file '$class_filename' is not readable.\n"); require($class_filename); } //__autoload() function jffnms_load_api($api_names) { global $Config; if (isset($Config)) $jffnms_real_path = $Config->get('jffnms_real_path'); else $jffnms_real_path = '..'; if (!is_array($api_names)) $api_names = array($api_names); foreach ($api_names as $api_name) { $api_filename = $jffnms_real_path . "/lib/api.$api_name.inc.php"; if (!is_readable($api_filename)) die ("API file '$api_filename' is not readable.\n"); require_once($api_filename); } } // {{{ resolve_host() /** * Resolves the given hostname or IP address * * The function can be given a hostname, IPv4 or IPv6 address and attempts * to resolve it to a family,address,port tuple * * @param string $host String of a hostname or addres, mayeb include :port * @return array (address family, ip address, port) * returns FALSE if cannot resolve **/ function resolve_host($host) { # IPV$ address with optional port if (preg_match('/^([0-9.]+)(?::(\d+))?$/', $host, $regs)) { if (@inet_pton($regs[1]) === FALSE) return FALSE; if (array_key_exists(2,$regs)) $port=$regs[2]; else $port=''; return array(4,$regs[1],$port); } if (preg_match('/^([0-9a-f:]+)$/',$host, $regs) || preg_match('/^\[([0-9a-f:]+)\]:(\d+)$/',$host, $regs)) { if (@inet_pton($regs[1]) === FALSE) return FALSE; if (array_key_exists(2,$regs)) $port=$regs[2]; else $port=''; return array(6,$regs[1],$port); } # Last resort, it is a hostname if (preg_match('/^([a-z0-9.-]+)(?::(\d+))?$/i', $host, $regs)) { if (array_key_exists(2,$regs)) $port=$regs[2]; else $port=''; $ip = get_dns_host($regs[1]); if ($ip === FALSE) return FALSE; if ( ($in_addr = @inet_pton($ip)) === FALSE) return FALSE; if (strlen($in_addr) == 16) return array(6,$ip,$port); if (strlen($in_addr) == 4) return array(4,$ip,$port); return FALSE; } return FALSE; } function get_dns_host($hostname) { for ($i=0 ; $i<3 ; $i++) { $dns_records = dns_get_record($hostname); if (sizeof($dns_records) == 0) return FALSE; foreach ($dns_records as $dns) { switch ($dns['type']) { case 'CNAME': unset($ipv6); $hostname = $dns['target']; break 2; case 'A': return $dns['ip']; // prefer IPv4 over IPv6 for now case 'AAAA': $ipv6 = $dns['ipv6']; } } if (isset($ipv6)) return $ipv6; } return FALSE; } function is_ipv6($addr) { $net_addr = @inet_pton($addr); if ($net_addr === FALSE || strlen($net_addr) < 16) return FALSE; return TRUE; } function print_version() { print 'JFFNMS version '.JFFNMS_VERSION.' Copyright (C) 2002-2011 JFFNMS Authors JFFNMS comes with ABSOLUTELY NO WARRANTY. This is free software, you can redistribute it and/or modify it under the terms of the GNU General Public License; either version 2 of the License or (at your option) any later version. For more information about these matters, see the files named COPYING that should be distributed along with this software. '; die; } ?> jffnms-0.9.3/lib/interface_types.class.php0000644000175000017500000000213511522414240020061 0ustar csmallcsmall'New Interface Type', 'autodiscovery_function'=>'none','rrd_structure_res'=>103680, 'rrd_structure_rra'=>'RRA:AVERAGE:0.5:1:'); function get_all($ids = NULL,$fields=NULL) { return get_db_list( array('interface_types' ,'pollers_groups','graph_types','slas'), $ids, array('interface_types.*', 'poller_default'=>'pollers_groups.description', 'graph_types_description'=>'graph_types.description', 'slas_description'=>'slas.description'), array( array('interface_types.autodiscovery_default_poller','=','pollers_groups.id'), array('interface_types.graph_default','=','graph_types.id'), array('interface_types.sla_default','=','slas.id'), array('interface_types.id','>',0)), array(array('interface_types.description','desc')) ); } } // class jffnms-0.9.3/lib/basic.class.php0000644000175000017500000000574411522760177016004 0ustar csmallcsmallget_current()) $this->record_pos++; return $result; } function get_current() { reset ($this->record); for ($i=0; $i < $this->record_pos; $i++) next($this->record); return current($this->record); } function count() { return count($this->record); } function _count() { return count($this->record); } function count_all() { return count($this->get_all()); } function slice($init,$span) { $this->record = array_slice($this->record,intval($init),intval($span)+1); reset($this->record); return true; } function get() { $params = func_get_args(); $this->record_pos = 0; $this->record = call_user_func_array(array($this,'get_all'),$params); return $this->count(); } function get_empty_record () { //Get the 'Unknown' Record 1 $aux = current(get_db_list( $this->jffnms_class(), 1, array($this->jffnms_class().'.*'))); //table,ids,fields foreach ($aux as $key=>$value) //fill the values with the default data $aux[$key] = (isset($this->jffnms_insert[$key])?$this->jffnms_insert[$key]:$value); return $aux; } function field_values ($fields = NULL) { $values = array(); $all_records = $this->get_all(); while (list(,$row) = each ($all_records)) while (list($field, $value) = each ($row)) if ($fields===NULL) $values[$field][]=$value; else if (isset($fields[$field])) $values[$field][$value]=$row[$fields[$field]]; unset ($values['id']); while (list ($field, $value) = each ($values)) { $values[$field] = array_unique($value); asort ($values[$field]); $values[$field] = array(''=>'') + $values[$field]; } reset ($values); return $values; } public function get_all($ids = NULL, $fields = array()) { return get_db_list($this->jffnms_class(), $ids, array($this->jffnms_class().'.*'), //table,ids,fields array(array($this->jffnms_class().'.id','>',$this->jffnms_filter_record)), //where array(array($this->jffnms_class().'.'.$this->jffnms_order_field,$this->jffnms_order_type)) ); //order } function add($filter=NULL) { if (!isset($this->jffnms_insert)) die("basic-> add(): missing jffnms_insert property for class ".get_class($this)."\n"); return db_insert($this->jffnms_class(), $this->jffnms_insert); } function update($id,$data) { return db_update($this->jffnms_class(), $id,$data); } function del($id) { return db_delete($this->jffnms_class(),$id); } } ?> jffnms-0.9.3/lib/users.class.php0000644000175000017500000000565211571315726016062 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ class JffnmsUsers extends basic { // Override the class name function jffnms_class() { return 'auth'; } function add ($username=NULL) { $ProfilesOptions = new JffnmsProfiles_options(); $user_id = db_insert('auth', array('usern'=>$username)); $query = 'SELECT id, default_value FROM profiles_options WHERE use_default = 1'; //FIXME order $result = db_query($query) or die ('Query Filed - user_add() - profile - '.db_error()); while ($row = db_fetch_array($result)) //add every default option to the user profile $ProfilesOptions->add($user_id,$row['id']); return $user_id; } // add() function get_id($username) { if ($username) { $query = "select id from auth where usern = '$username'"; $result = db_query($query) or die ('Query Failed - USER_GET_ID-1 - '.db_error()); if (db_num_rows($result)==1) { $row = db_fetch_array($result); return $row['id']; } } return false; } function get_username($user_id) { if ($user_id > 0) { $query = "select usern from auth where id = '$user_id'"; $result = db_query($query) or die ("Query Failed - USER_GET_USERNAME-1 - ".db_error()); if (db_num_rows($result) == 1) { $row = db_fetch_array($result); return $row['usern']; } } return FALSE; } function del ($user_id) { $TriggersUsers = new JffnmsTriggers_users(); $Triggers= new JffnmsTriggers(); $ProfilesOptions = new JffnmsProfiles_options(); if ($user_id) { $ProfilesOptions->del_user($user_id); $TriggersUsers->del_user($user_id); if (count($ProfilesOptions->list_users($user_id)) == 0 && count($TriggersUsers->get_all(NULL, $user_id)) == 0) return db_delete('auth',$user_id); //if everthing is ok delete the user } return FALSE; } //del() function modify($user_id, $usern, $old_password, $new_password, $fullname, $router) { if ($new_password == $old_password) $passwd = $new_password; else if (!empty($new_password)) $passwd = crypt($new_password); $user_fields = array('fullname' => $fullname); if ($router!='') $user_fields['router'] = $router; if (!empty($usern)) $user_fields['usern'] = $usern; if (!empty($passwd)) $user_fields['passwd'] = $passwd; return db_update('auth',$user_id,$user_fields); } function get_all ($ids = NULL,$where_special = NULL) { if (!is_array($where_special)) $where_special = array(); return get_db_list( 'auth', $ids, array( '*', 'old_passwd'=>'passwd'), array_merge( array(array('id','>',1)), $where_special), //where array(array("usern","asc")) ); //order } } //class ?> jffnms-0.9.3/lib/logfiles.class.php0000644000175000017500000000210311553274656016517 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ class JffnmsLogfiles extends basic { public $jffnms_insert = array('filename'=>'New Logfile'); public $jffnms_filter_record = 0; function add_match_group($filter) { return db_insert('logfiles_match_groups', array('logfile'=>$filter)); } function list_match_groups($ids = NULL) { return get_db_list( array('logfiles', 'logfiles_match_groups', 'logfiles_match_items'), $ids, array('logfiles_match_groups.*', 'logfile_match_description'=>'logfiles_match_items.description', ), array( array('logfiles_match_groups.logfile','=','logfiles.id'), array('logfiles_match_groups.match_item','=','logfiles_match_items.id'), array('logfiles_match_groups.id','>',1) ), array( array('logfiles.id','asc'), array('logfiles_match_groups.pos','asc'), ) ); } //list_match_groups() } //class jffnms-0.9.3/lib/profiles.class.php0000644000175000017500000000341511571304151016525 0ustar csmallcsmall JFFNMS Authors * This program is licensed under the GNU GPL, full terms in the LICENSE file */ class JffnmsProfiles extends basic { // Profile base methods function get_all($ids = NULL,$where_special = NULL) { if (!is_array($where_special)) $where_special = array(); return get_db_list( array('auth','profiles','profiles_options','profiles_values'), $ids, array( 'profiles.*', 'profiles_options.*', 'auth.*', 'profiles.id', 'values_description'=>'profiles_values.description', 'values_value'=>'profiles_values.value' ) , array_merge( array( array('profiles.userid' ,'=','auth.id'), array('profiles.profile_option','=','profiles_options.id'), array('profiles.value' ,'=','profiles_values.id'), array('profiles.id','>',1)), $where_special), array( array('profiles.userid','desc'), array('profiles.id','desc') )); } function add($user_id, $option) { $id = ''; $ProfilesValues = new JffnmsProfiles_values(); $ProfilesOptions = new JffnmsProfiles_options(); if (!is_numeric($option)) { $option = $ProfilesOptions->get_id($option); } if (!is_numeric($option) or $option == 0) return ''; $query = "insert into profiles (userid,profile_option,value) VALUES ($user_id, $option, 1)"; $result = db_query ($query) or die ("Query Failed - AZ15 - ".db_error()); $id = db_insert_id(); $ProfilesValues->modify($user_id, $option, $ProfilesOptions->get_default_value($option)); return $id; } function del($id) { return db_delete('profiles',$id); } } // class ?> jffnms-0.9.3/lib/events.class.php0000644000175000017500000001770311465637021016222 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ class JffnmsEvents { function set_ack($id,$ack = 1) { if ($ack == 1) $result = db_query ("update events set ack='$ack' where ack = 0 and id = '$id'"); //dont overwrite the journal else $result = db_update("events",$id,array("ack"=>$ack)); //if it's journal, overerite return $result; } // ack public function set_analized($id,$analized = 1) { return db_update('events',$id, array('analized'=>$analized)); } public function add($date,$type,$host,$interface,$state,$username,$info,$referer,$log_it = 1) { $Triggers = new JffnmsTriggers(); $info = substr($info,0,149); $data = compact('date','type','host','interface','state','username','info'); if (!empty($referer)) $data['referer'] = $referer; $id = db_insert('events',$data); if ($log_it == 1) logger("New Event ($id): $date - $type - $host - $interface - $state - $username - $info - $referer\n"); $Triggers->analyze('event',current($this->get_all($id)),$log_it); //analize event triggers return $id; } public function get_all ($event_id = NULL, $map_id = 1, $have_filter = 1, $filter = NULL, $init = 0, $span = 20, $order_type = "desc" ,$view_all = 0, $show_all = 0, $journal = 0, $client_id = 0) { global $Config; $params = func_get_args(); $params = current($params); $latest_mode = 2; //FIXME make this an option $use_latest = 1; $time_latest = $Config->get('events_latest_max')*(60); $query_select = "select /* SQL_BUFFER_RESULT HIGH_PRIORITY SQL_BIG_RESULT */ ". ".id, .date, hosts.name as host_name, .host as host_id, ". "hosts.ip as host_ip, zones.shortname as zone, zones.image as zone_image, types.description as type_description, ". ".type as type_id, severity.severity, zones.id as zone_id, zones.zone as zone_name, ". "severity.level as severity_level, severity.fgcolor, severity.bgcolor, .interface, ". ".username as user, .state, .info, types.text, types.show_host, ". ".ack, clients.name as interface_customer, interfaces.id as interface_id, interfaces.client as interface_client_id "; $query_from = "hosts, types, severity, zones, "; $query_joins = " LEFT OUTER JOIN interfaces on (.host = interfaces.host) and (.interface = interfaces.interface) \n". " LEFT OUTER JOIN clients on (interfaces.client = clients.id) "; $query_where = "where .host = hosts.id and .type = types.id and hosts.zone = zones.id and types.severity = severity.id $filter "; $query_order = "order by .date $order_type, .id $order_type "; if ($event_id > 1) $query_where.= " and .id = $event_id "; if (($map_id) && ($map_id !=1 )) //Map Selected and Not RootMap { $query_from = "maps_interfaces, $query_from"; $query_where .= " and interfaces.interface = .interface and interfaces.host = hosts.id and ". "maps_interfaces.interface = interfaces.id and maps_interfaces.map = $map_id"; if ($have_filter==0) $query_where .=" and date >= '".date("Y-m-d",time()-(60*60*24*3))." 00:00:00'"; $use_latest = 0; } if (is_numeric($client_id) && ($client_id > 0)) //Filter by Client ID $query_where .= " and interfaces.client = $client_id "; if (($init+$span) > $Config->get("events_latest_max")) $use_latest = 0; if ($have_filter==1) { $show_all = 1; $use_latest = 0; $query_where .= ' and types.show_default > 0'; //if its filtered show types 1 and 2 (show and 'only in filter') } if ($show_all==0) $query_where .= ' and types.show_default = 1'; //only show the normal (don't hidden) types if ($journal > 1) $query_where .= " and .ack = $journal"; //round span values (no decimals in SQL LIMIT) $span = round($span); $init = round($init); if (($view_all==1) && ($have_filter==1)) $query_limit = ''; else $query_limit = " LIMIT $init,$span"; if ($latest_mode == 1) { if ($use_latest==1) $events_table = "events_latest"; else $events_table = "events"; } if ($latest_mode == 2) { //filter by lastest hours on events table if ($use_latest==1) $query_where .= " and .date > '".date("Y-m-d H:i:s",time()-$time_latest)."' "; $events_table = "events"; } $query = "$query_select \nfrom $query_from \n$query_joins \n$query_where \n$query_order $query_limit;"; $query = str_replace("",$events_table,$query); //debug ($query); $res = db_query($query) or die ("Query Failed - events_list(".join(",",$params).") - ".db_error()); $info = array(); while ($reg = db_fetch_array($res)) { $reg["date"] = substr($reg["date"], 0, 19); $reg["text"] = $this->replace_vars($reg,$reg["text"]); //replace the variables in < > $info[]=$reg; } //debug ($info); return $info; } // fetch public function make_latest($max = 0) //for performance reasons, this must be db-specific { global $Config; if ($max == 0) $max = $Config->get('events_latest_max'); return db_copy_table("events","events_latest",$max); } // make_latest() public function replace_vars($event,$text_aux) { $Interfaces = new JffnmsInterfaces(); $replacer = array (); $int_id = $event["interface_id"]; if (is_numeric($int_id)) //if the event matched an interface { $int_data = $Interfaces->values($int_id); //get values foreach (current($int_data['fields']) as $fname=>$fdata) switch ($fdata['type']) { case 7: if (!isset($event['interface_description'])) $event['interface_description']=''; $event['interface_description'].= ' '.$int_data['values'][$int_id][$fname]; $event[$fname]=$int_data['values'][$int_id][$fname]; break; case 8: $event[$fname]=$int_data['values'][$int_id][$fname]; break; } unset ($int_data); } foreach (array_keys($event) as $key) { $replacer[$key] = $key; if (strpos($key,"_") > 1) $replacer[str_replace("_","-",$key)]=$key; } //exceptions $replacer['journal']='ack'; $replacer['client']='interface_customer'; $replacer['customer']='interface_customer'; //debug ($event); //debug ($replacer); foreach ($replacer as $match=>$field) $text_aux = str_replace("<$match>",htmlspecialchars(trim($event[$field])),$text_aux); // this replaces not mached < > variables $text_aux = preg_replace('(<\S+>)','',$text_aux); return $text_aux; } //replace vars } // class //FILTERS //-------------- function filters_generate_sql($filter_id = 1) { $query_filter_aux = " select filters_cond.pos, filters_fields.field, filters_cond.op, filters_cond.value from filters_cond, filters_fields where filters_cond.filter_id = $filter_id and filters_cond.field_id = filters_fields.id order by filters_cond.pos"; $result_filter_aux = db_query($query_filter_aux) or die ("Query failed - FS1 - ".db_error()); while ($registro_filter_aux = db_fetch_array($result_filter_aux)) { extract($registro_filter_aux); if ($field) { if (($field=="AND") or ($field=="OR")) //for special fields $sql .= " $field "; else if (strpos($value,"(") > 0 ) $sql .="($field $op $value)"; //this is for SQL functions like NOW() else $sql .="($field $op '$value')"; //for other values } } $sql = trim($sql); if ($sql!="") $sql_aux ="($sql)"; return $sql_aux; } ?> jffnms-0.9.3/lib/triggers_users.class.php0000644000175000017500000000406711571315302017755 0ustar csmallcsmall JFFNMS Authors * Licensed under GNU GPL v2, full terms in the LICENSE file */ class JffnmsTriggers_users extends basic { public function add($user_id=NULL) { if (!is_numeric($user_id) || $user_id < 1) $user_id = 1; $data = array( 'user_id' => $user_id, 'active' => 0 ); return db_insert('triggers_users', $data); } // add public function get_all($ids = NULL, $user_id = NULL,$trigger_id = NULL,$only_active = 0) { $where = array(); if (is_array($user_id)) $user_id = current($user_id); if ($user_id) $where[]=array('triggers_users.user_id','=',$user_id); if ($trigger_id) $where[]=array('triggers_users.trigger_id','=',$trigger_id); if ($only_active==1) $where[]=array('triggers_users.active','=',1); return get_db_list( array('triggers_users','auth','triggers'), $ids, array( 'triggers_users.*', 'user_description'=>'auth.fullname', 'trigger_description'=>'triggers.description'), array_merge(array( array('triggers_users.id','>',1), array('triggers_users.user_id','=','auth.id'), array('triggers_users.trigger_id','=','triggers.id')), $where), array( array('triggers_users.user_id','desc'), array('triggers_users.id','desc')) ); //order } //get_all() public function del($trigger_user_id) { return db_delete('triggers_users', $trigger_user_id); } public function del_user($user_id) { if (!is_numeric($user_id)) return FALSE; $query = "DELETE FROM triggers_users WHERE user_id = $user_id"; return db_query($query) or die('Query Failed TriigersUsers::del() - '.db_error()); } // delete() public function del_trigger($trigger_id) { if (!is_numeric($trigger_id)) return FALSE; $query = "DELETE FROM triggers_users WHERE trigger_id = $trigger_id"; return db_query($query) or die('Query Failed TriggersUsers::del_all_truger() - '.db_error()); } // delete() } ?> jffnms-0.9.3/lib/api.classes.inc.php0000644000175000017500000002507411741270765016574 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ class JffnmsAutodiscovery extends basic { public $jffnms_insert = array('description'=>'New Autodiscovery Type'); public $jffnms_filter_record = 0; public $jffnms_order_field = 'description'; } class JffnmsClients extends basic { public $jffnms_insert = array('name'=>'a New Customer', 'shortname'=>'new_cust'); public $jffnms_filter_record = 0; public $jffnms_order_field = 'name'; public $jffnms_order_type = 'asc'; } class JffnmsGraph_types extends basic { public $jffnms_insert = array('description'=>'New Graph Type'); function get_all($ids = NULL,$fields=NULL) { return get_db_list( array('graph_types','interface_types'), $ids, array('graph_types.*','types_description'=>'interface_types.description') , array(array('graph_types.type','=','interface_types.id'),array('graph_types.id','>',0)), array( array('graph_types.type','asc'), array('graph_types.id','asc') )); } } // class jffnms_graph_types class JffnmsHosts_config_types extends basic { public $jffnms_insert = array('description' => 'New Host Config Type'); public $jffnms_filter_record = 0; } class JffnmsSeverity extends basic { public $jffnms_insert = array('severity'=>'New Severity','bgcolor'=>'000000','fgcolor'=>'FFFFFF'); } class JffnmsInterface_types_field_types extends basic { public $jffnms_insert = array('description'=>'New','handler'=>'text'); public $jffnms_filter_record=1; public $jffnms_order_type = 'asc'; } class JffnmsSyslog_types extends basic { public $jffnms_insert = array('match_text'=>'New Syslog Message Type','info'=>'*'); function get_all($ids = NULL, $fields=NULL) { return get_db_list( array($this->jffnms_class(),'types'), $ids, array($this->jffnms_class().'.*','types_description'=>'types.description') , array(array($this->jffnms_class().'.type','=','types.id'),array($this->jffnms_class().'.id','>',1)), array(array($this->jffnms_class().'.pos','asc'),array($this->jffnms_class().'.id','desc')) ); } } class JffnmsEvent_types extends basic { public $jffnms_insert = array('description'=>'New Event Type'); function jffnms_class() { return 'types'; } function get_all($ids = NULL,$filters = array()) { $where_special = array(); if (array_key_exists('generate_alarm', $filters) && $filters['generate_alarm']==1) $where_special[]=array('types.generate_alarm','=',1); if (array_key_exists('show_unknown', $filters) && $filters['show_unknown']==1) $where_special[]=array('types.id','>',0); else $where_special[]=array('types.id','>',1); return get_db_list( array('types','severity','up'=>'types'), $ids, array('types.*','severity_description'=>'severity.severity','alarm_up_description'=>'up.description'), array_merge( array( array('types.severity','=','severity.id'), array('types.alarm_up','=','up.id')), $where_special), array(array('types.description','desc')) ); } } class JffnmsFilters extends basic { public $jffnms_insert = array('description'=>'New Filter'); public $jffnms_filter_record = 0; public $jffnms_order_type = 'asc'; function generate_sql() { $params = func_get_args(); return call_user_func_array('filters_generate_sql',$params); } function generate_where() { $params = func_get_args(); return call_user_func_array('filters_generate_sql2',$params); } } class JffnmsFilters_fields extends basic { public $jffnms_insert = array('description'=>'New Filter Field'); public $jffnms_filter_record = 0; public $jffnms_order_field = 'description'; public $jffnms_order_type = 'asc'; } class JffnmsFilters_cond extends basic { public $jffnms_insert = array('pos'=>1); function get_all($ids = NULL, $fields=NULL) { return get_db_list( array('filters',$this->jffnms_class(),'filters_fields'), $ids, array($this->jffnms_class().'.*', 'filter_description'=>'filters.description', 'field_description'=>'filters_fields.description', 'field_name'=>'filters_fields.field'), array( array($this->jffnms_class().'.field_id','=','filters_fields.id'), array($this->jffnms_class().'.filter_id','=','filters.id'), ), array( array('filters_cond.filter_id','asc'), array('filters_cond.pos','asc'), array('filters_cond.id','desc') )); } function add($filter = NULL) { if ($filter==NULL) $filter=1; return db_insert('filters_cond', array('filter_id'=>$filter)); } } //class jffnms_filters_cond class JffnmsSlas extends basic { public $jffnms_insert = array('description'=>'New SLA'); function get_all($ids = NULL,$fields=NULL) { return get_db_list( array('slas','types','interface_types','alarm_states'), $ids, array('slas.*', 'state_description'=>'alarm_states.description', 'types_description'=>'types.description', 'interface_type_description'=>'interface_types.description' ), array( array('slas.event_type','=','types.id'), array('slas.interface_type','=','interface_types.id'), array('slas.state','=','alarm_states.id'), array('slas.id','>',1)), array(array('slas.id','desc') ) ); } } class JffnmsSlas_cond extends basic { public $jffnms_insert = array('description'=>'New Condition'); } class JffnmsAlarm_states extends basic { public $jffnms_insert = array('description'=>'new'); public $jffnms_filter_record = 0; public $jffnms_order_type = 'asc'; } class JffnmsPollers_backend extends basic { public $jffnms_insert = array('description'=>'a New Backend','command'=>'no_backend'); public $jffnms_filter_record = 0; public $jffnms_order_field = 'description'; public $jffnms_order_type = 'asc'; } class JffnmsPollers extends basic { public $jffnms_insert = array('description'=>'a New Poller','name'=>'new_poller','command'=>'no_poller'); public $jffnms_filter_record = 0; public $jffnms_order_field = 'description'; public $jffnms_order_type = 'asc'; } class JffnmsTrap_receivers extends basic { public $jffnms_insert = array('description'=>'a New Trap Receiver', 'match_oid'=>'Trap OID', 'position'=>'10', 'command'=>'none'); public $jffnms_filter_record = 0; function get_all($ids = NULL, $fields=NULL) { return get_db_list( array('trap_receivers', 'interface_types','pollers_backend'), $ids, array( 'trap_receivers.*', 'interface_type_description'=>'interface_types.description', 'backend_description'=>'pollers_backend.description' ), array( array('trap_receivers.interface_type','=','interface_types.id'), array('trap_receivers.backend','=','pollers_backend.id') ), array( array('trap_receivers.position','asc'), array('trap_receivers.description','asc'), array('trap_receivers.id','desc') ) ); } } class JffnmsPollers_groups extends basic { public $jffnms_insert = array('description'=>'New Poller Group'); function get_all($ids = NULL, $fields=NULL) { return get_db_list( array('pollers_groups', 'interface_types'), $ids, array('pollers_groups.*','type_description'=>'interface_types.description') , array( array('pollers_groups.interface_type','=','interface_types.id'), array('pollers_groups.id','>',1) ), array(array('pollers_groups.id','desc')) ); } } class JffnmsPollers_poller_groups extends basic { public $jffnms_insert = array(); //no error function add($filter=NULL) { return db_insert('pollers_poller_groups', array('poller_group'=>$filter)); } function get_all($ids = NULL, $fields=NULL) { return get_db_list( array('pollers_groups','pollers_poller_groups','pollers','pollers_backend'), $ids, array('pollers_poller_groups.*', 'group_description'=>'pollers_groups.description', 'poller_description'=>'pollers.description', 'backend_description'=>'pollers_backend.description' ) , array( array('pollers_poller_groups.poller_group','=','pollers_groups.id'), array('pollers_poller_groups.poller','=','pollers.id'), array('pollers_poller_groups.backend','=','pollers_backend.id'), array('pollers_poller_groups.id','>',1) ), array( array('pollers_poller_groups.poller_group','asc'), array('pollers_poller_groups.pos','asc'), array('pollers_poller_groups.id','desc') ) ); } } class JffnmsSlas_sla_cond extends basic { public $jffnms_insert = array(); //no error function add($filter=NULL) { return db_insert('slas_sla_cond',array('sla'=>$filter)); } function get_all($ids = NULL, $fields=NULL) { return get_db_list( array('slas','slas_sla_cond','slas_cond'), $ids, array( 'slas_sla_cond.*', 'sla_description'=>'slas.description', 'cond_description'=>'slas_cond.description' ), array( array('slas_sla_cond.sla','=','slas.id'), array('slas_sla_cond.cond','=','slas_cond.id'), array('slas_sla_cond.id','>',1) ), array( array('slas_sla_cond.sla','asc'), array('slas_sla_cond.pos','asc'), array('slas_sla_cond.id','desc') ) ); } } class JffnmsLogfiles_match_items extends basic { public $jffnms_insert = array('description'=>'a New Item'); public $jffnms_filter_record = 0; public $jffnms_order_field = 'description'; public $jffnms_order_type = 'asc'; function get_all($ids = NULL,$filters=NULL) { $where = array(); if (array_key_exists('logfile_id', $filters)) { $where[] = array('logfiles_match_items.logfile_id','=',$filters['logfile_id']); } return get_db_list( array('logfiles_match_items','logfiles','types'), $ids, array( 'logfiles_match_items.*', 'logfile_description'=>'logfiles.description', 'types_description'=>'types.description' ), array_merge( array( array('logfiles_match_items.logfile_id','=','logfiles.id'), array('logfiles_match_items.type','=','types.id'), ),$where), array( array('logfiles_match_items.logfile_id','asc'), array('logfiles_match_items.pos','asc') )); } } ?> jffnms-0.9.3/lib/api.db.inc.php0000644000175000017500000003154511716447477015534 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function get_db_list($tables,$ids = NULL,$fields=NULL, $where= NULL, $order= NULL, $index = "", $groups = NULL, $limit_init = NULL, $limit_span = NULL) { if (!$tables) return FALSE; if (!$fields) $fields = "*"; if (!is_array($ids)) $ids=array($ids); if (!is_array($tables)) $tables=array($tables); if (!is_array($fields)) $fields = array($fields); if (!is_array($order)) $order = array(); if (!is_array($where)) $where = array(); if ($groups) if (!is_array($groups)) $groups = array($groups); $where_array=array(); $order_array=array(); //debug($where); if ($index) $fields["aux_table_index"]=$index; foreach ($tables as $as=>$table) if ($table) //if table is not null if (is_numeric($as)) $tables_array[]=$table; else $tables_array[]="$table as $as"; foreach ($fields as $as=>$field) if (is_numeric($as)) $fields_array[]=$field; else $fields_array[]="$field as $as"; foreach ($where as $type=>$aux) if ($aux) { if (!is_array($aux)) $aux=array($aux); //if its not an array create one if (is_numeric($type)) $where_array[]="and ".join (" ",$aux); else $where_array[]=$type." ".join (" ",$aux); } foreach ($order as $aux) $order_array[]=join (" ",$aux); if (count($ids) > 0) { if ($index) $index_ids = $index; else $index_ids = $tables[0].".id"; if (!isset($where_ids_aux)) $where_ids_aux = ""; if (!isset($index_ids)) $index_ids = ""; foreach ($ids as $id) if ($id) $where_ids_aux .= " or ($index_ids = '$id')"; if ($where_ids_aux) $where_array[] = "and ((1=2)".$where_ids_aux.")"; } if (!isset($tables_text)) $tables_text = ""; if (!isset($fields_text)) $fields_text = ""; if (!isset($where_text)) $where_text = ""; $tables_text .= join (", ",$tables_array); $fields_text .= join (", \n\t",$fields_array); $where_text .= join (" \n\t",$where_array); if (count($order_array) > 0) $order_text = "order by ".join (", ",$order_array); if (count($groups) > 0) $group_text = "group by ".join(", ",$groups); if (!$limit_init) $limit_init = 0; if ($limit_span > 0) $limit_text = " LIMIT $limit_init,$limit_span"; if (!isset($limit_text)) $limit_text = ""; if (!isset($order_text)) $order_text = ""; if (!isset($group_text)) $group_text = ""; $query = "SELECT /*! HIGH_PRIORITY */ /* get_db_list() */ \n\t$fields_text \nFROM $tables_text \nWHERE (1=1) \n\t$where_text \n$group_text \n$order_text\n$limit_text\n"; //debug ($query); $res = db_query($query) or die ("Query Failed - get_db_list() - $query - ".db_error()); $info = array(); while ($reg = db_fetch_array($res)) if ($index) $info[$reg["aux_table_index"]]=$reg; else $info[]=$reg; return $info; } function db_insert ($table,$values) { $id=0; if (array_key_exists('id', $values)) $id = $values['id']; if (is_array($values) && (count ($values) > 0)) { foreach ($values as $key=>$val) { $fields[]=$key; $values[$key]="'$val'"; } $fields_text = join(',',$fields); $values_text = join(',',$values); } $query = "insert into $table ($fields_text) VALUES ($values_text)"; $result = db_query($query); if (!$result) logger ("Query Failed - table_insert($table) - $query - ".db_error()); else $id = db_insert_id(); return $id; } function db_update( $table, $id, $table_data) { if (!$table || $id < 0) return FALSE; if (!is_array($table_data)) die("db_update, no table_data for table '$table'.\n"); $update_fields = array(); foreach ($table_data as $field => $value) $update_fields[] = "$field = '$value'"; $query = "UPDATE $table SET ".join($update_fields, ',')."WHERE $table.id = '$id'"; $result = db_query ($query) or die ("Query failed - db_update($table) - $query - ".db_error()); $result = (is_resource($result))?true:$result; return $result; } function db_delete ($table,$id,$field = "id") { $query="delete from $table where $field = '$id'"; if (($id) && ($table)) $result = db_query ($query) or die ("Query failed - db_delete($table) - $query - ".db_error()); return $result; } function db_open() { global $Config; $dbhost = $Config->get('dbhost'); $dbuser = $Config->get('dbuser'); $dbpass = $Config->get('dbpass'); $db = $Config->get('db'); $db_type = $Config->get('db_type'); switch ($db_type) { case 'mysql': if (($dbconn = @mysql_connect ($dbhost, $dbuser, $dbpass))===FALSE) die('Unable to connect to mysql database: '.mysql_error()); if (mysql_select_db($db)===FALSE) die('Could not select mysql database - CON2 '.mysql_error($dbconn)); break; case 'pg': if (($dbconn = pg_connect("host=$dbhost dbname=$db user=$dbuser password=$dbpass"))=== FALSE) die('Unable to connect to postgresql database: '.pg_last_error()); break; default: die("Unknown database type '$db_type'"); } if (is_resource($dbconn)) { $db_conn = array(); $db_conn['handle']=$dbconn; $db_conn['type']=$db_type; } else $db_conn = NULL; return $db_conn; } function db_test() { global $Config; $dbhost = $Config->get('dbhost'); $dbuser = $Config->get('dbuser'); $dbpass = $Config->get('dbpass'); $db = $Config->get('db'); $db_type = $Config->get('db_type'); switch ($db_type) { case 'mysql': if (extension_loaded('mysql')) { $result = mysql_connect($dbhost, $dbuser, $dbpass); if (mysql_select_db($db)===FALSE) unset($result); } break; case 'pg': if (extension_loaded("pgsql")) $result = @pg_connect("host=$dbhost dbname=$db user=$dbuser password=$dbpass"); break; } return $result; } function db_set_handle($handle = NULL) { $GLOBALS["conexion"] = $handle; } function db_get_handle($auto_create = 1) { if ((!isset($GLOBALS["conexion"]) || !is_resource($GLOBALS["conexion"]["handle"])) && ($auto_create==1)) $GLOBALS["conexion"] = db_open(); return $GLOBALS["conexion"]; } function db_close ($db_conn = NULL) { if (!isset($db_conn)) $db_conn = db_get_handle(0); if (is_resource($db_conn["handle"])) { switch ($db_conn["type"]) { case 'mysql': $result = mysql_close($db_conn["handle"]); break; case 'pg': $result = pg_close($db_conn["handle"]); break; } db_set_handle(NULL); unset($db_conn); $db_conn=NULL; } return $db_conn; } //Do the Real DB Query, but without reconnection logic function db_query_simple ($db_conn,$query) { switch ($db_conn["type"]) { case "mysql": $result = @mysql_query ($query,$db_conn["handle"]); break; case "pg": //postgres exeptions //limit if ($pos = stristr ($query," LIMIT")) { //FIXME when limit is a part of the query like in some tacacs messages $limit_old = substr($query,strlen($query)-strlen($pos),strlen($query)); $limit_new = str_replace ("LIMIT","OFFSET",$limit_old); $limit_new = str_replace (","," LIMIT ",$limit_new); $query = str_replace ($limit_old,$limit_new,$query); } //insert if ($pos = stristr ($query,"INSERT INTO")) { $insert_old = substr($query,12,strlen($query)); $table = substr($insert_old,0,strpos($insert_old," ")); $GLOBALS["conexion"]["insert_table"] = $table; //FIXME } $result = @pg_exec($db_conn["handle"],$query); break; } return $result; } //Calls the real DB Query, but includes a reconnection logic function db_query ($query) { $db_conn = db_get_handle(); $try = 0; $max_tries = 5; //$db_query_time = time_msec(); //echo "\n$query\n"; $result = db_query_simple ($db_conn,$query); while (($result===false) && ($try++ < $max_tries)) { //if result is an error, try this 3 times sleep(1); //wait db_ping($db_conn); //try to reconnect $result = db_query_simple ($db_conn,$query); //query again } //$db_query_time = time_msec_diff($db_query_time); //echo "TIME: $db_query_time msec\n"; return $result; } function db_fetch_array ($rs) { $db_conn = db_get_handle(); switch ($db_conn['type']) { case 'mysql': $result = mysql_fetch_array ($rs,MYSQL_ASSOC); break; case 'pg': $result = pg_fetch_array($rs,NULL,PGSQL_ASSOC); break; } return $result; } function db_error ($db_conn = NULL) { if (!isset($db_conn)) $db_conn = db_get_handle(0); switch ($db_conn['type']) { case 'mysql': $result = mysql_error($db_conn['handle']); break; case 'pg': $result = pg_errormessage($db_conn['handle']); break; } return $result; } function db_num_rows ($rs) { $db_conn = db_get_handle(); switch ($db_conn['type']) { case 'mysql': $result = mysql_num_rows($rs); break; case 'pg': $result = pg_numrows($rs); break; } return $result; } function db_free($rs) { $db_conn = db_get_handle(); switch ($db_conn["type"]) { case "mysql": $result = mysql_free_result ($rs); break; case "pg": $result = pg_free_result($rs); break; } return $result; } function db_insert_id ($db_conn = NULL) { if (!$db_conn) $db_conn = db_get_handle(); switch ($db_conn['type']) { case 'mysql': $result = mysql_insert_id($db_conn['handle']); break; case 'pg': $result = db_query("SELECT CURRVAL ('".$db_conn["insert_table"]."_id_seq')") or die ("db_insert_id(pg) - ".db_error()); //Ugly HACK list($result) = pg_fetch_array($result); break; } return $result; } function db_affected_rows ($db_conn = NULL) { if (!$db_conn) $db_conn = db_get_handle(); switch ($db_conn['type']) { case 'mysql': $result = mysql_affected_rows($db_conn['handle']); break; case 'pg': $result = pg_affected_rows($db_conn['handle']); break; } return $result; } function db_copy_table ($from,$to,$cant = NULL) { if (!$db_conn) $db_conn = db_get_handle(); if ($cant > 0) $limit = " LIMIT 0,$cant"; switch ($db_conn['type']) { case 'mysql': $query="TRUNCATE TABLE $to"; $result = db_query($query) or die("db_copy_table($from,$to,$cant) Error :".mysql_error()); $query="REPLACE INTO $to SELECT * FROM $from order by id desc $limit;"; $result = db_query($query); break; case 'pg': $query="TRUNCATE TABLE $to; ". "INSERT INTO $to SELECT * FROM $from order by id desc $limit;"; if (is_resource(db_query($query))) $result = 1; else $result = 0; break; } return $result; } function db_repair ($table) { $db_conn = db_get_handle(); switch ($db_conn['type']) { case 'mysql': $query="REPAIR TABLE $table"; $result1 = db_query($query) or die("repair($table) Error :".mysql_error()); $query="OPTIMIZE TABLE $table"; $result2 = db_query($query) or die("optimize($table) Error :".mysql_error()); $query="ALTER TABLE ".$table." AUTO_INCREMENT = 1;"; $result3 = db_query($query) or die("auto_increment($table) Error :".mysql_error()); $result1 = db_fetch_array($result1); $result2 = db_fetch_array($result2); $result = $result1["Msg_text"]."/".$result2["Msg_text"]."/".$result3; break; case 'pg': $query="VACUUM FULL VERBOSE ANALYZE $table;"; $result1 = db_query($query) or die("vacuum($table) Error :".mysql_error()); if (is_resource($result1)) $result1 = "OK"; $query="REINDEX TABLE $table;"; $result2 = db_query($query) or die("reindex($table) Error :".mysql_error()); if (is_resource($result2)) $result2 = "OK"; $result = $result1."/".$result2; break; } return $result; } //Checks the DB Connection status, and tries to reconnect function db_ping ($db_conn) { $result = FALSE; if (!is_resource($db_conn['handle'])) { logger('db_ping('.$db_conn['type'].') Invalid DB handle...\n'); die(); } switch ($db_conn['type']) { case 'mysql': if (!function_exists('mysql_ping')) die('db_ping(): mysql database selected but no mysql_ping().'); $result = mysql_ping ($db_conn['handle']); break; case 'pgsql': if (!function_exists('pg_ping')) die('db_ping(): postgresql database selected but no pg_ping().'); $result = pg_ping($db_conn["handle"]); break; default: die('pg_ping(): Unknown database type.'); } logger('db_ping('.$db_conn['type'].') Connection to DB '. ($result==TRUE?'Restored':'Lost'). "...\n"); return $result; } ?> jffnms-0.9.3/lib/api.satellites.inc.php0000644000175000017500000005343211716447477017317 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ class jffnms_satellites extends internal_base_standard { var $jffnms_class = "satellites"; var $jffnms_insert = array('description'=>"New Satellite"); //get data about satellites function get_all() { $params = func_get_args(); return call_user_func_array("satellites_list",$params); } function get_id() { $params = func_get_args(); return call_user_func_array("satellite_get_id",$params); } function get_data() { $params = func_get_args(); return call_user_func_array("satellite_get",$params); } function get_peers() { $params = func_get_args(); return call_user_func_array("satellite_get_peers",$params); } //remote functions for query, relay and functions function send_ping() { $params = func_get_args(); return call_user_func_array("satellite_send_ping",$params); } function callback() { $params = func_get_args(); return call_user_func_array("satellite_callback",$params); } function decide_mode() { $params = func_get_args(); return call_user_func_array("satellite_decide_mode",$params); } function elect_one() { $params = func_get_args(); return call_user_func_array("satellite_elect_one",$params); } function query() { $params = func_get_args(); return call_user_func_array("satellite_query",$params); } function distribute() { $params = func_get_args(); return call_user_func_array("satellite_distribute",$params); } function triggered_update() { $params = func_get_args(); return call_user_func_array("satellite_triggered_update",$params); } //paths information function get_paths() { $params = func_get_args(); return call_user_func_array("satellite_get_paths",$params); } function clean_distribution_path(){ $params = func_get_args(); return call_user_func_array("satellite_clean_distribution_path",$params); } function get_last_distribution_path(){ $params = func_get_args(); return call_user_func_array("satellite_get_last_distribution_path",$params); } } function satellite_get_id ($url) { //get the id of a satellite based on an URI if ($url!="") { $result = db_query("select id from satellites where url='$url';") or die("Query Failed - satellite_get_id($url) - ".db_error()); $num_rows = db_num_rows($result); if ($num_rows==1) { $data = db_fetch_array($result); return $data["id"]; } else if ($num_rows > 1) die ("More than one satellite with the same url"); } return NULL; } function satellite_get ($id) { //get the DB record for a Satellite ID $data = Array(); if ($id > 0) { $result = db_query("select * from satellites where id='$id' or (1 != '$id' and sat_group='$id') order by id asc;") or die("Query Failed - satellite_get($id) - ".db_error()); while ($aux= db_fetch_array($result)) $data[$aux["id"]]=$aux; } return $data; } function satellite_get_by_parent ($id,$group) { //get all satellites which parent is this ID or group $data = Array(); if ($id > 0) { if ($group > 1) $group_filter = "or satellites.parent='$group'"; $result = db_query(" select * from satellites where satellites.parent = '$id' $group_filter order by satellites.id asc;") or die("Query Failed - satellite_get_by_parent($id) - ".db_error()); while ($aux= db_fetch_array($result)) if ($aux["id"]!=$id) $data[$aux["id"]]=$aux; } return $data; } function satellite_get_masters ($my_sat_id = NULL) { //get a list of all satellites marked as masters $data = Array(); $query = " SELECT id,url FROM satellites WHERE (sat_type = 1 or sat_type = 2)". //if I'm a Local Master (($my_sat_id!=NULL)?" or (id = $my_sat_id and sat_type = 5)":"")." ORDER BY satellites.id asc"; $result = db_query($query) or die("Query Failed - satellite_get_masters() - ".db_error()); while ($aux= db_fetch_array($result)) $data[$aux["id"]]=$aux; return $data; } function satellites_list ($ids = NULL, $only_groups = 0) { //ge ta lists of satellites (to show) if ($only_groups == 1) { $filter .= " and satellites.sat_type = 3"; $data[]=array(id=>1,description=>"(none)"); } if ($only_groups == 2) $filter .= " and satellites.sat_type != 4"; if ($ids) { if (!is_array($ids)) $ids = Array($ids); $filter .= " and (1=2 or satellites.id = ".join(" or satellites.id = ",$ids).")"; } $result = db_query( "select satellites.*, parents.description as parent_description, groups.description as group_description from satellites, satellites as parents, satellites as groups where satellites.parent = parents.id and satellites.sat_group = groups.id $filter order by satellites.id asc;") or die("Query Failed - satellite_get($id) - ".db_error()); while ($aux = db_fetch_array($result)) { if (!$ids) { //avoid loop $aux1 = current(satellites_list($aux["parent"])); $aux["parent_description"] = $aux1["description"]; } if ($aux["sat_group"]==1) $aux["group_description"]="(none)"; else $aux["group_description"] = "Cluster ".$aux["group_description"]; if ($aux["sat_type"]==3) $aux["description"]="Cluster ".$aux["description"]; if ($aux["id"]==1) $aux["parent_description"] = "(none)"; $data[$aux["id"]]=$aux; } return $data; } function satellite_get_peers ($sat_id) { //get all peers of a satellite (up and down the tree) if ($sat_id > 0) { $sat = satellite_get($sat_id); if (count($sat)==1) if ($sat[$sat_id][parent]!=$sat_id) $result[$sat[$sat_id][parent]]=$sat[$sat_id][parent]; else foreach ($sat as $aux) if ($aux[parent]!=$sat_id) $result[$aux[id]]=$aux[id]; $sat = satellite_get_by_parent($sat_id,$sat[$sat_id][sat_group]); foreach ($sat as $aux) if ($aux[id]!=$sat_id) $result[$aux[id]]=$aux[id]; if (is_array($result)) foreach ($result as $peer) { $sat = satellite_get($peer); if (count($sat) > 1) { unset ($sat[$peer]); //group unset ($result[$peer]); foreach ($sat as $aux) $result[$aux[id]]=$aux[id]; } } } return $result; } function satellite_get_paths ($sat_id, $filter = NULL, $only_parents = 0, $deep=0) { //get all the paths leading to sat_id if ($sat_id > 0) { $peers[]=$sat_id; $i = 0; while (($search_id = current($peers)) && ($i++<5)) { $filter[] = $search_id; //echo "DEEP $deep: Searching sat $search_id, Filter ".join("-",$filter)."\n"; if (!$path) { $sat = satellite_get($search_id); if (count($sat)==1) $path[simple][]=$sat[$search_id][id]; else foreach($sat as $aux) $peers[$aux[id]]=$aux[id]; } if ($path) { if ($only_parents==0) { if (!($peers = satellite_get_peers($search_id))) break; //add peers } else { //add only parents as peers if (!($sat = satellite_get($search_id))) break; //get satellite info foreach ($sat as $sat_data) { $parent_id = $sat_data[parent]; //get its parent $parent_data = satellite_get($parent_id); //get parent information if (count($parent_data) > 1) unset ($parent_data[$parent_id]); //for groups foreach ($parent_data as $pid=>$aux1) //for each parent (in a group) $peers[$pid]="$pid"; //add it as a peer } } } foreach ($peers as $key=>$peer) //filter if (in_array($peer,$filter)) unset($peers[$key]); reset($peers); //echo "DEEP $deep: Peers of $search_id:\n"; var_dump($peers); //echo "DEEP $deep: Path so Far $search_id:\n"; var_dump($path); if (count($peers) == 1) { $path[simple][]=current($peers); //echo "DEEP $deep: Path (in_simple) so Far $search_id:\n"; var_dump($path); } else if (count($peers) > 1) foreach ($peers as $id=>$peer) { //echo "DEEP $deep: Going to search for $id...\n"; $new_path = satellite_get_paths($id,$filter,$only_parents,++$deep); //echo "DEEP $deep: New Path for $id:\n"; var_dump($new_path); if (count($new_path)==1) //only one new path, merge them $path[] = array_merge($path[simple],$new_path[simple]); else foreach ($new_path as $aux) // multiple new paths merge each with the simple we got $path[] = array_merge($path[simple],$aux); //echo "DEEP $deep: Path so Far(2) $search_id:\n"; var_dump($path); } } if (count($path) > 1) unset($path[simple]); //echo "DEEP $deep: Finial Path\n"; var_dump($path); } return $path; } function satellite_clean_distribution_path ($paths, $my_sat_id) { if (is_array($paths)) foreach ($paths as $path) if ((!$pos = array_search($my_sat_id,$path)) or //I'm not on the path ($path[0]==$my_sat_id)) //i'm the last step unset($path); else { $path = array_slice($path,0,$pos); //take the path from me (pos) to the destination (0) $i++; foreach ($path as $step) $new_path[$i][]=$step; } return $new_path; } function satellite_clean_poller_path ($paths, $my_sat_id) { if (is_array($paths)) foreach ($paths as $key=>$path) { $pos = array_search($my_sat_id,$path); if (($pos > 0) || ($pos===0)) //i'm in the path $new_path[$key] = array_slice($path,0,$pos); //get the path from the destination (0) to me (pos) } return $new_path; } function satellite_get_last_distribution_path ($paths) { if (is_array($paths)) foreach ($paths as $key=>$path) $new_path[$key]=$path[count($path)-1]; //return the last step from every path return array_unique($new_path); } function satellite_get_first_distribution_path ($paths) { if (is_array($paths)) foreach ($paths as $key=>$path) $new_path[$key]=$path[0]; //return the last step from every path return array_unique($new_path); } function satellite_distribute($sat_id,$host_ids = NULL,$to_sat_id = NULL, $debug = 0) { $info = Array(); if (($host_ids) && (!is_array($host_ids))) $host_ids=Array($host_ids); if (!$to_sat_id) $to_sat_id = $sat_id; //if the destination is another satellite (triggered updates) $satellite_slave = satellite_get($sat_id); $my_sat_id = $GLOBALS[my_sat_id]; if (count($satellite_slave)==1) { $info[total_errors]=0; $satellite_slave = current($satellite_slave); $jffnms = new jffnms(0); //new jffnms object broker $time_dist_total = time_msec(); //general data $distribution_plan = Array ( "zones"=>NULL, "hosts"=>NULL, "pollers"=>NULL, "pollers_groups"=>NULL, "pollers_backend"=>NULL, "pollers_poller_groups"=>NULL, "interface_types"=>NULL, "interface_types_fields"=>NULL, "interface_types_field_types"=>NULL, "clients"=>NULL, "slas"=>NULL ); //interface specific data if (is_array($host_ids)) foreach ($host_ids as $host_id) { $distribution_plan["interfaces:$host_id"]=Array(host=>$host_id); $distribution_plan["interfaces_values:$host_id"]=array( "add_tables"=>"interfaces", "interfaces.id"=>"interfaces_values.interface", "interfaces.host"=>$host_id); } $distribution_plan["satellites"]=NULL; $capabilities = unsatellize(); foreach ($distribution_plan as $data_type_orig=>$filter) if ($data_type_orig) { list ($data_type,) = explode (":",$data_type_orig); $time_dist_export = time_msec(); $obj = $jffnms->get($data_type); $data = $obj->export($filter); $message = array( sat_id=>$to_sat_id, method=>"distribution", capabilities=>$capabilities, params=>array( //only one parameter, array( //an array with this values data_class=>$data_type, data=>$data, filter=>$filter )) ); $time_dist_send = time_msec(); //$debug = true; if (!$debug) { list ( $result, $result_raw ) = satellite_query ($satellite_slave[url],$message,"$my_sat_id",8); //$result = satellite_query ($satellite_slave[url],$message,"$my_sat_id",0); //debug ($result_raw); } else { //$message["params"]["data"][16]=array("id"=>9999,"zone"=>"adasda55666666655"); //unset ($message["params"]["data"][16]); include_once ("/opt/jffnms/engine/satellite/distribution.inc.php"); $result = satellite_distribution($message["params"]); } //debug ($result); //die(); $time_dist_send = time_msec_diff($time_dist_send); //counters $info[data][$data_type_orig][time_send]=$time_dist_send; $info[data][$data_type_orig][sent]=count($data); $info[total_sent] += $info[data][$data_type_orig][sent]; if (is_array($result)) { //if result is valid //pass stats from response $info["data"][$data_type_orig]["added"]=$result["added"]; $info["data"][$data_type_orig]["modified"]=$result["modified"]; $info["data"][$data_type_orig]["recv"]=$result["items"]-$result["deleted"]; $info["data"][$data_type_orig]["deleted"]=$result["deleted"]; } else { //if response is invalid //record the raw_result for debug, and increase the error counter $info["data"][$data_type_orig]["error"]=$result_raw; $info["total_errors"]++; $info["data"][$data_type_orig]["added"]=0; $info["data"][$data_type_orig]["modified"]=0; $info["data"][$data_type_orig]["recv"]=0; $info["data"][$data_type_orig]["deleted"]=0; } $info["total_add"] += $info["data"][$data_type_orig]["added"]; $info["total_mod"] += $info["data"][$data_type_orig]["modified"]; $info["total_recv"] += $info["data"][$data_type_orig]["recv"]; $info["total_del"] += $info["data"][$data_type_orig]["deleted"]; //break; } $info[total_time]= time_msec_diff($time_dist_total); $info[traceroute]=$result[traceroute]; $info[items]=count($info[data]); //$info[plan]=$distribution_plan; $info[url]=$satellite_slave[url]; } return $info; } function satellite_send_ping ($parent_rec,$sat_id,$session = "get", $comment = NULL) { $message = Array( sat_id=>$sat_id, method=>"ping", session=>$session ); $aux = satellite_query($parent_rec[url],$message,"$comment-ping",0); if (!is_Array($aux)) $aux = Array(result=>false,session=>""); return Array(result=>$aux[result],session=>$aux[session]); } function satellite_callback($method,$params = NULL, $class = NULL,$response = NULL) { $my_sat_id = $GLOBALS[my_sat_id]; if ($class=="none") unset ($class); if ($class) $real_function = $class."_".$method; else $real_function=$method; if ((!function_exists($real_function)) && ($class)) { //try to load it $function_file = get_config_option("jffnms_real_path")."/engine/$class/$method.inc.php"; if (file_exists($function_file)) include_once($function_file); } unset ($aux); if (function_exists($real_function)) $aux = call_user_func_array($real_function,$params); //FIXME call thru jffnms object else { //try object broker $jffnms = &$GLOBALS["jffnms"]; $aux = $jffnms->proxy($class,$method,$params); } //FIXME detect errors //$response[error][$my_sat_id]="ERROR: Function '$real_function' doesn't exists."; if (is_array($aux) && is_array($response)) $response = $response + $aux; //this way we keep the keys else $response = $aux; return $response; } function satellite_elect_one ($satellite_destinations,$my_sat_id,$sat_id) { if (is_array($satellite_destinations)) { //some valid source/destination foreach ($satellite_destinations as $parent_sat_id=>$satellite_parent) { //ping to see if parent can reach the satellite $ping = satellite_send_ping(array(id=>$parent_sat_id,url=>$satellite_parent[url]),$sat_id,"get","$my_sat_id-elect_one"); if ($ping[result]==false) unset($satellite_destinations[$parent_sat_id]); //delete if it cant else { $satellite_destinations[$parent_sat_id][session]=$ping[session]; //save session data $working_paths[$sat_id][count($satellite_parent[path])][$parent_sat_id]=$satellite_destinations[$parent_sat_id]; } } $cant = count($satellite_destinations); if ($cant > 1) //we dont want to amplify the backend, send this only once $pos = rand (0,$cant-1); //pick one random path //FIXME select shorter else $pos = 0; $keys = array_keys($satellite_destinations); $satellite_destination = Array($keys[$pos]=>$satellite_destinations[$keys[$pos]]); //select only one satellite return $satellite_destination; } } function satellite_decide_mode ($my_sat_id,$sat_id,$from_sat_id) { //find out if relay or direct $paths = satellite_get_paths ($sat_id); if (is_array($paths)) foreach ($paths as $path) { $pos = array_search ($my_sat_id,$path); if (($pos > 0) || ($pos===0)) //i'm on the path $new_paths[]=array( source_sat=>current(satellite_get($path[$pos-1])), destination_sat=>current(satellite_get($path[$pos+1])), path=>$path); } $mode = 0; if (is_array($new_paths)) { $sat_host = $_SERVER["REMOTE_ADDR"]; foreach ($new_paths as $path) { //verify valid source preg_match("/^(.*:\/\/)?([^:\/]+):?([0-9]+)?(.*)/", $path[source_sat][url],$aux); $src_host = $aux[2]; preg_match("/^(.*:\/\/)?([^:\/]+):?([0-9]+)?(.*)/", $path[destination_sat][url],$aux); $dest_host = $aux[2]; if ($sat_host == gethostbyname($src_host)) $src_host_ok = 1; else $src_host_ok = 0; if ($sat_host == gethostbyname($dest_host)) $dest_host_ok = 1; else $dest_host_ok = 0; if (($src_host_ok) || ($dest_host_ok)) { //permited source or destination if ($my_sat_id == $sat_id ) //the message is to me $mode = 1; //then direct else { if ($sat_id == $path[destination_sat][id]) { //message to my peer (destination) $satellite_destinations[$path[destination_sat][id]]=Array(url=>$path[destination_sat][url],path=>$path[path]); //for election in relay $mode = 2; //for relay } if ($sat_id == $path[source_sat][id]) { //message to my peer (source) $satellite_destinations[$path[source_sat][id]]=Array(url=>$path[source_sat][url],path=>$path[path]); //for election in relay $mode = 2; //for relay } if ($mode != 2) { //if relay has not been selected yet if ($src_host_ok && $path[destination_sat] && ($path[destination_sat][id]!=$from_sat_id)) { //has source (means i'm in the middle) $satellite_destinations[$path[destination_sat][id]]=Array(url=>$path[destination_sat][url],path=>$path[path]); //for election in relay $mode = 2; //for relay } if ($dest_host_ok && $path[source_sat] && ($path[source_sat][id]!=$from_sat_id)) { //has source (means i'm in the middle) $satellite_destinations[$path[source_sat][id]]=Array(url=>$path[source_sat][url],path=>$path[path]); //for election in relay $mode = 2; //for relay } } if ($mode==2) $valid_paths[]=$path[path]; } //not direct }//source or dest ok }//foreach }//has paths if ( //this is to take care of the first data distribution to a fresh satellite ($mode==0) && //it will get an error if we dont do something, (count(satellites_list()==1)) && //there are not satellites defined or only one (I still can be the only master) ($my_sat_id=="") //I have not been identified in the satellites I'm not the only satellite defined ) $mode = 1; //so Allow direct connection, I assume this is for distribution // $mode = 0; switch ($mode) { case 0: $sat_mode = "error"; $error = "Connection from IP ".$_SERVER[REMOTE_ADDR]." claiming to be $from_sat_id to Satellite $sat_id is Not Allowed to go by me (Satellite $my_sat_id)". "\n".vd($paths). //debug "\n".vd($new_paths). //debug "\n".vd($satellite_destinations). //debug ""; break; case 1: $sat_mode = "direct"; break; case 2: $sat_mode = "relay"; break; } return Array( mode=>$sat_mode,destinations=>$satellite_destinations,error=>$error, my_sat_id=>$my_sat_id,sat_id=>$sat_id,valid_paths=>$valid_paths); } function satellite_triggered_update ($my_sat_id,$mod_sat_,$old_path) { $new_path = satellite_get_paths($mod_sat); if ($old_path = satellite_clean_distribution_path($old_path,$my_sat_id)) $dist_path1 = satellite_get_last_distribution_path($old_path); if ($new_path = satellite_clean_distribution_path($new_path,$my_sat_id)) $dist_path2 = satellite_get_last_distribution_path($new_path); //debug($old_path); //debug($new_path); //debug($dist_path2); //debug($dist_path1); if (is_array($dist_path2)) foreach ($dist_path2 as $path_id=>$peer) foreach ($new_path[$path_id] as $next_step) $triggered[$next_step]=array($peer,$next_step); if (is_array($dist_path1)) foreach ($dist_path1 as $path_id=>$peer) foreach ($old_path[$path_id] as $next_step) $triggered[$next_step]=array($peer,$next_step); //debug ($triggered); $info[errors]=0; if (is_array($triggered)) foreach ($triggered as $aux) { list ($next_step,$to_sat_id) = $aux; if ($to_sat_id!=$my_sat_id) { //debug("sending triggered update to $next_step for $to_sat_id..."); $result = satellite_distribute($next_step,NULL,$to_sat_id); //FIXME list of hosts with the satellite unset ($result[data]); unset ($result[traceroute]); $info[$to_sat_id]=$result; if ($result[total_errors] > 0) $info[errors]++; //debug ($result); } //break; } return $info; } //Get My Satellite ID, and cache it function satellite_my_id () { if (!isset($GLOBALS["my_sat_id"])) { //satellite $jffnms_satellite_uri = get_config_option("jffnms_satellite_uri"); if ($jffnms_satellite_uri=="none") $my_sat_id = 1; //Only Master Configuration, no satellites else $my_sat_id = satellite_get_id($jffnms_satellite_uri); if (!is_numeric($my_sat_id)) $my_sat_id = 1; $GLOBALS["my_sat_id"]=$my_sat_id; } return $GLOBALS["my_sat_id"]; } ?> jffnms-0.9.3/lib/alarms.class.php0000644000175000017500000001171611530371313016163 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ class JffnmsAlarms extends basic { // was delete public function delete($id) { return db_delete('alarms',$id); } //del() public function status ($interface,$event_type,$alarm_states) { $query =" SELECT alarms.id as start_id, alarms.referer_start, alarms.date_start as start_date, alarm_states.state as alarm_state FROM alarms, alarm_states WHERE alarms.interface = '$interface' and alarms.type = '$event_type' and alarms.active = alarm_states.id and (alarm_states.state = '".$alarm_states[0]."' or alarm_states.state = '".$alarm_states[1]."')"; $result = db_query ($query) or die ("Query failed - have_other_alarm() - ".db_error()); $cant = db_num_rows ($result); $data = array(); if ($cant > 0) $data = db_fetch_array($result); return array('result'=>$result,'count'=>$cant,'alarm'=>$data); } //have_other public function insert(&$Triggers, $date_start,$date_stop,$interface,$type,$active,$referer_start,$referer_stop) { $data = array( 'date_start' => $date_start, 'interface' => $interface, 'type' => $type, 'active' => $active, 'referer_start' => $referer_start); if ($date_stop != '') $data['date_stop'] = $date_stop; if ($referer_stop != '') $data['referer_stop'] = $referer_stop; $id = db_insert('alarms',$data); logger( "New Alarm: $id := $date_start - $date_stop - $interface - $type - $active - $referer_start - $referer_stop\n"); $Triggers->analyze('alarm',current($this->alarms_list(NULL,array('alarm_id'=>$id)))); //analyze alarm triggers return $id; } //insert // was list public function alarms_list ($ids,$filters = NULL,$init = 0,$span = 100, $where_special = NULL) { if (!is_array($where_special)) $where_special = array(); //round span values (no decimals in SQL LIMIT) $span = round($span); $init = round($init); if (is_array($filters)) foreach ($filters as $filter_key=>$filter_value) if ( isset($filter_value) ) switch ($filter_key) { case 'type': $where_special[]=array('types.id','=',$filter_value); break; case 'state': $where_special[]=array('alarm_states.id','=',$filter_value); break; case 'alarm_id': $where_special[]=array('alarms.id','=',$filter_value); break; case 'triggered': $where_special[]=array('alarms.triggered','=',$filter_value); break; case 'alarm_state': $where_special[]=array('alarm_states.state','=',$filter_value); break; case 'host': $where_special[]=array('interfaces.host','=',$filter_value); break; } //switch $result = get_db_list( array('interfaces','alarms','types','alarm_states','clients'), $ids, array( 'alarms.*', 'duration'=>'(alarms.date_stop - alarms.date_start)', 'interface_host'=>'interfaces.host', 'interface_interface'=>'interfaces.interface', 'interface_client'=>'clients.name', 'interface_client_id'=>'interfaces.client', //Needed for triggers by Customer 'interface_type'=>'interfaces.type', //needed for triggers by interface type 'type_description'=>'types.description', 'alarm_state'=>'alarm_states.state', 'state_description'=>'alarm_states.description'), array_merge( array( array('alarms.interface','=','interfaces.id'), array('interfaces.client','=','clients.id'), array('alarms.type','=','types.id'), array('alarms.active','=','alarm_states.id'), array('alarms.id','>','1')), $where_special), array ( array('alarms.id','desc')), '',NULL,$init,$span); foreach ($result as $key=>$data) { $result[$key]['interface_description'] = $data['interface_client'].' '.$data['interface_interface']; if ($result[$key]['alarm_state']==ALARM_DOWN) //Alarm still Active $result[$key]['duration'] = time() - strtotime($result[$key]['date_start']); //calculate the ongoing duration } return $result; } function lookup ($alarm_description) { $query = "SELECT state FROM alarm_states where description = '$alarm_description'"; $result = db_query ($query) or die ("Query Failed - alarms>lookup($alarm_description) - ".db_error()); if (db_num_rows($result) == 1) return current(db_fetch_array($result)); return NULL; }//lookup public function update($id,$data) { $Triggers = new JffnmsTriggers(); $result = FALSE; if (is_array($data)) $result = db_update('alarms',$id,$data); $Triggers->analyze('alarm',current($this->alarms_list(NULL,array('alarm_id'=>$id)))); //analyze alarm triggers return $result; } //update() } //class ?> jffnms-0.9.3/lib/api.network.inc.php0000644000175000017500000003454111741273732016624 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ // Frontend SNMP Functions for Current code. define ('INCLUDE_OID_NONE', false); define ('INCLUDE_OID_ALL', true); define ('INCLUDE_OID_BASE', '10'); define ('INCLUDE_OID_1', '11'); define ('INCLUDE_OID_2', '12'); define ('INCLUDE_OID_3', '13'); define ('SNMP_TIMEOUT', 1000000); #1,000,000 usec = 1sec /* * Check to see if snmp2_* functions exist * Really, if they don't, don't use snmp2 */ if (function_exists('snmp2_walk')) define('USE_INTERNAL_SNMP2', TRUE); else define('USE_INTERNAL_SNMP2', FALSE); function parse_community($comm) { if (empty($comm)) return FALSE; if (preg_match('/^v(\d):(\S+)$/', $comm, $regs)) return array(intval($regs[1]),$regs[2]); return (array(1,$comm)); } function snmp_walk ($host, $comm, $oid, $include_oid = INCLUDE_OID_NONE, $retries = 2) { list($version,$community)= parse_community($comm); $oid = parse_oid($oid, $version); switch($version) { case 1: if ($include_oid == INCLUDE_OID_NONE) $result = @snmpwalk($host, $community, $oid, SNMP_TIMEOUT, $retries); else $result = @snmprealwalk($host, $community, $oid, SNMP_TIMEOUT, $retries); break; case 2: if (USE_INTERNAL_SNMP2) { if ($include_oid == INCLUDE_OID_NONE) $result = @snmp2_walk($host, $community, $oid, SNMP_TIMEOUT, $retries); else $result = @snmp2_real_walk($host, $community, $oid, SNMP_TIMEOUT, $retries); } else $result = jffnms_snmp2_walk($host, $community, $oid, SNMP_TIMEOUT, $retries, $include_oid); break; case 3: list ($sec_name, $sec_level, $auth_proto, $auth_key, $priv_proto, $priv_key) = explode('|', $community); if ($include_oid == INCLUDE_OID_NONE) $result = @snmp3_walk($host, $sec_name, $sec_level, $auth_proto, $auth_key, $priv_proto, $priv_key, $oid, SNMP_TIMEOUT, $retries); else $result = @snmp3_real_walk($host, $sec_name, $sec_level, $auth_proto, $auth_key, $priv_proto, $priv_key, $oid, SNMP_TIMEOUT, $retries); break; } // switch if ($result === FALSE) return FALSE; if ($include_oid > INCLUDE_OID_BASE) $result = snmp_reduce_table_key ($result, $include_oid-INCLUDE_OID_BASE); $new_result = array(); foreach ($result as $oid => $value) { if ( (strpos($value, 'No Such Instance') !== FALSE) or (strpos($value, 'No Such Object') !== FALSE) or (strpos($value, 'No more variables left') !== FALSE) ) continue; $new_result[$oid] = snmp_fix_value($value); } return $new_result; } function snmp_get ($host, $comm, $oid, $retries = 2) { list($version,$community)= parse_community($comm); $oid = parse_oid($oid, $version); $result = FALSE; switch($version) { case 1: $result = @snmpget($host, $community, $oid, SNMP_TIMEOUT, $retries); break; case 2: if (USE_INTERNAL_SNMP2) $result = @snmp2_get($host, $community, $oid, SNMP_TIMEOUT, $retries); else $result = jffnms_snmp2_get($host, $community, $oid, SNMP_TIMEOUT, $retries); break; case 3: list ($sec_name, $sec_level, $auth_proto, $auth_key, $priv_proto, $priv_key) = explode('|', $community); $result = @snmp3_get($host, $sec_name, $sec_level, $auth_proto, $auth_key, $priv_proto, $priv_key, $oid, SNMP_TIMEOUT, $retries); break; } // switch if ( (strpos($result, 'No Such Instance') !== FALSE) or (strpos($result, 'No Such Object') !== FALSE) or (strpos($result, 'No more variables left') !== FALSE) ) return FALSE; return snmp_fix_value($result); } function snmp_set ($host, $comm, $oid, $type, $value, $retries = 2) { list($version,$community)= parse_community($comm); $oid = parse_oid($oid, $version); $result = FALSE; switch($version) { case 1: $result = @snmpset($host, $community, $oid, $type, $value, SNMP_TIMEOUT, $retries); break; case 2: if (USE_INTERNAL_SNMP2) $result = @snmp2_set($host, $community, $oid, $type, $value, SNMP_TIMEOUT, $retries); else $result = @snmp2_set($host, $community, $oid, $type, $value, SNMP_TIMEOUT, $retries); break; case 3: list ($sec_name, $sec_level, $auth_proto, $auth_key, $priv_proto, $priv_key) = explode('|', $community); $result = @snmp3_set($host, $sec_name, $sec_level, $auth_proto, $auth_key, $priv_proto, $priv_key, $oid, $type, $value, SNMP_TIMEOUT, $retries); break; } // switch return $result; } function get_snmp_counter ($ip,$community,$oid) { $aux = explode(":",@snmp_get($ip,$community,$oid)); $result = (count($aux)==1)?$aux[0]:$aux[1]; return $result; } /* * parse_oid() * Returns different OID depending if it is v1 or not */ function parse_oid ($oid, $version = 1) { if (!preg_match('/^([^,]+),(.+)$/', $oid, $regs)) return $oid; if ($version == 1) return $regs[1]; return $regs[2]; } function snmp_fix_value ($value) { if ($value === FALSE) return FALSE; $value = preg_replace('/(counter32|counter64|gauge|gauge32|gauge64|hex|ipaddress|integer|string):/i', '', $value); if ($value == '') return ''; if (is_numeric($value)) return trim($value); // Remove quotes and other delimiters $value = str_replace(array("\"","'",">","<","\\","\n","\r"),'', $value); return trim($value); } function snmp_reduce_table_key ($table, $important = 1) { if (!is_array($table) || count($table) == 0) return $table; $new_table = array(); foreach($table as $oid => $value) { $new_oid = join('.',array_slice(explode('.', $oid),-($important))); $new_table[$new_oid] = $value; } return $new_table; } function snmp_hex_to_string ($hex) { $value = trim($hex); if (substr($value,0,3)=='Hex') { $data = substr($value,4,strlen($value)-5); for ($i=0; $i < strlen($data) ; $i++) if (ord($data[$i])==10) $data[$i]=' '; $data_array = explode(' ',$data); $value = ''; foreach ($data_array as $aux) if ($aux!='00') $value .= chr(hexdec($aux)); } return $value; } //MISC //-------------------------------------------------------- function http_post_message ($url,$vars,$raw_data = "", $debug = 0,$comment = NULL, $HTTP_MODE = "1.0") { //unset($comment); //if ($comment) $url.="?method=".$vars[method]."&from=$comment"; $proto = 'http://'; $host = ''; $port = 80; $path = ''; if (preg_match('/^(https?:\/\/)(.*)$/i', $url, $regs)) { $proto = $regs[1]; $url2 = $regs[2]; } else $url2 = $url; if (preg_match('/^([a-z0-9.-]+)(:\d)?(\/.*)/i', $url2, $regs)) { $host = $regs[1]; if (isset($regs[3])) { $port = $regs[2]; $path = $regs[3]; } else { $path = $regs[2]; } } if ($port=='') $port=80; if ($proto=='https://') { $host = 'ssl://'.$host; $port = 443; } $user_agent = "JFFNMS"; $urlencoded = ""; while (list($key,$value) = each($vars)) if (!is_array($value)) $urlencoded.= "$key=$value&"; else $urlencoded.= "$key=".str_replace("&","%26",satellize($value))."&"; $urlencoded = substr($urlencoded,0,-1); $content_length = strlen($urlencoded); //Changed to HTTP/1.0 without KeepAlive $headers = "POST $path HTTP/".$HTTP_MODE."\r\n". "Host: $host\r\n". (($HTTP_MODE=="1.1")?"Connection: close\r\n":""). "Content-Type: application/x-www-form-urlencoded\r\n". "User-Agent: $user_agent\r\n". "Content-Length: $content_length\r\n". "\r\n$raw_data"; $fp = @fsockopen($host, $port, $errno, $errstr,4); if (!$fp) return false; $time_send = time_msec(); $a = fputs($fp, $headers.$urlencoded); $time_send = time_msec_diff($time_send); if ($debug == 1) echo "time send: $time_send \n"; if ($debug == 2) var_dump($headers.$urlencoded); $time_recv = time_msec(); $ret = ""; while (!feof($fp)) $ret.= fgets($fp, 1024); fclose($fp); $time_recv = time_msec_diff($time_recv); if ($debug == 1) echo "time recv: $time_recv \n"; $init = strpos($ret,"\r\n\r\n"); $data1 = substr($ret,$init+4,strlen($ret)-$init); if ($HTTP_MODE=="1.1") { $init = strpos($data1,"\r\n")+2; $len = strrpos($data1,"\r\n")-$init-4; } else { $init = strpos($data1,"\r\n"); $len = strlen($data1)-$init; } $data = trim(substr($data1,$init,$len)); return $data; } function https_post_message ($url,$vars,$raw_data = "", $debug = 0,$comment = NULL) { unset($comment); if ($comment) $url.="?method=".$vars["method"]."&from=$comment"; $user_agent = "JFFNMS"; $urlencoded = ""; while (list($key,$value) = each($vars)) if (!is_array($value)) $urlencoded.= "$key=$value&"; else $urlencoded.= "$key=".str_replace("&","%26",satellize($value))."&"; $urlencoded = substr($urlencoded,0,-1); $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_USERAGENT, $user_agent); curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt ($ch, CURLOPT_HEADER, 0); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt ($ch,CURLOPT_POST,1); curl_setopt ($ch, CURLOPT_POSTFIELDS,$urlencoded); $data = curl_exec ($ch); curl_close ($ch); return $data; } function soap_post_message ($url, $vars, $debug = 0,$comment = NULL) { require_once "SOAP/Client.php"; $url = str_replace("soap://","http://",$url); $options = array('namespace' => 'urn:JFFNMS', 'trace' => 1); $soapclient = new SOAP_Client("$url?capabilities=O"); $method = $vars["method"]; unset($vars["method"]); unset($vars["capabilities"]); $ret = $soapclient->call($method,$vars,$options); unset($soapclient); $ret = object2array($ret); if (is_array($ret["item"])) { $aux = $ret["item"]; unset ($ret["item"]); $ret = array_merge ($ret,$aux); } return $ret; } function wddx_post_message ($url,$vars,$raw_data = "", $debug = 0,$comment = NULL) { preg_match("/^(.*:\/\/)?([^:\/]+):?([0-9]+)?(.*)/", $url,$match); list(,,$host,$port,$path) = $match; if (!$port) $port = 5000; $send = satellize ($vars,"W"); $fp = fsockopen($host, $port, $errno, $errstr); if (!$fp) return false; fputs($fp, $send); $ret = ""; while (!feof($fp)) $ret.= fgets($fp, 1024); fclose($fp); return $ret; } function satellite_query ($satellite_url,$message,$comment = NULL,$debug = 0) { //debug = 1, debug the transport //debug = 2, debug the RAW reply //debug = 4, debug the reply //debug = 8, return Result and Raw Result if (!$message["capabilities"] && ($message["session"]=="get")) //set capabilities when establishing a session $message["capabilities"] = unsatellize(); $message["from_sat_id"]=$GLOBALS["my_sat_id"]; //add my sat id as from preg_match("/^(.*:\/\/)?([^:\/]+):?([0-9]+)?(.*)/", $satellite_url,$match); $proto = $match[1]; $result_raw = NULL; switch ($proto) { case "https://" : $result_raw = https_post_message ($satellite_url,$message,"",$debug,$comment); break; case "http://" : $result_raw = http_post_message ($satellite_url,$message,"",$debug,$comment); break; case "soap://" : $result = soap_post_message ($satellite_url,$message,$debug,$comment); //no need to unsatellize break; case "wddx://" : $result_raw = wddx_post_message ($satellite_url,$message,$debug,$comment); break; } if ($debug==2) var_dump($result_raw); if ($result_raw) $result = unsatellize($result_raw); if ($debug==4) var_dump($result); if ($debug==8) $result = array($result,$result_raw); return $result; } function satellite_call ($sat_id, $class, $method, $params = NULL) { $sat_url = current(satellite_get ($sat_id)); $sat_url = $sat_url["url"]; if (!is_array($params)) $params = array ($params); $message = array( "sat_id"=>$sat_id, "class"=>$class, "method"=>$method, "params"=>$params ); $result = satellite_query ($sat_url, $message); return $result; } function get_ip_peer($ip) { $octets = explode('.', $ip); if ($octets[3]%2) $octets[3]++; else $octets[3]--; return implode('.', $octets); } //Process MIB Status Values function parse_interface_status($status) { $statuses = array('1' => 'up', '2' => 'down', '3' => 'testing'); if (array_key_exists($status, $statuses)) return $statuses[$status]; if ( ($trim_status = strstr($status, '(', TRUE)) !== FALSE) return $trim_status; return $status; } ############################################################## # # External snmp functions # if (!USE_INTERNAL_SNMP2) { function jffnms_snmp2_walk($host, $community, $oid, $timeout, $retries, $include_oid) { if ($include_oid) $outopt = '-Oqn'; else $outopt = '-Oqv'; $command = "snmpwalk -v2c $outopt -c $community -t $timeout -r $retries $host $oid"; @exec($func, $result, $aux); if ((count($result)==1) && (preg_match("/No Such (Object|Instance)/i", current($result)) || preg_match("/No more variables left/i", current($result)))) return FALSE; if ($include_oid) { $new_result = array(); foreach($result as $key => $line) { if (preg_match('/^([0-9.]+)\s+(\S.+)/', $line, $regs)) $new_result[$regs[1]] = $regs[2]; } return $new_result; } return $result; } function jffnms_snmp2_get($host, $community, $oid, $timeout, $retries) { $command = "snmpget -v2c -Oqv -c $community -t $timeout -r $retries $host $oid"; @exec($func, $result, $aux); if ((count($result)==1) && (preg_match("/No Such (Object|Instance)/i", current($result)) || preg_match("/No more variables left/i", current($result)))) return FALSE; return $result; } function snmp2_set($host, $community, $oid, $type, $value, $timeout, $retries) { $command = "snmpset -v2c -c $community -t $timeout -r $retries $host $oid $type $value"; @exec($func, $result, $aux); if ((count($result)==1) && (preg_match("/No Such (Object|Instance)/i", current($result)) || preg_match("/No more variables left/i", current($result)))) return FALSE; return $result; } } //use_internal_snmp2 ?> jffnms-0.9.3/lib/maps_interfaces.class.php0000644000175000017500000000573411511005520020043 0ustar csmallcsmall'maps.name', 'aux_interface'=>'interfaces.interface', 'aux_customer'=>'clients.shortname', 'aux_host'=>'hosts.name', 'aux_zone'=>'zones.zone' ), array_merge( array( array('maps_interfaces.map','>','1'), array('maps_interfaces.map','=','maps.id'), array('maps_interfaces.interface','=','interfaces.id'), array('interfaces.client','=','clients.id'), array('interfaces.host','=','hosts.id'), array('hosts.zone','=','zones.id')), $where_special), array ( array('maps.id','asc'), array('maps_interfaces.id','desc') ), ''); foreach ($result as $key=>$data) $result[$key]['interface_description'] = $data['aux_host'].' '.$data['aux_zone'].' - '.$data['aux_customer'].' - '.$data['aux_interface']; return $result; } function update($id,$data) { return db_update('maps_interfaces',$id,$data); } function add($map = 1,$interface = 1) { return db_insert('maps_interfaces',array('map'=>$map,'interface'=>$interface)); } function del($id) { return db_delete("maps_interfaces",$id); } function del_from_all($int_id) { $query = "delete from maps_interfaces where interface='$int_id'"; $result = db_query($query) or die ("Query Failed - maps_interface_del_from_all() - ".db_error()); return $result; } function status($map_id,$interface_id) //alias of interface_in_map { return interface_in_map($map_id,$interface_id); } function delete_links ($map_id,$interface_id) { $query = " DELETE from maps_interfaces where (interface = 1 and map = $map_id) and (x = $interface_id or y = $interface_id);"; return db_query($query) or die ("Query Failed maps_interfaces_delete_links($map_id,$interface_id) - ".db_error()); } function interface_in_map($map_id,$interface_id) { $query = "select id from maps_interfaces where interface = '$interface_id' and map = '$map_id'"; $result = db_query($query) or die ('Query Failed - ISM1 - '.db_error()); $cant = db_num_rows($result); if ($cant >= 1) return 1; return 0; } function maps($interface_id) { $maps = array(); $query = "select map from maps_interfaces where interface = '$interface_id'"; $result = db_query($query) or die ("Query Failed - ISM1 - ".db_error()); while ($rs = db_fetch_array($result)) $maps[]=$rs['map']; return $maps; } } //class jffnms-0.9.3/lib/hosts.class.php0000644000175000017500000001321111531562614016043 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ class JffnmsHosts extends basic { public function status (&$Interfaces, $host_id = NULL, $map_id = NULL, $only_in_rootmap = 0, $client_id = NULL) { return $Interfaces->status(NULL,array('host'=>$host_id,'map'=>$map_id,'in_maps'=>$only_in_rootmap, 'show_disabled'=>0, 'client'=>$client_id)); } function get_all($ids = NULL, $zone_id = NULL, $where_special = NULL, $count = 0) { if (is_array($zone_id)) { global $Interfaces; return $this->list_filtered($Interfaces, $zone_id); } $index = 'hosts.id'; if (!is_array($where_special)) $where_special = array(); if (is_numeric($zone_id)) $where_special[]=array('hosts.zone','=',$zone_id); $order = array ( array('hosts.name','asc'), array('zones.zone','asc')); if (!$count) { $fields = array( 'hosts.*', 'zone_description'=>'zones.zone', 'autodiscovery_description'=>'autodiscovery.description', 'default_customer_description'=>"clients.name", 'satellite_description'=>'satellites.description', 'zone_image'=>'zones.image', 'config_type_description'=>'hosts_config_types.description' ); } else { $fields = array("count($index) as cant"); $index = NULL; $order = NULL; } return get_db_list( array('zones','hosts','autodiscovery','clients','satellites','hosts_config_types'), $ids,$fields, array_merge( array( array('hosts.zone','=','zones.id'), array('autodiscovery.id','=','hosts.autodiscovery'), array('clients.id','=','hosts.autodiscovery_default_customer'), array('satellites.id','=','hosts.satellite'), array('hosts_config_types.id','=','hosts.config_type'), array('hosts.id','>','0')), $where_special), $order, $index); } private function list_filtered (&$Interfaces, $filters = array()) { $interfaces = $Interfaces->get_all(NULL,$filters); $hosts = array(); foreach ($interfaces as $interface) $hosts[] = $interface['host']; $hosts = array_unique($hosts); return $this->get_all($hosts); } function count($ids = NULL, $zone_id = NULL, $where_special = NULL) { return current(current($this->get_all($ids, $zone_id, $where_special, 1)))-1; } function add($zone_id=NULL) { if (!is_numeric($zone_id)) $zone_id = 1; return db_insert('hosts', array('name'=>'New Host', 'zone'=>$zone_id, 'creation_date'=>time())); } function update($host_id,$host_data) { $host_data['rocommunity'] = snmp_options_parse($host_data['rocommunity']); $host_data['rwcommunity'] = snmp_options_parse($host_data['rwcommunity']); // if the only fields to update are the last_poll_* ones don't update the modification_date if ((count($host_data)==2) && isset($host_data['last_poll_date']) && isset($host_data['last_poll_time'])) ; //nothing else $host_data['modification_date']=time(); //update the modification date if (isset($host_data['dmii']) && (substr($host_data['dmii'],0,1)!='M') && (substr($host_data['dmii'],0,1)!='I')) $host_data["dmii"] = 1; $result = db_update('hosts',$host_id,$host_data); return $result; } function del($host_id,$IntObj=FALSE) { if (!$IntObj) $IntObj = new JffnmsInterfaces(); $interfaces = $IntObj->get_all (NULL,array('host'=>$host_id)); foreach ($interfaces as $int) $IntObj->del($int['id']); $interfaces = $IntObj->get_all (NULL,array('host'=>$host_id)); if (count($interfaces) == 0) return db_delete('hosts',$host_id); return FALSE; } function dmii_interfaces_list (&$Interfaces, $host_id) { $host_data = current($this->get_all($host_id)); $dmii = $host_data['dmii']; if ($dmii[0]=='M') return array_keys($Interfaces->get_all(NULL,array('map'=>substr($dmii,1)))); if ($dmii[0]=='I') return array(substr($dmii,1)); //return an array with only the interface id return 1; //force not to do nothing in poller plan } function dmii_if_all_down_list(&$Interfaces, $host_id,$dmii_map) { $dmii_down = maps_status_all_down($dmii_map); if ($dmii_down) //if they are all down, dont poll the others { $result = array_keys($Interfaces->get_all(NULL,array('map'=>$dmii_map,'host'=>$host_id))); //only poll the Designated Main Interfaces return $result; } return FALSE; } function status_dmii(&$Interfaces, $host_id) { $host_data = current($this->get_all($host_id)); $dmii = $host_data['dmii']; if ($dmii[0]=='M') return $this->dmii_if_all_down_list($Interfaces, $host_id,substr($dmii,1)); //set to a map if ($dmii[0]=='I') //set to an interface if (!$Interfaces->is_up(substr($dmii,1))) //is down return array(substr($dmii,1)); //return an array with only the interface id return FALSE; //not down } // New DMII functions function dmii_set($host_id, $new_dmii) { return db_update('hosts',$host_id, array('dmii_up' => $new_dmii)); } function dmii_get($host_id) { $dmii_query = "SELECT dmii,dmii_up FROM hosts WHERE id='$host_id'"; $result=db_query($dmii_query) or die("Query failed ($dmii_query) - Hosts -> dmii_get: ".db_error()); if (db_num_rows($result) == 0) return 0; $row = db_fetch_array($result); if ($row['dmii'] == '1') return '1'; // Always up if no DMII set return $row['dmii_up']; } }//class ?> jffnms-0.9.3/lib/profiles_values.class.php0000644000175000017500000001035311524413442020105 0ustar csmallcsmall JFFNMS Authors * This program is licensed under the GNU GPL, full terms in the LICENSE file */ class JffnmsProfiles_values extends basic { var $jffnms_insert = array('description'=>'New Value'); function get_all($filter = NULL, $filters=NULL) { if (is_numeric($filter)) $filters['option'] = $filter; $where_filters = array(); if (isset($filters['option'])) $where_filters[]=array('profiles_values.profile_option','=',$filters['option']); return get_db_list( array('profiles_options','profiles_values'), NULL, array('profiles_values.*','option_description'=>'profiles_options.description'), //table,ids,fields array_merge( array( array('profiles_values.profile_option','=','profiles_options.id'), array('profiles_values.id','>',1) ),$where_filters ), //where array(array('profiles_values.id','desc')) //order ); }//list_values() function add($option_id = 1) { $ProfilesOptions = new JffnmsProfiles_options(); if ($ProfilesOptions->get_type($option_id)!='text') return db_insert('profiles_values',array( 'description'=>'New Value', 'profile_option' => $option_id, 'value' =>'new_value')); } function description($option, $value) { $query_profile = 'SELECT description FROM profiles_values '. "WHERE profile_option=$option AND value='$value'"; $result_profile = db_query($query_profile) or die ('profile_values::description() - '.db_error()); if (db_num_rows($result_profile)==0) return $value; $row = db_fetch_array($result_profile); return $row['description']; } function get_value($tag, $user_id = 0) { if ($user_id == 0) { if (!array_key_exists('auth_user_id', $_SESSION)) die("profiles-> get_value(): auth_user_id not in SESSION table\n"); $user_id = $_SESSION['auth_user_id']; } $query_auth = " SELECT profiles_values.value as profile_value FROM profiles, profiles_options, profiles_values WHERE profiles.userid = '$user_id' and profiles_options.tag = '$tag' and profiles_options.id = profiles.profile_option and profiles_values.id = profiles.value "; $result_auth = db_query ($query_auth) or die('Profiles get_value 1 -'.db_error()); $auth_count = db_num_rows($result_auth); if ($auth_count == 1) { $auth_row = db_fetch_array($result_auth); //debug("$tag: $profile_value\n"); return $auth_row['profile_value']; } return FALSE; } //get_value() function modify($user_id, $option, $value) { $ProfilesOptions = new JffnmsProfiles_options(); $value_id = 0; if (!is_numeric($option)) $option = $ProfilesOptions->get_id($option); if ($type = $ProfilesOptions->get_type($option)) { if ($type == 'text') { $value_id = $ProfilesOptions->get($user_id,$option); //get the actual value of this option for this user if ($value_id=='0' or $value_id==1) // didnt have that option //we didnt have any value there so add a new one { $query = "INSERT INTO profiles_values (profile_option) VALUES ($option)"; $result = db_query($query) or die ("Query Failed - AZ12 - ".db_error()); $value_id = db_insert_id(); } if ($value_id > 1) db_update('profiles_values',$value_id,array('value'=>$value)); //update the value } if ($type=='select') //if its select, find out the ID of the value { $query = "SELECT id FROM profiles_values WHERE profile_option = $option and value = '$value'"; $result = db_query ($query) or die ('Query Failed - AZ10 - '.db_error()); if (db_num_rows($result) == 1) { $row = db_fetch_array($result); $value_id = $row['id']; } } } if ($value_id > 0) { $query = "UPDATE profiles SET value = '$value_id' WHERE profile_option = '$option' and userid = $user_id"; //echo "$query\n"; $result = db_query ($query) or die ('Query failed - profiles_modify_value() - '.db_error()); return true; } return false; } #modify_value() } jffnms-0.9.3/lib/gui.admin.inc.php0000644000175000017500000001416311742006570016227 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //This function creates the $filter array for interface_status, interface_list, etc. processed by interface_filter //from the URL from menu_reports function reports_make_interface_filter($use_interfaces,$view_all) { global $Sanitizer; $filters = array(); $filter_names=array('id'=>'interface_id','client'=>'client_id','type'=>'type_id','host'=>'host_id','map'=>'map_id'); foreach($filter_names as $filter_name => $filter_input) { $filter_value = $Sanitizer->get_string($filter_input,FALSE); if ($filter_value) $filters[$filter_name]=$filter_value; } if (($view_all==1) || ((count($use_interfaces)==0) && (count($filters)==0))) { if (profile('REPORTS_VIEW_ALL_INTERFACES')) $filters=array('custom'=>array(array('1=1'))); //show all else $filters=array('custom'=>Array('1=2')); //show nothing } return $filters; } function reports_pass_options() { global $Sanitizer; $fields = array('host_id','client_id','interface_id','map_id','type_id','view_all'); $output=''; foreach ($fields as $field) { $field_value = $Sanitizer->get_string($field,FALSE); if ($field_value !== FALSE) $output .= hidden($field,$field_value); } $use_interfaces = $Sanitizer->get_string('use_interfaces',FALSE,TRUE); if (is_array($use_interfaces)) foreach ($use_interfaces as $value) $output .= hidden('use_interfaces[]',$value); return $output; } function adm_table_header($title, $init, &$span, $cols, $total_items = -1, $id = "", $show_add = true) { global $Sanitizer; global $filter, $host_id, $client_id, $map_id, $use_interfaces, $interface_id, $filter_field; if (!$span) $span = 20; $url = $Sanitizer->get_url('', array('use_interfaces', 'admin_structure','init','span'), array('filter' => $filter)); $url_init = $Sanitizer->get_url('', array('use_interfaces', 'admin_structure', 'span'), array('filter' => $filter)); $url_span = $Sanitizer->get_url('', array('use_interfaces', 'admin_structure', 'init'), array('filter' => $filter)); return table ($id, "admintable"). tag("thead"). tr_open("navigation"). tag("td", "", "", "colspan='$cols'"). html("span", $title, "title"). (($init > 0) ?control_button("First","_self", $url_init."&init=0","a-top.png"). control_button("Prev","_self",$url_init."&init=".($init-$span),"a-left.png") :control_button(" ","","","none"). control_button(" ","","","none")). ((($total_items == -1) || (($init+$span) < $total_items)) ?control_button("Next","_self", $url_init."&init=".($init+$span),"a-right.png") :control_button(" ","","","none")). ((($total_items == -1) || (($init+($span*3)) < $total_items)) ?control_button("3rd Next","_self", $url_init."&init=".($init+($span*3)),"a-right.png") :control_button(" ","","","none")). control_button("More","_self", $url_span."&span=".($span*2),"plus.png"). control_button("Less","_self", $url_span."&span=".round($span/2),"minus.png"). (($show_add)?control_button("Add","_self", $url."&action=add","new2.png"):""). (($filter || $host_id || $client_id || $map_id || $use_interfaces || $interface_id || $filter_field) ?control_button("UnFilter","_self", $Sanitizer->get_url('',array('admin_structure')), 'query.png') :control_button(" ","","","none")). ((strpos($_SERVER["SCRIPT_NAME"],"adm_standard.php")!==false) ?control_button("Export","_new",$url."&adm_view_type=ascii", "text.png") :control_button(" ","","","none")). tag_close("td"). tag_close("tr"). tag_close("thead"); } function adm_standard_edit_delete($id = NULL, $filter, $view_name = '') { global $Sanitizer; $url = $Sanitizer->get_url('','all', array('actionid' => $id, 'filter' => $filter), array('action')). '&action='; return tag('td', "action_$id", 'action'). control_button ('Edit','_self',$url.'edit','edit.png',"edit_$id").'  '. control_button ("Del","_self",$url."delete","delete.png","delete_$id", "return confirm('Are you sure you want to Delete record ID ".$id."');"). (($view_name!==false) ?control_button ((empty($view_name)?"View":$view_name),"_self",$url."view","query.png"):""). tag_close("td"); } function adm_standard_submit_cancel($submit_value = 'Submit', $cancel_value='Cancel') { return adm_form_submit($submit_value). tag ('input', '' ,'', " value='".$cancel_value."' type='button'". " OnClick='javascript: location = location+\"&action=list\";'", false); } function adm_frame_menu_split ($adm_name,$standard = 0) { if ($standard==1) $url = "adm/adm_standard.php?admin_structure=$adm_name&filter=".$GLOBALS["actionid"]; else $url = "adm/adm_$adm_name.php?filter=".$GLOBALS["actionid"]; adm_frame_menu ( "40%", urlencode("adm/".basename($_SERVER["SCRIPT_NAME"])."?".$_SERVER["QUERY_STRING"]."&action="), "60%", urlencode($url)); } function adm_frame_menu($size1,$url1,$size2,$url2) { global $Config; $url = $Config->get('jffnms_rel_path')."/admin/menu_frame.php?size1=$size1&scroll1=yes&name1=$url1&size2=$size2&scroll2=yes&name2=$url2"; echo script(" if ((parent.frames[1]) && (parent.frames[1].name!='work')) parent.location = '$url'; else document.location = '$url'; "); die(); } function adm_form($action = "",$method="POST",$target = "_self", $echo = true, $form_id = "") { global $SCRIPT_NAME, $id, $actionid; if (!isset($id)) $id = $actionid; $global_vars = array("init", "span", "filter","admin_structure","filter_field","filter_value","sf","so"); $result = form ($form_id, $SCRIPT_NAME, $method, $target). hidden("actionid",$id). (!empty($action)?hidden("action",$action):""); foreach ($global_vars as $var) if (isset($GLOBALS[$var])) $result .= hidden($var, $GLOBALS[$var]); if ($echo) echo $result; return $result; } ?> jffnms-0.9.3/lib/hosts_config_types.class.php0000644000175000017500000000025411730205357020616 0ustar csmallcsmall 'New Host Config Type'); public $jffnms_filter_record = 0; } ?> jffnms-0.9.3/lib/triggers.class.php0000644000175000017500000002656111716447477016563 0ustar csmallcsmall JFFNMS Authors * This program is licensed under the GNU GPL, full terms in the LICENSE file */ class JffnmsTriggers extends basic { var $jffnms_insert = array('description'=>'New Trigger'); // Triggers public function del($trigger_id) { //delete all rules $TriggersRules = new JffnmsTriggers_rules(); $TriggersRules->del_trigger($trigger_id); $TriggersUsers = new JffnmsTriggers_users(); $TriggersUsers->del_trigger($trigger_id); //delete the trigger if everthing is ok $rules = $TriggersRules->get_all(NULL, $trigger_id); $users = $TriggersUsers->get_all(NULL, NULL, $trigger_id); if (count($rules) == 0 && count($users) == 0) return db_delete('triggers',$trigger_id); return FALSE; } // del() public function get_all($ids = NULL, $fields=array()) { return get_db_list('triggers', $ids, array('triggers.*'), //table,ids,fields array(array('triggers.id','>',0)), //where array(array('triggers.id','asc')) ); //order } public function analyze($data_type, $data, $log_it = 1) { global $Config; $Interface_maps = new JffnmsMaps_interfaces(); $TriggersUsers = new JffnmsTriggers_users(); $old_script_name = $Config->get('logging_file'); #$Config->set('logging_file','triggers'); $query_rules = " SELECT triggers.id as trigger_id, triggers_rules.id as rule_id, triggers_rules.pos as rule_pos, triggers_rules.field, triggers_rules.operator, triggers_rules.value, triggers_rules.action_parameters, triggers_rules.stop as rule_stop, triggers_rules.and_or, actions.id as action_id, actions.command as action_command, actions.internal_parameters as internal_parameters FROM triggers_rules, triggers, triggers_users, actions WHERE triggers_users.trigger_id = triggers.id AND triggers_users.active = 1 AND triggers.type = '$data_type' AND triggers_rules.trigger_id = triggers.id AND triggers_rules.action_id = actions.id GROUP BY triggers_rules.id, triggers_rules.pos, triggers_rules.field, triggers_rules.operator, triggers_rules.value, triggers_rules.action_parameters, triggers_rules.stop, actions.id, actions.command, actions.internal_parameters, triggers.id, triggers_rules.and_or ORDER BY triggers.id asc, triggers_rules.pos asc, triggers_rules.id asc "; //logger($query_rules); $result_rules = db_query ($query_rules) or die ('Query failed - trigger_analyze('.$data['id'].') - '.db_error()); $stopped_triggers = array(); if ($log_it) if (db_num_rows($result_rules) > 0) logger(str_repeat('=',71)."\n"); while ($rule = db_fetch_array($result_rules)) { unset ($rule_field); unset ($eval_result); if (!array_key_exists($rule['trigger_id'], $stopped_triggers) || $stopped_triggers[$rule['trigger_id']]==0) //trigger rules are not over { if (($log_it) && (isset($old_trigger)) && ($old_trigger!=$rule['trigger_id'])) //debuging logger ("$data_type ".$data[id].": ".str_repeat("-",80)."\n"); $rule_field = $rule['field']; if ($rule_field == '') continue; //exceptions $test_modifier = NULL; if (array_key_exists('field', $rule) && !empty($rule['field'])) { if (strpos('date',$rule['field']) > -1) $test_modifier = 'time'; elseif (strpos('map',$rule['field']) > -1) $test_modifier = 'map'; } $test_value = $data[$rule_field]; switch($rule['field']) { case 'date': if (($data_type=='alarm') && ($rule['field']=='date')) { if (strtotime($data['date_stop']) > strtotime($data['date_start'])) $data['date']=$data['date_stop']; else $data['date']=$data['date_start']; } break; case 'map': $test_value = $rule['value']; $rule['value'] = join(',',$Interface_maps->maps($data['interface'])); $rule['operator']='IN'; //force IN break; case 'none': $eval_result = 0; break; case 'any': $eval_result = 1; break; default: #logger("Unknown trigger rule field type '$rule[field]', skipping.\n"); continue; } //switch if ($rule_field != 'none' && $rule_field != 'any') $eval_result = $this->test_operation ($test_value,$rule['operator'],$rule['value'],$test_modifier); if ($eval_result==1) //if the eval was true { if ($rule['rule_stop']==1) $stopped_triggers[$rule['trigger_id']]=1; if ($rule['action_id'] > 1) { $action_result = $this->action_execute($rule['action_command'],$rule['internal_parameters'].",".$rule['action_parameters'], $TriggersUsers->get_all(NULL,NULL,$rule['trigger_id'],1),$data_type,$data); # Update the alarm and set the triggered flag # To not sent out triggers for the same alarm twice db_update('alarms',$data['id'],$arr = array('triggered' => 1)); } else { $action_result = 0; } } else //if the eval was false if ($rule['and_or']==1) //and rule specified AND $stopped_triggers[$rule['trigger_id']]=1; //Stop this trigger //Logging & Debugging $log=array(); if (($rule_field!='none') && ($rule_field!='any')) $log[]="\tIf '".$rule['field']."(".substr($test_value,0,20).") ".$rule['operator']." ".$rule['value']."' ($eval_result)"; else $log[]="\tIf '".$rule['field']."' ($eval_result)"; if (($eval_result==1) && ($rule['action_id'] > 1)) $log[]="\tThen ".$rule['action_command']." ($action_result)"; if (array_key_exists('trigger_id', $stopped_triggers) && $stopped_triggers[$rule['trigger_id']]==1) $log[]="\tStop"; if ($log_it) logger ("$data_type ".$data['id'].": ". "\tT ".$rule['trigger_id']. " - P ".$rule['rule_pos']. " - R ".$rule['rule_id']. join("",$log)."\n"); } // not stopped $old_trigger = $rule['trigger_id']; $old_rule = $rule['rule_id']; }//while #$Config->set('logging_file', $old_script_name); } // analyze // private private function action_execute ($command, $parameters, $user_ids, $data_type, $data) { global $Config; $Interfaces = new JffnmsInterfaces(); $Events = new JffnmsEvents(); $Profiles = new JffnmsProfiles(); $TriggersUsers = new JffnmsTriggers_users(); if (!is_array($user_ids)) $user_ids=array($user_ids); $action_function = "action_$command"; $action_file = $Config->get('jffnms_real_path')."/engine/actions/$command.inc.php"; if (!in_array($action_file, get_included_files())) { if (!is_readable($action_file)) { logger("ERROR Action plugin '$action_file' is not readable.\n"); return FALSE; } require_once($action_file); } if (!function_exists($action_function)) { logger("ERROR Function '$action_function' not found in action plugin '$action_file'.\n"); return FALSE; } unset($parameters_array); unset($function_data); if ($data_type=='alarm') { if ($data['interface']) $function_data['interface']=current($Interfaces->get_all($data['interface'])); if ($data['referer_start']) $function_data['event']['start']=current($Events->get_all($data['referer_start'])); if ($data['referer_stop']) $function_data['event']['stop']=current($Events->get_all($data['referer_stop'])); if ($function_data['event']) krsort($function_data['event']); $function_data['alarm']=$data; //alarm data } if ($data_type=='event') { $function_data['event'][]=$data; if ($data['interface_id'] > 1) $function_data['interface']=current($Interfaces->get_all($data['interface_id'])); } $param_aux = explode(",",$parameters); foreach ($param_aux as $aux) if ($aux) { $pair = explode(':',$aux); //EXCEPTION 'from' handling, keep the last one if (($pair[0]=='from') && (!empty($pair[1]))) $parameters_array[$pair[0]]=''; if (!array_key_exists($pair[0], $parameters_array)) $parameters_array[$pair[0]] = ''; $parameters_array[$pair[0]] .=' '.$pair[1]; $parameters_array[$pair[0]] = trim($parameters_array[$pair[0]]); } if (is_array($parameters_array)) { $replacer=array('interface','alarm','event'); foreach ($replacer as $aux) if ($function_data[$aux]) //replace variables { if ($aux=='event') $data=current($function_data[$aux]); //take only last event else $data = $function_data[$aux]; if (is_array($data)) foreach ($data as $var_key=>$var_data) //every piece of data foreach ($parameters_array as $key=>$param) //every parameter $parameters_array[$key]=str_replace("<$aux-$var_key>",$var_data,$parameters_array[$key]); } } // parameters //debug ($parameters_array); $parameters_array_aux = $parameters_array; //save parameters before users loop $result=Array(); if (is_array($user_ids) && (count ($user_ids) > 0)) foreach ($user_ids as $user_id) if ($user_id > 1) { $user_id = $user_id['user_id']; $function_data['user'] = current($TriggersUsers->get_all($user_id)); //get user data if (is_array($parameters_array)) { $profile_options = $Profiles->get_all($user_id); foreach ($profile_options as $profile) //replace profile variables foreach ($parameters_array as $key=>$param) $parameters_array[$key]=str_replace("",$profile['values_value'],$param); } $function_data['parameters']=$parameters_array; //debug ($function_data); $result[]= call_user_func_array($action_function,array($function_data)); $parameters_array=$parameters_array_aux; //restore parameters } return join(',', $result); } //action_execute() private function test_operation ($value1, $op, $value2, $modifier = NULL) { $result = 0; if ($modifier == 'time') { $today = strtotime(substr($value1,0,10).' 00:00:00'); $value1 = strtotime($value1)-$today; //only take today hour } switch ($op) { case '=' : if ($value1 == $value2) $result = 1; break; case '!=' : if ($value1 != $value2) $result = 1; break; case '>' : if ($value1 > $value2) $result = 1; break; case '<' : if ($value1 < $value2) $result = 1; break; case '>=' : if ($value1 >= $value2) $result = 1; break; case '<=' : if ($value1 <= $value2) $result = 1; break; case 'IN' : if (in_array($value1,explode(',',$value2))) $result = 1; break; case '!IN': if (!in_array($value1,explode(',',$value2))) $result = 1;break; case 'C' : if (stristr($value1,$value2)!=false) $result = 1; break; case '!C' : if (stristr($value1,$value2)==false) $result = 1; break; } return $result; } //test_operation() } // class ?> jffnms-0.9.3/lib/nad.class.php0000644000175000017500000002141511525140075015446 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ class JffnmsNad { function get_data ($params = array()) { if (array_key_exists('zone', $params)) $zone_where = ' AND zones.id='.$params['zone']; else $zone_where = ''; $query_nad = " SELECT nad_networks.network, nad_networks.id as net_id, nad_ips.ip, nad_ips.dns, nad_hosts.id as host_id, nad_hosts.snmp_name, nad_hosts.description, nad_hosts.forwarding, nad_ips.type as if_type, nad_hosts.snmp_community, zones.id as zone, nad_hosts.date_added FROM nad_networks, nad_hosts, nad_ips, zones WHERE nad_ips.host = nad_hosts.id AND nad_ips.network = nad_networks.id and zones.id = nad_networks.seed AND nad_ips.id > 1 AND nad_hosts.id > 1 ". $zone_where. " ORDER BY nad_networks.network, nad_hosts.date_added desc, nad_hosts.id, nad_ips.ip "; $result_nad = db_query($query_nad); while ($rnad = db_fetch_array($result_nad)) { if (!isset($hosts[$rnad['host_id']])) $hosts[$rnad["host_id"]] = array( 'ips'=>array(), 'snmp_name'=>$rnad['snmp_name'], 'description'=>$rnad['description'], 'forwarding'=>$rnad['forwarding'], 'snmp_community'=>$rnad['snmp_community'], 'zone'=>$rnad['zone'], 'date_added'=>$rnad['date_added'] ); $ips[$rnad['ip']]['dns'] = $rnad['dns']; $ips[$rnad['ip']]['type'] = $rnad['if_type']; $hosts[$rnad['host_id']]['ips'][$rnad['network']][]=$rnad['ip']; $networks[$rnad['network']]['id']=$rnad['net_id']; $networks[$rnad['network']]['zone']=$rnad['zone']; $networks[$rnad['network']]['hosts'][] = $rnad['host_id']; $net_ids[$rnad['net_id']]=$rnad['network']; return array($hosts, $ips, $networks, $net_ids); } return FALSE; } function graph_host_id ($id, &$hosts) { return (($hosts[$id]['forwarding']==1)?'H':'I').$id; } function graph_host ($id, &$hosts, &$ips) { $idg = $this->graph_host_id($id, $hosts); $top = $hosts[$id]["snmp_name"]; $a = $hosts[$id]["ips"]; $b = @current($a); $c = @current($b); $bottom = $c; if (empty($top)) $top = $ips[$bottom]["dns"]; $top = current(explode(".",$top)); if (empty($top)) $top = "Host"; $text = "\t$idg\t[shape=record, label=\" { $top | $bottom } \", URL=\"$idg\", style=filled ". "color=". (($hosts[$id]["forwarding"]==1)?"black": "dodgerblue1").",". "fillcolor=". (($hosts[$id]["forwarding"]==1)?"mediumseagreen": "dodgerblue1").",". "fontcolor=". (($hosts[$id]["forwarding"]==1)?"black": "white"). "]"; return array($idg, $text); } function graph_net ($id, $name) { $idg = "N$id"; $text = "\tN$id\t[shape=doubleoctagon, label=\"$name\", URL=\"$idg\", color=black, style=filled, fillcolor=green]"; return array($idg, $text); } function graph_data ($graph) { global $Config; $graph_output = join("\n",array_unique($graph)); $neato_path = $Config->get('neato_executable'); $path_real = $Config->get('engine_temp_path'); $file = uniqid(rand()); $file_real = $path_real."/".$file; $file_dot = $file_real.".dot"; $file_cmap = $file_real.".cmap"; $file_real_png = $path_real."/".$file.".png"; $fp = fopen ($file_dot,"w+"); fputs($fp, $graph_output); fclose($fp); $command = "$neato_path -Tpng -o $file_real_png $file_dot"; exec($command); $command = "$neato_path -Tcmap -o $file_cmap $file_dot"; exec($command); $cmap = join("",file($file_cmap)); unlink($file_cmap); unlink($file_dot); $graph_data = join("",file($file_real_png)); return array($graph_data, $cmap); } function graph_init ($bgcolor = "white") { return array( "graph A { ratio=compress; overlap=false; center=true; bgcolor=$bgcolor; node [fontsize=8, width=0.25, height=0.125, fontname=Helvetica, fixedsize=false]; edge [fontname=Helvetica, labeldistance=3, labelfontsize=7]; "); } function graph_by_host ($hosts, $ips, $networks, $host_id="", $show_all = 0) { $hosts_ids = array(); if (isset($host_id)) $hosts1 = array($host_id=>$hosts[$host_id]); else $hosts1 = $hosts; if (is_array($hosts1)) while (list ($host_id, $host_data) = each ($hosts1)) if (($host_data["no_more"] < 1) && (count($host_data["ips"]) > 1)) foreach ($host_data["ips"] as $net=>$net_data) if (nad_get_bitmask($net) < 30) $host_cnx[$host_id]["networks"][$net]=1; else { $aux = $networks[$net]["hosts"]; if (count($aux)==2) { unset ($aux[array_search($host_id,$aux)]); $other_host_id = current($aux); if ((count($hosts[$other_host_id]["ips"]) > 1) || ($show_all==1)) { $host_cnx[$host_id]["hosts"][$other_host_id]=$net; if (!isset($hosts1[$other_host_id]) || ($show_all==1)) { $hosts1[$other_host_id] = $hosts[$other_host_id]; $hosts1[$other_host_id]["no_more"] = 1; $host_cnx[$other_host_id]=array(); } } } } if (is_array($host_cnx)) foreach ($host_cnx as $host_id=>$host_data) { list ($host_idg, $graph[]) = $this->graph_host($host_id, $hosts, $ips); if (isset($host_data["networks"])) foreach ($host_data["networks"] as $net=>$aux) { list($net_idg, $graph[]) = $this->graph_net($networks[$net]["id"],$net); $graph[] = "$host_idg -- $net_idg"; } if (isset($host_data["hosts"])) foreach ($host_data["hosts"] as $host2_id=>$net) $graph[] = "$host_idg -- ".$this->graph_host_id($host2_id, $hosts); } return $graph; } function graph_by_network (&$hosts, &$ips, &$networks, $network = '') { $hosts_ids = array(); $net_cnx[$network]=$networks[$network]; while (list ($net1,$aux1) = each ($net_cnx)) if ($aux1['no_more'] != 1) foreach ($aux1['hosts'] as $aux2=>$host_id) foreach ($hosts[$host_id]['ips'] as $net2=>$aux3) if ($net1!=$net2) if (($this->get_bitmask($net2) < 30) && ($net2!=$network)) $net_cnx[$net2]=array('hosts'=>array($host_id)); else { $net_cnx[$net2]['hosts'] = $networks[$net2]['hosts']; $net_cnx[$net2]['no_more']=1; } reset($net_cnx); foreach ($net_cnx as $net1=>$aux) if ($this->get_bitmask($net1)==30) { if (count($aux['hosts'])==2) { $h1 = $aux["hosts"][0]; $h2 = $aux["hosts"][1]; $graph[] = $this->graph_host_id($h1, $hosts).' -- '.$this->graph_host_id($h2, $hosts).' [headlabel=\'$net1\']'; $hosts_ids[$h1]=1; $hosts_ids[$h2]=1; } } else { list ($net1_idg, $graph[]) = $this->graph_net($networks[$net1]['id'], $net1); foreach ($aux["hosts"] as $host_id) { $graph[] = "$net1_idg -- ".$this->graph_host_id ($host_id, $hosts); $hosts_ids[$host_id]=1; } } foreach ($hosts_ids as $host_id=>$aux) list(,$graph[]) = $this->graph_host($host_id, $hosts, $ips); return $graph; } //naf_graph_by_network() function get_bitmask ($prefix) { list (,$mask) = explode ("/",$prefix); return $mask; } function graph_finish() { return array("}"); } function graph($params = array()) { if (!array_key_exists('data', $params) || !is_array($params['data'])) $params['data'] = $this->get_data(); if ($params['data'] === FALSE) return FALSE; list ($hosts, $ips, $networks, $net_ids) = $params["data"]; if (isset($params["net_id"])) $params["network"] = $net_ids[$params["net_id"]]; $graph_init = $this->graph_init($params["bgcolor"]); if (isset($params['network'])) $graph_core = $this->graph_by_network ($hosts, $ips, $networks, $params['network']); else $graph_core = $this->graph_by_host ($hosts, $ips, $networks, $params['host_id'], $params['view_all']); $graph_finish = $this->graph_finish(); if (count($graph_core)!=0) { $graph = array_merge($graph_init, $graph_core, $graph_finish); $output = $this->graph_data($graph); if ($params["get_data"]==true) $output[]=$params["data"]; return $output; } else return false; } } ?> jffnms-0.9.3/lib/hosts_configs.class.php0000644000175000017500000000432611730344040017552 0ustar csmallcsmall Javier Szyszlican :w * This program is licensed under the GNU GPL, full terms in the LICENSE file */ class JffnmsHosts_configs extends basic { function jffnms_class() { return 'hosts_config'; } function add($host_id=1) { return db_insert('hosts_config', array('config'=>'New Config', 'host'=>$host_id)); } // add function diff ($id1, $id2) { global $Config; if ($id1 != $id2) { $aux = $this->get_all(array($id1,$id2)); $str1 = $aux[0]['config']; $str2 = $aux[1]['config']; $engine_temp = $Config->get('engine_temp_path'); $name1 = $engine_temp.'/'.uniqid('').'.dat'; $name2 = $engine_temp.'/'.uniqid('').'.dat'; $pf = fopen($name1,'w'); fputs($pf,$str1); fclose($pf); $pf = fopen($name2,"w"); fputs($pf,$str2); fclose($pf); $diff_executable = $Config->get('diff_executable'); if (file_exists($diff_executable)) { $c = exec($diff_executable.' -Nru '.$name1.' '.$name2, $diff); unlink($name1); unlink($name2); $diff = join("\n",array_slice($diff, 3)); return $diff; } } return false; } function get_all($ids = NULL, $host_id=NULL, $init=NULL, $span=NULL, $where_special=NULL) { if (!is_array($where_special)) $where_special = array(); if (is_numeric($host_id)) $where_special[]=array('hosts.id','=',$host_id); if ($ids!= NULL) $order = 'asc'; else $order = 'desc'; return get_db_list( array('hosts_config','zones','hosts'), $ids, array('hosts_config.*', 'zone_description'=>'zones.zone', 'host_description'=>'hosts.name' ), array_merge( array( array('hosts.zone','=','zones.id'), array('hosts_config.host','=','hosts.id'), array('hosts_config.id','>','1')), $where_special), array ( array('hosts_config.date',$order), array('hosts.id','asc')), '',NULL,$init,$span ); } } // class JffnmsHosts_Config jffnms-0.9.3/lib/zones.class.php0000644000175000017500000000225211571316412016041 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ class JffnmsZones extends basic { public function get_all($ids = NULL) { return get_db_list( array('zones'), $ids, 'zones.*', array(array('zones.id','>','1')), array(array('zone','asc'))); } // get_all() public function add($filters=NULL) { return db_insert('zones',array('zone'=>'a New Zone','image'=>'unknown.png')); } // add() function update($id,$data) { return db_update('zones',$id,$data); } //update() function del($id) { $Hosts = new JffnmsHosts(); $zone_hosts = $Hosts->get_all(NULL,$id); foreach ($zone_hosts as $host) $Hosts->del($host['id']); $zone_hosts = $Hosts->get_all(NULL,$id); if (count($zone_hosts) == 0) return db_delete('zones', $id); return FALSE; } //del() public function status(&$Interfaces, $zone_id = NULL, $only_in_rootmap = 0) { return $Interfaces->status(NULL, array('zone'=>$zone_id,'in_maps'=>$only_in_rootmap)); } } //class ?> jffnms-0.9.3/lib/api.iad.inc.php0000644000175000017500000000344611741274236015670 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ // AUTODISCOVERY //=================================================================================== function iad_interfaces_from_db (&$Interfaces, $host_id,$type_id) { $db_interfaces = array(); $fields_types = array(); $aux = $Interfaces->get_all(NULL,array('host'=>$host_id,'type'=>$type_id,'with_field_type'=>1)); if (count($aux) > 0) { if (is_array($aux['field_types'][$type_id])) while (list($field,$fdata) = each ($aux["field_types"][$type_id])) if ($fdata['type']==3) { $index=$field; break; } if (!isset($index)) return $db_interfaces; unset ($field); unset ($fdata); unset ($aux['field_types']); reset ($aux); while (list(,$data) = each ($aux)) $db_interfaces[$data[$index]]=$data; } unset ($aux); return $db_interfaces; } function iad_interfaces_from_discovery ($function,$host_ip,$community,$host_id,$parameters) { global $Config; $real_function = "discovery_$function"; $function_file = $Config->get('jffnms_real_path')."/engine/discovery/$function.inc.php"; if (! in_array($function_file, get_included_files())) { if (!is_readable($function_file)) { logger("Discovery plugin file \"$function_file\" is not readable."); return FALSE; } require_once($function_file); } if (!function_exists($real_function)) { logger("Discovery function \"$real_function\" was not found in discovery plugin \"$function_file\"."); return FALSE; } $host = call_user_func_array($real_function,array($host_ip,$community,$host_id,$parameters)); return $host; } ?> jffnms-0.9.3/lib/sanitizer.class.php0000644000175000017500000000535211717643013016721 0ustar csmallcsmall Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ class Sanitizer { function get_string($tag, $default=FALSE, $force_array = FALSE) { return $this->get_val($tag, $default, $force_array, FILTER_SANITIZE_STRING, FILTER_FLAG_ENCODE_LOW|FILTER_FLAG_ENCODE_HIGH); } function get_special($tag, $default=FALSE, $force_array = FALSE) { return $this->get_val($tag, $default, $force_array, FILTER_UNSAFE_RAW, FILTER_FLAG_STRIP_HIGH); } private function get_val($tag, $default, $force_array, $filter, $filt_opts) { if (!array_key_exists($tag, $_REQUEST)) return $default; $value = $_REQUEST[$tag]; if (!is_array($value) && $force_array === FALSE) { return filter_var($value, $filter, $filt_opts); } $retval = array(); if (!is_array($value)) $value = array($value); foreach($value as $key => $item) { if (is_array($item)) $retval[$key] = filter_var_array($item, $filter); else $retval[$key] = filter_var($item, $filter, $filt_opts); } return $retval; } function get_int($tag, $default=FALSE, $force_array=FALSE) { return $this->get_val($tag, $default, $force_array, FILTER_SANITIZE_NUMBER_INT,0); } function get_url($base_url,$copy_tags=array(),$new_tags=FALSE, $del_tags=FALSE, $overwrite=TRUE) { $get_vars = array(); if (empty($base_url)) $base_url = $_SERVER['SCRIPT_NAME']; if (!is_array($copy_tags) && $copy_tags == 'all') $copy_tags = array_keys($_REQUEST); if (is_array($copy_tags)) { if (is_array($del_tags)) $copy_tags = @array_diff($copy_tags, $del_tags); if ($overwrite == TRUE && is_array($new_tags)) $copy_tags = array_diff($copy_tags, array_keys($new_tags)); } if (is_array($copy_tags)) { //$copy_tags = array_values($copy_tags); foreach($copy_tags as $tag) { $value = $this->get_string($tag,FALSE,FALSE); if ($value != NULL && $value !== FALSE) if (is_array($value)) array_push($get_vars, $tag.'='.implode(',',$value)); else array_push($get_vars, $tag.'='.$value); } } if (is_array($new_tags)) foreach($new_tags as $key => $value) { $fvalue = filter_var($value, FILTER_SANITIZE_ENCODED, FILTER_FLAG_STRIP_LOW|FILTER_FLAG_STRIP_HIGH); $fkey = filter_var($key, FILTER_SANITIZE_ENCODED, FILTER_FLAG_STRIP_LOW|FILTER_FLAG_STRIP_HIGH); array_push($get_vars, "$fkey=$fvalue"); } return $base_url.(count($get_vars>0)?'?'.join('&',$get_vars):''); } }; ?> jffnms-0.9.3/lib/interfaces.class.php0000644000175000017500000007530111726104656017042 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ class JffnmsInterfaces extends basic { public function get_by_field_value($host_id, $interface_type, $field_name, $field_value) { $query=" SELECT i.id as interface_id,i.interface as interface FROM interfaces_values iv, interface_types_fields itf, interfaces i WHERE iv.field=itf.id AND iv.interface=i.id AND itf.name='$field_name' AND itf.itype=$interface_type AND i.host=$host_id AND value='$field_value'"; $result=db_query($query) or die("Query failed ($query) - interfaces_get_id_by_field_value: ".db_error()); if(db_num_rows($result) > 0) { $row=db_fetch_array($result); return $row; } return array('interface'=>NULL,'interface_id'=>-1); } public function filter($filters = NULL) { $from = array(); $where = array(); $fields = array(); $index = NULL; $order = NULL; $interface_id_filter = 1; //debug ($filters); if (is_array($filters)) foreach ($filters as $filter_type=>$filter_value) if ($filter_value) switch ($filter_type) { //normal field matches case 'client': case 'host': case 'id': case 'type': $where[] = array("interfaces.$filter_type", '=', $filter_value); break; case 'interface': $where[] = array("interfaces.interface", '=', "'$filter_value'"); break; case 'zone': $where[] = array('hosts.zone','=',$filter_value); break; case 'map': if ($filter_value > 1) { $where[] = array('maps_interfaces.interface','=','interfaces.id'); $where[] = array('maps_interfaces.map','=',$filter_value); $from[] = 'maps_interfaces'; } break; case 'in_maps': if ($filter_value==1) $where[]=array("interfaces.show_rootmap","!=",0); break; case 'custom': if (is_array($filter_value)) $where=array_merge($where,$filter_value); break; case 'with_graph': $where[] = array('graph_types.type','=','interfaces.type'); $from[] = 'graph_types'; $fields['graph_type'] = 'graph_types.id'; $fields['graph_type_default'] = 'interface_types.graph_default'; $fields['graph_type_agg'] = 'graph_types.allow_aggregation'; $fields['graph_type_description'] = 'graph_types.description'; $fields['graph_type_graph1'] = 'graph_types.graph1'; $fields['graph_type_graph1_sx'] = 'graph_types.sizex1'; $fields['graph_type_graph1_sy'] = 'graph_types.sizey1'; $fields['graph_type_graph2'] = 'graph_types.graph2'; $fields['graph_type_graph2_sx'] = 'graph_types.sizex2'; $fields['graph_type_graph2_sy'] = 'graph_types.sizey2'; $index = 'no set index'; //dont summarize by ID break; case 'graph_fields': $where[]=array('interface_types.graph_default','=','graph_types.id'); $fields['have_graph'] ='interface_types.have_graph'; $fields['db_break_by_card'] ='interface_types.break_by_card'; $fields['default_graph'] ='graph_types.graph1'; $fields['have_tools'] ='interface_types.have_tools'; $from[]='graph_types'; break; //map connections id = 1, x and y, for view_interface with map case 'map_cnx': if ($filter_value > 1) { $fields['map_int_id'] = 'maps_interfaces.id'; $fields['map_x'] = 'maps_interfaces.x'; $fields['map_y'] = 'maps_interfaces.y'; $index = 'no set index'; //to allow map conexions id = 1 $interface_id_filter = 0; } break; //change order for view_interfaces case 'client_order': case 'map_order': if ($filter_value==1) $order = array( array('zones.zone'), array('hosts.name'), array('interfaces.type'), array('interfaces.interface')); break; //With Host Information case 'host_fields': $fields['host_rocommunity'] ='hosts.rocommunity'; $fields['host_rwcommunity'] ='hosts.rwcommunity'; $fields['host_satellite'] ='hosts.satellite'; break; case 'only_visible': if ($filter_value) { $where[] = array('interfaces.show_rootmap', '=', '1'); $where[] = array('hosts.show_host', '=', '1'); $where[] = array('zones.show_zone', '=', '1'); } break; } //switch $where[]=array('interfaces.id','>',$interface_id_filter); //filter interface id return array($where, $from, $fields, $index, $order); } // filter() public function alarms($ids = NULL, $filters = NULL, $alarm_filters = NULL, $start=FALSE, $stop=FALSE) { if (!is_array($ids)) $ids=array($ids); $now = date('Y-m-d H:i:s',time()); if ($start && $stop) //FIXME implement this { //finished between start and end for availability $fields = 'SELECT interfaces.id, alarms.id as alarm, alarms.date_start, alarms.date_stop, types.description as type, interfaces.show_rootmap,'; $alarms_filter = "(alarms.date_start > '$start' and alarms.date_stop < '$stop')"; $alarm_state_filter = "alarm_states.state = ".ALARM_UP." /* UP */"; $group = ''; $order = "ORDER BY interfaces.id, alarms.date_start, alarms.date_stop desc"; } else { //active alarms for maps $fields = 'SELECT interfaces.id as interface_id, alarm_states.description as alarm, alarm_states.activate_alarm as alarm_level, interfaces.show_rootmap, '. 'alarm_states.id as alarm_id, types.id as type_id, types.description as type, severity.bgcolor, severity.fgcolor, alarms.date_start, alarms.date_stop'; $alarms_filter = "(alarms.date_stop > '$now' /* SLAs */ or alarms.date_stop <= '0001-01-01 00:00:00' /* Not Ended */)"; $alarm_state_filter = 'alarm_states.state != '.ALARM_UP.' /* not UP */'; $group = 'GROUP BY interfaces.id, alarms.active, alarm_states.id, alarm_states.description, alarm_states.activate_alarm, interfaces.show_rootmap, '. 'types.id, types.description, severity.bgcolor, severity.fgcolor, alarms.date_start, alarms.date_stop'; $order = ''; } list ($where_special,$aux_from) = $this->filter($filters); $aux_from = join(', ',$aux_from); if (array_key_exists('only_active', $filters) && $filters['only_active']==1) $alarm_join_type = 'RIGHT'; //like a where, strict dont show record if it doesnt match else $alarm_join_type = 'LEFT OUTER'; //show null if not found $from = "FROM zones, hosts".(($aux_from!="")?", $aux_from":"").", interfaces"; $joins = "$alarm_join_type JOIN alarms on (alarms.interface = interfaces.id and interfaces.check_status = 1 and $alarms_filter)". 'LEFT OUTER JOIN types on (types.id = alarms.type)'. 'LEFT OUTER JOIN severity on (types.severity = severity.id)'. "LEFT OUTER JOIN alarm_states on (alarms.active = alarm_states.id and $alarm_state_filter)"; $where = "WHERE interfaces.id > 1 and interfaces.host = hosts.id and hosts.zone = zones.id"; if (is_array($where_special)) foreach ($where_special as $aux) $where .= ' and '.join($aux,' '); if (count($ids) > 0) { foreach ($ids as $id) if ($id) $where_ids_aux .= " or (interfaces.id = '$id')"; if (isset($where_ids_aux)) $where .= ' and ((1=2)'.$where_ids_aux.')'; } $query = "$fields \n$from \n$joins \n$where \n$group \n$order"; //debug($query); $result = db_query($query) or die ('Query Failed - Interface->alarms - '.db_error()); return $result; } //alarms() public function status($ids = NULL, $filters = NULL) { $result = $this->alarms ($ids, $filters); if (!isset($filters['alarms_summary'])) $filters['alarms_summary'] = 1; //Summary is Default if (!isset($filters['show_disabled'])) $filters['show_disabled'] = 1; //By Default Show Disabled Interfaces $summary = ($filters['alarms_summary']==1?true:false); $show_disabled = ($filters['show_disabled']==1?true:false); $status = array(); $all_status = array(); while ($res = db_fetch_array($result)) { //debug ($res); if (!$summary) if (array_key_exists($res['interface_id'], $all_status)) $status = $all_status[$res['interface_id']]; else $status = array(); //set total to 0 if (!array_key_exists('total', $status) || !array_key_exists('qty', $status['total'])) $status['total']['qty'] = 0; if ((($show_disabled) || ($res['show_rootmap']!=2)) //We're showing the disabled or interface is not disabled && (!empty($res['alarm']))) //Valid Interface Alarm { if (!array_key_exists($res['alarm'], $status)) $status[$res['alarm']] = array('qty'=>0); $status[$res['alarm']]['qty']++; $status[$res['alarm']]['alarm_level']=$res['alarm_level']; $status[$res['alarm']]['bgcolor']=$res['bgcolor']; $status[$res['alarm']]['fgcolor']=$res['fgcolor']; $status[$res['alarm']]['alarm_id']=$res['alarm_id']; $status[$res['alarm']]['type_id']=$res['type_id']; $status[$res['alarm']]['type']=$res['type']; $status[$res['alarm']]['start']=$res['date_start']; $status[$res['alarm']]['stop']=$res['date_stop']; } $status['total']['qty']++; //increment total anyway $status['total']['alarm_level']=255; $status['total']['bgcolor']='64FF64'; $status['total']['fgcolor']='000000'; $status['total']['alarm_id']=ALARM_UP; $status['total']['type_id']=1; ksort($status); //order so total is place at the end if (!$summary) $all_status[$res['interface_id']] = $status; }//while res if (!$summary) $status = $all_status; //debug ($status); return $status; } //status() public function is_up($interface_id) { $query = "select alarms.id from alarms, alarm_states where alarms.interface = '$interface_id' and alarms.active=alarm_states.id and alarm_states.state=".ALARM_DOWN; $result = db_query($query) or die ("Query Failed - Interfaces=>is_up - ".db_error()); $cant = db_num_rows($result); if ($cant == 0) return 1; return 0; } //is_up() public function get_all($ids = NULL, $filters = array(), $count = 0) { $index = "interfaces.id"; list ($where_special,$aux_from,$aux_fields, $aux_index, $aux_order) = $this->filter($filters); if ($aux_index) $index = NULL; $where = array_merge( array( array('zones.id','=','hosts.zone'), array('slas.id','=','interfaces.sla'), array('hosts.id','=','interfaces.host'), array('clients.id','=','interfaces.client'), array('pollers_groups.id','=','interfaces.poll'), array('interface_types.id','=','interfaces.type')), $where_special); if (is_array($aux_order)) $order = $aux_order; else $order = array ( array('interfaces.type','asc'), array('interfaces.interface','desc'), array('clients.name','asc')); $from = array_merge( array('interfaces','hosts','zones','slas','clients','pollers_groups','interface_types'), $aux_from); if (!$count) $fields = array_merge( array( 'interfaces.id', 'interfaces.host', 'interfaces.type', 'interfaces.sla', 'interfaces.client', 'interfaces.show_rootmap', 'interfaces.interface', 'interfaces.poll', 'interfaces.check_status', 'interfaces.make_sound', 'interfaces.creation_date', 'interfaces.modification_date', 'interfaces.last_poll_date', 'interfaces.rrd_mode', 'interfaces.poll_interval', 'host_name'=>'hosts.name', 'host_ip'=>'hosts.ip', 'host_show'=>'hosts.show_host', 'host_poll_interval'=>'hosts.poll_interval', 'client_name'=>'clients.name', 'client_shortname'=>'clients.shortname', 'sla_description'=>'slas.description', 'sla_threshold'=>'slas.threshold', 'poller_group_description'=>'pollers_groups.description', 'type_description'=>'interface_types.description', 'zone'=>'hosts.zone', 'zone_name'=>'zones.zone', 'zone_image'=>'zones.image', 'zone_show'=>'zones.show_zone', 'zone_shortname'=>'zones.shortname' ), $aux_fields); else { $fields = array("count($index) as cant"); $index = NULL; $order = NULL; } //debug($filters); debug ($fields); debug ($from); debug ($where); debug ($ids); debug ($order); $result = get_db_list($from, $ids, $fields, $where, $order, $index); if ($count) $result = current(current($result)); else if (count($result) > 0) { array_key_sort($result,convert_sql_sort($fields, $order)); if ($index!=NULL) $result = array_rekey($result, "id"); //Get Interface Fields Values $ids = array(); while (list ($id, $aux) = each ($result)) //get the ID of each returned interface if ($aux['id'] > 1) $ids[$aux['id']][]=$id; $data = $this->values(array_keys($ids),array('exclude_types'=>array(20))); while (list ($id, $aux) = each ($data['values'])) foreach ($ids[$id] as $id_real) $result[$id_real]=array_merge($result[$id_real],$aux); reset ($result); if (array_key_exists('with_field_type', $filters) && $filters['with_field_type']==1) $result = array_merge(array("field_types"=>$data["fields"]),$result); unset ($id_real); unset ($data); unset ($ids); unset ($aux); } //debug ($result); return $result; } //get_all() public function interface_count ($ids = NULL, $filters = NULL, $count = 0) { return $this->get_all($ids, $filters, 1); } function update($id,$interface_data) { global $Config; // Dont change mod date if we are updating last poll date if (key($interface_data)!='last_poll_date') $interface_data["modification_date"]=time(); //Fix for Make Sound Bool Value if (array_key_exists("make_sound",$interface_data) && empty($interface_data["make_sound"])) $interface_data["make_sound"]=0; if (array_key_exists("check_status",$interface_data) && empty($interface_data["check_status"])) $interface_data["check_status"]=0; $data = $this->values($id,array('exclude_types'=>20)); $fields = current($data['fields']); $values = current($data['values']); unset ($data); //debug ($interface_data); if (is_array($fields) && (count($fields) > 0)) { //Update Handler $field_data = current($fields); $update_function = $field_data['update_handler']; //debug ("Calling $update_function Handler"); $real_function = "handler_$update_function"; $function_file = $Config->get("jffnms_real_path")."/engine/handlers/$update_function.inc.php"; if (in_array($function_file,get_included_files()) || (file_exists($function_file) && (include_once($function_file)))) { if (function_exists($real_function)) call_user_func_array($real_function,array($id, &$interface_data,$values)); else logger("ERROR: Calling Function '$real_function' doesn't exists.
\n"); } else logger ("ERROR Loading file $function_file.
\n"); $interface_data = array_merge($values,$interface_data); //Field processing foreach ($fields as $field_name => $field_data) { $old_value = $values[$field_name]; $new_value = $interface_data[$field_name]; $update_function = $field_data['type_handler']; //debug ("Calling $update_function Handler for $field_name"); $real_function = "handler_$update_function"; $function_file = $Config->get('jffnms_real_path')."/engine/handlers/$update_function.inc.php"; if (in_array($function_file,get_included_files()) || (file_exists($function_file) && (include_once($function_file)))) { if (function_exists($real_function)) call_user_func_array($real_function,array($field_name,&$new_value)); else logger("ERROR: Calling Function '$real_function' doesn't exists.
\n"); } //Field Value Verification //debug ($field_data["id"].":$field_name: $old_value => $new_value"); if ($old_value!=$new_value) //different than before or default { if ($new_value == $field_data['default_value']) { $this->delete_value ($id,$field_data["id"]); } else { if ($old_value == $field_data["default_value"]) { //debug ("Adding $field_name to $new_value in interface $id field ".$field_data["id"]); $this->insert_value ($id,$field_data["id"],$new_value); } else { //debug ("Updating $field_name to $new_value in interface $id field ".$field_data["id"]); $this->update_value ($id,$field_data["id"],$new_value); } } } unset ($interface_data[$field_name]); //remove interface type fields from the global values } } //debug ($interface_data); $result = db_update('interfaces',$id,$interface_data); //update only remaining interface-table data if (key($interface_data)!='last_poll_date') //if we are not just updating the last poll date $this->adjust_rrd_max($id); // adjust the RRDs MAX values return $result; } //update() function del($id) { global $Config; $Maps_interfaces = new JffnmsMaps_interfaces(); //RRD Deletion $rrd_path = $Config->get('rrd_real_path'); $type_info = $this->get_type_info($id); if ($type_info['rrd_mode']==1) { $rrd_file = "$rrd_path/interface-$id.rrd"; if (file_exists($rrd_file)) $result["delete-rrd-$id"] = @unlink ($rrd_file); } else { $dss = $this->parse_rrd_structure($type_info["rrd_structure_def"]); foreach ($dss as $ds_name=>$ds_num) { $rrd_file = "$rrd_path/interface-$id-$ds_num.rrd"; if (file_exists($rrd_file)) $result["delete-rrd-$id-$ds_num"] = @unlink ($rrd_file); } unset ($dss); } unset ($type_info); $result["delete-values-$id"] = $this->delete_value($id); $result["delete-db-$id"] = db_delete("interfaces",$id); $result["delete-from-maps-$id"] = $Maps_interfaces->del_from_all($id); return $result; } //del() function add($host_data=NULL) { $host_data['creation_date'] = time(); return db_insert('interfaces',$host_data); } // Private functions - rrdtool public function get_type_info ($interface_id) { $query = " SELECT interface_types.id as type, interface_types.rrd_structure_step, interface_types.rrd_structure_res, interface_types.rrd_structure_rra, interface_types.graph_default, interfaces.rrd_mode FROM interfaces, interface_types WHERE interfaces.type = interface_types.id and interfaces.id = $interface_id"; $result = db_query($query) or die ("Query failed - IGT1 - ".db_error());; if (db_num_rows($result) == 1) { $register = db_fetch_array($result); //get RRD Structure from Interface Values $normal_data = $this->values($interface_id,array('exclude_types'=>20)); $normal_data = current($normal_data["values"]); $rrd_data = $this->values($interface_id,array('ftype'=>20)); $rrd_data = current($rrd_data["values"]); if (is_array($rrd_data)) { $register['rrd_structure_def'] = join(' ',$rrd_data); //This is just for Physical Interfaces, legacy if (isset($normal_data['bandwidthin'])) $normal_data['bandwidth'] = max($normal_data['bandwidthin'],$normal_data['bandwidthout']); foreach ($normal_data as $key=>$value) //replace variables for max in rrd $register['rrd_structure_def'] = str_replace("<$key>",$this->calculate_rrd_max($value),$register["rrd_structure_def"]); } return $register; } return FALSE; } //get_type_info private function calculate_rrd_max ($max) { $max = (($max * 1.5)/8)+1; //1.5 times the bigger bw in bytes, plus 1 return round($max); } private function adjust_rrd_max($interface_id) { global $Config; jffnms_load_api('rrdtool'); $info = $this->get_type_info($interface_id); if ($info == FALSE) return; $rrd_structure_def = explode(' ',trim($info['rrd_structure_def'])); $filename = $Config->get('rrd_real_path')."/interface-$interface_id.rrd"; if ((is_array($rrd_structure_def)) && (count($rrd_structure_def) > 0)) //if it has a RRD Structure and more than 1 DS foreach ($rrd_structure_def as $dsn=>$ds) { $aux = explode(':',$ds); $filename_ds = str_replace(".rrd","-$dsn.rrd",$filename); if ($info['rrd_mode']==1) $result[] = rrdtool_tune($filename,'-a '.$aux[1].':'.$aux[5]); if ($info['rrd_mode']==2) $result[] = rrdtool_tune($filename_ds,'-a data:'.$aux[5]); } } //interface_adjust_rrd_max() public function parse_rrd_structure($structure) { $dss_def = explode(" ",trim($structure)); foreach ($dss_def as $dsn=>$ds) { list (,$name) = explode (":",$ds); $dss[$name]=$dsn; } return $dss; } public function values($ids = NULL,$filters = array()) { $fields = array(); $values = array(); if (!is_array($ids)) $ids = array($ids); $ids = array_merge(array('1=2'),$ids); $ids_filter = '( '.join(' or i.id = ',$ids).' )'; $types_filter = ''; foreach ($filters as $filter_field => $filter_value) switch ($filter_field) { case 'exclude_types' : if (!is_array($filter_value)) $filter_value = array($filter_value); $filter_value=array_merge(array(""),$filter_value); $types_filter .= trim(join(' and ft.id != ',$filter_value)); break; case 'ftype' : $types_filter .= 'and ft.id = '.$filter_value; break; } $query= " SELECT ft.description as field_type_description, ft.handler, f.id as field_id, f.description, f.name, f.showable, f.overwritable, f.default_value, f.ftype, v.value, it.update_handler, it.autodiscovery_parameters, i.type, i.id FROM interface_types_field_types as ft INNER JOIN interface_types as it on (ft.id > 1 $types_filter) INNER JOIN interface_types_fields as f on (f.itype = it.id and f.ftype = ft.id) INNER JOIN interfaces as i on (it.id = i.type) LEFT OUTER JOIN interfaces_values as v on (v.interface = i.id and v.field = f.id) WHERE $ids_filter ORDER BY f.pos "; //debug ($query); $result = db_query ($query) or die ('Query Failed - interface_values() - '.db_error()); while ($r = db_fetch_array($result)) { $fields [$r['type']][$r['name']] = array( 'id'=>$r['field_id'], 'description'=>$r['description'], 'type'=>$r['ftype'], 'type_description'=>$r['field_type_description'], 'type_handler'=>$r['handler'], 'update_handler'=>$r['update_handler'], 'showable'=>$r['showable'], 'overwritable'=>$r['overwritable'], 'default_value'=>$r['default_value'], 'autodiscovery_parameters'=>$r['autodiscovery_parameters'], ); if ($r['value'] == NULL) $values[$r['id']][$r['name']] = $fields[$r['type']][$r['name']]['default_value']; else $values[$r['id']][$r['name']] = $r['value']; } return array('fields'=>$fields, 'values'=>$values); } //values() private function update_value ($interface, $field, $value) { if (!is_numeric($interface) || !is_numeric($field)) return FALSE; $query = "UPDATE interfaces_values SET value = '$value' WHERE interface=$interface AND field=$field"; return db_query($query) or die ("Query Error - ".db_error()); } private function insert_value ($interface, $field, $value) { if (!is_numeric($interface) || !is_numeric($field)) return FALSE; $query = "INSERT INTO interfaces_values (interface,field,value) VALUES ($interface,$field,'$value')"; return db_query($query) or die ("Query Error - ".db_error()); } // intert_value() private function delete_value ($interface, $field = NULL) { if (!is_numeric($interface)) return FALSE; $query = "DELETE FROM interfaces_values WHERE interface=$interface ".((is_numeric($field))?"AND field=$field":""); return db_query($query) or die ("Query Error - ".db_error()); } //FIXME merge this function with interfaces_status/interfaces_alarms because the SQL is repeated too many times function get_availability($ids, $date_from_unix, $date_to_unix, $alarm_types, $detail = 0) { $info = array('interfaces'=>array(), 'summary'=>array('interfaces'=>0) ); $time_span = 60; //span between alarms to be considered distinct $degraded = 30; //if the alarm lasted less than 30 seconds, it was degraded time, not unavailable $date_from = date("Y-m-d H:i:s",$date_from_unix); $date_to = date("Y-m-d H:i:s",$date_to_unix); $period = $date_to_unix - $date_from_unix; if ($period==0) $period = 1; //fix division problems period cannot be zero if (!is_array($ids)) $ids = array($ids); $interface_ids_filter=''; foreach ($ids as $id) if ($id) $interface_ids_filter .= " or interfaces.id = $id "; if (is_array($alarm_types)) if (current($alarm_types)!="SELECT_ALL") { $types_filter = " and ( 1=2 "; foreach ($alarm_types as $value) $types_filter.=" or alarms.type = $value"; $types_filter .=" )"; } $cant_types = count($alarm_types); $query= "\n Select interfaces.id, alarms.id as alarm,". "\n alarms.date_start, alarms.date_stop, types.description as type". "\n\n from interfaces \n". "\n LEFT OUTER JOIN alarms on (alarms.interface = interfaces.id) and ". "\n (alarms.date_start > '$date_from') and (alarms.date_stop < '$date_to')". "\n $types_filter ". "\n LEFT OUTER JOIN types on (types.id = alarms.type)". "\n LEFT OUTER JOIN alarm_states on (alarm_states.id = alarms.active and alarm_states.state = ".ALARM_UP.")"; if ($interface_ids_filter) $query .= "\n\n where ( 1=2 $interface_ids_filter)"; $query .= "\n order by interfaces.id, alarms.date_start, alarms.date_stop desc"; //debug ($query); $result = db_query ($query) or die ("Query failed - interface_get_availability() - ".db_error()); $data = array(); $unav = array(); $ok = 1; $old_id = 0; $total_seconds = 0; $total_degraded_seconds = 0; while ($ok == 1) { if (count($data) > 1) { if ($data['alarm']) { //we have an alarm $start_unix = strtotime($data['date_start']); $stop_unix = strtotime($data['date_stop']); $duration = $stop_unix - $start_unix; //calculate duration if ($duration > 1) { //valid duration if (($stop_unix > ($last+$time_span)) or ($cant_types == 1)) { if ($duration < $degraded) //unavailable time $total_degraded_seconds += $duration; $total_seconds+=$duration; //add duration of the alarm $last = $stop_unix; //take this alarm as the last one $counted = 1; } else $counted = 0; if ($detail==1) { //save detail data $detail_data = $data; $detail_data['duration'] = $duration; $detail_data['counted'] = $counted; $info['interfaces'][$data['id']]['detail'][]=$detail_data; } //outages raw array //Look for already used places and add a new key to not overwrite other values $i = 0; while (isset($unav["$start_unix-$i"])) $i++; $unav["$start_unix-$i"]="D"; $i = 0; while (isset($unav["$stop_unix-$i"])) $i++; $unav["$stop_unix-$i"]="U"; } } } $data = db_fetch_array($result) or $ok = 0; //read a new record if ($old_id != $data['id']) { //when the interface changes if ($old_id > 0) { // if we had an older id, consolidate $info['interfaces'][$old_id]['degraded_seconds'] = $total_degraded_seconds; $info['interfaces'][$old_id]['unavail_seconds'] = $total_seconds; $info['interfaces'][$old_id]['unavail_percent'] = round(($total_seconds*100)/$period,3); $info['summary']['interfaces']++; } //initialize variables $last=0; $total_seconds = 0; $total_degraded_seconds = 0; $old_id = $data['id']; } } list( $info['summary']['unavail_seconds'], $info['summary']['outages']) = $this->calculate_unavail_time($unav); $info['summary']['total_seconds']=$period; $info['summary']['unavail_percent'] = round(($info['summary']['unavail_seconds']*100)/$period,3); $info['summary']['unavail_percent_average'] = round($info['summary']['unavail_percent'] / $info['summary']['interfaces'],3); return $info; } function calculate_unavail_time($unav) { ksort($unav); $outages=0; $cant_outages=0; $total_duration = 0; $outages_data = array(); foreach ($unav as $date=>$data) { list ($date) = explode ("-",$date); //clean the date if ($data=="D") { if ($outages == 0) { //start outage $cant_outages++; $outages_data[$cant_outages][start]=$date; } $outages++; } else { $outages--; if ($outages == 0) { //end outage $outages_data[$cant_outages]['stop']=$date; $outages_data[$cant_outages]['duration']=$date-$outages_data[$cant_outages]['start']; $total_duration += $outages_data[$cant_outages]['duration']; //dont save data, FIXME in the future we could do some graph with this. unset($outages_data[$cant_outages]); } } if ($outages < 0) $outages = 0; //echo "$data: ".date("Y-m-d H:i:s",$date)." OUT: $outages Duration:".$outages_data[$cant_outages][duration]."
"; } if ($outages > 0) { //some events hanging $outages_data[$cant_outages]['stop']=$date; $outages_data[$cant_outages]['duration']=$date-$outages_data[$cant_outages]['start']; $total_duration += $outages_data[$cant_outages]['duration']; } //debug ($outages_data); //view_outage($outages_data); return array($total_duration,$outages_data); } } //class ?> jffnms-0.9.3/lib/journals.class.php0000644000175000017500000000202211475015613016535 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ class JffnmsJournals extends basic { public $jffnms_insert = array('subject'=>'New Journal'); //overwrite the default DB table mapping function jffnms_class() { return 'journal'; } function get_all($ids = NULL,$only_active = 1) { if ($only_active==1) $filter = array("journal.active","=",1); else $filter = array(); return get_db_list( array('journal'), $ids, array('journal.*'), array($filter,array('journal.id','>',2)), array(array('journal.id','desc')) ); } function update($id, $data, $comment_update = '') { $journal_data = current($this->get_all($journal_id)); $new_comment = $journal_data['comment']."\n".$comment_update; //merge old and new comments if (!$data['comment']) $data['comment'] = $new_comment; return db_update('journal',$id,$data); } } ?> jffnms-0.9.3/lib/tools.class.php0000644000175000017500000001400111462451061016035 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ class JffnmsTools extends basic { var $jffnms_class = "tools"; var $jffnms_insert = array("description"=>"New Tool","name"=>"none"); var $jffnms_filter_record = 0; var $jffnms_order_type = "asc"; function get_all ($ids = NULL, $filters = array()) { $where = array(); foreach ($filters as $field=>$value) switch ($field) { case 'itype': if (!empty($value)) $where[]=array('tools.itype','=',$value); break; case 'name': if (!empty($value)) $where[]=array('tools.name','=',"'$value'"); break; } //switch return get_db_list( array('tools','interface_types'), $ids, array('tools.*', 'itype_description'=>'interface_types.description' ) , array_merge( array( array('tools.itype','=','interface_types.id'), array('tools.id','>',1)), $where ), array( array('tools.itype','asc'), array('tools.pos','asc'), array('tools.description','desc'), array('tools.id','desc') )); } function info($tool_name) { global $Config; $data = $this->get_all(NULL,array('name'=>$tool_name)); $data = current($data); $file = (!empty($data['file_group'])?$data['file_group']:$data['name']); $real_function = 'tool_'.$data['name'].'_info'; $function_file = $Config->get('jffnms_real_path')."/engine/tools/$file.inc.php"; if (in_array($function_file,get_included_files()) || (file_exists($function_file) && (include_once($function_file)))) { if (function_exists($real_function)) { $result = call_user_func_array($real_function,array()); return $result; } else logger("ERROR: Calling Function '$real_function' doesn't exists.
\n"); } else logger ("ERROR Loading file $function_file.
\n"); return false; } function get(&$Interfaces, $tool_name,$id) { $data = $this->get_all(NULL,array('name'=>$tool_name)); $interface_data = ((is_numeric($id))?$Interfaces->get_all($id,array("host_fields"=>1)):$id); if (is_array($data) and (count($data)==1) && is_array($interface_data) && (count($interface_data)==1)) { $data = current($data); $interface_data = current($interface_data); $result = $this->get_real ($data,$interface_data); } else logger("ERROR: Bad Tool Name or Interface\n"); if (isset($result)) return $result; return false; } function tools_set(&$Interfaces, $tool_name,$id,$value,$username = "unknown",$reget = true) { $Events = new JffnmsEvents(); $data = $this->get_all(NULL,array('name'=>$tool_name)); if (is_array($data) and (count($data)==1)) { $data = current($data); if ($data['allow_set']==1) { $interface_data = ((is_numeric($id))?$Interfaces->get_all($id,array("host_fields"=>1)):$id); if (is_array($interface_data) && (count($interface_data)==1)) { $interface_data = current($interface_data); $result = tools_set_real ($data,$interface_data,$value); } else logger("ERROR: Bad Interface\n"); } else logger ("ERROR: Tool does not allow Setting.\n"); } else logger("ERROR: Bad Tool Name\n"); if (isset($result)) { //Event Creation $tool_event_type = 42; //FIXME Hard-Coded //Get a meaningful value to show in the event $tool_info = $This->info($data['name']); switch ($tool_info['type']) { case 'select': $value_info = $tool_info["param"][$value]; break; default: $value_info = $value; } $description= (isset($tool_info['description_label'])?$tool_info['description_label']:$data['description']); $value_info = (isset($tool_info['state_label']) ?$tool_info['state_label']:$value_info); $value_info .= (isset($tool_info['param']['label']) ?$tool_info['param']['label']:''); // add label to event value $Events->add(date('Y-m-d H:i:s',time()),$tool_event_type, $interface_data['host'],$interface_data['interface'],$value_info,$username,$description,'',0); //Return data to the caller return array($result,($reget==true)?$this->get($data['name'],array($interface_data)):NULL); } return false; } function tools_get_real ($tool_data,$interface_data) { global $Config; $file = (!empty($tool_data['file_group'])?$tool_data['file_group']:$tool_data['name']); $real_function = "tool_".$tool_data["name"]."_get"; $function_file = $Config->get('jffnms_real_path')."/engine/tools/$file.inc.php"; if (in_array($function_file,get_included_files()) || (file_exists($function_file) && (include_once($function_file)))) { if (function_exists($real_function)) $result = call_user_func_array($real_function,array($interface_data)); else logger("ERROR: Calling Function '$real_function' doesn't exists.
\n"); } else logger ("ERROR Loading file $function_file.
\n"); return $result; } function tools_set_real ($tool_data,$interface_data,$value) { $file = (!empty($tool_data['file_group'])?$tool_data['file_group']:$tool_data['name']); $real_function = 'tool_'.$tool_data['name'].'_set'; $function_file = $Config->get("jffnms_real_path")."/engine/tools/$file.inc.php"; if (in_array($function_file,get_included_files()) || (file_exists($function_file) && (include_once($function_file)))) { if (function_exists($real_function)) $result = call_user_func_array($real_function,array($interface_data,$value)); else logger("ERROR: Calling Function '$real_function' doesn't exists.
\n"); } else logger ("ERROR Loading file $function_file.
\n"); return $result; } } //class ?> jffnms-0.9.3/UPGRADE0000644000175000017500000000346111760060424013334 0ustar csmallcsmallThis file explains the upgrade procedure between versions: 0.9.2 to 0.9.3 ============== 0. You are adviced to upgrade your PHP and PostgreSQL (if you use that) versions before the upgrade, because some new features may need that. The new poller is still experimental, and its not enabled by default. Replace the with the actual path to the patch files, '../jffnms-upgrade-0.9.2-to-0.9.3' if you are using jffnms-upgrade-0.9.2-to-0.9.3.tar.gz or '/opt/jffnms-0.9.3/docs/upgrade' if you are using jffnms-0.9.3.tar.gz 1. Apply the code patch: # cd /opt/jffnms # patch -p1 < /jffnms-0.9.2-to-0.9.3.patch If you have not changed the code, there should not be any errors. Replace apache.apache with your HTTPd username and group (nobody, httpd, etc) 2. Upgrade the DB: MySQL: Backup in case of failure: # mysqldump --opt -ujffnms -pjffnms jffnms > /tmp/jffnms.backup.mysql Upgrade the MySQL Tables: # cat docs/upgrade/mysql/jffnms-0.9.2-to-0.9.3.mysql.diff* | mysql -u jffnms -pjffnms jffnms PgSQL: Backup in case of failure: # pg_dump -U jffnms jffnms -dROc > /tmp/jffnms.backup.pgsql Upgrade the PgSQL Tables: # cat docs/upgrade/pgsql/jffnms-0.9.2-to-0.9.3.pgsql.diff* | psql jffnms jffnms 3. Copy the new binary files: # cp -Rv /files/* /opt/jffnms/ 4. Change Ownership # chown -R apache:apache * OR if you used the new Instalation method: # chown -R jffnms:jffnms * And then re apply the permissions to the /opt/jffnms folder: # chmod -R ug+rw * 5. Verify Everything is ok: Go to the Setup page at http://youserver/jffnms/admin/setup.php (or the path you set) Check everything, make the corrections and SAVE the Configuration anyway. jffnms-0.9.3/engine/0002755000175000017500000000000011743375123013573 5ustar csmallcsmalljffnms-0.9.3/engine/ticket/0002755000175000017500000000000011716447477015072 5ustar csmallcsmalljffnms-0.9.3/engine/ticket/tiba.inc.php0000644000175000017500000000312411716447477017270 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //Custom Hooks for TIBA Trouble Ticket System (you can modify it to your TT) function ticket_tiba_create ($journal_data) { return ticket_tiba_internal("create",$journal_data); } function ticket_tiba_update ($journal_data) { return ticket_tiba_internal("update",$journal_data); } function ticket_tiba_internal ($action,$journal_data) { die ("Trouble Ticket System Plugin Not Configured"); $status = 0; $journal_data[action]=$action; $journal_data[active]=""; $journal_data[journal_id]=$journal_data[id]; $journal_data[id]=""; $journal_data[date_start]=""; $journal_data[date_stop]=""; if ($action=="update") { if ($journal_data[update]) $journal_data[comment]=""; //dont send full comment only update $journal_data[subject]=""; } $url = "http://ticket/toto.php?"; foreach ($journal_data as $key=>$aux) if (trim($aux)!="") $url.="&$key=".urlencode($aux); $data = implode ("", file ($url)); if ($data) { $status = 1; //var_dump ($data); $ticket = trim($data); } return array($status, $ticket); } function ticket_tiba_view ($journal_data) { $ticket = $journal_data[ticket]; $url = "http://ticket/link.php3?urlid=$ticket"; return array(NULL,$url); } ?> jffnms-0.9.3/engine/pollers/0002755000175000017500000000000011742411424015245 5ustar csmallcsmalljffnms-0.9.3/engine/pollers/reachability_end.php0000644000175000017500000000106511733710726021253 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_reachability_end ($options) { global $poller_buffer; global $Config; $temp_path = $Config->get('engine_temp_path'); $uniq = $poller_buffer['ping-'.$options['interface_id']]; //get file id from reachability_start $filename = "$temp_path/$uniq.log"; $result = NULL; if (file_exists($filename)) $result = unlink ($filename); return $result; } ?> jffnms-0.9.3/engine/pollers/snmp_counter.php0000644000175000017500000000124111733712263020473 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_snmp_counter ($options) { $oid = $options['poller_parameters']; $host_ip = $options['host_ip']; if (!$options['ro_community']) return FALSE; $value = trim(get_snmp_counter($options['host_ip'], $options['ro_community'], $oid)); if ($value === FALSE or $value == '') return $value; if ( ($pos = strpos($value,' ')) !==FALSE) $value = substr($value,0,$pos); return (str_replace(array('(',')'),'',$value)); } ?> jffnms-0.9.3/engine/pollers/no_poller.php0000644000175000017500000000036011716447477017766 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_no_poller ($options) { return 0; } ?> jffnms-0.9.3/engine/pollers/cisco_accounting.php0000644000175000017500000000272211716447477021313 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ // get Cisco IP Accounting Information // URL : http://www.cisco.com/en/US/tech/tk648/tk362/technologies_tech_note09186a0080094aa2.shtml // MIB: ftp://ftp.cisco.com/pub/mibs/v1/OLD-CISCO-IP-MIB.my function poller_cisco_accounting ($options) { $checkpoint_oid = ".1.3.6.1.4.1.9.2.4.11.0"; $accounting_packets_oid = ".1.3.6.1.4.1.9.2.4.9.1.3"; $accounting_bytes_oid = ".1.3.6.1.4.1.9.2.4.9.1.4"; $total_bytes = 0; $total_packets = 0; if (($options["host_ip"]) && (strlen($options["rw_community"]) > 3)) { $checkpoint_id = snmp_get($options["host_ip"],$options["rw_community"],$checkpoint_oid); $get_data = snmp_set($options["host_ip"],$options["rw_community"],$checkpoint_oid,"i",$checkpoint_id); //mark checkpoint to get new data //var_dump($get_data); if ($get_data) { $packets = snmp_walk($options["host_ip"],$options["rw_community"],$accounting_packets_oid); if (is_array($packets)) while (list(,$aux) = each($packets)) $total_packets += $aux; unset($packets); $bytes = snmp_walk($options["host_ip"],$options["rw_community"],$accounting_bytes_oid); if (is_array($bytes)) while (list(,$aux) = each($bytes)) $total_bytes += $aux; unset($bytes); } return "$total_bytes,$total_packets"; //return to buffer } else return -1; } ?> jffnms-0.9.3/engine/pollers/snmp_interface_status_all.php0000644000175000017500000000567111730074512023215 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //This poller stores all the table on an array and then request its contents, //this is faster if you are monitoring a lot of same-type interface in a host function poller_snmp_interface_status_all ($options) { // buffer->hid static $static_buffer = array(); static $buffer_age = 0; $hid = $options['host_id']; $buffer_max_age = 180; // 3 minutes of buffer $buffer_max_size = 20; // 20 hosts worth of data $min_iface_buffer = 30; // If device has 30 or more int, buffer it $snmp_col = $options['poller_parameters']; if (!$options['ro_community']) return FALSE; if (($options['poller_parameters']==7) && //If we're polling the Admin Status ($options['fixed_admin_status']==1)) //And the interface has specified that it does not want its admin status to be modified return FALSE; //Return nothing // Check freshnewss of buffer if ($buffer_age + $buffer_max_age < time()) { $static_buffer = array(); $buffer_age = time(); } // Fill static buffer if (!array_key_exists($hid, $static_buffer)) { // Check max size if (count($static_buffer) > $buffer_max_size) shift($static_buffer); $static_buffer[$hid]=array('number_of_interfaces' => snmp_get($options['host_ip'],$options['ro_community'],'.1.3.6.1.2.1.2.1.0')); } if ($static_buffer[$hid]['number_of_interfaces'] > $min_iface_buffer) { if (!array_key_exists($snmp_col, $static_buffer[$hid])) { $rets=snmp_walk($options['host_ip'],$options['ro_community'],'.1.3.6.1.2.1.2.2.1.'.$options['poller_parameters'],1); if (is_array($rets)) { $static_buffer[$hid][$snmp_col] = array(); foreach ($rets as $key=>$entry) { $key=explode('.',$key); $key=$key[count($key)-1]; $static_buffer[$hid][$snmp_col][$key]=$entry; } } } } $check_val = ''; if ($static_buffer[$hid]['number_of_interfaces'] > $min_iface_buffer) { if (!array_key_exists($options['interfacenumber'], $static_buffer[$hid][$snmp_col])) return FALSE; // No found in buffer $check_val = $static_buffer[$hid][$snmp_col][$options['interfacenumber']]; } else { $check_val = snmp_get($options['host_ip'],$options['ro_community'],'.1.3.6.1.2.1.2.2.1.'.$snmp_col.'.'.$options['interfacenumber']); } if ($check_val == '') return FALSE; list($check_val) = explode('(',$check_val); if (is_numeric($check_val)) //Process MIB Values switch ($check_val) { case '1' : $value = 'up'; break; case '2' : $value = 'down'; break; case '3' : $value = 'testing'; break; default : $value = 'down'; } else $value=$check_val; return $value; } ?> jffnms-0.9.3/engine/pollers/nut_status.php0000644000175000017500000000272211377440254020177 0ustar csmallcsmall Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_nut_status ($options) { $open_timeout = 10; $ip = $options['host_ip']; $upsname = $options['interface']; if ( ($skt = @fsockopen($ip, 3493, $errno, $errstr, $open_timeout)) == FALSE) { return -1; } $battery_status = 'battery normal'; $output_status = 'unknown'; fputs($skt, "LIST VAR $upsname\nLOGOUT\n"); while(!feof($skt)) { $line = fgets($skt, 1024); if (preg_match('/^VAR \S+\s+([a-z.]+)\s+\"([^"]+)\"/', $line, $regs)) { switch($regs[1]) { case 'ups.status': if (preg_match('/^(.*\s+|)(ONLINE|OL)(\s+.*|)$/', $regs[2])) { $output_status = 'on line'; } if (preg_match('/^(.*\s+|)OB(\s+.*|)$/', $regs[2])) { $output_status = 'on battery'; } if (preg_match('/^(LB|RB)$/', $regs[2])) { $battery_state = 'battery low'; } break; case 'input.voltage': $in_voltage = $regs[2]; break; case 'output.voltage': $out_voltage = $regs[2]; break; case 'ups.load': $load = $regs[2]; break; case 'ups.temperature': $temperature = $regs[2]; break; case 'battery.charge': $capacity = $regs[2]; break; } /* switch */ } /*preg match */ } /*while */ fclose($skt); return "$in_voltage|$out_voltage|$load|$temperature|$capacity|$battery_status|$output_status"; } jffnms-0.9.3/engine/pollers/cisco_saagent_backwardjitter.php0000644000175000017500000000202111734014460023631 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_cisco_saagent_backwardjitter($options) { if (empty($options['ro_community']) or !is_numeric($options['index'])) return FALSE; $sa_oid = '1.3.6.1.4.1.9.9.42.1.5.2.1'; $ip = $options['host_ip']; $comm = $options['ro_community']; $inst = $options['index']; if ( ($sumposds = snmp_get($ip, $comm, "$sa_oid.19.$inst")) === FALSE) return FALSE; if ( ($sumnegds = snmp_get($ip, $comm, "$sa_oid.24.$inst")) === FALSE) return FALSE; if ( ($nrposds = snmp_get($ip, $comm, "$sa_oid.18.$inst")) === FALSE) return FALSE; if ( ($nrnegds = snmp_get($ip, $comm, "$sa_oid.23.$inst")) === FALSE) return FALSE; $sum = $sumposds + $sumnegds; $nr = $nrposds + $nrnegds; $jitter=0; if ($nr > 0) $jitter = round($sum / $nr,2); return $jitter; } ?> jffnms-0.9.3/engine/pollers/tcp_status.php0000644000175000017500000000225511552703366020161 0ustar csmallcsmall JFFNMS authors * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_tcp_status ($options) { if ( ($host_info = resolve_host($options['host_ip'])) === FALSE) return 'error| |0'; list ($af,$ip,$hport) = $host_info; if ($af == 6) $ip="tcp://[$ip]"; //Get the Port using only the first numeric characters. $i = 0; $port = ''; while (is_numeric(substr($options['port'],$i,1))) $port .= substr($options['port'],$i++,1); $time_tcp = time_msec(); $fp = @fsockopen ($ip, $port, $errno, $errstr, 10); //try to connect $time_tcp = time_msec_diff($time_tcp); //save the delay of connection in milliseconds $time_tcp_secs = $time_tcp / 1000; //time tcp less the normal delay in seconds if (!$fp) { if (!empty($errstr)) logger ("$errstr ($errno):"); $status = 'closed'; $data = ''; } else { socket_set_blocking($fp,FALSE); //try to read for 1 second sleep(3); $data = preg_replace('/[^ -~]/', '', addslashes( trim (fgets ($fp,100)))); fclose ($fp); $status = "open"; } return "$status|$data|$time_tcp_secs"; } ?> jffnms-0.9.3/engine/pollers/cisco_saagent_fwpacketloss.php0000644000175000017500000000152611734015513023347 0ustar csmallcsmall Javier Szyszlican * Copyright (C) 2012 Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_cisco_saagent_fwpacketloss($options) { if (empty($options['ro_community']) or !is_numeric($options['index'])) return FALSE; $sa_oid = '1.3.6.1.4.1.9.9.42.1.5.2.1'; $ip = $options['host_ip']; $comm = $options['ro_community']; $inst = $options['index']; if ( ($fwpacketloss = snmp_get($ip, $comm, "$sa_oid.26.$inst")) === FALSE) return FALSE; if ( ($nr = snmp_get($ip, $comm, "$sa_oid.1.$inst")) === FALSE) return FALSE; $pktloss=0; if ($nr > 0) $pktloss = $fwpacketloss/($fwpacketloss+$nr)*100; return $pktloss; } ?> jffnms-0.9.3/engine/pollers/brocade_fcport_phystate.php0000644000175000017500000000175111734013301022646 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_brocade_fcport_phystate ($options) { $swFCPortPhyState = '1.3.6.1.4.1.1588.2.1.1.1.6.2.1.3'; $community = $options['ro_community']; $ip = $options['host_ip']; $inst = $options['poller_parameters']; if ($ip && $community && $inst) { $snmp_value = snmp_get($ip, $community, $swFCPortPhyState.".$inst"); switch ($snmp_value) { case 1: return 'down|No card present'; case 2: return 'down|No GBIC module'; case 3: return 'down|Laser Fault'; case 4: return 'down|No light received'; case 5: return 'down|Not in sync'; case 6: return 'up|In sync'; case 7: return 'down|Port marked faulty'; case 8: return 'down|Port locked to reference signal'; default: return "down|Unknown status $snmp_value"; } } return 'down'; } ?> jffnms-0.9.3/engine/pollers/reachability_values.php0000644000175000017500000000222011522432732021770 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_reachability_values ($options) { global $Config; global $poller_buffer; $fping_pattern = "/\S+ : xmt\/rcv\/%loss = (\S+)\/(\S+)\/\S+%(, min\/avg\/max = \S+\/(\S+)\/\S+|)/"; $temp_path = $Config->get('engine_temp_path'); $uniq = $poller_buffer['ping-'.$options['interface_id']]; //get file id from reachability_start $filename = "$temp_path/$uniq.log"; $which_value = $options['poller_parameters']; //Poller Parameter specifies which value to return $value = 0; if (file_exists($filename)) { $data = file($filename); //get last trimmed line of the fping result $data = trim(end($data)); if (preg_match($fping_pattern,$data,$parts)) switch ($which_value) { case 'rtt': if (!empty($parts[3])) $value = $parts[4]; // RTT Average break; case 'pl': $value = $parts[1] - $parts[2]; // Lost Packets = Sent Packets - Recv Packets break; } } return $value; } ?> jffnms-0.9.3/engine/pollers/apache.php0000644000175000017500000000254211716447477017222 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //Apache 2.0.x Example //Total Accesses: 2739 //Total kBytes: 11439 //CPULoad: .0303957 //Uptime: 403478 //ReqPerSec: .00678847 //BytesPerSec: 29.0314 //BytesPerReq: 4276.57 //BusyWorkers: 1 //IdleWorkers: 9 //Apache 1.3 Example //Total Accesses: 46283 //Total kBytes: 2886996 //CPULoad: 1.35633 //Uptime: 8276 //ReqPerSec: 5.59244 //BytesPerSec: 357212 //BytesPerReq: 63874.1 //BusyServers: 44 //IdleServers: 21 function poller_apache ($options) { $raw_data = file ("http://".$options["ip_port"]."/server-status?auto"); foreach ($raw_data as $line) { $pos = strpos($line, ":"); $field = str_replace(" ","",substr($line,0,$pos)); $value = substr($line, $pos+2, strlen($line)); $values[$field]=round(trim("0".$value),3); } //Fix for Apache 1.3.x, that calls the Workers, Servers if (isset($values["BusyServers"])) $values["BusyWorkers"] = $values["BusyServers"]; if (isset($values["IdleServers"])) $values["IdleWorkers"] = $values["IdleServers"]; return $values["TotalAccesses"]."|".$values["TotalkBytes"]."|".$values["CPULoad"]."|".$values["Uptime"]."|". $values["BytesPerReq"]."|".$values["BusyWorkers"]."|".$values["IdleWorkers"]; } ?> jffnms-0.9.3/engine/pollers/cisco_saagent_verify.php0000644000175000017500000000077211734017452022154 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_cisco_saagent_verify($options) { if ($options['ro_community'] == '') return FALSE; $numrtt = snmpget($options['host_ip'], $options['ro_community'], '.1.3.6.1.4.1.9.9.42.1.5.2.1.1.'.$options['index']); if ($numrtt === FALSE) return FALSE; return "UP|$numrtt"; } ?> jffnms-0.9.3/engine/pollers/verify_tc_class_number.php0000644000175000017500000000242511730077741022515 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_verify_tc_class_number ($options) { static $static_buffer = array(); static $buffer_age = 0; $buffer_max_len = 20; $buffer_max_age = 180; $linux_tc_oid = $options['autodiscovery_parameters']; if (empty($options['ro_community'])) return -1; // Check freshness of buffer if ($buffer_age + $buffer_max_age < time()) { $static_buffer = array(); $buffer_age = time(); } if (!array_key_exists($options['host_id'], $static_buffer)) { // Check max buffer size if (sizeof($static_buffer) > $buffer_max_len) array_shift($static_buffer); $static_buffer[$options['host_id']] = snmp_walk($options['host_ip'],$options['ro_community'], $linux_tc_oid.'.1.2',1); } if (is_array($static_buffer[$options['host_id']])) { $class_name = substr($options['interface'],strpos($options['interface'],'/')+1,strlen($options['interface'])); $oid_key = array_search($class_name,$static_buffer[$options['host_id']]); return current(array_reverse(explode ('.',$oid_key))); } return -1; } ?> jffnms-0.9.3/engine/pollers/cisco_snmp_ping_get_rtt.php0000644000175000017500000000120311470616555022664 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_cisco_snmp_ping_get_rtt ($options) { global $poller_buffer; $oid = ".1.3.6.1.4.1.9.9.16.1.1.1"; $interface_id = $options['interface_id']; $buffer_name = "cisco_snmp_ping_start-$interface_id"; if (!array_key_exists($buffer_name, $poller_buffer) || $poller_buffer[$buffer_name] !=2) return 0; $rtt=round(snmp_get($options['host_ip'],$options['rw_community'],"$oid.12.$options[random]$interface_id")); return $rtt; } ?> jffnms-0.9.3/engine/pollers/odbc_query.php0000644000175000017500000000170511716447477020135 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_odbc_query ($options) { $connection = odbc_connect ($options["dsn"], $options["username"], $options["password"]); if (is_resource($connection)) { $result = odbc_exec ($connection, $options["query"]); if (is_resource($result)) { $num_rows = odbc_num_rows($result); if (($num_rows == 1) or ($num_rows == -1)) { if (odbc_fetch_row($result,1)) $num_rows = odbc_result($result,1); //Current Value (if it was a Count(*) Query) else return -3; } if ($options["absolute"]==1) return "|".$num_rows; //Return the number of rows else return $num_rows."|"; //Return the number of rows } else return -2; // Query Failed. } else return -1; // Connection Failed. } ?> jffnms-0.9.3/engine/pollers/snmp_status_ibm.php0000644000175000017500000000225311377440254021174 0ustar csmallcsmall Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ /* * parameters: |=,=,.... * * is the SNMP OID to be polled * is the SNMP value to match * is the value returned if SNMP get equals valN * * If there is no match, then 'down' is returned. */ function poller_snmp_status_ibm ($options) { $community = $options['ro_community']; $ip = $options['host_ip']; list($oid, $valstr) = explode(',', $options['poller_parameters']); $match_pairs = explode('|', $valstr); if ($ip && $community && $oid && $valstr) { $snmp_value = (int) (snmp_get($ip, $community, $oid)); foreach($match_pairs as $match_pair) { list ($match_string, $return_value) = explode('=', $match_pair); if ($match_string==NULL || $return_value==NULL) { logger("The matching pair \"$match_pair\" is not in = format.\n"); return 'down'; } if ($match_string == $snmp_value) return $return_value; } } return 'down'; } ?> jffnms-0.9.3/engine/pollers/ibm_ds_storage.php0000644000175000017500000000677411466136206020760 0ustar csmallcsmall David LIMA * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_ibm_ds_storage ($options) { $smcli_bin=exec('which SMcli'); $sudo_bin=exec('which sudo'); $device=$options['poller_parameters']; $ip=$options['host_ip']; //debug($options); switch($device) { case 'controler': $smcli_cmd = "-S -e -c \"show storagesubsystem healthstatus;\""; $command = "$sudo_bin $smcli_bin $ip $smcli_cmd"; //$ip=str_replace(".","\.",$ip); $pattern = 'Storage Subsystem health status = optimal.'; exec($command,$output,$retval); //debug($retval); //debug($output); //FIXME add more checks to return status like: poller error $output = implode(",", $output); if (eregi($pattern,$output)) { $status=up; } else { //str_replace("The following failures have been found:,"," ",$output); $status="down| $output"; } return $status; break; case 'arrays': //FIXME: interface with: name, $smcli_cmd = "-e -c \"show storagesubsystem summary;\""; $command = "$smcli_bin $ip $ip2 $smcli_cmd"; $pattern = '/Number of arrays:\s+(\d+)/'; echo "Device type is $device\n"; exec($command,$output); //print_r($output); $output2=join("",$output); //var_dump($output2); preg_match($pattern,join("",$output),$matches); $nb_arrays=$matches[1]; echo "Number of arrays: "."$nb_arrays"."\n"; break; case 'drives': if ($smcli_bin === FALSE) return FALSE; $smcli_cmd = "-e -c \"show allDrives summary;\""; $command = "$smcli_bin $ip $ip2 $smcli_cmd"; $pattern = '/^\s{6}(\d+),\s+(\d+)\s+([aA-zZ]+)/'; $keyz=0; exec($command,$output); //var_dump($output); foreach ($output as $drivez) { if (preg_match($pattern,$drivez,$drive) == TRUE) { $keyz++; $interfaces[$index]=array ( 'interfaces' => "Drive ".$keyz, 'tray' => $drive[1], 'slot' => $drive[2], 'oper' => $drive[3]=="Optimal"?"up":"down", 'drv_idx' => $keyz, ); //var_dump($interfaces); } } break; case 'logdrives': if ($smcli_bin === FALSE) return FALSE; $smcli_cmd = "-e -c \"show allLogicalDrives;\""; $pattern = '/(\w+)\s+(\w+)\s+([0-9]*\,?[0-9]*\.?[0-9]*)\s[MKG]B\s+(\d+)\s+(\d+)$/'; $keyz=0; $command = "LANG=US $smcli_bin $ip $ip2 $smcli_cmd"; exec($command,$output); //print_r($output); foreach ($output as $line) { if (preg_match($pattern,$line,$logdrive) == TRUE) { //var_dump($logdrive); //fputs($fp,$keyz.";".$logdrive[1].";".$logdrive[2].";".$logdrive[3].";".$logdrive[4]."\n"); $interfaces[$index] = array ( 'interface' => $logdrive[1], 'logdrive_idx' => $keyz, 'oper' => $logdrive[2]=="Optimal"?"up":"down", 'capacity' => $logdrive[3], 'array' => $logdrive[4], ); //$index++; $keyz++; //print_r($interfaces); } } //fclose($fp); break; case 'drivesbad': //FIXME: interface with: name, $smcli_cmd = "-e -c \"show allDrives summary;\""; $command = "$smcli_bin $ip $ip2 $smcli_cmd"; $pattern = '/(\d+),\s+(\d+)\s+(\w+)\s+/'; exec($command,$output); //print_r($output); foreach ($output as $lines) { //echo "Traitement de ligne: ".$lines; preg_match_all($pattern,$lines,$matches); foreach ($matches as $index => $value) { $interfaces[$index] = array ( 'interface' => "Drive ".$index, 'tray' => $value[1], 'slot' => $value[2], 'oper' => $value[3], ); } } break; } return $interfaces ; } ?> jffnms-0.9.3/engine/pollers/hostmib_perf.php0000644000175000017500000000201011742411423020425 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //HOSTMIB Software Performance Poller //By: Javier Szyszlican //Based on the Status Poller By: Anders Karlsson function poller_hostmib_perf ($options) { global $Apps; $hid = $options['host_id']; $hrSWRunPerfEntry_oid = '.1.3.6.1.2.1.25.5.1.1'; $perf_oid = $hrSWRunPerfEntry_oid.'.'.$options['poller_parameters']; if (!array_key_exists('Apps', $GLOBALS)) return FALSE; $value = 0; if (array_key_exists($hid, $Apps) && is_array($Apps[$hid]['pids'][$options['interface']])) { //if we got something $pids = $Apps[$hid]['pids'][$options['interface']]; foreach ($pids as $pid) $value += intval(current(explode(' ',snmp_get($options['host_ip'], $options['ro_community'], $perf_oid.".$pid")))); } return $value; } ?> jffnms-0.9.3/engine/pollers/sql_status.php0000644000175000017500000000266511734017167020176 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_sql_status ($options) { global $poller_buffer; if (!array_key_exists('records_counter-'.$options['interface_id'], $poller_buffer) or !array_key_exists('records_absolute-'.$options['interface_id'], $poller_buffer)) return FALSE; $record_values = array( $poller_buffer['records_counter-'.$options['interface_id']], $poller_buffer['records_absolute-'.$options['interface_id']]); $records = is_numeric($record_values[0])?$record_values[0]:$record_values[1]; if ($records >= 0) { if (is_numeric($options['max_records']) && ($records > $options['max_records'])) return 'out of bounds|$records records is more than Max '.$options['max_records']; if (is_numeric($options['min_records']) && ($records < $options['min_records'])) return 'out of bounds|$records records is less than Min '.$options['min_records']; return 'ok|$records records is within boundaries'; } else { switch ($records) { case -1: $error = 'Problem connecting to the DB'; break; case -2: $error = 'Problem in Query'; break; case -3: $error = 'Problem in Data Retrival'; break; } return 'out of bounds|$error'; } } ?> jffnms-0.9.3/engine/pollers/verify_smokeping_number.php0000644000175000017500000000215711716447477022733 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_verify_smokeping_number($options) { //Check that required options are here if (!isset($options['interface']) || !isset($options['ro_community'])) return -1; $topdir = $options['ro_community']; $ifaces = array(); scan_dir($topdir, $ifaces); $ifnum = 0; foreach($ifaces as $key => $ifname) { if (preg_match('%^'.$topdir.'/(.*)\.rrd$%', $ifname, $regs)) { $ifnum++; if ($options['interface'] == $regs[1]) { return $ifnum; } } } return -1; } function scan_dir($parent, &$ifaces) { if (!is_dir($parent)) { return; } if ($dir = opendir($parent)) { while (($file = readdir($dir)) !== false) { if ($file == '.' || $file == '..') continue; if (is_dir($parent.'/'.$file)) { scan_dir($parent.'/'.$file, $ifaces); } else { if (preg_match('/\.rrd$/', $file)) { $ifaces[] = $parent.'/'.$file; } } } } } ?> jffnms-0.9.3/engine/pollers/snmp_status.php0000644000175000017500000000223711377440254020347 0ustar csmallcsmall Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ /* * parameters: |=,=,.... * * is the SNMP OID to be polled * is the SNMP value to match * is the value returned if SNMP get equals valN * * If there is no match, then 'down' is returned. */ function poller_snmp_status ($options) { $community = $options['ro_community']; $ip = $options['host_ip']; list($oid, $valstr) = explode(',', $options['poller_parameters']); $match_pairs = explode('|', $valstr); if ($ip && $community && $oid && $valstr) { $snmp_value = snmp_get($ip, $community, $oid); foreach($match_pairs as $match_pair) { list ($match_string, $return_value) = explode('=', $match_pair); if ($match_string==NULL || $return_value==NULL) { logger("The matching pair \"$match_pair\" is not in = format.\n"); return 'down'; } if ($match_string == $snmp_value) return $return_value; } } return 'down'; } ?> jffnms-0.9.3/engine/pollers/tcp_port_content.php0000644000175000017500000000624411733777712021365 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_tcp_port_content ($options) { global $poller_buffer; $buffer_name = $options['poller_parameters'].'-'.$options['interface_id']; if (!array_key_exists($buffer_name, $poller_buffer)) return FALSE; if ($options['check_content']!=1) return 'valid|not checked'; $tcp_data = $poller_buffer[$buffer_name]; $url=''; if (!empty($options['check_url'])) //we have a URL to check $url = $options['check_url']; else if (empty($tcp_data)) { //if didn't have data directly from TCP $allowed_protos = array('http','ftp','https','ftps'); //protos we can handle list ($proto, $param) = explode ('|',$options['description']); $proto_token = strpos($proto,'://'); if ($proto_token===FALSE) $proto_type = $proto; else $proto_type = substr($proto,0,$proto_token); if (in_array($proto_type, $allowed_protos)) $url = (($proto_token===FALSE)?"$proto_type://":$proto).$options["host_ip"].":".$options["port"].$param; } //Data Gathering //-------------- if (!empty($url)) { if (!array_key_exists('tcp_port_content', $poller_buffer)) $poller_buffer['tcp_port_content']=array(); if (!array_key_exists($url, $poller_buffer['tcp_port_content'])) $poller_buffer['tcp_port_content'][$url]= file($url); $data = $poller_buffer['tcp_port_content'][$url]; if (is_array($data)) $data = implode('',$data); } else $data = $tcp_data; //if we didn't have a URL then use the tcp data; //Analisis //-------- $valid = FALSE; if ($data!==FALSE) { //if we didn't had an error if (!empty($options['check_regexp'])) { //if we have a regular expression set, use it. if (strpos($options["check_regexp"],"\\")!==false) //if the user escaped its regexp take it like it is. $regexp = $options['check_regexp']; else //if he didn't then take it as a simple regexp (without grab) and escape it $regexp = preg_quote($options['check_regexp']); $regexp = "/$regexp/i"; //echo "REGEXP: $regexp\nDATA: $data\n"; //DEBUG if (preg_match($regexp,$data,$parts)==true) { //var_dump($parts); //DEBUG $valid = true; if (count($parts) > 1) //more parts means with grab, so take all the parts except the first one as the result $data = join(" ",array_slice($parts,1,count($parts))); } } else if (strlen($data) >= 60) // if we didn't have a Regular Expression to check, just check if its longer than 60 characters $valid = true; } if ($valid == true) return "valid|".substr(trim(strip_tags($data)),0,40); //return part of the valid data return 'invalid'; //has URL or TCP data, but data is invalid } ?> jffnms-0.9.3/engine/pollers/ups_line.php0000644000175000017500000000456011716447477017621 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_ups_line ($options) { $upstype = $options["upstype"]; switch($upstype) { case "ups": $UPSMIB = ".1.3.6.1.2.1.33"; //SNMPv2-SMI::mib-2.33 $upsInputs = $UPSMIB.".1.3.3.1"; //UPS-MIB::upsInputEntry $upsOutputs = $UPSMIB.".1.4.4.1"; //UPS-MIB::upsOutputEntry $multiplier = 1; break; case "ups_mitsu": $UPSMIB = ".1.3.6.1.4.1.13891.101"; $upsInputs = $UPSMIB.".3.3.1"; //Mitsubishi Diamondlink $upsOutputs = $UPSMIB.".4.4.1"; //Mitsubishi Diamondlink $multiplier = .1; //Mitsubishi returns voltage/current as 0.1 incriments break; } $upsInputsIndex = $upsInputs.".1"; $upsOutputsIndex = $upsOutputs.".1"; $upsInputVoltage = $upsInputs.".3"; $upsOutputVoltage = $upsOutputs.".2"; $upsInputCurrent = $upsInputs.".4"; $upsOutputCurrent = $upsOutputs.".3"; $upsInputPower = $upsInputs.".5"; $upsOutputPower = $upsOutputs.".4"; $upsOutputLoad = $upsOutputs.".5"; $input = ($options["line_type"]=="INPUT")?true:false; switch ($options["poller_name"]) { case "voltage" : $oid = ($input)?$upsInputVoltage:$upsOutputVoltage; $value = poller_ups_line_multiplier($options, $multiplier, $oid); break; case "current" : $oid = ($input)?$upsInputCurrent:$upsOutputCurrent; $value = poller_ups_line_multiplier($options, $multiplier, $oid); break; case "power" : if($upstype == "ups_mitsu") { //only get wattage on Mitsubishi UPS $oid = ($input)?$upsInputPower:$upsOutputPower; $value = poller_ups_line_nomultiplier($options, $oid); } break; case "load" : $oid = ($input)?false:$upsOutputLoad; $value = poller_ups_line_nomultiplier($options, $oid); break; } return $value; } function poller_ups_line_multiplier ($options, $multiplier, $oid) { if (!empty($oid)) { $oid .= ".".$options["line_index"]; $myvalue = snmp_get($options["host_ip"], $options["ro_community"], $oid); $value = ($myvalue * $multiplier); } return $value; } function poller_ups_line_nomultiplier ($options, $oid) { if (!empty($oid)) { $oid .= ".".$options["line_index"]; $value = snmp_get($options["host_ip"], $options["ro_community"], $oid); } return $value; } ?> jffnms-0.9.3/engine/pollers/cisco_saagent_rtl.php0000644000175000017500000000145511734015533021446 0ustar csmallcsmall Javier Szyszlican * Copyright (C) 2012 Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_cisco_saagent_rtl($options) { if (empty($options['ro_community']) or !is_numeric($options['index'])) return FALSE; $sa_oid = '1.3.6.1.4.1.9.9.42.1.5.2.1'; $ip = $options['host_ip']; $comm = $options['ro_community']; $inst = $options['index']; if ( ($rtlsum = snmpget($ip, $comm, "$sa_oid.2.$inst")) === FALSE) return FALSE; if ( ($rtlnum = snmpget($ip, $comm, "$sa_oid.1.$inst")) === FALSE) return FALSE; $rtl = 0; if ($rtlnum > 0) $rtl = $rtlsum / $rtlnum; return $rtl; } ?> jffnms-0.9.3/engine/pollers/internal.php0000644000175000017500000000064111716447477017613 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //This poller just takes a parameter and returns it to the backend //Currently used to send the Last Poll Date to the db backend function poller_internal ($options) { return $options["poller_parameter"]; } ?> jffnms-0.9.3/engine/pollers/ups.php0000644000175000017500000000317711716447477016615 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_ups ($options) { $upstype = $options["upstype"]; switch($upstype) { case "ups": $UPSMIB = ".1.3.6.1.2.1.33"; //SNMPv2-SMI::mib-2.33 $chargeRemaining = $UPSMIB.".1.2.4.0"; $minutesRemaining = $UPSMIB.".1.2.3.0"; $status = $UPSMIB.".1.2.1.0"; $temperature = $UPSMIB.".1.2.7.0"; break; case "ups_mitsu": $UPSMIB = ".1.3.6.1.4.1.13891.101"; $chargeRemaining = $UPSMIB.".2.4.0"; $minutesRemaining = $UPSMIB.".2.3.0"; $status = $UPSMIB.".2.1.0"; $temperature = $UPSMIB.".2.7.0"; break; } switch ($options["poller_name"]) { case "charge_remaining": $value = poller_ups_getvalue($options, $chargeRemaining); break; case "minutes_remaining": $value = poller_ups_getvalue($options, $minutesRemaining); break; case "temperature": $value = poller_ups_getvalue($options, $temperature); break; case "status": $value = poller_ups_batterystatus($options, $status); break; } return $value; } function poller_ups_getvalue ($options, $oid) { if (!empty($oid)) { $value = snmp_get($options["host_ip"], $options["ro_community"], $oid); } return $value; } function poller_ups_batterystatus ($options, $oid) { if (!empty($oid)) { $value = snmp_get($options["host_ip"], $options["ro_community"], $oid); } $battery_status = array (1=>"battery unknown", 2=>"battery normal", 3=>"battery low", 4=>"battery depleted"); return $battery_status[$value]; } ?> jffnms-0.9.3/engine/pollers/cisco_snmp_ping_start.php0000644000175000017500000000337111733714651022357 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //uses CISCO-PING-MIB //Check if your IOS version supports it in: http://tools.cisco.com/ITDIT/MIBS/servlet/com.cisco.itdit.mibs.mainServlet function poller_cisco_snmp_ping_start ($options) { $ping_count = $options['pings']; $peer = $options['peer']; $host_ip = $options['host_ip']; $rw_community = $options['rw_community']; $interface_id = $options['interface_id']; $random = $options['random']; $result = -5; $oid = '.1.3.6.1.4.1.9.9.16.1.1.1'; if ($peer == '' || $host_ip == '' || $rw_community == '' || $ping_count <= 0) return -1; $octects = explode('.',$peer); $hex = ''; foreach ($octects as $octect) $hex .= dec2hex($octect); $set_oids = array( array('16', 'i', '5'), //create array('15', 's', "PING-$interface_id"), //name array('2', 'i', 1), //tipo ip array('3', 'x', $hex), //ip en hex array('4', 'i', $ping_count), array('5', 'i', 64), //size ); if (snmp_set($host_ip,$rw_community,"$oid.16.$random$interface_id","i","6")) //destroy { foreach($set_oids as $set_oid) { if (snmp_set($host_ip,$rw_community, $oid.'.'.$set_oid[0].$random.$interface_id, $set_oid[1], $set_oid[2]) === FALSE) { logger("ERROR: Ping not ready", 0); return -1; } } //foreach if (($result = snmp_get($host_ip,$rw_community,"$oid.16.$random$interface_id"))==2) //2 si esta listo { snmp_set($host_ip,$rw_community,"$oid.16.$random$interface_id","i",1); //activarlo return $result; } } return $result; } ?> jffnms-0.9.3/engine/pollers/livingston_serial_port_status.php0000644000175000017500000000237611716447477024210 0ustar csmallcsmall Thomas Mangin * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_livingston_serial_port_status ($options) { global $pm3; $option = $options["poller_parameters"]; // idle 1 // connecting 2 // established 3 // disconnecting 4 // command 5 // noservice 6 $oid_activity = ".1.3.6.1.4.1.307.3.2.1.1.1.8"; $oid_name = ".1.3.6.1.4.1.307.3.2.1.1.1.2"; if (!is_array($pm3["lines"])) $pm3["lines"] = snmp_walk($options["host_ip"],$options["ro_community"],$oid_activity); if (!is_array($pm3["names"])) $pm3["names"] = snmp_walk($options["host_ip"],$options["ro_community"],$oid_name); $lines = $pm3["lines"]; $names = $pm3["names"]; $total_ports = 0; $selected_ports = 0; if (is_array($lines)) foreach ( $lines as $line ) { if ( $line == $option and (strpos($names[$total_ports],"S") !== false) ) $selected_ports ++; //echo "line: $line, name: ".$names[$total_ports].", looking: $option, ports: $total_ports, sel: $selected_ports\n"; $total_ports ++; } // debug($selected_ports); return $selected_ports; } ?> jffnms-0.9.3/engine/pollers/db.php0000644000175000017500000000060211716447477016361 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_db ($options) { list ($field,$option) = explode (",",$options["poller_parameters"]); $value = $options[$field]; if ($option=="to_bytes") $value = $value / 8; return $value; } ?> jffnms-0.9.3/engine/pollers/ntp_client.php0000644000175000017500000000172511733712572020130 0ustar csmallcsmall JFFNMS Authors * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_ntp_client ($data) { global $Config; $ntp_command = $Config->get('ntpq_executable'); if (!is_executable($ntp_command)) return FALSE; exec($ntp_command.' -p '.$data['host_ip'].' 2>/dev/null',$raw_result); if (count($raw_result)<=2) return 'unsynchronized'; unset($raw_result[0]); unset($raw_result[1]); $statuses = array(); foreach ($raw_result as $line) { if (preg_match('/^[*#]([a-z0-9.-]+)\s+\S+\s+(\d+)\s+(\S+)/',$line, $regs)) { if ($regs[3] != 'l' or $regs[2] == 0) //not local clock or is 0 stratum return "synchronized|with $regs[1]"; } } return 'unsynchronized'; } ?> jffnms-0.9.3/engine/pollers/tcp_connection_number.php0000644000175000017500000000366011733763212022343 0ustar csmallcsmall JFFNMS Authors * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //Read the tcp.tcpConnTable.tcpConnEntry.tcpConnState table to find out //which ports are used in the host function poller_tcp_connection_number ($options) { static $static_buffer = array(); static $buffer_age = 0; $buffer_max_len=20; // 20 hosts of details $buffer_max_age=180; // 3 minutes of buffer $port = $options['port']; $hid = $options['host_id']; if ($options['ro_community'] =='') return FALSE; if ($buffer_age + $buffer_max_age < time()) { $static_buffer = array(); $buffer_age = time(); } if (!array_key_exists($hid, $static_buffer) or count($static_buffer[$hid])==0) { if (sizeof($static_buffer) > $buffer_max_len) array_shift($static_buffer); // Fill the static buffer with port counts $snmp_table = snmp_walk ($options['host_ip'],$options['ro_community'],'.1.3.6.1.2.1.6.13.1.1',1); if (!is_array($snmp_table)) return 0; reset($snmp_table); $static_buffer[$hid]=array(); foreach ($tcpConnEntry as $key => $state) if (strpos($state,'5')!==FALSE) { //only established $entry = explode('.',$key); $entry = array_slice ($entry, count($entry)-10,10); //get only the last 10 items (SRC-IP(4) + srcport + DEST-IP(4) + destport) $entry_port = $entry[4]; //srcport (local) if (array_key_exists($entry_port,$static_buffer[$hid])) $static_buffer[$hid][$entry_port]++; else $static_buffer[$hid][$entry_port]=1; }//state==5 }//buffer doesnt have hid if (array_key_exists($hid, $static_buffer) and array_key_exists($port, $static_buffer[$hid])) return $static_buffer[$hid][$port]; return 0; } ?> jffnms-0.9.3/engine/pollers/verify_interface_number.php0000644000175000017500000000646111730075242022660 0ustar csmallcsmall Javier Szyszlican * Copyright (C) 2012 Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_verify_interface_number ($options) { static $static_buffer = array(); static $buffer_age = 0; $buffer_max_len=20; // 20 hosts of details $buffer_max_age=180; // 3 minutes of buffer require_once(jffnms_shared('catos')); require_once(jffnms_shared('webos')); $ifIndex_oid = '.1.3.6.1.2.1.2.2.1.1'; $current_ifindex = $options['interfacenumber']; if (empty($options['ro_community'])) return -1; $rocommunity = $options['ro_community']; $ip = $options['host_ip']; $hid = $options['host_id']; # If the interface has no IP address then we need to search by name if (($options['address']=='')) { // Check freshness of buffer if ($buffer_age + $buffer_max_age < time()) { $static_buffer = array(); $buffer_age = time(); } if (!array_key_exists($hid, $static_buffer)) { if (sizeof($static_buffer) > $buffer_max_len) array_shift($static_buffer); $ifIndex = snmp_walk($options['host_ip'],$options['ro_community'],$ifIndex_oid); include_once(jffnms_shared('catos')); if (is_catos($options['host_ip'], $options['ro_community'])) $ifDescr_oid = CATOS_IFDESCR_OID; else $ifDescr_oid = '.1.3.6.1.2.1.2.2.1.2'; $ifDescr = snmp_walk($options['host_ip'],$options['ro_community'],$ifDescr_oid); if (is_array($ifIndex) && count($ifIndex) > 0 && is_array($ifDescr) && count($ifDescr) > 0) { $static_buffer[$hid] = array('ifIndex'=>$ifIndex, 'ifDescr'=>$ifDescr); } else { return -1; //snmpwalk failed } } if ($current_ifindex != '') { $pos = array_search($current_ifindex, $static_buffer[$hid]['ifIndex']); if (is_numeric($pos) && array_key_exists($pos, $static_buffer[$hid]['ifDescr'])) { $polled_ifdescr = $static_buffer[$hid]['ifDescr'][$pos]; if (strncmp($polled_ifdescr, $options['interface'],30)==0) return $current_ifindex; // we found it } } // If not matched, then its changed, find new index $pos = array_search($options['interface'],$static_buffer[$hid]['ifDescr']); //Find the DB interface name and return the index if (is_numeric($pos) and array_key_exists($pos, $static_buffer[$hid]['ifIndex'])) //if we found something return $static_buffer[$hid]['ifIndex'][$pos]; //return the ifIndex at the same position we found this } else //Search by IP Address if (strpos($options['address'],'.') === FALSE) // if the address is not an IP, use that as the IfIndex { return $options['address']; } else //If its an IP Address return snmp_get($options['host_ip'],$options['ro_community'], //Get the interface index '.1.3.6.1.2.1.4.20.1.2.'.$options['address']); //by looking up the IP return -1; } ?> jffnms-0.9.3/engine/pollers/snmp_walk_average.php0000644000175000017500000000106411734017107021443 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_snmp_walk_average ($options) { $oid = $options["poller_parameters"]; if (empty($options['ro_community'])) return FALSE; $average=FALSE; $values = snmp_walk ($options['host_ip'],$options['ro_community'],$oid); if (is_array($values) && count($values) > 0) $average = array_sum($values)/count($values); return $average; } ?> jffnms-0.9.3/engine/pollers/cisco_snmp_ping_end.php0000644000175000017500000000120711733716700021761 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_cisco_snmp_ping_end ($options) { $peer = $options['peer']; $host_ip = $options['host_ip']; $rw_community = $options['rw_community']; $interface_id = $options['interface_id']; $oid = '.1.3.6.1.4.1.9.9.16.1.1.1'; if ($peer == '' || $host_ip == '' || $rw_community == '' ) return -1; if (snmp_set($host_ip,$rw_community,"$oid.16.$random$interface_id","i","6") !== FALSE) return 1; else return -1; } ?> jffnms-0.9.3/engine/pollers/cisco_snmp_ping_get_pl.php0000644000175000017500000000152211470616467022474 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_cisco_snmp_ping_get_pl ($options) { global $poller_buffer; $oid = '.1.3.6.1.4.1.9.9.16.1.1.1'; $host_ip = $options['host_ip']; $rw_community = $options['rw_community']; $random = $options['random']; $interface_id = $options['interface_id']; $buffer_name = "cisco_snmp_ping_start-$interface_id"; if (!array_key_exists($buffer_name, $poller_buffer) || $poller_buffer[$buffer_name] != 2) return 0; $cant_send = get_snmp_counter($host_ip,$rw_community,"$oid.9.$random$interface_id"); $cant_recv = get_snmp_counter($host_ip,$rw_community,"$oid.10.$random$interface_id"); $pl = $cant_send - $cant_recv; return $pl; } ?> jffnms-0.9.3/engine/pollers/reachability_start.php0000644000175000017500000000163211733717303021640 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_reachability_start ($options) { global $Config; $temp_path = $Config->get('engine_temp_path'); $uniq=FALSE; if ( ($host_info = resolve_host($options['host_ip'])) === FALSE) return FALSE; list ($af, $ip, $port) = $host_info; if ($af == 6) $fping = $Config->get('fping6_executable'); else $fping = $Config->get('fping_executable'); $num_ping = $options['pings']; $interval = $options['interval']; if (file_exists($fping) && ($num_ping > 0) && ($interval > 10)) { $uniq = uniqid(''); $filename = "$temp_path/$uniq.log"; $command = "$fping -c $num_ping -p $interval -q $ip > $filename 2>&1 &"; exec($command); //FIXME check if it is running } return $uniq; } ?> jffnms-0.9.3/engine/pollers/snmp_ibm_temperature.php0000644000175000017500000000101611734016711022174 0ustar csmallcsmall David LIMA * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_snmp_ibm_temperature ($options) { $oid = $options['poller_parameters']; if (empty($options['ro_community'])) return FALSE; $snmp_value = (snmp_get($options['host_ip'],$options['ro_community'],$oid)); if ( preg_match('{[+|-](\d+)}',$snmp_value,$matches)) return $matches[1]; return FALSE; } ?> jffnms-0.9.3/engine/pollers/pdu_banks.php0000644000175000017500000000163211716447477017746 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file * Chris Wopat - me@falz.net Jan 2006 */ function poller_pdu_banks ($options) { $PDUMIB = ".1.3.6.1.4.1.318.1.1.12"; $pduLoad_oid = $PDUMIB.".2.3.1.1.2"; switch ($options["poller_name"]) { // for future expansion.. // case "voltage": $oid = ($input)?$pduInputVoltage:$pduOutputVoltage; break; // case "current": $oid = ($input)?$pduInputCurrent:$pduOutputCurrent; break; case "load" : $oid = ($input)?false:$pduLoad_oid; break; } if (!empty($oid)) { $oid .= ".".$options["index"]; $tempvalue = snmp_get($options["host_ip"], $options["ro_community"], $oid); // values returned are in 1/10th, so "27" is "2.7". Let's fix this up.. $value = $tempvalue * .1; } return $value; } ?> jffnms-0.9.3/engine/pollers/reachability_status.php0000644000175000017500000000123111466754501022025 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_reachability_status ($options) { global $poller_buffer; $pl = $poller_buffer['packetloss-'.$options['interface_id']]; //get PacketLoss from reachability_pl $num_ping = $options['pings']; $interval = $options['interval']; $threshold = $options['threshold']; $pl_percent = ($pl * 100) / $num_ping; $result = 'reachable'; if ($pl_percent > $threshold) $result = 'unreachable'; $result .= "|$pl_percent% Packet Loss"; return $result; } ?> jffnms-0.9.3/engine/pollers/smokeping.php0000644000175000017500000000147511716447477020001 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_smokeping($options) { $topdir = $options['ro_community']; $dss = $options['poller_parameters']; $file = $options['interface']; $pathname = $topdir . '/'.$file . '.rrd'; if (!is_file($pathname)) { echo ("File not found $pathname"); return 0; } // Find last value of RRD $lastdate = rrdtool_last($pathname); $rra = 'AVERAGE'; $opts = array ($rra, "--start=$lastdate"); $values = rrdtool_fetch($pathname, $opts); $names = $values['ds_namv']; $data = $values['data']; if ($dss == 'loss') { return($data[1]*5); } if ($dss == 'median') { return($data[2]*1000); } return 0; } ?> jffnms-0.9.3/engine/pollers/bgp_peer_status.php0000644000175000017500000000073311734013211021136 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_bgp_peer_status ($options) { $oid = '.1.3.6.1.2.1.15.3.1.2.'.$options['remote']; $value = snmp_get($options["host_ip"],$options["ro_community"],$oid); if ($value == '') return FALSE; if ($value == '6') return 'up'; return 'down'; } ?> jffnms-0.9.3/engine/pollers/reachability_wait.php0000644000175000017500000000144211733722177021453 0ustar csmallcsmallget('engine_temp_path'); $buffer_name ='ping-'.$options['interface_id']; if (!array_key_exists($buffer_name, $poller_buffer)) return 'error'; $uniq = $poller_buffer[$buffer_name]; $filename = "$temp_path/$uniq.log"; if (file_exists($filename)) { for($i=0; $i < 100 ; $i++) { clearstatcache(TRUE, $filename); if ( ($new_filesize = filesize($filename)) === FALSE) return 'error'; if ($new_filesize > 40) return 'ok'; sleep(1); } } return 'error'; } ?> jffnms-0.9.3/engine/pollers/cisco_snmp_ping_wait.php0000644000175000017500000000207711470616252022164 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_cisco_snmp_ping_wait ($options) { global $poller_buffer; $ping_count = $options['pings']; $oid = '.1.3.6.1.4.1.9.9.16.1.1.1'; $cant = 1; $buffer_name = "cisco_snmp_ping_start-$options[interface_id]"; if (!array_key_exists($buffer_name, $poller_buffer) || $poller_buffer[$buffer_name] != 2) return -1; //Esperar a que terminen los pings o que pasen mas de ((.25*4)*8) == 8 seg = 32 == 30 $timeout = 2; //sec per ping $wait = 4; $max_wait = ($ping_count*$timeout*$wait)*80/100; //cant de usleeps max while (( ($pings_sent = trim(get_snmp_counter($options['host_ip'],$options['rw_community'],"$oid.9.$options[random]$options[interface_id]"))) < $ping_count ) && ($cant < $max_wait)) { usleep((1000000/$wait)); $cant++; echo "."; } echo "\n"; //logger("end wait\n"); if ($cant < $max_wait) return $pings_sent; return -1; } ?> jffnms-0.9.3/engine/pollers/udp_status.php0000644000175000017500000000245611524363516020164 0ustar csmallcsmall JFFNMS authors * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_udp_status ($options) { global $Config; if ( ($host_info = resolve_host($options['host_ip'])) === FALSE) return 'closed|0'; list ($af, $ip, $port) = $host_info; if ($af == 6) $ipv6_flag = '-6'; else $ipv6_flag = ''; $temp_path = $Config->get('engine_temp_path'); $nmap = $Config->get('nmap_executable'); $i = 0; if (preg_match('/^(\d+)/', $options['port'], $regs)) $port = $regs[1]; else return 'error|0'; $filename = $temp_path.'/'.uniqid('').'.log'; $command = "$nmap -sU -p$port $ipv6_flag -n -oG $filename $ip"; exec($command,$a,$b); if (file_exists($filename)==true) { $data = file($filename); unlink($filename); } if (count($data)==3) { $pos1 = strpos($data[1],"Ports")+6; if ($pos1 > 6) { $data_line = substr($data[1],$pos1,strlen($data[1])-$pos1); $data_ports = explode(",",$data_line); } $time = current(array_slice(explode(" ",$data[2]),-2)); } if (is_array($data_ports) && (count($data_ports) > 0)) foreach ($data_ports as $port) list ($udp_port, $status) = explode("/",trim($port)); return "$status|$time"; } ?> jffnms-0.9.3/engine/pollers/buffer.php0000644000175000017500000000123411734013335017225 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ // Get Values from the Buffer Temp storage function poller_buffer ($options) { global $poller_buffer; $buffer_names = explode (',',$options['poller_name']); $values = array(); foreach ($buffer_names as $buffer_name) { $buffer_fullname = $buffer_name.'-'.$options['interface_id']; if (array_key_exists($buffer_fullname, $poller_buffer)) $values[] = $poller_buffer[$buffer_fullname]; else $values[] = ''; } return join('|',$values); } ?> jffnms-0.9.3/engine/pollers/hostmib_apps.php0000644000175000017500000000325711733712445020462 0ustar csmallcsmall Anders Karlsson * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_hostmib_apps ($options) { global $Apps; static $buffer_age = 0; $buffer_max_len=20; $buffer_max_age=180; $oid = '.1.3.6.1.2.1.25.4.2.1.2'; //host.hrSWRun.hrSWRunTable.hrSWRunEntry.hrSWRunName $hid = $options['host_id']; if (empty($options['ro_community'])) return FALSE; // Check freshness of buffer if (!array_key_exists('Apps', $GLOBALS) or ($buffer_age + $buffer_max_age < time())) { $Apps = array(); $buffer_age = time(); } if (!array_key_exists($hid, $Apps) || !array_key_exists('raw',$Apps[$hid])) $Apps[$hid] = array( 'raw'=> snmp_walk($options['host_ip'],$options['ro_community'],$oid,1), 'pids'=> array() ); if (is_array($Apps[$hid]['raw'])) { $instances=0; foreach ($Apps[$hid]['raw'] as $key=>$service) //go thru all { $interface_in = trim(str_replace(array("\"","'"),'',trim($service))); if (array_key_exists('ignorecase', $options) && $options['ignorecase']) $match = strncasecmp($interface_in,$options['interface'],30); else $match = strncmp($interface_in,$options['interface'],30); if ($match == 0) { $instances++; $pid = end(explode('.',$key)); $Apps[$hid]['pids'][$interface_in][]=$pid; } } $value='not running'; if ( $instances > 0 ) $value="running;$instances Instance(s)|$instances"; return $value; } } ?> jffnms-0.9.3/engine/pollers/snmp_ibm_power.php0000644000175000017500000000100311734016556020776 0ustar csmallcsmall David LIMA * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_snmp_ibm_power ($options) { $oid = $options['poller_parameters']; if (empty($options['ro_community'])) return FALSE; $snmp_value = (snmp_get($options['host_ip'],$options['ro_community'],$oid)); if ( preg_match('{(\d+)}',$snmp_value,$matches)) return $matches[1]; return FALSE; } ?> jffnms-0.9.3/engine/pollers/cisco_serial_port_status.php0000644000175000017500000000431011716447477023102 0ustar csmallcsmall Thomas Mangin * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_cisco_serial_port_status ($options) { global $port_status; // 1 : Async // 2 : DSX // 3 : Free $option = $options["poller_parameters"]; $host_ip = $options["host_ip"]; $host_ro = $options["ro_community"]; if (!is_array($port_status["description"])) $port_status["description"] = snmp_walk($host_ip, $host_ro, ".1.3.6.1.2.1.2.2.1.2"); if (!is_array($port_status["admin"])) $port_status["admin"] = snmp_walk($host_ip,$host_ro,".1.3.6.1.2.1.2.2.1.7"); if (!is_array($port_status["operation"])) $port_status["operation"] = snmp_walk($host_ip,$host_ro,".1.3.6.1.2.1.2.2.1.8"); $max = count($port_status["description"]); $nb_e1 = 0; for ($index=0; $index < $max; $index++) { if (strstr($port_status["description"][$index],"E1") or strstr($port_status["description"][$index],"T1")) { if (strstr($port_status["admin"][$index],"up") and strstr($port_status["operation"][$index],"up")) { $nb_e1 ++; } } } if (!is_array($port_status["lines"])) $port_status["lines"] = snmp_walk($host_ip,$host_ro,".1.3.6.1.4.1.9.2.2.1.1.2"); if (!is_array($port_status["names"])) $port_status["names"] = snmp_walk($host_ip,$host_ro,".1.3.6.1.4.1.9.2.2.1.1.1"); $lines = $port_status["lines"]; $names = $port_status["names"]; $total_ports = 0; $selected_ports = 0; $number_ports = 0; foreach ( $lines as $line ) { $is_async = strstr($names[$total_ports],"Async Serial"); $is_dsx = strstr($names[$total_ports],"DSX1"); if ($is_async) $number_ports++; if ((int)($lines[$total_ports])) { if ($option == 1) { if ($is_async) $selected_ports ++; } elseif ($option == 2) { if ($is_dsx) $selected_ports ++; } else { if ($is_async or $is_dsx) $selected_ports ++; } } $total_ports ++; } if ($option == 2 or $option == 3) $selected_ports -= $nb_e1; if ($option == 3) $selected_ports = $number_ports - $selected_ports; // debug($selected_ports); return $selected_ports; } ?> jffnms-0.9.3/engine/pollers/verify_storage_index.php0000644000175000017500000000340511730076531022200 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_verify_storage_index ($options) { $hrStorageDescr_oid = '.1.3.6.1.2.1.25.2.3.1.3'; $index_actual = -1; static $static_buffer = array(); static $buffer_age=0; $buffer_max_len=20; $buffer_max_age=180; if (empty($options['ro_community'])) return $index_actual; // Check freshness for buffer if ($buffer_age + $buffer_max_age < time()) { $static_buffer = array(); $buffer_age = time(); } if (!array_key_exists($options['host_id'], $static_buffer)) { // Check buffer length if (sizeof($static_buffer) > $buffer_max_len) array_shift($static_buffer); $storage_descs = snmp_walk($options['host_ip'],$options['ro_community'], $hrStorageDescr_oid, INCLUDE_OID_1); include_once(jffnms_shared('storage')); if (is_array($storage_descs)) { $static_buffer[$options['host_id']] = array(); foreach ($storage_descs as $key => $value) { $static_buffer[$options['host_id']][$key]=substr(current(storage_interface_parse_description ($value)),0,30); } } unset ($storage_descs); } if (array_key_exists($options['host_id'], $static_buffer) and sizeof($static_buffer[$options['host_id']]) > 0) { $storage_name = $options['interface']; if (($index_actual = array_search($storage_name, $static_buffer[$options['host_id']]))===false) $index_actual = 90000+$options['interface_id']; // if its not found in the host, change its id out of the picture for removal } return $index_actual; } ?> jffnms-0.9.3/engine/pollers/cisco_saagent_bwpacketloss.php0000644000175000017500000000152611734015361023344 0ustar csmallcsmall Javier Szyszlican * Copyright (C) 2012 Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_cisco_saagent_bwpacketloss($options) { if (empty($options['ro_community']) or !is_numeric($options['index'])) return FALSE; $sa_oid = '1.3.6.1.4.1.9.9.42.1.5.2.1'; $ip = $options['host_ip']; $comm = $options['ro_community']; $inst = $options['index']; if ( ($bwpacketloss = snmp_get($ip, $comm, "$sa_oid.27.$inst")) === FALSE) return FALSE; if ( ($nr = snmp_get($ip, $comm, "$sa_oid.1.$inst")) === FALSE) return FALSE; $pktloss=0; if ($nr > 0) $pktloss = $bwpacketloss/($bwpacketloss+$nr)*100; return $pktloss; } ?> jffnms-0.9.3/engine/pollers/cisco_saagent_forwardjitter.php0000644000175000017500000000200711734015404023522 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_cisco_saagent_forwardjitter($options) { if (empty($options['ro_community']) or !is_numeric($options['index'])) return FALSE; $sa_oid = '1.3.6.1.4.1.9.9.42.1.5.2.1'; $ip = $options['host_ip']; $comm = $options['ro_community']; $inst = $options['index']; if ( ($sumpossd = snmp_get($ip, $comm, "$sa_oid.9.$inst")) === FALSE) return FALSE; if ( ($sumnegsd = snmp_get($ip, $comm, "$sa_oid.14.$inst")) === FALSE) return FALSE; if ( ($nrpossd = snmp_get($ip, $comm, "$sa_oid.8.$inst")) === FALSE) return FALSE; if ( ($nrnegsd = snmp_get($ip, $comm, "$sa_oid.13.$inst")) === FALSE) return FALSE; $sum = $sumpossd + $sumnegsd; $nr = $nrpostsd + $nrnegsd; $jitter=0; if ($nr > 0) $jitter = round($sum / $nr,2); return $jitter; } ?> jffnms-0.9.3/engine/pollers/cisco_envmib_status.php0000644000175000017500000000107311733760655022035 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_cisco_envmib_status ($options) { if ($options['ro_community']=='' or !is_numeric($options['index'])) return FALSE; $snmp_value = snmp_get($options['host_ip'], $options['ro_community'], '.1.3.6.1.4.1.9.9.13.1.'.$options['poller_parameters'].'.'. $options['index']); if ($snmp_value == '1') return 'up'; return 'down'; } ?> jffnms-0.9.3/engine/trap_receivers/0002755000175000017500000000000011716447477016624 5ustar csmallcsmalljffnms-0.9.3/engine/trap_receivers/unknown.inc.php0000644000175000017500000000130711466150745021572 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function trap_receiver_unknown ($params) { $trap_oid = $params['trap']['trap_oid']; $trap_oid = preg_replace('/^\.1\.3\.6\.1\.4\.1\.(\S+)/','Enterprises.$1', $trap_oid); $varbinds = array(); foreach($params['trap_vars_oid'] as $id => $value) $varbinds[] = "$id=$value"; $res = array( 'info' => "Trap OID: $trap_oid Values: ".join(', ', $varbinds), 'date' => date('Y-m-d H:i:s', $params['trap']['date']), 'referer' => $params['trap']['id'] ); return array(true, $res); } ?> jffnms-0.9.3/engine/trap_receivers/static.inc.php0000644000175000017500000000271611466136003021356 0ustar csmallcsmall Erno Rigo * This program is licensed under the GNU GPL, full terms in the LICENSE file * * Trap sink receiver. Meant to be used in conjunction with the 'event' backend plugin. * * Parameters: * alarm_state,[interface_index_field],[interface_index_varbind] * * Where: * alarm_state - alarm state to send to backend * interface_index_field - interface index field name (eg. "index"), * interface_index_varbind - interface index value SNMP Varbind number * */ function trap_receiver_static ($params) { $Interfaces = new JffnmsInterfaces(); $res = array(); list ($res['status'], $interface_index_field, $interface_index_varbind) = explode(',', $params['receiver_parameters']); // Match interface (name and id) by index field if (($interface_index_field !== '') && ($interface_index_varbind !== '')) { $int_data = $Interfaces->get_by_field_value ($params['host_id'], $params['interface_type'], $interface_index_field, $params['trap_vars'][$interface_index_varbind]); if (is_numeric($int_data['interface_id'])) { $res['interface'] = $int_data['interface']; // for event backend $res['interface_id'] = $int_data['interface_id']; // for alarm backend } } // for event or alarm backend $res['date'] = date('Y-m-d H:i:s', $params['trap']['date']); $res['referer'] = $params['trap']['id']; return array(TRUE, $res); } ?> jffnms-0.9.3/engine/trap_receivers/none.inc.php0000644000175000017500000000043311716447477021042 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function trap_receiver_none ($params) { // Never Matches return array(false, array()); } ?> jffnms-0.9.3/engine/shared/0002755000175000017500000000000011727517505015045 5ustar csmallcsmalljffnms-0.9.3/engine/shared/webos.inc.php0000644000175000017500000000205411461436753017444 0ustar csmallcsmall Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ # Returns true if this is a WebOS host function is_webos ($ip, $comm) { $system_name = snmp_get($ip, $comm, '.1.3.6.1.2.1.1.1.0'); if (strpos($system_name, 'Alteon AD3') !== FALSE) return TRUE; return FALSE; } function webos_info($ip, $comm, $ifIndex) { $ifDescr_OID = '.1.3.6.1.2.1.2.2.1.2'; $ipInterfaceTableMax_OID = '.1.3.6.1.4.1.1872.2.1.3.1.0'; $agPortCurCfgPortName_OID = '.1.3.6.1.4.1.1872.2.1.2.3.2.1.15'; $ifDescrs = snmp_walk($ip,$comm, $ifDescr_OID); $ipIntMax = snmp_get($ip,$comm, $ipInterfaceTableMax_OID); $PortNames = snmp_walk($ip,$comm, $agPortCurCfgPortName_OID); if (!$ipIntMax) return $ifDescrs; foreach($ifIndex as $key => $index) { if ($index > $ipIntMax) { $ifDescrs[$key] = 'Port '.intval($index-$ipIntMax); $ifAliases[$key] = $PortNames[$index-$ipIntMax-1]; } } return array($ifDescrs,$ifAliases); } ?> jffnms-0.9.3/engine/shared/catos.inc.php0000644000175000017500000000211111470324023017412 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ define('CATOS_IFDESCR_OID','.1.3.6.1.2.1.31.1.1.1.1'); function is_catos ($ip, $comm) { return ((strpos(snmp_get($ip, $comm,'.1.3.6.1.2.1.1.1.0'),'Catalyst Operating System')!==false)?true:false); } function catos_info($ip, $comm, $ifIndex) { $ifDescr_oid = CATOS_IFDESCR_OID; $ifAlias = array(); // CatOs portName is indexted by module and port instead of ifNum..... Grrrrrrr // OID .1.3.6.1.4.1.9.5.1.4.1.1.4.mod.port yields the portName // OID .1.3.6.1.4.1.9.5.1.4.1.1.11 appears to xref .mod.port back to ifNum however $ifPortName = snmp_walk($ip, $comm, '.1.3.6.1.4.1.9.5.1.4.1.1.4'); $ifPortIfNum = snmp_walk($ip, $comm, '.1.3.6.1.4.1.9.5.1.4.1.1.11'); if (is_array($ifPortIfNum)) foreach ($ifPortIfNum as $PortID=>$ifNum) if ( ($key = array_search($ifNum, $ifIndex)) !== FALSE) $ifAlias[$key] = $ifPortName[$PortID]; return array($ifDescr_oid, $ifAlias); } ?> jffnms-0.9.3/engine/shared/.check0000644000175000017500000000001611377440254016113 0ustar csmallcsmallDO NOT DELETE jffnms-0.9.3/engine/shared/storage.inc.php0000644000175000017500000000205211727064256017767 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function storage_interface_parse_description ($descr) { $description = ''; $label_hex = strpos($descr,"Hex"); if ($label_hex!==FALSE) // UCD-SNMP 4.2.4 fix $descr = substr($descr,0,$label_hex-1); $descr = str_replace("\"","",$descr); // UCD-SNMP 4.2.4 fix $descr = str_replace("\\","",$descr); // Windows Hack for C:\ breaking the DB // By default it is the filtered thing given to us $interface = $descr; //Windows XP Disk Label Hack $label_pos = strpos($descr,"Label"); if ($label_pos!==false) { $interface = substr($descr,0, $label_pos - 1); //strip the \ and the space $description = substr($descr,$label_pos, strlen($descr) - $label_pos); } // Juniper JUNOS hack if (preg_match('/mounted on: (\S+)/', $descr, $groups)) { $interface = $groups[1]; } return array($interface, $description); } ?> jffnms-0.9.3/engine/shared/percentile.inc.php0000644000175000017500000000201411716447477020463 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function calculate_percentile ($percentile, $values) { unset ($values["information"]); $dss = array_keys($values); $ids = array_keys($values[current($dss)]); foreach ($ids as $id) { $aux = array(); foreach ($dss as $ds) $aux[$ds]=$values[$ds][$id]; $new_values[$id]=max($aux); //debug ($id.": ".join(", ",$aux). " = ".$new_values[$id]); } $cant = count($new_values); $cant_skip = round(((100-$percentile)*$cant-1)/100)+1; //get the N% of the total values $data_points = array($values, $new_values, $cant_skip); rsort($new_values); //sort the list from max->min $result = $new_values[$cant_skip]; //get the following value //debug ("cant: $cant, skip: $cant_skip, result: ".($result*8).", avg: ".round((array_sum($new_values)/$cant)*8)); return array($result, $data_points); } ?> jffnms-0.9.3/engine/rrd_analizer.php0000644000175000017500000001332011741732016016751 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ require_once('../conf/config.php'); $Config = new JffnmsConfig(); config_load_libs('basic', 0); $opt_interface=''; parse_commandline(); rrd_analizer_main($opt_interface); function rrd_analizer_main($opt_interface) { global $Config; $Interfaces = new JffnmsInterfaces(); $span = 30; //30 minutes (start time) $end = 10; //10 minutes (end time) $start_time = (($span-5)+$end)*60; $end_time = ($end*60); //------------------------------------------> timeline // |(start_time)--------|(end_time) |(now) if (empty($opt_interface)) $int_where = '> 1'; else $int_where = "= $opt_interface"; $query_rrd=' SELECT interfaces.id, interfaces.interface, interfaces.host, interfaces.sla, interfaces.type, slas.info, slas.event_type, alarm_states.description as state FROM interfaces, slas, alarm_states, hosts WHERE interfaces.id '.$int_where.' AND interfaces.poll > 1 AND interfaces.sla > 1 AND interfaces.sla = slas.id AND slas.state = alarm_states.id AND interfaces.host = hosts.id AND hosts.poll = 1 ORDER BY interfaces.id'; $result_analyzer = db_query ($query_rrd) or die ("Query failed - S1 - ".db_error()); $type_dss = array(); while ($row = db_fetch_array($result_analyzer)) { if (!$Interfaces->is_up($row['id'])) { logger("I$row[id] : is not UP.\n"); continue; } if (!isset($type_dss[$row['type']])) { $interface_data = $Interfaces->values($row['id'],array('ftype'=>20)); $type_dss[$row['type']] = $interface_data['values'][$row['id']]; unset ($interface_data); } if (!array_key_exists($row['type'], $type_dss)) { logger("I$row[id] : has no values.\n"); continue; } $dss = &$type_dss[$row['type']]; $values = analyzer_fetch ($row['id'], $start_time, $end_time, $dss); if (!is_array($values)) { logger("I$row[id] : RRD File(s) not found.\n"); continue; } foreach ($dss as $ds=>$aux) if (isset($values[$ds])) $text[]=$ds.'('.$values[$ds].')'; logger("I$row[id]. : ".str_repeat("=",90)."\n"); logger("I$row[id]. : Start: ".date('Y-m-d H:i:s',$values['information']['start']). "\tStop: ".date("Y-m-d H:i:s",$values['information']['stop']). "\tMeasures: ".$values['information']['measures']."\n"); logger("I$row[id] : ".join(' ',$text)."\n"); logger("I$row[id] : ".str_repeat('-',90)."\n"); //Call the Analyzers $analyzers = array ('sla'); $function_data = array ($row,&$values); foreach ($analyzers as $analyzer_command) { $analyzer_function = "analyzer_$analyzer_command"; $analyzer_file = $Config->get('jffnms_real_path')."/engine/analyzers/$analyzer_command.inc.php"; if (!in_array($analyzer_file, get_included_files())) { if (!is_readable($analyzer_file)) { logger("ERROR: Analyzer file '$analyzer_file' is not readable.\n"); continue; } require_once($analyzer_file); } if (!function_exists($analyzer_function)) { logger("ERROR: Analyzer function '$analyzer_function' not found in plugin file '$analyzer_file'.\n"); continue; } $result = call_user_func_array($analyzer_function,$function_data); //show result if (is_array($result)) foreach ($result as $aux) logger("I$row[id] : $analyzer_function : $aux\n"); unset ($result); }//foreach unset ($values); unset ($text); }//while row db_close(); } //FIXME what happens when you need to could all values for the average, event the 0, like for packetloss function get_average($data) { $data_points = count ($data); $values = 0; $result = 0; for ($i = 0;$i < $data_points ; $i++) if ($data[$i]!=0) //avoid counting when there's a 0 there. (Don't know if its ok) FIXME { $result += $data[$i]; $values++; } if ($values==0) $values = 1; //avoid divide by 0 return round($result/$values); } function analyzer_fetch($interface_id,$from,$to,$dss) { jffnms_load_api('rrdtool'); $dss_names = array_keys($dss); $values = rrdtool_fetch_ds($interface_id, $dss_names, "-$from", "-$to"); if (!is_array($values)) return FALSE; foreach ($values as $value_name=>$value_data) if ($value_name!='information') $result[$value_name] = get_average($value_data); //FIXME how to handle Last Value Deltas and 95th Percentile $result['information']=$values['information']; $result['information']['measures'] = count ($values[current(array_keys($values))]); unset ($values); return $result; } function parse_commandline() { global $opt_interface; $num_params = $GLOBALS['argc']-1; $longopts = array( 'help', 'version', 'interface:'); if ( ($opts = getopt('i:oVH', $longopts)) === FALSE) { return; } foreach ($opts as $opt => $opt_val) { switch ($opt) { case 'interface': case 'i': $num_params-= 2; $opt_interface = $opt_val; if (!is_numeric($opt_interface)) print_help('interface ID option must be numeric'); break; case 'help': case 'H': print_help(); break; case 'version': case 'V': print_version(); }// switch }//for if ($num_params > 0) print_help('Problem with command line options.'); } function print_help($errmsg = FALSE) { if ($errmsg) print "$errmsg\n"; print $_SERVER['SCRIPT_NAME'] . ' [options] -i, --interface Analyze interface only -H, --help Print this help -V, --version Print version information '; die; } ?> jffnms-0.9.3/engine/autodiscovery_interfaces-old.php0000644000175000017500000003361111716447477022201 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //launcher parameters $launcher_function = "real_iad"; $launcher_param_normal_handler = "iad_params"; $launcher_param_managed_handler = "iad_params_managed"; $launcher_item_source = "ad_hosts_list"; $timeout = (8*60); $max_tries = 1; $refresh_items = false; $items_per_child = 1; // Old Master function ad_hosts_list() { //FIXME add Satellite $query_hosts=" SELECT hosts.id FROM hosts WHERE hosts.id > 1 and hosts.poll = 1 and hosts.autodiscovery > 1 GROUP BY hosts.id ORDER BY hosts.id"; $result_hosts = db_query ($query_hosts) or die ("Query failed - R2 - ".db_error()); $hosts = array(); while ($host = db_fetch_array($result_hosts)) $hosts[]=$host["id"]; return $hosts; } function iad_params($params) { $base = array(NULL,NULL,NULL,NULL); $params[2] = true; $params[3] = true; if (isset($_SERVER['argv'][3]) && $_SERVER['argv'][3]== 'nolog') $params[3] = false; // Do no insert events foreach ($params as $pos=>$value) $base[$pos] = $value; return $base; } function iad_params_managed($params) { $base = array(NULL,NULL,NULL,NULL); $params[2] = false; $params[3] = true; foreach ($params as $pos=>$value) $base[$pos] = $value; return $base; } function ad_show_interface ($fields,$data) { $fields = array_merge(array(array("name"=>"interface", "ftype"=>1, "ftype_handler"=>"none")),$fields); $text = array(); foreach ($fields as $fdata) if (isset($fdata["ftype"]) && ($fdata["ftype"]!=3) && isset($fdata["ftype_handler"]) && ($fdata["ftype_handler"]!="bool")) $text[] = substr($fdata["name"],0,4).": ".(isset($data[$fdata["name"]])?$data[$fdata["name"]]:""); $text = join(" | ",$text); return $text; } function real_iad ($host_id = NULL, $type_id = NULL, $output = true, $log_events = true) { global $heartbeat; global $Config; $event_type_id = $Config->get('jffnms_administrative_type'); $ad_time = time_usec(); if (!$output) ob_start(); $query_hosts=' SELECT hosts.id, hosts.ip, hosts.rocommunity, hosts.autodiscovery_default_customer, autodiscovery.poller_default, autodiscovery.permit_add, autodiscovery.permit_del, autodiscovery.permit_mod, autodiscovery.permit_disable, autodiscovery.skip_loopback, autodiscovery.check_state, autodiscovery.check_address, autodiscovery.alert_del FROM hosts, autodiscovery WHERE hosts.id = '.$host_id.' AND hosts.autodiscovery = autodiscovery.id AND hosts.autodiscovery > 1 and hosts.poll = 1'; $result_hosts = db_query ($query_hosts) or die ('Query failed - autodiscovery hosts data - '.db_error()); while ($host_info = db_fetch_array($result_hosts)) //this should return only one host { $type_filter = ($type_id > 1)?" and id = ".$type_id:""; $query_ad=' SELECT id, autodiscovery_validate, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, description, sla_default FROM interface_types WHERE autodiscovery_enabled = 1 '.$type_filter.' ORDER BY id'; $result_ad = db_query ($query_ad) or die ('Query failed - autodiscovery interface types - '.db_error()); while ($it = db_fetch_array($result_ad)) //loop thru all interface_types { unset($db); unset($host); if (!$output) { ob_end_clean(); // if $heartbeat seconds have passed since last time if (($old_time + $heartbeat) > time()) echo '.'; // Output a dot is sign of a heartbeat for the master flush(); ob_flush(); ob_start(); $old_time = time(); } discovery_logger($host_info['id'], $it['id'], FALSE, 'Autodiscovering '.$it['description']); //Get All nedded data for this interface type $db = hosts_interfaces_from_db ($host_info['id'],$it['id']); $host = hosts_interfaces_from_discovery ($it['autodiscovery_function'], $host_info['ip'], $host_info['rocommunity'], $host_info['id'], $it['autodiscovery_parameters']); $fields = interface_types_fields_list (NULL, array('itype'=>$it['id'],'exclude_types'=>20)); if (is_array($host)) //merge the keys to get a single list of all interfaces on both lists { $interface_ids_list = array_unique(array_merge(array_keys($db),array_keys($host))); asort($interface_ids_list); reset($interface_ids_list); } if (is_array($host) && (count($host) > 0)) //if the host aswered something foreach ($interface_ids_list as $key) if ($key >= 0) //key is valid { $processed = 0; $now_date = date("Y-m-d H:i:s",time()); if (isset($db[$key])) ksort($db[$key]); if (isset($host[$key])) ksort($host[$key]); //output discovery_logger($host_info['id'], $it['id'], $key, 'DB : '.(isset($db[$key])?ad_show_interface($fields,$db[$key]):'Not Found')); discovery_logger($host_info['id'], $it['id'], $key, 'HOST: '.(isset($host[$key])?ad_show_interface($fields,$host[$key]):'Not Found')); //not found in DB and found in Host, add if (!isset($db[$key]) && isset($host[$key])) { if (($it['autodiscovery_validate']==0) //the interface type told us not to validate the data || (( ($host_info["skip_loopback"]==0) || //the policy says not to skip loopbacks ( //check if the interface is loopback (strpos(strtolower($host[$key]["interface"]),"loopback") === false) && //cisco (strpos(strtolower($host[$key]["interface"]),"null") === false) && //cisco (array_key_exists('address', $host[$key]) && $host[$key]['address'] != '127.0.0.1') && //any loopback (substr(strtolower($host[$key]["interface"]),0,2) != "lo") //linux ) //TRUE if its not a loopback ) && ( //check address ($host_info["check_address"]==0) || //the policy tell us not to check if the address is valid (array_key_exists("address",$host[$key]) == false) || //or the host doesn't have an address field (($host[$key]["address"]!="") && ($host[$key]["address"]!="0.0.0.0")) //or the interface has a valid IP address ) && ( //check status ($host_info["check_state"]==0) || //the host autodiscovery policy tell us not to check state (alarm_lookup($host[$key]["oper"])==ALARM_UP) //or the state is UP ) ) //end of validation ) //add the interface { $text = ''; discovery_logger($host_info['id'], $it['id'], $key, 'RES : New Interface Found'); //if the AD policy permits adding an interface. if ($host_info["permit_add"]==1) { //if the AD policy says use default poller if ($host_info["poller_default"]==1) ad_set_default ($host[$key]['poll'],$it['autodiscovery_default_poller']); //use the interface type default poller for this new interface ad_set_default ($host[$key]['client'],$host_info['autodiscovery_default_customer']); ad_set_default ($host[$key]['sla'],$it['sla_default']); //Find the Index Field foreach ($fields as $fdata) if ($fdata['ftype']==3) $index_field = $fdata['name']; //add the index field as data to use when adding a record $host[$key][$index_field]=$key; //delete the status fields, because they will not be found in the db unset ($host[$key]['admin']); unset ($host[$key]['oper']); $interface_id = adm_interfaces_add(array('host'=>$host_info['id'],'type'=>$it['id'])); //add new record adm_interfaces_update($interface_id,$host[$key]); //update it with the data $text = '- Added'; } // permit add if ($log_events==true) insert_event ($now_date, $event_type_id, $host_info['id'], $host[$key]['interface'], //add informative event 'alert','autodiscovery',trim('Found '.$text),0); $processed = 1; } // if allow add } // add if ( !isset($host[$key]) && isset($db[$key]) //found in DB but not in host && ($it['autodiscovery_validate']==1) && ($db[$key]['poll'] > 1)) //IT need validation, and the interface is being polled (preserve non polling) { discovery_logger($host_info['id'], $it['id'], $key, 'RES : Not Found in Host'); unset ($text); if (($host_info['permit_del']==1) && ($host_info['permit_disable']==0)) //Policy permits delete and not disable { adm_interfaces_del ($db[$key]['id']); //delete it $text = '- Deleted'; } if (($host_info['permit_del']==0) && ($host_info['permit_disable']==1)) //policy permits disable but not delete { adm_interfaces_update ($db[$key]['id'],array('poll'=>1,'show_rootmap'=>2)); //disable it (No Polling), and mark it disabled on the map $text = '- Disabled'; } if (($log_events==true) && ($host_info["alert_del"]==1)) insert_event($now_date,$event_type_id, $host_id, $db[$key]['interface'], 'alert','autodiscovery', trim('Not Found in Host '.$text),0); $processed = 1; } // delete //found in both and poll enabled, check for modification if (isset($host[$key]) && isset($db[$key]) && ($db[$key]['poll'] > 1)) { //track field changes if ($it['autodiscovery_validate']==1) //validate fields in this interface type? { $fields_to_modify = array(); $track_fields = array('interface' => 'Interface Name'); foreach ($fields as $fdata) if ($fdata['tracked']==1) $track_fields[$fdata['name']]=$fdata['description']; foreach ($track_fields as $track_field=>$track_field_descr) if ((!empty($host[$key][$track_field])) //field from host not empty && (trim(substr($db[$key][$track_field],0,30)) != trim(substr($host[$key][$track_field],0,30))) ) //fields not equal { discovery_logger($host_info['id'], $it['id'], $key, 'RES : '.$track_field_descr.' Changed from '. $db[$key][$track_field].' to '. $host[$key][$track_field]); //add field to be modified $fields_to_modify[$track_field]=$host[$key][$track_field]; } if (count($fields_to_modify) > 0) //there are fields to be modified { $aux_changes = array(); foreach ($fields_to_modify as $field_name=>$field_value) $aux_changes[] = $track_fields[$field_name].' to '.$field_value.' was '.$db[$key][$field_name]; $aux_changes = join (' and ',$aux_changes); if ($host_info['permit_mod']==1) //policy permits modification { adm_interfaces_update ($db[$key]['id'],$fields_to_modify); //modify it if (array_key_exists('interface',$fields_to_modify)) //if we changed the interface field (key for events) $aux_interface_name = $host[$key]['interface']; //use the new one else $aux_interface_name = $db[$key]['interface']; //if not use the old one $aux_comment = '- Changed '.$aux_changes; } else { $aux_interface_name = $db[$key]['interface']; $aux_comment = '- NOT Changed '.$aux_changes; } if ($log_events==true) insert_event($now_date, $event_type_id, $host_id, $aux_interface_name, 'alert','autodiscovery', trim('detected modification '.$aux_comment),0); $processed = 1; unset ($aux_interface_name); unset ($aux_comment); } unset($track_fields); unset($fields_to_modify); } //validate //no customer selected if ($db[$key]['client'] <= 1) //customer not selected in DB { discovery_logger($host_info['id'], $it['id'], $key, 'RES : No Customer Selected'); if ($log_events==true) insert_event($now_date, $event_type_id, $host_id, $db[$key]['interface'], 'alert','autodiscovery', 'Incomplete Interface Setup (Customer not Selected)',0); $processed = 1; } }// modification if ($processed == 0) //interface was not touched by any posibility discovery_logger($host_info['id'], $it['id'], $key, 'RES : Nothing Done'); } //for (interface ids) } //while (interface types) } //while (host) $ad_time = round(time_usec_diff($ad_time)); logger('H '.str_pad($host_id,3,' ',STR_PAD_LEFT)." : Autodiscovery took ".$ad_time." msec.\n"); if (!$output) ob_end_clean(); return array('times'=>$ad_time); } //function function discovery_logger($host, $itype, $intid, $result) { logger( 'H '.str_pad($host,3,' ',STR_PAD_LEFT).' : '. 'IT '.str_pad($itype,3,' ',STR_PAD_LEFT).' : '. ($intid?'I '.str_pad($intid,4,' ',STR_PAD_LEFT).' : ':''). "$result.\n"); } jffnms_load_api('iad'); include ('launcher.inc.php'); ?> jffnms-0.9.3/engine/satellite_distribution.php0000644000175000017500000001023711716447477021106 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ $jffnms_functions_include="engine"; include_once("../conf/config.php"); if (!$_SERVER[argv][0]) $sync = $SCRIPT_NAME; else $sync = $_SERVER[argv][0]; if (!$sat_id) $sat_id = $_SERVER[argv][1]; if (!$hosts_ids) $hosts_ids = $_SERVER[argv][2]; if ($jffnms_satellite_uri=="none") die("Satellite not configured.\n"); $my_sat_id = satellite_get_id($jffnms_satellite_uri); if (!$sat_id) { $masters = array_keys (satellite_get_masters()); $peers = array_keys (satellite_get_peers($my_sat_id)); $query_sats=" SELECT hosts.id as host_id, satellites.id as sat_id FROM satellites LEFT OUTER JOIN hosts on (hosts.satellite = satellites.id and hosts.id > 1) WHERE satellites.id > 1 ORDER by satellites.id asc"; $result_sats = db_query ($query_sats) or die ("Query failed - R2 - ".db_error()); while ($sat_data = db_fetch_array($result_sats)) if ($my_sat_id != $sat_data["sat_id"]) { // no distribution to me //echo "Host ".$sat_data[host_id]." - Sat ".$sat_data[sat_id]."\n"; $paths = satellite_get_paths($sat_data["sat_id"],NULL,1); //paths down to the destinations using only parents //FIXME multiple masters $paths = satellite_clean_distribution_path($paths,$my_sat_id); if (is_array($paths)) { //there are paths from me to the destination satellite (i'm in the middle) $next_hops = satellite_get_last_distribution_path($paths); //logger("S$my_sat_id\t: To get to Satellite ".$sat_data[sat_id]." I have to send data to satellite(s) ".join (" and ",$next_hops)."\n"); foreach ($next_hops as $hop) if (!in_array($hop,$masters)) { //if the next hop is not a master if ($sat_data["host_id"]) //if it has a host assiged $distribution[$hop][]=$sat_data["host_id"]; //send host data else if (!is_array($distribution[$hop])) //empty hosts, to send only basic data $distribution[$hop]=array(); } } else ;//echo "No paths from $my_sat_id down to $sat_id\n"; } unset ($result_sats); //var_dump($distribution); if (is_array($distribution)) { //if there is something to do... if (count($distribution) > 1) { //more than one destination satellite, spawn processes. foreach (array_keys($distribution) as $dest_sat_id) { $hosts = join($distribution[$dest_sat_id],","); spawn (false, "$dest_sat_id $hosts",1); //spawn myself if I'm not already running sleep(2); //wait before spawning new proceses unset($sat_id); } } else { //if only one, continue directly $sat_id = current(array_keys($distribution)); if (count($distribution[$sat_id]) > 0) $hosts_ids = join($distribution[$sat_id],","); } } } if ($sat_id > 1) { //no one distributes to 1 if ($hosts_ids) { $hosts = explode (",",$hosts_ids); logger("S$my_sat_id\t: Sending Basic and Hosts $hosts_ids data to Satellite $sat_id ...\n"); } else logger("S$my_sat_id\t: Sending Basic data to Satellite $sat_id ...\n"); $result = satellite_distribute($sat_id,$hosts); //var_dump ($result); $text = "S$my_sat_id\t: Satellite $sat_id sync ".$result["items"]." objects, ".$result["total_errors"]." errors, ". $result["total_sent"]." items sent, ".$result["total_recv"]." recv: ".$result["total_add"]." added, ".$result["total_mod"]." modified, ".$result["total_del"]." deleted. Total time: ".$result["total_time"]."\n"; logger($text); if (($result["total_recv"]!=$result["total_sent"])) foreach ($result["data"] as $data_type=>$info) logger("S$my_sat_id\t: Satellite $sat_id - $data_type\tS:".$info["sent"]." R:".$info["recv"]." A:".$info["added"]." M:".$info["modified"]." D:".$info["deleted"]."\n"); if ($result[total_errors]>0) //if any errors were found foreach ($result[data] as $data_type=>$info) if (isset($info["error"])) //if this data type has an error field logger("S$my_sat_id\t: Satellite $sat_id Data Type: $data_type, Error: ".$info["error"]."\n"); flush(); } db_close(); ?> jffnms-0.9.3/engine/poller_child.php0000644000175000017500000002622211734601552016744 0ustar csmallcsmallstdin); $write_fds = NULL; $except_fds = NULL; $nr = stream_select($read_fds, $write_fds, $except_fds, 1); if ($nr === FALSE) { $Child->send_error("** FATAL ** Child process had error on select."); die(); } if ($nr == 0) { $old_time = $Child->check_heartbeat($old_time); continue; } $line = fgets($Child->stdin,4096); $params = unserialize($line); if (!is_array($params)) { $Child->send_error("Received bad line from parent, not an array"); continue; } if (!array_key_exists('cmd', $params)) { $Child->send_error("Recieved array from parent with no cmd field."); continue; } switch($params['cmd']) { case 'DIE': die(); break; case 'POLL': if (child_poll_interface($params) === TRUE) $Child->send_array('DONE'); else $Child->send_array('NOTDONE'); break; default: $Child->send_error("Received unknown command '".$params['cmd']."'"); }//switch cmd $old_time = $Child->check_heartbeat($old_time); } } function child_poll_interface($params) { global $Config, $Child, $poller_buffer; $host_id = $params['host_id']; if (!is_numeric($host_id)) { $Child->send_error("Host ID must be an integer, given \'$host_id\'"); return FALSE; } $interface_id = $params['interface_id']; if (!is_numeric($interface_id)) { $Child->send_error("Interface ID must be an integer, given \'$interface_id\'"); return FALSE; } $poller_group = $params['poller_group']; if (!is_numeric($poller_group)) { $Child->send_error("Poller Group must be an integer, given \'$poller_group\'"); return FALSE; } // Poller Group 1 is no polling so return immediately if ($poller_group == 1) return TRUE; $check_status = $params['check_status']; $poller_group_query = 'SELECT pollers.name AS poller_name, pollers.command AS poller_command, pollers.parameters AS poller_parameters, pollers_backend.command AS backend_command, pollers_backend.parameters AS backend_parameters, pollers_poller_groups.pos AS poller_pos FROM pollers, pollers_backend, pollers_poller_groups WHERE pollers_poller_groups.poller_group = '.$poller_group.' AND pollers_poller_groups.poller = pollers.id AND pollers_poller_groups.backend = pollers_backend.id '.($check_status==0?' AND pollers_backend.type != 1':'').' ORDER BY pollers_poller_groups.pos'; //fwrite(STDERR, $poller_query); if ( ($poller_group_result = db_query($poller_group_query)) === FALSE) { $Child->send_error('Query failed - poller_plan - '.db_error()); return FALSE; } $jffnms_real_path = $Config->get('jffnms_real_path'); $poller_buffer=array(); while ($poller_row = db_fetch_array($poller_group_result)) { $poller_command = $poller_row['poller_command']; $backend_command = $poller_row['backend_command']; $poller_filename = "$jffnms_real_path/engine/pollers/".$poller_row['poller_command'].'.php'; $backend_filename = "$jffnms_real_path/engine/backends/".$poller_row['backend_command'].'.php'; if ( $Child->require_file($poller_filename, 'poller_'.$poller_command) === FALSE) continue; if ( $Child->require_file($backend_filename, 'backend_'.$backend_command) === FALSE) continue; # Calls poller, poller returns NULL if there is an error # An errors means don't waste time running backend $poller_data = child_poller_data($interface_id, $poller_row, $params); $time_poller_query = time_msec(); $poller_result = call_user_func_array('poller_'.$poller_command, array($poller_data)); $time_poller_query = time_msec_diff($time_poller_query); if ($poller_result === FALSE) { $time_backend_query=0; $poller_result='(FALSE)'; $backend_result='(not run)'; } else { $time_backend_query = time_msec(); $backend_result = call_user_func_array('backend_'.$backend_command, array($poller_data, $poller_result)); $time_backend_query = time_msec_diff($time_backend_query); } // Output the results $poller_param_description = ''; if (array_key_exists('poller_parameters', $poller_row)) $poller_param_description = $poller_row['poller_parameters']; if ( ($desc_len = strlen($poller_param_description)) > 10) $poller_param_description = substr($poller_param_description,0,4).'..'. substr($poller_param_description,$desc_len-4,4); $Child->logger( ' : H '.str_pad($poller_data['host_id'],3,' ',STR_PAD_LEFT). ' : I '.str_pad($poller_data['interface_id'],3,' ',STR_PAD_LEFT). ' : P '.str_pad($poller_row['poller_pos'],3,' ',STR_PAD_LEFT). ' : '.(($backend_command=='buffer')?"$poller_command:":''). $poller_row['poller_name'].'('.$poller_param_description. "): $poller_result ". "-> $backend_command($poller_row[backend_parameters]): $backend_result". " (time P: $time_poller_query | B: $time_backend_query) ". "\n"); } //while poller_row unset($poller_buffer); return TRUE; } function child_poller_data($interface_id, &$poller_data, &$host_data) { $Interfaces = new JffnmsInterfaces(); $host_fields = array('interface', 'show_rootmap', 'rw_community', 'ro_community', 'host_id', 'host_ip'); $interface_values = $Interfaces->values($interface_id); $values = current($interface_values['values']); foreach ($host_fields as $field) $values[$field] = $host_data[$field]; if (strpos($poller_data['poller_parameters'], '<') !== FALSE) { $replace_values = array_merge($host_data, $poller_data, $values); foreach($replace_values as $field => $value) $poller_data['poller_parameters'] = str_replace("<$field>", $value, $poller_data['poller_parameters']); } $values['interface_id'] = $interface_id; $values['random'] = rand(10,99); return array_merge($values,$poller_data); } function poller_child_poll($host_id, $interface_id, $poller_pos, $itype, $output=TRUE) { global $Config, $Child; $loaded_pollers = array(); $loaded_backends = array(); $old_time = time(); $time_start = time(); //debug(array('cmd'=>'START','host'=>$host_id)); // input validation done at parent $poller_plan_filter = array('interface'=>$interface_id,'host'=>$host_id, 'pos'=>$poller_pos,'type'=>$itype); $poller_plan_result = poller_plan ($poller_plan_filter); // Get the Poller Plan (things to poll) if ($output) $Child->logger(" : H ".str_pad($host_id,3," ",STR_PAD_LEFT)." : Poller Start : ".$poller_plan_result["items"]." Items.\n"); else ob_start(); // Loop through all the polling for this host while ($poller_data = poller_plan_next($poller_plan_result)) { $poller_command = $poller_data['poller_command']; $backend_command = $backend_data['backend_command']; $poller_filename = $Config->get('jffnms_real_path')."engine/pollers/$poller_command.php"; $backend_filename = $Config->get('jffnms_real_path')."engine/backends/$backend_command.php"; $poller_function = "poller_$poller_command"; $backend_function = "backend_$backend_command"; if (!array_key_exists($poller_command, $loaded_pollers)) { if ($loaded_pollers[$poller_command] == FALSE) // already failed continue; if (! is_readable($poller_filename)) { $Child->send_error("Poller plugin '$poller_filename' does not exist or is not readable."); $loaded_pollers[$poller_command] = FALSE; continue; } require($poller_filename); if (!function_exists($poller_function)) { $Child->send_error("Poller function '$poller()' was not found in poller plugin '$poller_filename'."); $loaded_pollers[$poller_command] = FALSE; } $loaded_pollers[$poller_command] = TRUE; } // Load and check the backend, if not done already if (!array_key_exists($backend_command, $loaded_backends)) { if ($loaded_backends[$backend_command] == FALSE) // already failed continue; if (! is_readable($backend_filename)) { $Child->send_error("backend plugin '$backend_filename' does not exist or is not readable."); $loaded_backends[$backend_command] = FALSE; continue; } require($backend_filename); if (!function_exists($backend_function)) { $Child->send_error("backend function '$backend()' was not found in backend plugin '$backend_filename'."); $loaded_backends[$backend_command] = FALSE; } $loaded_backends[$backend_command] = TRUE; } // Time and run the poller $time_poller_query = time_msec(); $poller_result = call_user_func_array($poller_function, $poller_data); $time_poller_query = time_msec_diff($time_poller_query); // Time and run the backend $time_backend_query = time_msec(); $backend_result = call_user_func_array($backend_function, array($poller_data, $poller_result)); $time_backend_query = time_msec_diff($time_backend_query); $items_ok++; if ($output) { //Cut the Poller Parameters String $poller_param_description = isset($poller_data['poller_parameters'])?$poller_data['poller_parameters']:''; if ($aux = strlen($poller_param_description) > 10) $poller_param_description = substr($poller_param_description,0,4)."..".substr($poller_param_description,strlen($aux)-4,4); $Child->logger( " : H ".str_pad($poller_data["host_id"],3," ",STR_PAD_LEFT). " : I ".str_pad($poller_data["interface_id"],3," ",STR_PAD_LEFT). " : P ".str_pad($poller_data["poller_pos"],3," ",STR_PAD_LEFT). " : ".(($backend_command=="buffer")?"$poller_command:":"").$poller_data["poller_name"]."(".$poller_param_description."): $poller_result ". "-> $backend_command(".$poller_row["backend_parameters"]."): $backend_result". " (time P: $time_poller_query | B: $time_backend_query) ". "\n"); } else { ob_end_clean(); $old_time = $Child->check_heartbeat($old_time); } } // while $polling_time = round(time_msec_diff($time_start)); if ($output) $Child->logger(" : H ".str_pad($host_id,3," ",STR_PAD_LEFT)." : Poller End, Total Time: $polling_time msec.\n"); else ob_end_clean(); adm_hosts_update($host_id,array('last_poll_date'=>time(), 'last_poll_time'=>round($polling_time/1000))); echo serialize(array('cmd'=>'OK', 'items'=>$poller_plan_result['items'], 'items_ok'=>$items_ok, 'time'=>$polling_time))."\n"; } function child_get_interface_args($int_id) { $int_query = ' SELECT interfaces.id AS interface_id, interfaces.interface, interfaces.poll AS poller_group, hosts.rwcommunity hosts.rocommunity, hosts.id AS host_id, hosts.ip AS host_ip FROM interfaces, hosts WHERE interfaces.id = '.$int_id.' AND hosts.id = interfaces.host'; } ?> jffnms-0.9.3/engine/discovery/0002755000175000017500000000000011741271330015573 5ustar csmallcsmalljffnms-0.9.3/engine/discovery/brocade_sensors.inc.php0000644000175000017500000000402711450352444022233 0ustar csmallcsmall Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_brocade_sensors($ip, $community, $hostid, $param) { $swSensorIndex = '1.3.6.1.4.1.1588.2.1.1.1.1.22.1.1'; $swSensorType = '1.3.6.1.4.1.1588.2.1.1.1.1.22.1.2'; $swSensorStatus = '1.3.6.1.4.1.1588.2.1.1.1.1.22.1.3'; $swSensorValue = '1.3.6.1.4.1.1588.2.1.1.1.1.22.1.4'; $swSensorInfo = '1.3.6.1.4.1.1588.2.1.1.1.1.22.1.5'; $sensors = array(); if ($ip && $community && $hostid) { $indexes = snmp_walk($ip, $community, $swSensorIndex); // Bomb out now if no sensors if ($indexes === FALSE) return FALSE; $types = snmp_walk($ip, $community, $swSensorType); $stats = snmp_walk($ip, $community, $swSensorStatus); $values = snmp_walk($ip, $community, $swSensorValue); $infos = snmp_walk($ip, $community, $swSensorInfo); foreach($indexes as $key => $index) { // Sensor is absent if ($stats["$key"] == 6) continue; // Magic number if ($values["$key"] == '-2147483648') continue; $type = brocade_sensor_type($types["$key"]); $sensors["$index"] = array( 'interface' => $infos["$key"], #'description' => $infos["$key"], 'sensor_type' => $type, 'oper' => brocade_sensor_oper($stats["$key"]), 'admin' => brocade_sensor_admin($stats["$key"]), ); } } return $sensors; } function brocade_sensor_type($type) { $SENSOR_TYPES = array('1'=>'temperature', '2' => 'fan', '3' => 'power'); if (array_key_exists($type, $SENSOR_TYPES)) { return $SENSOR_TYPES["$type"]; } return "Unknown ($type)"; } function brocade_sensor_oper($status) { if ($status == '4') // nominal return 'ok'; if ($status == '3' || $status == '5') // nominal return 'alert'; return 'down'; } function brocade_sensor_admin($status) { $istat = intval($status); if ($status > 1 && $status < 6) return 'up'; return 'down'; } ?> jffnms-0.9.3/engine/discovery/nut.inc.php0000644000175000017500000000224311377440254017671 0ustar csmallcsmall Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_nut ($ip, $rocommunity, $hostid, $param) { $open_timeout = 10; $nut_info = array(); if ( ($skt = @fsockopen($ip, 3493, $errno, $errstr, $open_timeout)) == FALSE) { return $nut_info; } $ups_num=1; fputs($skt,"LIST UPS\nLOGOUT\n"); while(!feof($skt)) { $line = fgets($skt, 1024); if (preg_match('/^UPS (\S+) \"(.+)\"\s*$/', $line, $regs)) { $nut_info[$ups_num] = array( 'interface' => $regs[1], 'description' => $regs[2], 'admin' => 'up', 'oper' => 'unknown' ); } } foreach($nut_info as $index => $fields) { $line = ''; if ( ($skt = @fsockopen($ip, 3493, $errno, $errstr, $open_timeout)) == FALSE) { return $nut_info; } fputs($skt, "GET VAR $fields[interface] ups.status\nLOGOUT\n"); $line = fgets($skt); fclose($skt); if (preg_match('/^VAR \S+ ups.status \"([^"]+)\"/', $line, $regs)) { $nut_info["$index"]['oper'] = $regs[1]; } } //var_dump($nut_info); return $nut_info; } ?> jffnms-0.9.3/engine/discovery/brocade_fcports.inc.php0000644000175000017500000000317311417601745022224 0ustar csmallcsmall Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_brocade_fcports($ip, $community, $hostid, $param) { $swFCPortIndex = '1.3.6.1.4.1.1588.2.1.1.1.6.2.1.1'; $swFCPortPhyState= '1.3.6.1.4.1.1588.2.1.1.1.6.2.1.3'; $swFCPortOpStatus = '1.3.6.1.4.1.1588.2.1.1.1.6.2.1.4'; $swFCPortAdmStatus = '1.3.6.1.4.1.1588.2.1.1.1.6.2.1.5'; $fcports = array(); if ($ip && $community && $hostid) { $indexes = snmp_walk($ip, $community, $swFCPortIndex); // Bomb out now if no sensors if ($indexes === FALSE) return FALSE; $phys = snmp_walk($ip, $community, $swFCPortPhyState); $opers = snmp_walk($ip, $community, $swFCPortOpStatus); $admins = snmp_walk($ip, $community, $swFCPortAdmStatus); foreach($indexes as $key => $index) { $fcports["$index"] = array( 'interface' => "Port ".($index-1), 'oper' => brocade_fcport_oper($opers["$key"]), 'admin' => brocade_fcport_admin($admins["$key"]), 'phy' => brocade_fcport_phy($phys["$key"]), ); } } return $fcports; } function brocade_fcport_oper($status) { if ($status == '1') return 'up'; #online if ($status == '3') return 'testing'; # testing return 'down'; } function brocade_fcport_admin($status) { if ($status == '1') return 'up'; #online if ($status == '3') return 'testing'; # testing return 'down'; } function brocade_fcport_phy($status) { if ($status == '6') return 'up'; #inSync return 'down'; } // vim:et:sw=4:ts=4: ?> jffnms-0.9.3/engine/discovery/bgp_peers.inc.php0000644000175000017500000000251411716447477021045 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_bgp_peers ($ip,$rocommunity,$hostid,$param) { $bgp_interfaces = array(); if ($ip && $hostid && $rocommunity) $ifIndex = snmp_walk($ip, $rocommunity, ".1.3.6.1.2.1.15.3.1.1"); //bgp.bgpPeerTable.bgpPeerEntry.bgpPeerIdentifier if (count($ifIndex) > 0) { $ifLocal = snmp_walk($ip,$rocommunity,".1.3.6.1.2.1.15.3.1.5"); $ifRemote = snmp_walk($ip,$rocommunity,".1.3.6.1.2.1.15.3.1.7"); $ifOperStatus = snmp_walk($ip,$rocommunity,".1.3.6.1.2.1.15.3.1.2"); $ifRemoteAS = snmp_walk($ip,$rocommunity,".1.3.6.1.2.1.15.3.1.9"); for ($i=0; $i < count($ifIndex) ; $i++) if ($ifIndex[$i]) { list($ifOperStatus[$i]) = explode("(",$ifOperStatus[$i]); switch ($ifOperStatus[$i]) { case 1: $OperStatus[$i] = "down"; break; case 3: $OperStatus[$i] = "down"; break; //active case 6: $OperStatus[$i] = "up"; break; } $ifRemote[$i] = trim($ifRemote[$i]); $bgp_interfaces[$ifRemote[$i]]= array( "local"=>trim($ifLocal[$i]), "asn"=>"AS ".$ifRemoteAS[$i], "interface"=>$ifRemote[$i], "oper"=> $OperStatus[$i] ); } } return $bgp_interfaces; } ?> jffnms-0.9.3/engine/discovery/alteon_virtualservers.inc.php0000644000175000017500000000440211571343027023520 0ustar csmallcsmall Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_alteon_virtualservers($ip, $community, $hostid, $param) { // SNMP OID $CfgVirtServerIndex = '.1.3.6.1.4.1.1872.2.1.5.5.1.1'; $CfgVirtServerIpAddress = '.1.3.6.1.4.1.1872.2.1.5.5.1.2'; $CfgVirtServerState = '.1.3.6.1.4.1.1872.2.1.5.5.1.4'; $CfgVirtServerDname = '.1.3.6.1.4.1.1872.2.1.5.5.1.5'; $CfgVirtServiceHname = '.1.3.6.1.4.1.1872.2.1.5.7.1.8'; $server_type=$param; $interfaces = array(); if ($ip && $community && $hostid) { $indexes = snmp_walk($ip, $community, $CfgVirtServerIndex); // Die Quickly if no index if ($indexes === FALSE) return FALSE; $ipaddrs = snmp_walk($ip, $community, $CfgVirtServerIpAddress); $adminstates = snmp_walk($ip, $community, $CfgVirtServerState); $serverdnames = snmp_walk($ip, $community, $CfgVirtServerDname); if ($indexes !== FALSE) { foreach($indexes as $key => $index) { $ipaddress = ''; if (array_key_exists($key, $ipaddrs)) { if (($colpos = strpos($ipaddrs[$key],':')) !== FALSE) $ipaddress = substr($ipaddrs[$key],$colpos+1); else $ipaddress = $ipaddrs[$key]; } $ipaddress = trim($ipaddress); if (empty($serverdnames["$key"])) { $servername = 'unknown'; } else { $service_hnames = snmp_walk($ip, $community,$CfgVirtServiceHname.".$index" ); if (!empty($service_hnames[0])) { $servername = "$service_hnames[0].$serverdnames[$key]"; } else { $servername = $serverdnames["$key"]; } } if (isset($adminstates["$key"]) && $adminstates["$key"] == '2') $admin = 'up'; else $admin = 'down'; $interfaces["$index"] = array ( 'interface' => $ipaddress, 'hostname' => $servername, 'address' => $ipaddress, 'admin' => $admin, 'oper' => 'up', //Always up if switch is alive ); } } } //var_dump($interfaces); return $interfaces; } ?> jffnms-0.9.3/engine/discovery/linux_tc.inc.php0000644000175000017500000000324611716447477020727 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ // Use with the JFFNMS tc-snmp program function discovery_linux_tc ($ip,$rocommunity,$hostid,$param) { $linux_tc = array(); $linux_tc_oid = $param; if ($ip && $hostid && $rocommunity) $clIndex = snmp_walk($ip,$rocommunity,"$linux_tc_oid.1.0"); if ((is_array($clIndex)) && (count($clIndex) > 0)) { $ifIndex = snmp_walk($ip,$rocommunity,"$linux_tc_oid.0.0"); $ifNames = snmp_walk($ip,$rocommunity,"$linux_tc_oid.0.1"); $clInt = snmp_walk($ip,$rocommunity,"$linux_tc_oid.1.1"); $clNames = snmp_walk($ip,$rocommunity,"$linux_tc_oid.1.2"); $clQdisc = snmp_walk($ip,$rocommunity,"$linux_tc_oid.1.3"); $clRate = snmp_walk($ip,$rocommunity,"$linux_tc_oid.1.4"); $clCeil = snmp_walk($ip,$rocommunity,"$linux_tc_oid.1.5"); if (is_array($ifIndex) && is_array($ifNames) && is_array($clInt) && is_array($clNames) && is_array($clQdisc) && is_array($clRate) && is_array($clCeil)) foreach ($clIndex as $pos=>$index) { $aux1 = array(); $aux1["interface"] = $ifNames[array_search($clInt[$pos],$ifIndex)]."/".$clNames[$pos]; $aux1["interface"] = str_replace ("\"","",$aux1["interface"]); //clean posible quotes, happens in windows $aux1["description"] = "TC ".str_replace("\"","",$clQdisc[$pos]); $aux1["rate"] = $clRate[$pos]; $aux1["ceil"] = $clCeil[$pos]; $aux1["oper"] = "up"; $linux_tc[$index]= $aux1; unset($aux1); } } return $linux_tc; } ?> jffnms-0.9.3/engine/discovery/none.inc.php0000644000175000017500000000040511716447477020033 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_none () { $none = array(); return $none; } ?> jffnms-0.9.3/engine/discovery/simple.inc.php0000644000175000017500000000132411467742300020350 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_simple ($ip, $rocommunity, $hostid, $param) { $simple = array(); if (!empty($rocommunity) && !empty($ip)) { list ($test_oid, $interface_name) = explode (',', $param); $test = snmp_get($ip, $rocommunity, $test_oid); // query the Test OID if ($test!==false) // if the OID exists $simple[1] = array( // return a new interface 'interface' => $interface_name, // with the specified name 'oper' => 'up' ); } return $simple; } ?> jffnms-0.9.3/engine/discovery/ibm_blade_servers.inc.php0000644000175000017500000000473611412635632022537 0ustar csmallcsmall David LIMA * This program is licensed under the GNU GPL, full terms in the LICENSE file */ // Some used OID for this interface type define('BladeServerIndex', '.1.3.6.1.4.1.2.3.51.2.22.1.5.1.1.1'); define('BladeServerSerial', '.1.3.6.1.4.1.2.3.51.2.2.21.4.1.1.11'); define('BladeServerState', '.1.3.6.1.4.1.2.3.51.2.22.1.5.1.1.3'); define('BladeServerHealthState', '.1.3.6.1.4.1.2.3.51.2.22.1.5.1.1.5'); define('BladeServerName', '.1.3.6.1.4.1.2.3.51.2.22.1.5.1.1.6'); define('BladeManufDate', '.1.3.6.1.4.1.2.3.51.2.2.21.4.1.1.9'); function discovery_ibm_blade_servers($ip, $community, $hostid, $param) { $interfaces = array(); if ($ip && $community && $hostid) { $indexes = snmp_walk($ip, $community, BladeServerIndex); if ($indexes === FALSE) return FALSE; $bladeserverserial = snmp_walk($ip, $community, BladeServerSerial); $bladeserverstate = snmp_walk($ip, $community, BladeServerState); $bladeservername = snmp_walk($ip, $community, BladeServerName); $bladeserverhealth = snmp_walk($ip,$community, BladeServerHealthState); $blademanufdate = snmp_walk($ip,$community, BladeManufDate); if ($indexes !== FALSE) { foreach($indexes as $index) { $idx = $index-1; if (!isset($bladeserverserial["$idx"])) $bladeserverserial="N/A"; else $bladeserverfru= $bladeserverserial["$idx"]; if (!isset($bladeservername["$idx"])) $bladeservername["$idx"] = 'N/A'; if (!isset($blademanufdate["$idx"])) $blademanufdate["$idx"] = 'N/A'; if (isset($bladeserverstate["$idx"]) && $bladeserverstate["$idx"] == '1') { $admin = 'Up'; } else { $admin = 'No blade present'; } switch ($bladeserverhealth["$idx"]) { case "0": $bladeserverhealth["$idx"] = "N/A"; break; case "1": $bladeserverhealth["$idx"] = "good"; break; case "2": $bladeserverhealth["$idx"] = "warning"; break; case "3": $bladeserverhealth["$idx"] = "bad"; break; } $interfaces["$index"] = array ( //'interface' => $index, 'serial' => $bladeserverfru, 'admin' => $admin, 'interface' => $bladeservername["$idx"], 'manuf_date' => $blademanufdate["$idx"], 'health_state' => $bladeserverhealth["$idx"], ); } } } return $interfaces; } ?> jffnms-0.9.3/engine/discovery/pdu_banks.inc.php0000644000175000017500000000570611417603210021024 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file * * Chris Wopat - me@falz.net Jan 2006 * Nov 2007 - fixed to work with v3+ of APC firmware */ function discovery_pdu_banks ($ip,$rocommunity,$hostid,$param) { $pdu_banks = array(); $PDUMIB = '.1.3.6.1.4.1.318.1.1.12'; $pduFirmwareVersion_oid = $PDUMIB . '.1.3.0'; $pduBanksIndex_oid = $PDUMIB . '.2.3.1.1.1'; $pduBankNearOverloadThresholdRoot_oid = $PDUMIB . '.2.4.1.1.3'; $pduBankOverloadThresholdRoot_oid = $PDUMIB . '.2.4.1.1.4'; // these two are only used in legacy (v2 firmware) to find the total thresholds $pduTotalNearOverloadThresholdLegacy_oid = $PDUMIB.'.2.2.1.1.3.1'; $pduTotalOverloadThresholdLegacy_oid = $PDUMIB.'.2.2.1.1.4.1'; if (!empty($ip) && !empty($rocommunity)) { $pduFirmwareVersion = snmp_get($ip, $rocommunity, $pduFirmwareVersion_oid); // returns something like "v2.6.5" or "v3.3.3": $pduFirmwareVersionMajor = substr($pduFirmwareVersion, 1, 1); // returns "2" or "3", etc: $pduNumBanks = snmp_walk($ip, $rocommunity, $pduBanksIndex_oid); // total number of banks if (!is_array($pduNumBanks)) return FALSE; if ($pduFirmwareVersionMajor > 2) $pduBankTotalID = count($pduNumBanks); // last bank = totals for v3 firmware else $pduBankTotalID = '1'; // first bank = totals for v2 firmware // grab last item, as it's the "special" total item foreach ($pduNumBanks as $index) { // special treatment if this is the "total" bank. // Mainly for legacy firmware support if ($index == $pduBankTotalID) { $interface = 'Bank Total'; if ($pduFirmwareVersionMajor < 3) { $powerrating = snmp_get($ip, $rocommunity, $pduTotalNearOverloadThresholdLegacy_oid); $threshold = snmp_get($ip, $rocommunity, $pduTotalOverloadThresholdLegacy_oid); } else { $powerrating = snmp_get($ip, $rocommunity, $pduBankNearOverloadThresholdRoot_oid . "." . $index); $threshold = snmp_get($ip, $rocommunity, $pduBankOverloadThresholdRoot_oid . "." . $index); } } else { if ($pduFirmwareVersionMajor < 3) { $interface = 'Bank '. ($index -1); $pollindex = $index - 1; } else { $interface = 'Bank '. ($index); $pollindex = $index; } $powerrating = snmp_get($ip, $rocommunity, $pduBankNearOverloadThresholdRoot_oid . '.' . $pollindex); $threshold = snmp_get($ip, $rocommunity, $pduBankOverloadThresholdRoot_oid . '.' . $pollindex); } // create array out of information we've gathered $pdu_banks[$index] = array( 'interface'=>$interface, 'powerrating'=>$powerrating, 'threshold'=>$threshold, 'index'=>$index, 'admin'=>'up', 'oper'=>'up' ); } } return $pdu_banks; } ?> jffnms-0.9.3/engine/discovery/pix_connections.inc.php0000644000175000017500000000203111716447477022273 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_pix_connections ($ip,$community, $host_id, $param) { $cnx_stats = array(); $cfwConnectionStatEntry = ".1.3.6.1.4.1.9.9.147.1.2.2.2.1"; $cfwConnectionStatValue = $cfwConnectionStatEntry.".5"; $cfwConnectionStatDescription = $cfwConnectionStatEntry.".3"; if ($ip && $community && $host_id) { //check for required values $cnx_values = snmp_walk ($ip, $community, $cfwConnectionStatValue, INCLUDE_OID_2); if (is_array($cnx_values)) { $cnx_descr = snmp_walk ($ip, $community, $cfwConnectionStatDescription, INCLUDE_OID_2); while (list ($key) = each ($cnx_values)) $cnx_stats[$key] = array ( "interface" => "FW Stat ".$key, "description" => $cnx_descr[$key], "oper" => "up" ); } } return $cnx_stats; } ?> jffnms-0.9.3/engine/discovery/host_information.inc.php0000644000175000017500000000425211737256147022455 0ustar csmallcsmall Robert Bogdon * Copyright (C) <2002-2005> Modifications by Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_host_information ($ip,$rocommunity,$hostid,$param) { $systemMIB_oid = ".1.3.6.1.2.1.1"; $sysDescr_oid = $systemMIB_oid.".1.0"; $sysObjectID_oid = $systemMIB_oid.".2.0"; $sysContact_oid = $systemMIB_oid.".4.0"; $sysName_oid = $systemMIB_oid.".5.0"; $sysLocation_oid = $systemMIB_oid.".6.0"; $hrDeviceType_oid = ".1.3.6.1.2.1.25.3.2.1.2"; $cpu_info = array(); if ($ip && !empty($rocommunity)) { // Fetch the ObjectID $system_oid = snmp_get($ip, $rocommunity, $sysObjectID_oid); $system_oid = str_replace (".1.3.6.1.4.1","enterprises",$system_oid); //replace OID for enterprises // Check if the ObjectID is in our parameters $found = false; $systems = explode(",",$param); foreach ($systems as $data) if (strpos($system_oid,trim($data)) > 1) $found = true; // If it was, get all the other information and return an interface if ($found==true) { $description = str_replace("\n",' ',snmp_get ($ip, $rocommunity, $sysDescr_oid)); $name = snmp_get ($ip, $rocommunity, $sysName_oid); $contact = snmp_get ($ip, $rocommunity, $sysContact_oid); $location = snmp_get ($ip, $rocommunity, $sysLocation_oid); // Try to discover the number of CPUs $cpus = 0; $devices = snmp_walk ($ip, $rocommunity, $hrDeviceType_oid); if (is_array($devices)) foreach ($devices as $device) if ((strpos($device, "Processor")!==false) || (strpos($device, "25.3.1.3")!==false)) $cpus++; if ($cpus==0) // if it didn't have any, or it didn't have support for that OID. $cpus = 1; // we assume it has at least 1 CPU. $cpu_info[1] = array( "interface" => "CPU", "oper" => "up", "cpu_num" => $cpus, "name" => $name, "location" => $location, "contact" => $contact, "description" => $description, ); } } return $cpu_info; } ?> jffnms-0.9.3/engine/discovery/apc.inc.php0000644000175000017500000000233611716447477017644 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_apc ($ip,$rocommunity,$hostid,$param) { $apc = array(); list ($apc_oid) = explode(",",$param); if ($ip && $hostid && $rocommunity) { $system_oid = @current(snmp_walk($ip, $rocommunity, ".1.3.6.1.2.1.1.2")); // system.sysObjectID if (strpos($system_oid,$apc_oid)!==false) { $aux = array(); $apcmib = ".1.3.6.1.4.1.318.1.1.1."; $name_oid = $apcmib."1.1.2.0"; $model_oid = $apcmib."1.1.1.0"; $status_oid = $apcmib."2.1.1.0"; $name = trim(snmp_get($ip,$rocommunity,$name_oid)); $model = snmp_get($ip,$rocommunity,$model_oid); $status = snmp_get($ip,$rocommunity,$status_oid); $battery_status = array (1=>"bettery unknown", 2=>"battery normal", 3=>"battery low"); if (!empty($name) && !empty($model) && !empty($status)) { $aux = array(); $aux["interface"] = $model; $aux["description"] = $name; $aux["admin"] = "up"; $aux["oper"] = $battery_status[$status]; $apc[1]=$aux; } } } return $apc; } ?> jffnms-0.9.3/engine/discovery/linux_iptables.inc.php0000644000175000017500000000435611716447477022127 0ustar csmallcsmall Hans Peter Dittler * Copyright (C) <2005> Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_linux_iptables ($ip,$rocommunity,$hostid,$param) { $linux_iptables = array(); $IPT_MIB = $param; if ($ip && $hostid && $rocommunity) $tableIndex = snmp_walk($ip,$rocommunity, $IPT_MIB.".0.0", false, 5); if ((is_array($tableIndex)) && (count($tableIndex) > 0)) { $tableName = snmp_walk ($ip,$rocommunity, $IPT_MIB.".0.1"); $chainIndex = snmp_walk ($ip,$rocommunity, $IPT_MIB.".1.0"); $chainTableIndex= snmp_walk ($ip,$rocommunity, $IPT_MIB.".1.1"); $chainName = snmp_walk ($ip,$rocommunity, $IPT_MIB.".1.2"); $chainPolicy = snmp_walk ($ip,$rocommunity, $IPT_MIB.".1.3"); if (is_array($chainIndex) && is_array($tableName) && is_array($chainTableIndex) && is_array($chainName) && is_array($chainPolicy)) foreach ($chainIndex as $pos=>$chain_id) if ($chainPolicy[$pos]!="dynamic") { $chain = $tableName[array_search($chainTableIndex[$pos],$tableIndex)]."/".$chainName[$pos]; $linux_iptables[$chain_id] = array( "interface" => "IPTables ".$chain, "policy" => $chainPolicy[$pos], "description"=>$chain." Chain", "oper" => "up" ); } //d($linux_iptables); } return $linux_iptables; } // iptables are transmitted in three sepearte tables // rows in table 0 // 0 - index of table // 1 - name of table // rows in table 1 // 0 - index of chain // 1 - index of table where this chain belongs to // 2 - name of chain // 3 - default policy of chain or keyword dynamic for dymacally defined chains // 4 - packets worked by this chain (not counting LOG) // 5 - bytes worked by this chain (not counting LOG) // 6 - packets ACCEPTED by this chain // 7 - bytes ACCEPTED by this chain // rows in table 2 // 0 - index of rule // 1 - index of chain which contains this rule // 2 - target of this rule // 3 - parameters of this rule // 4 - packets worked by this rule // 5 - bytes worked by this rule ?> jffnms-0.9.3/engine/discovery/snmp_interfaces.inc.php0000644000175000017500000001232711740430352022237 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_snmp_interfaces($ip,$rocommunity,$hostid,$param) { $ifAux = array(); $snmp_interfaces = array(); list($host_ip) = explode(":",$ip); //remove :port from IP $host_ip = gethostbyname ($host_ip); //try to resolve it, this is just to check there is an IP if ((ip2long($host_ip)!==-1) && !empty($hostid) && !empty($rocommunity)) $ifIndex = snmp_walk($ip, $rocommunity, '.1.3.6.1.2.1.2.2.1.1'); if (is_array($ifIndex) && (count($ifIndex) > 0)) { // Exceptions include_once(jffnms_shared('catos')); //Load the CatOS Functions include_once(jffnms_shared('webos')); //Load the WebOS Functions if (is_catos($ip, $rocommunity)) // Check if its CatOS list ($ifDescr_oid, $ifAlias) = catos_info($ip, $rocommunity, $ifIndex); //Get the CatOS Information elseif (is_webos($ip, $rocommunity)) // Check if its WebOS list($ifDescr,$ifAlias) = webos_info($ip, $rocommunity, $ifIndex); else //Normal IF-MIB oids { $ifDescr_oid = '.1.3.6.1.2.1.2.2.1.2'; $ifAlias_oid = '.1.3.6.1.2.1.31.1.1.1.18'; } // Get all the data via SNMP if (isset($ifDescr_oid)) $ifDescr = snmp_walk($ip,$rocommunity,$ifDescr_oid); if (isset($ifAlias_oid)) $ifAlias = snmp_walk($ip,$rocommunity,$ifAlias_oid); $ifAdminStatusValue = snmp_walk($ip,$rocommunity,'.1.3.6.1.2.1.2.2.1.7'); $ifOperStatus = snmp_walk($ip,$rocommunity,'.1.3.6.1.2.1.2.2.1.8'); $ifSpeed = snmp_walk($ip,$rocommunity,'.1.3.6.1.2.1.2.2.1.5'); $ipAddEntIP = snmp_walk($ip,$rocommunity,'.1.3.6.1.2.1.4.20.1.1'); $ipAddifIndex = snmp_walk($ip,$rocommunity,'.1.3.6.1.2.1.4.20.1.2'); $ipAddMask = snmp_walk($ip,$rocommunity,'.1.3.6.1.2.1.4.20.1.3'); if (!is_array($ipAddifIndex)) $ipAddifIndex = array(); for ($i=0; $i < count($ifIndex) ; $i++) if ($ifIndex[$i]) { $ipPos = array_search($ifIndex[$i],$ipAddifIndex); //Find FIRST the pos where this ifIndex has an IP if ($ipPos !== false) //we Found some IPs for this interface index { $ifAddr[$i] = $ipAddEntIP[$ipPos]; //Get the IP from that Pos $ifAddrMask[$i] = $ipAddMask[$ipPos]; //Get the Mask from that Pos if (strpos($ifAddr[$i],".") > 0) //IP Address for peer { $aux = explode(".",$ifAddr[$i]); if ($aux[3]%2) $aux[3]++; //if it's even, then peer is next one else if ($aux[3]>0) $aux[3]--; //if its not and grater than 0 peer is previous one $peerAddr[$i] = implode('.',$aux); } } if (array_key_exists($i, $ifSpeed)) $ifspeed = round($ifSpeed[$i]/1000)*1000; else $ifspeed = 128000; // default is 128kbps $admin = parse_interface_status($ifAdminStatusValue[$i]); $oper = parse_interface_status($ifOperStatus[$i]); $descr = fix_interface_description($ifDescr[$i]); $alias = array_item_blank($ifAlias, $i); $alias = str_replace(array("\"", "'"),array('',''), $alias); $new_interface = array( 'address' => array_item_blank($ifAddr, $i), 'mask' => array_item_blank($ifAddrMask, $i), 'peer' => array_item_blank($peerAddr, $i), 'description' => $alias, 'interface' => $descr, 'bandwidthin' => $ifspeed, 'bandwidthout' => $ifspeed, 'admin' => $admin, 'oper' => $oper, ); // Juniper Fixes // Because Juniper Creates one new interface per L3 stack on each L2 interface // So we have to merge them //if the before-end char is . (like in t1-1/0/1:6.0) and the description is not set if (preg_match('/^(.+)\..$/', $new_interface['interface'], $regs) && (empty($new_interface['description']))) { $int = $regs[1]; if (!empty($interface_names[$int])) // if it is already loaded in list { $old_id = $interface_names[$int]; $aux2 = $snmp_interfaces[$old_id]; $aux2['address'] = $new_interface['address']; $aux2['peer'] = $new_interface['peer']; $new_interface = $aux2; unset ($snmp_interfaces[$old_id]); } } else $interface_names[$new_interface['interface']] = $ifIndex[$i]; //check for the interface name, if its ok, add the interface to the list if (!empty($new_interface['interface'])) $snmp_interfaces[$ifIndex[$i]]= $new_interface; } }//is_array ifindex return $snmp_interfaces; } function fix_interface_description($ifdescr) { global $Config; //FIXME This is only for cisco to discard Atm9/1/0.2-aal5 layer, and FastEthernet4/0/0.1-ISL vLAN s after the dash if (preg_match('/^(.+)-(?:aal5|ISL|802\.1Q)/', $ifdescr, $regs)) $ifdescr = $regs[1]; if ($Config->get('os_type') == 'windows') $ifdescr = str_replace("\"", '', $ifdescr); $ifdescr = substr(snmp_hex_to_string($ifdescr),0,30); $ifdescr = str_replace("'", '', $ifdescr); return $ifdescr; } ?> jffnms-0.9.3/engine/discovery/ibm_blade_power.inc.php0000644000175000017500000000307311412636013022165 0ustar csmallcsmall David LIMA * This program is licensed under the GNU GPL, full terms in the LICENSE file */ // Some used OID for this interface type define('fuelGaugeIndex', '.1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.1'); define('fuelGaugeStatus', '.1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.3'); define('fuelGaugeFirstPowerModule', '.1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.4'); define('fuelGaugeSecondPowerModule', '.1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.5'); define('fuelGaugeTotalPower', '.1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.7'); function discovery_ibm_blade_power($ip, $community, $hostid, $param) { $interfaces = array(); if ($ip && $community && $hostid) { $indexes = snmp_walk($ip, $community, fuelGaugeIndex); if ($indexes !== FALSE) { $fuelgaugestatus = snmp_walk($ip, $community, fuelGaugeStatus); $fuelgaugefirstpowermodule = snmp_walk($ip, $community, fuelGaugeFirstPowerModule); $fuelgaugesecondpowerpodule = snmp_walk($ip, $community, fuelGaugeSecondPowerModule ); $fuelgaugetotalpower = snmp_walk($ip,$community, fuelGaugeTotalPower); foreach($indexes as $idx=>$index) { $interfaces[$index] = array ( 'admin'=> 'ok', 'interface' => "Power domain $index", 'status' => $fuelgaugestatus[$idx], 'module1' => $fuelgaugefirstpowermodule[$idx], 'module2' => $fuelgaugesecondpowerpodule[$idx], 'totalpower' => $fuelgaugetotalpower[$idx], ); } } } return $interfaces; } ?> jffnms-0.9.3/engine/discovery/ibm_ComponentHealth.inc.php0000644000175000017500000000162211716447477023015 0ustar csmallcsmall David LIMA * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_ibm_ComponentHealth($ip, $community, $hostid, $param) { $interfaces = array(); $ComponentHealth_MIB = ".1.3.6.1.4.1.2.6.159.1.1.30.3.1"; $KeyIndex_oid = $ComponentHealth_MIB.".1"; if ($ip && $community && $hostid) { $ComponentEntries = snmp_walk($ip, $community, $KeyIndex_oid, true); //var_dump($ComponentEntries); if (is_array($ComponentEntries)) foreach ($ComponentEntries as $oid=>$interface) { $index = join(".",array_slice(explode(".",$oid),10)); $interfaces[$index] = array ( 'interface' => $interface, 'oper' => "OK" ); } else return false; } return $interfaces; } ?> jffnms-0.9.3/engine/discovery/cisco_accounting.inc.php0000644000175000017500000000523411716447477022413 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_cisco_accounting ($ip,$rocommunity,$hostid,$param) { $accounting = array(); $mac_accounting_oid = ".1.3.6.1.4.1.9.9.84.1.2.1.1.3"; $netToMedia_oid = ".1.3.6.1.2.1.4.22.1.2"; $bgpRemote_oid = ".1.3.6.1.2.1.15.3.1.7"; $bgpAS_oid = ".1.3.6.1.2.1.15.3.1.9"; if ($ip && $hostid && $rocommunity) $mac = snmp_walk($ip,$rocommunity,$mac_accounting_oid,1); if (is_array($mac)) { $netToMedia = snmp_walk($ip,$rocommunity,$netToMedia_oid,1); $bgpRemote = snmp_walk($ip,$rocommunity,$bgpRemote_oid,1); while (list ($oid,) = each ($mac)) { unset ($ip_aux); unset($ip_addr); unset($asn); unset ($mac_hex2); unset ($sum); unset($mac_hex); $aux = explode(".",$oid); $ifIndex = $aux[9]; $direction = $aux[10]; $mac_array = array_slice($aux,11,16); $mac_addr_dec = join(".",$mac_array); foreach ($mac_array as $part) $mac_hex[] = str_pad(dechex($part),2,"0",STR_PAD_LEFT); $mac_addr_hex1 = strtoupper(@join(":",$mac_hex)); foreach ($mac_array as $part) { $aux = dechex($part); $mac_hex2[] = $aux; $sum += (int)$aux; } $mac_addr_hex2 = @join(":",$mac_hex2); if (!$accounting[$sum]) { //if we dont already have this MAC address //Get Interface Name $interface = substr(snmp_hex_to_string(snmp_get($ip,$rocommunity,".1.3.6.1.2.1.2.2.1.2.$ifIndex")),0,30); //get IP Address $ip_aux = array_search($mac_addr_hex2,$netToMedia); } if ($ip_aux) { //if has an ip address; unset($netToMedia[$ip_aux]); //delete it so we have only one ip address per mac $ip_addr = join(".",array_slice(explode(".",$ip_aux),-4)); //GET BGP ASN if Any if ($as_aux = array_search("IpAddress: $ip_addr",$bgpRemote)) $asn = snmp_get($ip,$rocommunity,$bgpAS_oid.".".join(".",array_slice(explode(".",$as_aux),-4))); else $asn = ""; //debug ("IfIndex $ifIndex, Interface $interface, Direction $direction, " // ."MAC: DEC: $mac_addr_dec HEX: $mac_addr_hex HEX1: $mac_addr_hex1 HEX2: $mac_addr_hex2, IP: $ip_addr, ASN: $asn"); if ($asn) $asn = "AS $asn"; $aux1["address"] = $ip_addr; $aux1["mac"] = $mac_addr_dec; $aux1["ifindex"] = $ifIndex; $aux1["description"] = "MAC $mac_addr_hex1 $asn"; $aux1["interface"] = $interface.":$sum"; $aux1["oper"] = "up"; $accounting[$sum]=$aux1; } } } return $accounting; } ?> jffnms-0.9.3/engine/discovery/tcp_ports.inc.php0000644000175000017500000000266411743375617021116 0ustar csmallcsmall JFFNMS Authors * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_tcp_ports($host,$community, $host_id, $param) { global $Config; $ports = array(); if ( ($host_info = resolve_host($host)) === FALSE) return $ports; $nmap = $Config->get('nmap_executable'); list ($af, $ip, $port) = $host_info; if ($af == 6) $ipv6_flag='-6'; else $ipv6_flag=''; if ($host_id && (is_executable($nmap)===TRUE)) { $command = "$nmap $ipv6_flag $param -n -oG - $ip"; exec($command, $lines, $retval); if ($retval != 0) { logger("tcp_ports(): nmap returned $retval\n"); return $ports; } foreach($lines as $id => $line) { if (preg_match('/Host: [0-9a-f:.]+\s+\S+\s+Ports: (.+)\s+Ignored State:/', $line, $regs)) { $nmap_ports = explode(',',$regs[1]); foreach($nmap_ports as $nmap_port) { $port_data = explode('/', $nmap_port); if ($port_data[1] == 'open') { $port_num = trim($port_data[0]); $ports[$port_num] = array( 'interface' => 'Port '.$port_num, 'description' => $port_data[4], 'admin' => 'open', 'oper' => 'open' ); } }//foreach nmap ports }// preg match host }//foreach lines } return $ports; } ?> jffnms-0.9.3/engine/discovery/livingston_serial_port.inc.php0000644000175000017500000000153211716447477023675 0ustar csmallcsmall Thomas Mangin * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_livingston_serial_port ($ip, $rocommunity, $hostid, $param) { $oid = ".1.3.6.1.4.1.307.3.2.1.1.1.8"; $interface = array(); $number = 0; if ($ip && $hostid && $rocommunity) { $state = snmp_walk($ip, $rocommunity, $oid); $number = count($state); //Remove two : one failed and one console $number --; if ( $number > 0 ) { $interface[1]["description"] = "AS $ip"; $interface[1]["interface"] = "Serial lines"; $interface[1]["oper"] = "up"; $interface[1]["admin"] = "ok"; $interface[1]["interface_number"] = $number; } } return $interface; } ?> jffnms-0.9.3/engine/discovery/informant_ldisks.inc.php0000644000175000017500000000152411716447477022445 0ustar csmallcsmall David LIMA * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_informant_ldisks($ip, $community, $hostid, $param) { $interfaces = array(); $SNMP_INFORMAT_MIB = ".1.3.6.1.4.1.9600.1.1"; $lDiskEntry_oid = $SNMP_INFORMAT_MIB.".1.1.1.2"; if ($ip && $community && $hostid) { $DisksEntries = snmp_walk($ip, $community, $lDiskEntry_oid, true); if (is_array($DisksEntries)) foreach ($DisksEntries as $oid=>$interface) { $index = join(".",array_slice(explode(".",$oid),7)); $interfaces[$index] = array ( 'interface' => $interface." Stats", 'oper' => "up" ); } else return false; } return $interfaces; } ?> jffnms-0.9.3/engine/discovery/hostmib_apps.inc.php0000644000175000017500000000247611717643703021565 0ustar csmallcsmall Anders Karlsson * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_hostmib_apps($ip,$community, $host_id, $param) { $services_table = array(); $SWRunName_oid = ".1.3.6.1.2.1.25.4.2.1.2"; $SWRunPath_oid = ".1.3.6.1.2.1.25.4.2.1.4"; if ($ip && $community && $host_id) { //check for required values $services = snmp_walk($ip,$community,$SWRunName_oid); $paths = snmp_walk($ip,$community,$SWRunPath_oid); if (is_array($services)) //verify if the array has something foreach ( $services as $key=>$service ) { $service=trim(str_replace('"','',$service)); $path= preg_replace("/[^[:print:]]/","", trim(str_replace('"','', snmp_hex_to_string($paths[$key])))); if (!isset($services_table[$service])) $services_table[$service]=array( "interface"=>$service, "process_name"=>$service, "description"=>"Application $path", "instances"=>1, "ignore_case"=>0, "oper"=>"running" ); else $services_table[$service]["instances"]++; //add one more instance } } return $services_table; } ?> jffnms-0.9.3/engine/discovery/storage.inc.php0000644000175000017500000000637611571317233020536 0ustar csmallcsmall Robert Bogdon * Copyright (C) <2002-2005> Modifications by Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_storage($ip,$rocommunity,$hostid,$param) { $storage_devices = array(); $blocked_devices = array ('/dev', '/.vol'); if (!$ip || !$hostid || !$rocommunity) return $storage_devices; $deviceIndex = snmp_walk($ip, $rocommunity, '.1.3.6.1.2.1.25.2.3.1.1'); if ($deviceIndex === FALSE) return $storage_devices; if (count($deviceIndex) > 0) { $deviceDescription = snmp_walk($ip, $rocommunity, '.1.3.6.1.2.1.25.2.3.1.3'); $deviceType = snmp_walk($ip, $rocommunity, '.1.3.6.1.2.1.25.2.3.1.2'); $deviceBlockSize = snmp_walk($ip, $rocommunity, '.1.3.6.1.2.1.25.2.3.1.4'); $deviceBlockCount = snmp_walk($ip, $rocommunity, '.1.3.6.1.2.1.25.2.3.1.5'); for ($i=0; $i < count($deviceIndex) ; $i++) { if (!array_key_exists($i,$deviceIndex)) continue; $devInfo = array(); $aux1 = array(); if (isset($deviceType[$i])) { $tmp_type = storage_get_device_type($deviceType[$i]); if ($tmp_type !== FALSE) $devInfo['storage_type'] = $tmp_type; } list($deviceBlockSize[$i], $aux) = explode(' ', $deviceBlockSize[$i]); if (isset($deviceBlockSize[$i]) && isset($deviceBlockCount[$i])) $devInfo['size'] = $deviceBlockSize[$i] * $deviceBlockCount[$i]; include_once(jffnms_shared('storage')); list ($devInfo['interface'], $devInfo['description']) = storage_interface_parse_description ($deviceDescription[$i]); foreach ($devInfo as $key=>$value) $devInfo[$key]=trim($value); if (in_array($devInfo['interface'], $blocked_devices)) //set blocked devices to size 0 so they don't get auto-discovered $devInfo['size'] = 0; if ($devInfo['size'] > 0) { $devInfo['admin'] = 'up'; $devInfo['oper'] = 'up'; } else { $devInfo['admin'] = 'down'; $devInfo['oper'] = 'down'; } $storage_devices[$deviceIndex[$i]] = $devInfo; }//for }//found indexes //debug($storage_devices); return $storage_devices; } function storage_get_device_type($raw_device_type) { if (strpos ($raw_device_type,'.hrStorage')!==FALSE) //UCD-SNMP { $aux1 = explode('.hrStorage',$raw_device_type); if (isset($aux1[count($aux1) - 1])) return($aux1[count($aux1) - 1]); } if (strpos ($raw_device_type,'::hrStorage')!==FALSE) //NET-SNMP { $aux1 = explode ('::',$raw_device_type); return (str_replace('hrStorage','',$aux1[count($aux1)-1])); } //if we didnt get the name in the OID, use the RFC/MIB Values $aux1 = explode ('.', $raw_device_type); $device_type_id = current(array_reverse($aux1)); //get the last value of the OID switch ($device_type_id) { case '1' : return 'Other'; break; case '2' : return 'Ram'; break; case '3' : return 'VirtualMemory'; break; case '4' : return 'FixedDisk'; break; case '5' : return 'RemovableDisk'; break; case '6' : return 'FloppyDisk'; break; case '7' : return 'CompactDisk'; break; case '8' : return 'RamDisk'; break; } return FALSE; } ?> jffnms-0.9.3/engine/discovery/informant_adv_ldisks.inc.php0000644000175000017500000000144711412635322023260 0ustar csmallcsmall Craig Small * Based on the work by David LIMA and Sebastian van Dijk */ // define('lDiskInstance', '.1.3.6.1.4.1.9600.1.2.44.1.1'); function discovery_informant_adv_ldisks($ip, $community, $hostid, $param) { $interfaces = array(); if ($ip && $community && $hostid) { $instances = snmp_walk($ip, $community, lDiskInstance, TRUE); if ($instances === FALSE) return FALSE; foreach($instances as $oid => $instance) { //$oid = 'enterprises.9600.1.2.44.1.1.2.67.58' i think $index = join('.',array_slice(explode('.',$oid),7)); $interfaces["$index"] = array ( 'interface' => $instance.' Stats', 'oper' => 'up' ); } } return $interfaces; } jffnms-0.9.3/engine/discovery/iis_info.inc.php0000644000175000017500000000111411450352227020650 0ustar csmallcsmall Robert St.Denis * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_iis_info ($ip, $rocommunity, $hostid, $param) { if (!$ip || !$hostid || !$rocommunity) return array(); $test = snmp_get($ip, $rocommunity, '.1.3.6.1.4.1.311.1.7.3.1.1.0'); if ($test === FALSE) return array(); $iis_info = array(1 => array( 'interface' => 'IIS Information', 'admin' => 'ok', 'oper' => 'up' )); return $iis_info; } ?> jffnms-0.9.3/engine/discovery/cisco_envmib.inc.php0000644000175000017500000000272611716447477021544 0ustar csmallcsmall Anders Karlsson * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_cisco_envmib($ip,$community, $host_id, $param) { $envinfo = Array(); $CiscoEnvMibOid=".1.3.6.1.4.1.9.9.13.1"; list ($interface_basename, $list_oid, $status_oid) = explode(",",$param); $oid_list = "$CiscoEnvMibOid.$list_oid"; $oid_status= "$CiscoEnvMibOid.$status_oid"; if ($ip && $community && $host_id) { //check for required values $envmon_list = snmp_walk($ip,$community,$oid_list,1); $envmon_status = snmp_walk($ip,$community,$oid_status,1); if (is_array($envmon_list) && (count($envmon_list)==count($envmon_status))) while (list ($key, $entry) = each ($envmon_list)) { list ($key_aux ,$entry_status) = each ($envmon_status); //keep tracking the status entries $key_array = explode (".",$key); $key = $key_array[count($key_array)-1]; $entry=str_replace('"','',$entry); $interface_name = $interface_basename.$key; if ($entry_status==1) $status = "up"; //if status is 1 is up else $status = "down"; $envinfo[$key]["interface"] = $interface_name; $envinfo[$key]["description"] = $entry; $envinfo[$key]["admin"] = $status; $envinfo[$key]["oper"] = $status; } } return $envinfo; } ?> jffnms-0.9.3/engine/discovery/reachability.inc.php0000644000175000017500000000152511655375665021541 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_reachability ($host,$community, $host_id, $param) { global $Config; $reach = array(); if ( ($host_info = resolve_host($host)) === FALSE) return $reach; list ($af, $ip, $port)= $host_info; if ($af == 6) $fping = $Config->get ('fping6_executable'); else $fping = $Config->get ('fping_executable'); $perms = @fileperms($fping); if ($host_id && (file_exists($fping)===TRUE) && ($perms & 0x800)) { $reach['1']['description'] = 'Reachability to '.$ip; $reach['1']['interface'] = 'Reachability Test'; $reach['1']['admin'] = 'Not Checked'; $reach['1']['oper'] = 'reachable'; } return $reach; } ?> jffnms-0.9.3/engine/discovery/fc_ports.inc.php0000644000175000017500000000264511716447477020723 0ustar csmallcsmall David LIMA * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_fc_ports($ip, $community, $hostid, $param) { $fcFxPortPhysOperStatus = '1.3.6.1.2.1.75.1.2.2.1.2'; $fcFxPortPhysAdminStatus = '1.3.6.1.2.1.75.1.2.2.1.1'; $interfaces = array(); if ($ip && $community && $hostid) { $oidindex = snmp_walk($ip,$community, $fcFxPortPhysOperStatus,true); if ($oidindex ===FALSE) return FALSE; foreach ($oidindex as $oid => $value) { $realindex = join('.',array_slice(explode('.',$oid),7)); $admins = snmp_get($ip, $community, $fcFxPortPhysAdminStatus.'.'.$realindex); $index = join('.',array_slice(explode('.',$realindex),1)); $interfaces[$index] = array ( 'interface' => 'FC Port '.($index-1), 'oper' => fcport_oper($value), 'admin' => fcport_admin($admins), 'real_index' => $realindex, ); } } //debug ($interfaces); return($interfaces); } function fcport_oper($status) { if ($status == '1') return 'up'; #online if ($status == '4') return 'down'; # link-failure if ($status == '3') return 'testing'; # testing return 'down'; } function fcport_admin($status) { if ($status == '1') return 'up'; #online if ($status == '3') return 'testing'; # testing return 'down'; } ?> jffnms-0.9.3/engine/discovery/cisco_serial_port.inc.php0000644000175000017500000000151511716447477022602 0ustar csmallcsmall Thomas Mangin * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_cisco_serial_port ($ip, $rocommunity, $hostid, $param) { $oid = ".1.3.6.1.4.1.9.2.2.1.1.1"; $interface = array(); if ($ip && $hostid && $rocommunity) { $state = snmp_walk($ip, $rocommunity, $oid); $number = 0; if (is_array($state)) foreach ($state as $line) if(strstr($line,"Async Serial")) $number++; if ( $number > 0 ) { $interface[1]["description"] = "AS $ip"; $interface[1]["interface"] = "Cisco Dialup Usage"; $interface[1]["oper"] = "up"; $interface[1]["admin"] = "ok"; $interface[1]["nb_async_line"] = $number; } } return $interface; } ?> jffnms-0.9.3/engine/discovery/alteon_realservers.inc.php0000644000175000017500000000450711450352506022761 0ustar csmallcsmall Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_alteon_realservers($ip, $community, $hostid, $param) { $CfgRealServerIndex = '.1.3.6.1.4.1.1872.2.1.5.2.1.1'; $CfgRealServerIpAddr = '.1.3.6.1.4.1.1872.2.1.5.2.1.2'; $CfgRealServerMaxConns = '.1.3.6.1.4.1.1872.2.1.5.2.1.4'; $CfgRealServerState = '.1.3.6.1.4.1.1872.2.1.5.2.1.10'; $CfgRealServerName = '.1.3.6.1.4.1.1872.2.1.5.2.1.12'; $slbRealServerInfoState = '.1.3.6.1.4.1.1872.2.1.9.2.2.1.7'; $server_type=$param; $interfaces = array(); if ($ip && $community && $hostid) { $indexes = snmp_walk($ip, $community, $CfgRealServerIndex); // Die Quickly if no index if ($indexes === FALSE) return FALSE; $ipaddrs = snmp_walk($ip, $community, $CfgRealServerIpAddr); $adminstates = snmp_walk($ip, $community, $CfgRealServerState); $servernames = snmp_walk($ip, $community, $CfgRealServerName); $operstates = snmp_walk($ip, $community, $slbRealServerInfoState); $maxconns = snmp_walk($ip, $community, $CfgRealServerMaxConns); if ($indexes !== FALSE) { foreach($indexes as $index) { $idx = $index-1; if (!isset($ipaddrs["$idx"])) $ipaddress=""; else list($dummy, $ipaddress) = explode(':', $ipaddrs["$idx"]); $ipaddress = trim($ipaddress); if (!isset($servernames["$idx"])) $servernames["$idx"] = ''; if (!isset($maxconns["$idx"])) $maxconns["$idx"] = '20001'; if (isset($adminstates["$idx"]) && $adminstates["$idx"] == '2') $admin = 'up'; else $admin = 'down'; if (isset($operstates["$idx"]) && $operstates["$idx"] == '2') $oper = 'up'; else $oper = 'down'; $interfaces["$index"] = array ( 'interface' => $ipaddress, 'real_server' => $index, 'address' => $ipaddress, 'admin' => $admin, 'oper' => $oper, 'hostname' => $servernames["$idx"], 'max_connections' => $maxconns["$idx"], ); } } } //var_dump($interfaces); return $interfaces; } ?> jffnms-0.9.3/engine/discovery/smokeping.inc.php0000644000175000017500000000217311450511403021044 0ustar csmallcsmall Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function scan_dir($parent, &$ifaces) { if (!is_dir($parent)) return; if ($dir = opendir($parent)) { while (($file = readdir($dir)) !== false) { if ($file == '.' || $file == '..') continue; if (is_dir($parent.'/'.$file)) scan_dir($parent.'/'.$file, $ifaces); elseif (preg_match('/\.rrd$/', $file)) $ifaces[] = $parent.'/'.$file; } } } function discovery_smokeping ($ip, $rocommunity,$hostid,$param) { $topdir = $rocommunity; $ifaces = array(); scan_dir($topdir, $ifaces); $smokeping_interfaces = array(); $ifnum=0; foreach ($ifaces as $key => $ifname) { if (preg_match('%^'.$topdir.'/(.*)\.rrd$%', $ifname, $regs)) { $ifnum++; $ifname = $regs[1]; $smokeping_interfaces[$ifnum] = array( 'interface' => trim($ifname), 'admin' => 'up', 'oper' => 'up' ); } } return $smokeping_interfaces; } ?> jffnms-0.9.3/engine/discovery/sensors.inc.php0000644000175000017500000000246611716447477020601 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_sensors ($ip,$community, $host_id, $param) { $sensors = array(); $hrSensorEntry = ".1.3.6.1.2.1.25.8.1"; $hrSensorMapping= $hrSensorEntry.".1"; $hrSensorName = $hrSensorEntry.".3"; $hrSensorLabel = $hrSensorEntry.".4"; $hrSensorValue = $hrSensorEntry.".5"; if ($ip && $community && $host_id) { //check for required values $mappings = snmp_walk ($ip, $community, $hrSensorMapping, INCLUDE_OID_1); if (is_array($mappings)) { $labels = snmp_walk ($ip, $community, $hrSensorLabel, INCLUDE_OID_1); $names = snmp_walk ($ip, $community, $hrSensorName, INCLUDE_OID_1); $values = snmp_walk ($ip, $community, $hrSensorValue, INCLUDE_OID_1); while (list ($key,$mapping) = each ($mappings)) if (($mapping=="-1") && // Its a parent sensor isset($values[$key])) // it has a value $sensors[$key] = array ( "interface" => "Sensor ".$names[$key], "description" => $labels[$key], "oper" => "up" ); } } return $sensors; } ?> jffnms-0.9.3/engine/discovery/ups_lines.inc.php0000644000175000017500000000310711716447477021077 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_ups_lines ($ip,$rocommunity,$hostid,$param) { $ups_lines = array(); $UPSMIBS= array( "ups" => ".1.3.6.1.2.1.33", "ups_mitsu" => ".1.3.6.1.4.1.13891.101" ); foreach($UPSMIBS as $key => $UPSMIB) { switch($key) { case "ups": $upsInputs = $UPSMIB.".1.3.3.1"; //UPS-MIB::upsInputEntry $upsOutputs = $UPSMIB.".1.4.4.1"; //UPS-MIB::upsOutputEntry $addToIndex = 0; break; case "ups_mitsu": $upsInputs = $UPSMIB.".3.3.1"; $upsOutputs = $UPSMIB.".4.4.1"; $addToIndex = 1; break; } $upsInputsIndex = $upsInputs.".1"; $upsOutputsIndex = $upsOutputs.".1"; if (!empty($ip) && !empty($rocommunity)) { $upsInputLines = snmp_walk($ip, $rocommunity, $upsInputsIndex); $upsOutputLines = snmp_walk($ip, $rocommunity, $upsOutputsIndex); if (is_array($upsInputLines) && is_array($upsOutputLines)) { foreach ($upsInputLines as $index) $ups_lines[10+$index] = array( "interface"=>"Input Line ".$index, "line_type"=>"INPUT", "line_index"=>$index + $addToIndex, "upstype"=>$key, "admin"=>"up", "oper"=>"up" ); foreach ($upsOutputLines as $index) $ups_lines[20+$index] = array( "interface"=>"Output Line ".$index, "line_type"=>"OUTPUT", "line_index"=>$index + $addToIndex, "upstype"=>$key, "admin"=>"up", "oper"=>"up" ); } } } return $ups_lines; } ?> jffnms-0.9.3/engine/discovery/pdu.inc.php0000644000175000017500000000275211716447477017673 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file * Chris Wopat - me@falz.net Jan 2006 */ function discovery_pdu ($ip,$rocommunity,$hostid,$param) { $pdu = array(); $PDUMIB = ".1.3.6.1.4.1.318.1.1.12"; $pduIdentName_oid = $PDUMIB.".1.1.0"; $pduModelNumber_oid = $PDUMIB.".1.5.0"; $pduNumBanks_oid = $PDUMIB.".2.1.4.0"; $pduLoadStatus_oid = $PDUMIB.".2.3.1.1.3"; $load_status = array (1=>"load normal", 2=>"load low", 3=>"load near overload", 4=>"load overloaded"); if (!empty($ip) && !empty($rocommunity)) { $pduNumBanks = snmp_get($ip, $rocommunity, $pduNumBanks_oid); // total number of banks + 1 will be index for the "total" status $pduTotalBanks = $pduNumBanks +1; $pduIdentName = snmp_get($ip, $rocommunity, $pduIdentName_oid); $pduModelNumber = snmp_get($ip, $rocommunity, $pduModelNumber_oid); if ($pduIdentName!==false && $pduTotalBanks!==false) { $pduTotalStatus = $pduLoadStatus_oid . "." . $pduTotalBanks; $pduLoadStatus = snmp_get($ip, $rocommunity, $pduTotalStatus); if (!empty($pduIdentName) && !empty($pduLoadStatus)) $pdu[1] = array( "interface"=>"PDU", "ident"=>$pduIdentName, "description"=>$pduIdentName." ".$pduModelNumber, "banks"=>$pduNumBanks, "admin"=>"ok", "oper"=>$load_status[$pduLoadStatus] ); } } return $pdu; } ?> jffnms-0.9.3/engine/discovery/css_vips.inc.php0000644000175000017500000000413711716447477020733 0ustar csmallcsmall Robert Bogdon * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_css_vips($ip,$rocommunity,$hostid,$param) { //print "
";
        //var_dump($ip);
        //var_dump($rocommunity);
        //var_dump($hostid);
        //var_dump($param);
        //print "
"; $css_vips = array(); if ($ip && $hostid && $rocommunity) $vipIndex = snmp_walk("$ip","$rocommunity",".1.3.6.1.4.1.2467.1.16.4.1.3"); if (count($vipIndex) > 0) { $vipName = snmp_walk("$ip","$rocommunity",".1.3.6.1.4.1.2467.1.16.4.1.2"); $vipEnabled = snmp_walk($ip, $rocommunity, ".1.3.6.1.4.1.2467.1.16.4.1.11"); $vipStatus = snmp_walk($ip, $rocommunity, ".1.3.6.1.4.1.2467.1.16.4.1.41"); $vipIPAddress = snmp_walk($ip, $rocommunity, ".1.3.6.1.4.1.2467.1.16.4.1.4"); $vipOwner = snmp_walk($ip, $rocommunity, ".1.3.6.1.4.1.2467.1.16.4.1.1"); //print "
";
   	    //var_dump($vipName);
   	    //var_dump($vipEnabled);
   	    //var_dump($vipStatus);
   	    //var_dump($vipIPAddress);
   	    //var_dump($vipOwner);
   	    //print "
"; $statusCodes = array(0=>"down", 1=>"up", 4=>"up"); for ($i=0; $i < count($vipIndex) ; $i++) if ($vipIndex[$i]) { $vipInfo = array(); list($aux, $vipIPAddress[$i]) = split(" ", $vipIPAddress[$i]); $vipName[$i] = str_replace("\"", "", $vipName[$i]); $vipOwner[$i] = str_replace("\"", "", $vipOwner[$i]); $vipInfo["address"] = $vipIPAddress[$i]; $vipInfo["description"] = $vipOwner[$i]; $vipInfo["bandwidth"] = 1000000000; $vipInfo["interface"] = $vipName[$i]; $vipInfo["admin"] = $statusCodes[$vipEnabled[$i]]; $vipInfo["oper"] = $statusCodes[$vipStatus[$i]]; foreach ($vipInfo as $key=>$value) $vipInfo[$key]=trim($value); $css_vips[$vipIndex[$i]] = $vipInfo; } } //print "
";
        //var_dump($css_vips);
        //print "
"; return $css_vips; } ?> jffnms-0.9.3/engine/discovery/alteon_realservices.inc.php0000644000175000017500000000626311417601062023111 0ustar csmallcsmall Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_alteon_realservices($ip, $community, $hostid, $param) { $server_type=$param; $interfaces = array(); // SNMP OIDs $SlbInfoVirtServ = '.1.3.6.1.4.1.1872.2.1.9.2.4.1.1'; $SlbInfoService = '.1.3.6.1.4.1.1872.2.1.9.2.4.1.2'; $SlbInfoRealServ = '.1.3.6.1.4.1.1872.2.1.9.2.4.1.3'; $SlbInfoRealPort = '.1.3.6.1.4.1.1872.2.1.9.2.4.1.5'; $SlbInfoOperState = '.1.3.6.1.4.1.1872.2.1.9.2.4.1.6'; $CfgRealServerIpAddr = '.1.3.6.1.4.1.1872.2.1.5.2.1.2'; $CfgRealServerState = '.1.3.6.1.4.1.1872.2.1.5.2.1.10'; $CfgVirtServerDname = '.1.3.6.1.4.1.1872.2.1.5.5.1.5'; $CfgVirtServiceHname = '.1.3.6.1.4.1.1872.2.1.5.7.1.8'; if ($ip && $community && $hostid) { $rsrv_virtservs = snmp_walk($ip, $community, $SlbInfoVirtServ); // Die Quickly if no Virtual servers if ($rsrv_virtservs === FALSE) return FALSE; $rsrv_serviceidx = snmp_walk($ip, $community, $SlbInfoService); $rsrv_realservs = snmp_walk($ip, $community, $SlbInfoRealServ); $rsrv_realports = snmp_walk($ip, $community, $SlbInfoRealPort); $rsrv_oper = snmp_walk($ip, $community, $SlbInfoOperState); $ipaddrs = snmp_walk($ip, $community, $CfgRealServerIpAddr); $adminstates = snmp_walk($ip, $community, $CfgRealServerState); if ($rsrv_virtservs !== FALSE) { foreach($rsrv_virtservs as $key => $virt_server) { if (!isset($rsrv_serviceidx["$key"])) continue; else $service_idx = $rsrv_serviceidx["$key"]; if (!isset($rsrv_realservs["$key"])) continue; else $real_server = $rsrv_realservs["$key"]; $rs_name = snmp_get($ip,$community,$CfgVirtServerDname.".$virt_server.0"); $vs_name = snmp_get($ip,$community,$CfgVirtServiceHname.".$virt_server.$service_idx.0"); $index="$virt_server.$service_idx.$real_server"; $rs_index = $real_server - 1; if (!isset($ipaddrs["$rs_index"])) continue; else $ipaddress = preg_replace('/^[^:]+: /','', $ipaddrs["$rs_index"]); // Admin state of port is bound to real server if (!isset($adminstates["$rs_index"]) || $adminstates["$rs_index"] != '2') $admin = 'down'; else $admin = 'up'; //echo "Index: $index
\n"; if (!isset($rsrv_realports["$key"])) continue; else $real_port = $rsrv_realports["$key"]; if (isset($rsrv_oper["$key"]) && $rsrv_oper["$key"] == '2') $oper = 'up'; else $oper = 'down'; $interfaces["$index"] = array ( 'interface' => "$ipaddress:$real_port", 'hostname' => "$vs_name.$rs_name", 'address' => $ipaddress, 'port' => $real_port, 'real_server' => $real_server, 'admin' => $admin, 'oper' => $oper, ); } // foreach } } //var_dump($interfaces); return $interfaces; } ?> jffnms-0.9.3/engine/discovery/ntp_client.inc.php0000644000175000017500000000222411525134635021217 0ustar csmallcsmall JFFNMS Authors * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_ntp_client ($ip,$rocommunity,$hostid,$param) { global $Config; $ntp_client = array(); $ntp_command = $Config->get('ntpq_executable'); if ( ($host_info=resolve_host($ip)) === FALSE) return $ntp_client; list ($af, $ip, $port) = $host_info; if (!is_executable($ntp_command)) return $ntp_clients; exec($ntp_command.' -p '.$ip.' 2>/dev/null',$raw_result); if (count($raw_result)>0 && ($raw_result[0] != "No association ID's returned")) { $ntp_client['1'] = array('interface' => 'Time', 'oper' => 'unsynchronised'); foreach ($raw_result as $line) { if (preg_match('/^\s+remote/', $line) || preg_match('/^=+/', $line)) continue; // scan result looking for a * as status and u as type if (preg_match('/^\*\S+\s+[0-9.]+\s+\d+\s+u/i', $line)) { $ntp_client[1]['oper'] = 'synchronised'; break; } } } return $ntp_client; } ?> jffnms-0.9.3/engine/discovery/ibm_ds_storage.inc.php0000644000175000017500000000302011417600165022030 0ustar csmallcsmall David LIMA * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_ibm_ds_storage ($ip, $hostname, $rwcommunity, $param ) { if ( $rwcommunity == 'DS4000' ) { $sudo_bin=exec('which sudo',$retval1); if ($retval1 == '127') { logger('Sudo is not installed, please read the documentation'); return FALSE ; } $smcli_bin=exec('which SMcli',$retval1); if ($retval1 == '127') { logger('SMCli is not installed, please read the documentation'); return FALSE ; } $device=$param; $interfaces=array(); switch($device) { case 'storagesubsystem': $smcli_cmd = '-d -v'; $command = "$sudo_bin $smcli_bin $smcli_cmd"; //$ip=str_replace(".","\.",$ip); $pattern = '/(\S+).*'.$ip.'.*\s(\S+)$/'; exec($command,$output,$retval); //debug($retval); //debug($output); if ($retval == '4') return FALSE; //FIXME add more checks to return status like: poller error //debug($retval); $i="0"; $index = 1; foreach ($output as $lines) { if (preg_match($pattern,$lines,$parts) == TRUE) { $interfaces[$index] = array ( 'interface' => "IBM Storage $parts[1]", 'oper' => $parts[2]=="Optimal"?"up":"$parts[2]", ); $index++; } } break; } return $interfaces ; } return FALSE; } ?> jffnms-0.9.3/engine/discovery/apache.inc.php0000644000175000017500000000200011716447477020306 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //Apache Discovery function discovery_apache ($ip, $rocommunity, $hostid, $param) { $open_timeout = 10; list($host_ip) = explode(":",$ip); //remove :port from IP $ip_port = $host_ip.":80"; $apache_info = array(); if ( ($skt = @fsockopen($host_ip, 80, $errno, $errstr, $open_timeout)) == FALSE) { return $apache_info; } fputs($skt, "GET /server-status?auto HTTP/1.1\r\nHost: ".$host_ip."\r\n\r\n"); $reply = ''; while(!feof($skt) && (strlen($reply) < 100)) { $reply .= fgets($skt, 1024); } fclose($skt); if (preg_match('/^HTTP\/1.1 200 OK/', $reply)) { $apache_info[$ip_port]["interface"] = "Apache Information"; $apache_info[$ip_port]["admin"] = "ok"; //to show $apache_info[$ip_port]["oper"] = "up"; //to be added by the AD } return $apache_info; } ?> jffnms-0.9.3/engine/discovery/cpqmib.inc.php0000644000175000017500000000712511417600453020334 0ustar csmallcsmall Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_cpqmib ($ip, $rocommunity, $hostid, $param) { $disc_type = $param; $interfaces = array(); // Constant Variables $phydrv = '.1.3.6.1.4.1.232.3.2.5.1.1.'; $fans = '.1.3.6.1.4.1.232.6.2.6.7.1.'; $temp = '.1.3.6.1.4.1.232.6.2.6.8.1.'; $power = '.1.3.6.1.4.1.232.6.2.9.3.1.'; if (empty($ip) || empty($rocommunity) || empty($param)) { return $interfaces; } $ifnum=1; switch($disc_type) { case 'phydrv': $controllers = snmp_walk($ip, $rocommunity, $phydrv.'1'); if (is_array($controllers)) { $drvindex = snmp_walk($ip, $rocommunity, $phydrv.'2'); $model = snmp_walk($ip, $rocommunity, $phydrv.'3'); $status = snmp_walk($ip, $rocommunity, $phydrv.'6'); foreach($controllers as $key => $ctl) { $interfaces[$ifnum++] = array( 'interface' => "Disk$ctl/$drvindex[$key]", 'controller' => $ctl, 'drvindex' => $drvindex[$key], 'model' => $model[$key], 'oper' => $status[$key]==2?'up':'down', ); } } break; case 'fans': $chassis = snmp_walk($ip, $rocommunity, $fans.'1'); if (is_array($chassis)) { $fanindex = snmp_walk($ip, $rocommunity, $fans.'2'); $location = snmp_walk($ip, $rocommunity, $fans.'3'); $present = snmp_walk($ip, $rocommunity, $fans.'4'); $condition = snmp_walk($ip, $rocommunity, $fans.'9'); foreach($chassis as $key => $cha) { $locname = get_fan_location($location[$key]); $interfaces[$ifnum++] = array( 'interface' => "Fan$cha/$fanindex[$key]" , 'chassis' => $cha, 'fanindex' => $fanindex[$key], 'location' => $locname, 'admin' => $present[$key]==3?'up':'down', 'oper' => $condition[$key]==2?'up':'down', ); } } break; case 'temperature': $chassis = snmp_walk($ip, $rocommunity, $temp.'1'); if (is_array($chassis)) { $tempindex = snmp_walk($ip, $rocommunity, $temp.'2'); $location = snmp_walk($ip, $rocommunity, $temp.'3'); $condition = snmp_walk($ip, $rocommunity, $temp.'6'); foreach($chassis as $key => $cha) { $interfaces[$ifnum++] = array( 'interface' => "Temperature$cha/$tempindex[$key]", 'chassis' => $cha, 'tempindex' => $tempindex[$key], 'location' => get_fan_location($location[$key]), 'admin' => 'up', 'oper' => $condition[$key]==2?'up':'down', ); } } break; case 'powersupply': $chassis = snmp_walk($ip, $rocommunity, $power.'1'); if (is_array($chassis)) { $bayindex = snmp_walk($ip, $rocommunity, $power.'2'); $present = snmp_walk($ip, $rocommunity, $power.'3'); $condition = snmp_walk($ip, $rocommunity, $power.'4'); foreach($chassis as $key => $cha) { $interfaces[$ifnum++] = array( 'interface' => "Power $cha/$bayindex[$key]" , 'chassis' => $cha, 'bayindex' => $bayindex[$key], 'admin' => $present[$key]==3?'up':'down', 'oper' => $condition[$key]==2?'up':'down', ); } } break; } // switch return $interfaces; } function get_fan_location($locid) { $locations = array ( 1 => 'other', 2 => 'unknown', 3 => 'system', 4 => 'system board', 5 => 'io board', 6 => 'cpu', 7 => 'memory', 8 => 'storage', 9 => 'removeable media', 10 => 'power supply', 11 => 'ambient', 12 => 'chassis', 13 => 'bridge card', ); if (array_key_exists($locid, $locations )) { return $locations[$locid]; } else { return "Unknown $locid"; } } jffnms-0.9.3/engine/discovery/ups.inc.php0000644000175000017500000000265211716447477017711 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_ups ($ip,$rocommunity,$hostid,$param) { $ups = array(); $UPSMIBS= array( "ups" => ".1.3.6.1.2.1.33", "ups_mitsu" => ".1.3.6.1.4.1.13891.101" ); foreach($UPSMIBS as $key => $UPSMIB) { // any common variables between the UPS's $battery_status = array (1=>"battery unknown", 2=>"battery normal", 3=>"battery low", 4=>"battery depleted"); switch($key) { case "ups": $upsIdentName_oid = $UPSMIB.".1.1.5.0"; //UPS-MIB::upsIdentName.0 $upsBatteryStatus_oid = $UPSMIB.".1.2.1.0"; //UPS-MIB::upsBatteryStatus.0 break; case "ups_mitsu": $upsIdentName_oid = $UPSMIB.".1.5.0"; $upsIdentName = snmp_get($ip, $rocommunity, $upsIdentName_oid); $upsBatteryStatus_oid = $UPSMIB.".2.1.0"; break; } if (!empty($ip) && !empty($rocommunity)) { $upsIdentName = snmp_get($ip, $rocommunity, $upsIdentName_oid); if ($upsIdentName!==false) { $upsBatteryStatus = snmp_get($ip, $rocommunity, $upsBatteryStatus_oid); if (!empty($upsIdentName) && !empty($upsBatteryStatus)) $ups[1] = array( "interface"=>"UPS", "ident"=>$upsIdentName, "upstype"=>$key, "admin"=>"ok", "oper"=>$battery_status[$upsBatteryStatus] ); } } } return $ups; } ?> jffnms-0.9.3/engine/discovery/cisco_saagent.inc.php0000644000175000017500000000206511716447477021702 0ustar csmallcsmall Anders Karlsson * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function discovery_cisco_saagent($ip, $community, $host_id, $param) { $saagent = Array(); $CiscoSaAgentOid=".1.3.6.1.4.1.9.9.42.1.5.2.1.1"; if ($ip && $community && $host_id) { //check for required values $saagent_list = snmp_walk($ip,$community,$CiscoSaAgentOid,1); if (is_array($saagent_list)) foreach ($saagent_list as $key=>$entry) { $key=explode(".",$key); $key=$key[count($key)-1]; $description = str_replace('"','', snmp_get($ip, $community, "1.3.6.1.4.1.9.9.42.1.2.1.1.3.".$key)); $saagent[$key]["interface"] = "SAAgent".$key; $saagent[$key]["description"] = "SAA ".$key." ".$description; $saagent[$key]["admin"] = "ok"; $saagent[$key]["oper"] = "up"; //FIXME verify state } } return $saagent; } ?> jffnms-0.9.3/engine/graphs/0002755000175000017500000000000011717644161015061 5ustar csmallcsmalljffnms-0.9.3/engine/graphs/cisco_serial.inc.php0000644000175000017500000000212711716447477021013 0ustar csmallcsmall Thomas Mangin * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_cisco_serial ($data) { $opts_DEF = rrdtool_get_def($data,array("cisco_free","cisco_dsx","cisco_async")); $opts_GRAPH = array( "AREA:cisco_free#00FF00:'Number of Connections Free '", "GPRINT:cisco_free:MAX:'Max\:%5.0lf'", "GPRINT:cisco_free:AVERAGE:'Average\:%5.0lf'", "GPRINT:cisco_free:LAST:'Last\:%5.0lf \\n'", "STACK:cisco_dsx#000000:'Number DSX line in use '", "GPRINT:cisco_dsx:MAX:'Max\:%5.0lf'", "GPRINT:cisco_dsx:AVERAGE:'Average\:%5.0lf'", "GPRINT:cisco_dsx:LAST:'Last\:%5.0lf \\n'", "STACK:cisco_async#0000FF:'Number Async line in use '", "GPRINT:cisco_async:MAX:'Max\:%5.0lf'", "GPRINT:cisco_async:AVERAGE:'Average\:%5.0lf'", "GPRINT:cisco_async:LAST:'Last\:%5.0lf \\n'" ); $opts_header[] = "--vertical-label='Number of Lines'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/ucd_load_average_aggregation.inc.php0000644000175000017500000000361411716447477024171 0ustar csmallcsmall Robert St.Denis * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_ucd_load_average_aggregation ($data) { $opts_agg = array(); $cant = count($data["id"]); $str_cdef_1 .= "CDEF:load_average_1=0"; $str_cdef_5 .= "CDEF:load_average_5=0"; $str_cdef_15 .= "CDEF:load_average_15=0"; foreach ($data["id"] as $id) { $interface=$data[$id]; $opts_agg = array_merge($opts_agg,rrdtool_get_def($interface,array( "load_average_1$id"=>"load_average_1", "load_average_5$id"=>"load_average_5", "load_average_15$id"=>"load_average_15"))); $str_cdef_1 .=",load_average_1$id,+"; $str_cdef_5 .=",load_average_5$id,+"; $str_cdef_15 .=",load_average_15$id,+"; } $str_cdef_1 .= ",$cant,/"; $str_cdef_5 .= ",$cant,/"; $str_cdef_15 .= ",$cant,/"; $opts_GRAPH = array( $str_cdef_1, $str_cdef_5, $str_cdef_15, "COMMENT:'Number of Processors:".$cant."\\n'", "LINE1:load_average_1#FF0000:' 1 Minute Load Average'", "GPRINT:load_average_1:MAX:'Max\: %5.2lf'", "GPRINT:load_average_1:AVERAGE:'Average\: %5.2lf'", "GPRINT:load_average_1:LAST:'Last\: %5.2lf\\n'", "LINE2:load_average_5#0000FF:' 5 Minutes Load Average'", "GPRINT:load_average_5:MAX:'Max\: %5.2lf'", "GPRINT:load_average_5:AVERAGE:'Average\: %5.2lf'", "GPRINT:load_average_5:LAST:'Last\: %5.2lf\\n'", "LINE2:load_average_15#00CC00:'15 Minutes Load Average'", "GPRINT:load_average_15:MAX:'Max\: %5.2lf'", "GPRINT:load_average_15:AVERAGE:'Average\: %5.2lf'", "GPRINT:load_average_15:LAST:'Last\: %5.2lf\\n'" ); $opts_header[] = "--vertical-label='Load Average'"; return array ($opts_header, @array_merge($opts_agg,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/cpu_util.inc.php0000644000175000017500000000151011716447477020173 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_cpu_util ($data) { $opts_DEF = rrdtool_get_def($data,"cpu"); $limit = 100; $opts_GRAPH = array( "HRULE:".$limit."#FF0000:", "AREA:cpu#00CC00:'CPU Utilization '", "LINE1:cpu#0000FF:''", "GPRINT:cpu:MAX:'Max\:%8.2lf %%'", "GPRINT:cpu:AVERAGE:'Average\:%8.2lf %%'", "GPRINT:cpu:LAST:'Last\:%8.2lf %%'" ); $opts_header[] = "--vertical-label='CPU Utilization %'"; $opts_header[] = "--rigid"; $opts_header[] = "--upper-limit=".$limit; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/acct_bytes.inc.php0000644000175000017500000000144411716447477020475 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //Accounting Bytes function graph_acct_bytes ($data) { $opts_DEF = rrdtool_get_def($data,array(input=>"acct_bytes")); $opts_DEF[inputbits]="CDEF:inputbits=input,UN,input,input,IF,8,*"; $opts_GRAPH = array( "AREA:inputbits#00CC00:'Accounting Traffic (probably Outbound)\\n'", "GPRINT:inputbits:MAX:'Max\:%6.2lf %sbps'", "GPRINT:inputbits:AVERAGE:'Average\:%6.2lf %sbps'", "GPRINT:inputbits:LAST:'Last\:%6.2lf %sbps'" ); $opts_header[] = "--vertical-label='Accounting Traffic per Second'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/tcp_conn_delay.inc.php0000644000175000017500000000127311716447477021336 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_tcp_conn_delay ($data) { $opts_DEF = rrdtool_get_def($data,array("conn_delay")); $opts_GRAPH = array( "AREA:conn_delay#00CC00:'Connection Delay '", "GPRINT:conn_delay:MAX:'Max\:%8.2lf %ssec'", "GPRINT:conn_delay:AVERAGE:'Average\:%8.2lf %ssec'", "GPRINT:conn_delay:LAST:'Last\:%8.2lf %ssec'", ); $opts_header[] = "--vertical-label='Connection Delay'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/iis_tfs.inc.php0000644000175000017500000000120011716447477020003 0ustar csmallcsmall Robert St.Denis * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_iis_tfs ($data) { $opts_DEF = rrdtool_get_def($data,array("tfs")); $opts_GRAPH = array( "AREA:tfs#00CC00:'Total Files Sent '", "GPRINT:tfs:MAX:'Max\:%8.0lf %s'", "GPRINT:tfs:AVERAGE:'Average\:%8.0lf %s'", "GPRINT:tfs:LAST:'Last\:%8.0lf %s\\n'", ); $opts_header[] = "--vertical-label='Total Files Sent'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/pdu_load.inc.php0000644000175000017500000000212111716447477020135 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file * Chris Wopat - me@falz.net Jan 2006 */ function graph_pdu_load ($data) { $opts_DEF = rrdtool_get_def($data,array("load")); $powerrating=$data['powerrating']; $threshold=$data['threshold']; // the power rating is always 80% of the actual limit, so have the size of the graph // be the full limit $limit = $powerrating * 1.2; $opts_GRAPH = array( "HRULE:".$powerrating."#FF0000:'Maximum \: ".$powerrating." Amps\\n'", "HRULE:".$threshold."#FF9900:'Threshold \: ".$threshold." Amps\\n'", "AREA:load#0033FF:'Load '", "GPRINT:load:MAX:'Max\: %3.1lf %sAmps'", "GPRINT:load:AVERAGE:'Average\: %3.1lf %sAmps'", "GPRINT:load:LAST:'Last\: %3.1lf %sAmps\\n'", ); $opts_header[] = "--vertical-label='Amps'"; $opts_header[] = "--rigid"; $opts_header[] = "--upper-limit=".$powerrating; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/traffic_pl.inc.php0000644000175000017500000000277111716447477020472 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //Packet Loss Over the Traffic Graph function graph_traffic_pl ($data) { if ($data["flipinout"]==1) { $opts_DEF = rrdtool_get_def($data,array(output=>"input",input=>"output",plraw=>"packetloss")); $flip_legend = " (In / Out Flipped)"; } else $opts_DEF = rrdtool_get_def($data,array("input","output",plraw=>"packetloss")); $opts_GRAPH = array( "CDEF:inputbits=input,8,*", "CDEF:outputbits=output,8,*", "HRULE:".$data["bandwidthin"]. "#550000:'Total Inbound Bandwidth\: ".($data["bandwidthin"] /1000)." kbps\\n'", "HRULE:".$data["bandwidthout"]."#990000:'Total Outbound Bandwidth\: ".($data["bandwidthout"]/1000)." kbps\\n'", "CDEF:plpor=plraw,2,*", "CDEF:pldiv=plraw,2,/", "CDEF:bigger=inputbits,outputbits,MAX", "CDEF:10bigger=10,bigger,*,100,/", "CDEF:pl=10bigger,pldiv,*", "AREA:bigger#FFFFFF:", "STACK:pl#FF0000:'Packet Loss'", //"GPRINT:plpor:MAX:'Max\:%5.0lf %%'", "GPRINT:plpor:AVERAGE:'Average\:%5.0lf %%'", "GPRINT:plpor:LAST:'Last\:%5.0lf %%\\n'", "AREA:inputbits#00CC00:Inbound", "LINE2:outputbits#0000FF:'Outbound $flip_legend'" ); $opts_header[] = "--vertical-label='% of Lost Packets'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/response_time.inc.php0000644000175000017500000000133211716447477021225 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ // Round Trip Time function graph_response_time ($data) { $opts_DEF = rrdtool_get_def($data,"response_time"); $opts_GRAPH = array( "AREA:response_time#00CC00:'Response Time\\n'", "GPRINT:response_time:MAX:'Max\:%5.0lf msec'", "GPRINT:response_time:AVERAGE:'Average\:%5.0lf msec'", "GPRINT:response_time:LAST:'Last\:%5.0lf msec'" ); $opts_header[] = "--vertical-label='Response Time in Milliseconds'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/cisco_mac_packets.inc.php0000644000175000017500000000237311716447477022011 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_cisco_mac_packets ($data) { if ($data["flipinout"]==1) { $opts_DEF = rrdtool_get_def($data,array(outputpackets=>"inputpackets",inputpackets=>"outputpackets")); $flip_legend = " (In / Out Flipped)"; } else $opts_DEF = rrdtool_get_def($data,array("inputpackets","outputpackets")); $opts_GRAPH = array( "COMMENT:'".$data["description"].", IP Address: ".$data["address"]." on ".$data["interface"]."\\n'", "AREA:inputpackets#00CC00:'Input Packets '", "GPRINT:inputpackets:MAX:'Max\:%8.2lf %sPps'", "GPRINT:inputpackets:AVERAGE:'Average\:%8.2lf %sPps'", "GPRINT:inputpackets:LAST:'Last\:%8.2lf %sPps$flip_legend\\n'", "LINE2:outputpackets#0000FF:'Output Packets'", "GPRINT:outputpackets:MAX:'Max\:%8.2lf %sPps'", "GPRINT:outputpackets:AVERAGE:'Average\:%8.2lf %sPps'", "GPRINT:outputpackets:LAST:'Last\:%8.2lf %sPps'" ); $opts_header[] = "--vertical-label='Packets per Second'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/iis_tcgir.inc.php0000644000175000017500000000122011716447477020321 0ustar csmallcsmall Robert St.Denis * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_iis_tcgir ($data) { $opts_DEF = rrdtool_get_def($data,array("tcgir")); $opts_GRAPH = array( "AREA:tcgir#00CC00:'Total CGI Requests '", "GPRINT:tcgir:MAX:'Max\:%8.0lf %s'", "GPRINT:tcgir:AVERAGE:'Average\:%8.0lf %s'", "GPRINT:tcgir:LAST:'Last\:%8.0lf %s\\n'", ); $opts_header[] = "--vertical-label='Total CGI Requests'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/iptables_rate.inc.php0000644000175000017500000000166511716447477021200 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_iptables_rate ($data) { $opts_DEF = rrdtool_get_def($data,array("bytes"=>"ipt_bytes","packets"=>"ipt_packets")); $opts_DEF["bits"]="CDEF:bits=bytes,UN,bytes,bytes,IF,8,*"; $opts_GRAPH = array( "AREA:bits#00CC00:'Rate '", "GPRINT:bits:MAX:'Max\:%8.2lf %sbps'", "GPRINT:bits:AVERAGE:'Average\:%8.2lf %sbps'", "GPRINT:bits:LAST:'Last\:%8.2lf %sbps\\n'", "LINE2:packets#0000FF:Packets", "GPRINT:packets:MAX:'Max\:%8.0lf %spps'", "GPRINT:packets:AVERAGE:'Average\:%8.0lf %spps'", "GPRINT:packets:LAST:'Last\:%8.0lf %spps'", ); $opts_header[] = "--vertical-label='Bits per Second'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/inf_ldisk_opsrate.inc.php0000644000175000017500000000246011377440254022040 0ustar csmallcsmall Sebastian van Dijk * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_inf_ldisk_opsrate ($data) { $opts_DEF = rrdtool_get_def($data,array("rd_rate"=>"rd_ops","wr_rate"=>"wr_ops")); $opts_GRAPH = array( "CDEF:ldisk_rate_total=rd_rate,wr_rate,+", "CDEF:wr_rate_graph=wr_rate,-1,*", "COMMENT:' Disk Total '", "GPRINT:ldisk_rate_total:MAX:'Max\:%8.2lf %s '", "GPRINT:ldisk_rate_total:AVERAGE:'Average\:%8.2lf %s '", "GPRINT:ldisk_rate_total:LAST:'Last\:%8.2lf %s \\n'", "AREA:rd_rate#0000CC:'RD. Disk rate '", "GPRINT:rd_rate:MAX:'Max\:%8.2lf %s '", "GPRINT:rd_rate:AVERAGE:'Average\:%8.2lf %s '", "GPRINT:rd_rate:LAST:'Last\:%8.2lf %s \\n'", "AREA:wr_rate_graph#FF0000:'WR. Disk rate '", "GPRINT:wr_rate:MAX:'Max\:%8.2lf %s '", "GPRINT:wr_rate:AVERAGE:'Average\:%8.2lf %s '", "GPRINT:wr_rate:LAST:'Last\:%8.2lf %s \\n'" ); $opts_header[] = "--vertical-label='RD/WR Disk rate'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/alteon_sessionrate_aggregation.inc.php0000644000175000017500000000262011377440254024607 0ustar csmallcsmall Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_alteon_sessionrate_aggregation ($data) { $color_array = array("0","7","D"); foreach ($color_array as $a) foreach ($color_array as $c) foreach ($color_array as $e) $colors[] = $a.$a.$c.$c.$e.$e; $color_array = array("3","9","F"); foreach ($color_array as $a) foreach ($color_array as $c) foreach ($color_array as $e) $colors[] = $a.$a.$c.$c.$e.$e; $graph_type='AREA'; foreach ($data[id] as $id) { $interface = $data[$id]; $used_color = $colors[++$i*4]; $interace['interface'] = str_replace(':','\:',$interface['interface']); $name = $interface['interface'].' '.$interface['description']; $defs = @array_merge ($defs, rrdtool_get_def($interface,array("sessions$id" =>"total_sessions"))); $graph = @array_merge($graph, array( "$graph_type:sessions$id#$used_color:'$name'", "GPRINT:sessions$id:MAX:'Max\:%5.2lf '", "GPRINT:sessions$id:AVERAGE:'Average\:%5.2lf '", "GPRINT:sessions$id:LAST:'Last\:%5.2lf\\n'" )); $graph_type='STACK'; } $opts_header[] = "--vertical-label='Sessions/second'"; return array ($opts_header, @array_merge($defs,$graph)); } ?> jffnms-0.9.3/engine/graphs/packets.inc.php0000644000175000017500000000161011716447477020002 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_packets ($data) { $opts_DEF = rrdtool_get_def($data,array(input=>"inpackets",output=>"outpackets")); $opts_GRAPH = array( "AREA:input#00CC00:'Input Pkts '", //"GPRINT:input:MAX:'Max\:%8.2lf %sPps'", "GPRINT:input:AVERAGE:'Average\:%8.2lf %sPps'", "GPRINT:input:LAST:'Last\:%8.2lf %sPps\\n'", "LINE2:output#0000FF:'Output Pkts'", //"GPRINT:output:MAX:'Max\:%8.2lf %sPps'", "GPRINT:output:AVERAGE:'Average\:%8.2lf %sPps'", "GPRINT:output:LAST:'Last\:%8.2lf %sPps'" ); $opts_header[] = "--vertical-label='Packets per Second'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/ups_load_aggregation.inc.php0000644000175000017500000000266311716447477022536 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_ups_load_aggregation ($data) { $color_array = array("3","C","F"); foreach ($color_array as $a) foreach ($color_array as $c) foreach ($color_array as $e) $colors[] = $e."0".$c."0".$a."0"; $opts_DEF = array(); $opts_GRAPH = array(); foreach ($data["id"] as $id) { $interface=$data[$id]; if ($interface["line_type"]=="OUTPUT") { $defs = rrdtool_get_def($interface,array("load$id"=>"load")); $opts_DEF = @array_merge($opts_DEF, $defs); $description = substr(str_pad($interface["host_name"]." ".$interface["zone_shortname"],20," ",STR_PAD_RIGHT),0,20)." ". substr(str_pad($interface["interface"]." ".$interface["description"],20," ",STR_PAD_RIGHT),0,20); $used_color = $colors[++$i*2]; $opts_GRAPH = array_merge ($opts_GRAPH,array( "LINE2:load$id#$used_color:'".$description."\:'", "GPRINT:load$id:MAX:'Max\: %3.0lf %%'", "GPRINT:load$id:AVERAGE:'Average\: %3.0lf %%'", "GPRINT:load$id:LAST:'Last\: %3.0lf %%\\n'" )); } } $opts_header[] = "--vertical-label='Loads'"; $opts_header[] = "--rigid"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/packets_new.inc.php0000644000175000017500000000520311716447477020655 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_packets_new ($data) { $opts_DEF = rrdtool_get_def($data,array("inpackets","outpackets","inputerrors","outputerrors")); $opts_GRAPH = array( //Sanitize the 4 DS's "CDEF:input=inpackets,UN,0,inpackets,IF", "CDEF:output=outpackets,UN,0,outpackets,IF", "CDEF:inputerr=inputerrors,UN,0,inputerrors,IF", "CDEF:outputerr=outputerrors,UN,0,outputerrors,IF", //This is to get the output as negative "CDEF:outputrev=output,-1,*", //Total packets = valid packets + error packets "CDEF:totin=input,inputerr,+", "CDEF:totout=output,outputerr,+", //Input packts % of the total packtes "CDEF:inpct1=input,100,*,totin,/", "CDEF:outpct1=output,100,*,totout,/", // In case tot is 0, then % is 100% "CDEF:inpct=inpct1,UN,100,inpct1,IF", "CDEF:outpct=outpct1,UN,100,outpct1,IF", //Errors pkts % of the total packtes limited from 0.01% to 100% "CDEF:ierrpct1=inputerr,100,*,totin,/,0.01,100,LIMIT", "CDEF:oerrpct1=outputerr,100,*,totout,/,0.01,100,LIMIT", // In case tot is 0, then 0% errors "CDEF:ierrpct=ierrpct1,UN,0,ierrpct1,IF", "CDEF:oerrpct=oerrpct1,UN,0,oerrpct1,IF", "AREA:input#00CC00:'Input Packets '", "GPRINT:input:MAX:'Max\: %6.2lf %sPps'", "GPRINT:inpct:MAX:'(%6.2lf%%)'", "GPRINT:input:AVERAGE:'Average\: %6.2lf %sPps'", "GPRINT:inpct:AVERAGE:'(%6.2lf%%)'", "GPRINT:input:LAST:'Last\: %6.2lf %sPps'", "GPRINT:inpct:LAST:'(%6.2lf%%)\\n'", "STACK:ierrpct#FF0000:'Input Errors '", "GPRINT:inputerr:MAX:'Max\: %6.2lf %sPps'", "GPRINT:ierrpct:MAX:'(%6.2lf%%)'", "GPRINT:inputerr:AVERAGE:'Average\: %6.2lf %sPps'", "GPRINT:ierrpct:AVERAGE:'(%6.2lf%%)'", "GPRINT:inputerr:LAST:'Last\: %6.2lf %sPps'", "GPRINT:ierrpct:AVERAGE:'(%6.2lf%%)\\n'", "COMMENT:'\\n'", "AREA:outputrev#0000FF:'Output Packets'", "GPRINT:output:MAX:'Max\: %6.2lf %sPps'", "GPRINT:outpct:MAX:'(%6.2lf%%)'", "GPRINT:output:AVERAGE:'Average\: %6.2lf %sPps'", "GPRINT:outpct:AVERAGE:'(%6.2lf%%)'", "GPRINT:output:LAST:'Last\: %6.2lf %sPps'", "GPRINT:outpct:LAST:'(%6.2lf%%)\\n'", "STACK:oerrpct#AA0000:'Output Errors '", "GPRINT:outputerr:MAX:'Max\: %6.2lf %sPps'", "GPRINT:oerrpct:MAX:'(%6.2lf%%)'", "GPRINT:outputerr:AVERAGE:'Average\: %6.2lf %sPps'", "GPRINT:oerrpct:AVERAGE:'(%6.2lf%%)'", "GPRINT:outputerr:LAST:'Last\: %6.2lf %sPps'", "GPRINT:oerrpct:AVERAGE:'(%6.2lf%%)\\n'" ); $opts_header[] = "--vertical-label='Packets per Second'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/alteon_octets_aggregation.inc.php0000644000175000017500000000267211377440254023560 0ustar csmallcsmall Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_alteon_octets_aggregation ($data) { $color_array = array("0","7","D"); foreach ($color_array as $a) foreach ($color_array as $c) foreach ($color_array as $e) $colors[] = $a.$a.$c.$c.$e.$e; $color_array = array("3","9","F"); foreach ($color_array as $a) foreach ($color_array as $c) foreach ($color_array as $e) $colors[] = $a.$a.$c.$c.$e.$e; $graph_type='AREA'; foreach ($data[id] as $id) { $interface = $data[$id]; $used_color = $colors[++$i*4]; $interace['interface'] = str_replace(':','\:',$interface['interface']); $name = $interface['interface'].' '.$interface['description']; $defs = @array_merge ($defs, rrdtool_get_def($interface,array("octets$id" =>"octets"))); $graph = @array_merge($graph, array( "CDEF:bits$id=octets$id,UN,octets$id,octets$id,IF,8,*", "$graph_type:bits$id#$used_color:'$name'", "GPRINT:bits$id:MAX:'Max\:%8.2lf %sbps'", "GPRINT:bits$id:AVERAGE:'Average\:%8.2lf %sbps'", "GPRINT:bits$id:LAST:'Last\:%8.2lf %sbps\\n'" )); $graph_type='STACK'; } $opts_header[] = "--vertical-label='Bits per Second'"; return array ($opts_header, @array_merge($defs,$graph)); } ?> jffnms-0.9.3/engine/graphs/apache_cplo.inc.php0000644000175000017500000000126111716447477020610 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_apache_cplo ($data) { $opts_DEF = rrdtool_get_def($data,array("cplo","up")); $opts_GRAPH = array( "GPRINT:up:LAST:'Uptime\: %8.0lf %s seconds\\n'", "AREA:cplo#00CC00:'CPU Load '", "GPRINT:cplo:MAX:'Max\:%8.0lf %s'", "GPRINT:cplo:AVERAGE:'Average\:%8.0lf %s'", "GPRINT:cplo:LAST:'Last\:%8.0lf %s\\n'", ); $opts_header[] = "--vertical-label='CPU Load'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/ucd_memory.inc.php0000644000175000017500000000622511716447477020522 0ustar csmallcsmall Robert Bogdon * This program is licensed under the GNU GPL, full terms in the LICENSE file */ // Real Memory, UCD-SNMP function graph_ucd_memory ($data) { $opts_DEF = rrdtool_get_def($data,array( mem_free_b=>"mem_available", mem_total_b=>"mem_total", swap_free_b=>"swap_available", swap_total_b=>"swap_total")); $opts_GRAPH = array( "CDEF:mem_free=mem_free_b,1024,*", "CDEF:mem_total=mem_total_b,1024,*", "CDEF:swap_free=swap_free_b,1024,*", "CDEF:swap_total=swap_total_b,1024,*", "CDEF:mem_used=mem_total,mem_free,-", "CDEF:swap_used=swap_total,swap_free,-", "CDEF:mem_free_p=mem_free,100,*,mem_total,/", "CDEF:mem_used_p=mem_used,100,*,mem_total,/", "CDEF:swap_free_p=swap_free,100,*,swap_total,/", "CDEF:swap_used_p=swap_used,100,*,swap_total,/", "LINE3:mem_total#FF0000:'Total Memory\: '", "GPRINT:mem_total:MAX:'%6.2lf %sB\\n'", "LINE3:swap_total#AA0000:'Total Swap\: '", "GPRINT:swap_total:MAX:'%6.2lf %sB\\n'", "AREA:mem_used#FF8800:'Used Memory'", "GPRINT:mem_used:MAX:'Max\: %6.2lf %sB'", "GPRINT:mem_used_p:MAX:'(%3.0lf %%)'", "GPRINT:mem_used:AVERAGE:'Average\: %6.2lf %sB'", "GPRINT:mem_used_p:AVERAGE:'(%3.0lf %%)'", "GPRINT:mem_used:LAST:'Last\: %6.2lf %sB'", "GPRINT:mem_used_p:LAST:'(%3.0lf %%)\\n'", "STACK:swap_used#FFDD00:'Used Swap '", "GPRINT:swap_used:MAX:'Max\: %6.2lf %sB'", "GPRINT:swap_used_p:MAX:'(%3.0lf %%)'", "GPRINT:swap_used:AVERAGE:'Average\: %6.2lf %sB'", "GPRINT:swap_used_p:AVERAGE:'(%3.0lf %%)'", "GPRINT:swap_used:LAST:'Last\: %6.2lf %sB'", "GPRINT:swap_used_p:LAST:'(%3.0lf %%)\\n'", "STACK:mem_free#00CC00:'Free Memory'", "GPRINT:mem_free:MAX:'Max\: %6.2lf %sB'", "GPRINT:mem_free_p:MAX:'(%3.0lf %%)'", "GPRINT:mem_free:AVERAGE:'Average\: %6.2lf %sB'", "GPRINT:mem_free_p:AVERAGE:'(%3.0lf %%)'", "GPRINT:mem_free:LAST:'Last\: %6.2lf %sB'", "GPRINT:mem_free_p:LAST:'(%3.0lf %%)\\n'", "STACK:swap_free#00EE00:'Free Swap '", "GPRINT:swap_free:MAX:'Max\: %6.2lf %sB'", "GPRINT:swap_free_p:MAX:'(%3.0lf %%)'", "GPRINT:swap_free:AVERAGE:'Average\: %6.2lf %sB'", "GPRINT:swap_free_p:AVERAGE:'(%3.0lf %%)'", "GPRINT:swap_free:LAST:'Last\: %6.2lf %sB'", "GPRINT:swap_free_p:LAST:'(%3.0lf %%)\\n'" ); $opts_header[] = "--vertical-label='Used Memory'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/ups_current_aggregation.inc.php0000644000175000017500000000253411716447477023276 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_ups_current_aggregation ($data) { $color_array = array("2","9","F"); foreach ($color_array as $a) foreach ($color_array as $c) foreach ($color_array as $e) $colors[] = $e."0".$c."0".$a."0"; $opts_DEF = array(); $opts_GRAPH = array(); foreach ($data["id"] as $id) { $interface=$data[$id]; $defs = rrdtool_get_def($interface,array("current$id"=>"current")); $opts_DEF = @array_merge($opts_DEF, $defs); $description = substr(str_pad($interface["host_name"]." ".$interface["zone_shortname"],20," ",STR_PAD_RIGHT),0,20)." ". substr(str_pad($interface["interface"]." ".$interface["description"],20," ",STR_PAD_RIGHT),0,20); $used_color = $colors[++$i*2]; $opts_GRAPH = array_merge ($opts_GRAPH,array( "LINE2:current$id#$used_color:'".$description."\:'", "GPRINT:current$id:MAX:'Max\: %3.0lf %sA'", "GPRINT:current$id:AVERAGE:'Average\: %3.0lf %sA'", "GPRINT:current$id:LAST:'Last\: %3.0lf %sA\\n'" )); } $opts_header[] = "--vertical-label='Currents'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/ibm_blade_cpu_temp.inc.php0000644000175000017500000000165311716447477022151 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_ibm_blade_cpu_temp($data) { $opts_DEF = rrdtool_get_def($data,array("temperature2","temperature")); $opts_GRAPH = array( "LINE2:temperature2#00CC00:'Cpu2 Temperature'", "GPRINT:temperature2:MAX:'Max\:%5.0lf%s°'", "GPRINT:temperature2:AVERAGE:'Average\:%5.0lf%s°'", "GPRINT:temperature2:LAST:'Last\:%5.0lf%s°\\n'", "LINE2:temperature#0000FF:'Cpu1 Temperature'", "GPRINT:temperature:MAX:'Max\:%5.0lf%s°'", "GPRINT:temperature:AVERAGE:'Average\:%5.0lf%s°'", "GPRINT:temperature:LAST:'Last\:%5.0lf%s°'" ); $opts_header[] = "--vertical-label='Degres Centigrade'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/pix_connections.inc.php0000644000175000017500000000132111716447477021551 0ustar csmallcsmall Mario Spendier * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_pix_connections ($data) { $opts_DEF = rrdtool_get_def($data,array("pix_connections")); $opts_GRAPH = array( "AREA:pix_connections#00CC00:'Established Connections '", "GPRINT:pix_connections:MAX:'Max\:%8.0lf %s'", "GPRINT:pix_connections:AVERAGE:'Average\:%8.0lf %s'", "GPRINT:pix_connections:LAST:'Last\:%8.0lf %s'", ); $opts_header[] = "--vertical-label='Established Connections'"; return array ($opts_header, array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/hostmib_users_procs.inc.php0000644000175000017500000000163511716447477022453 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_hostmib_users_procs ($data) { $opts_DEF = rrdtool_get_def($data,array("num_procs","num_users")); $opts_GRAPH = array( "AREA:num_procs#00CC00:'Number of Processes '", "GPRINT:num_procs:MAX:'Max\:%8.0lf %s'", "GPRINT:num_procs:AVERAGE:'Average\:%8.0lf %s'", "GPRINT:num_procs:LAST:'Last\:%8.0lf %s\\n'", "LINE2:num_users#0000FF:'Number of Users '", "GPRINT:num_users:MAX:'Max\:%8.0lf %s'", "GPRINT:num_users:AVERAGE:'Average\:%8.0lf %s'", "GPRINT:num_users:LAST:'Last\:%8.0lf %s'" ); $opts_header[] = "--vertical-label='Processes/Users'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/ucd_cpu_solaris.inc.php0000644000175000017500000000375411716447477021541 0ustar csmallcsmall Robert Bogdon * This program is licensed under the GNU GPL, full terms in the LICENSE file */ // Solaris CPU Graph, UCD-SNMP function graph_ucd_cpu_solaris ($data) { $opts_DEF = rrdtool_get_def($data,array("cpu_user_ticks","cpu_idle_ticks","cpu_wait_ticks","cpu_kernel_ticks")); $opts_GRAPH = array( "CDEF:user_ticks=cpu_user_ticks,UN,0,cpu_user_ticks,IF", "CDEF:idle_ticks=cpu_idle_ticks,UN,0,cpu_idle_ticks,IF", "CDEF:wait_ticks=cpu_wait_ticks,UN,0,cpu_wait_ticks,IF", "CDEF:kernel_ticks=cpu_kernel_ticks,UN,0,cpu_kernel_ticks,IF", "HRULE:".($data["cpu_num"]*100)."#990000:'Number of Processors\: ".$options["cpu_num"]."\\n'", "AREA:user_ticks#FF0000:'User CPU Time'", "GPRINT:user_ticks:MAX:'Max\:%8.2lf %%'", "GPRINT:user_ticks:AVERAGE:'Average\:%8.2lf %%'", "GPRINT:user_ticks:LAST:'Last\:%8.2lf %%\\n'", "STACK:wait_ticks#0000FF:'Wait CPU Time'", "GPRINT:wait_ticks:MAX:'Max\:%8.2lf %%'", "GPRINT:wait_ticks:AVERAGE:'Average\:%8.2lf %%'", "GPRINT:wait_ticks:LAST:'Last\:%8.2lf %%\\n'", "STACK:kernel_ticks#FFFF00:'Kernel CPU Time'", "GPRINT:kernel_ticks:MAX:'Max\:%8.2lf %%'", "GPRINT:kernel_ticks:AVERAGE:'Average\:%8.2lf %%'", "GPRINT:kernel_ticks:LAST:'Last\:%8.2lf %%\\n'", "STACK:idle_ticks#00CC00:'Idle CPU Time'", "GPRINT:idle_ticks:MAX:'Max\:%8.2lf %%'", "GPRINT:idle_ticks:AVERAGE:'Average\:%8.2lf %%'", "GPRINT:idle_ticks:LAST:'Last\:%8.2lf %%\\n'"); $opts_header[] = "--vertical-label='CPU Usage'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/traffic.inc.php0000644000175000017500000000510311522434525017750 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //normal traffic function graph_traffic ($data) { $opts_GRAPH_end = array(); $rrd_data=''; if ($data['flipinout']==1) { $opts_DEF = rrdtool_get_def($data,array('output'=>'input', 'input'=>'output')); $flip_legend = "(In / Out Flipped)"; } else $opts_DEF = rrdtool_get_def($data,array('input','output')); $opts_DEF[]='CDEF:inputbits=input,UN,input,input,IF,8,*'; $opts_DEF[]='CDEF:outputbits=output,UN,output,output,IF,8,*'; $opts_GRAPH_init=array( "HRULE:".$data["bandwidthin"]. "#FF0000:' '", "COMMENT:'Inbound Bandwidth: ".($data["bandwidthin"] /1000)." kbps'", "HRULE:".$data["bandwidthout"]."#AA0000:' '", "COMMENT:'Outbound Bandwidth:".($data["bandwidthout"]/1000)." kbps".(!empty($data["address"])?" IP: ".$data["address"]:"")."\\n'", ); // External Data Gathering if (is_numeric($data['percentile']) or (array_key_exists('other_data', $data) and $data['other_data']=='get_graph_data')) { $Interfaces = new JffnmsInterfaces(); $rrd_data = $Interfaces->fetch_ds ($data['id'], array ('input', 'output'), $data['rrd_grapher_time_start'], $data['rrd_grapher_time_stop']); } // Nth Percentile Calculation if (is_numeric($data['percentile'])) { include_once (jffnms_shared('percentile')); if (is_array($rrd_data)) { list($result, $data_points) = calculate_percentile ($data['percentile'], $rrd_data); $percentile_value = $result*8; $opts_GRAPH_init[] = "HRULE:".$percentile_value."#CC00FF:'".$data["percentile"]." Percentile Usage\: ".byte_format($percentile_value,2)."bps\\n'"; } } else $data_points = array($rrd_data); // get Data Points for CSV without Percentile $opts_GRAPH = array_merge($opts_GRAPH_init,array( "AREA:inputbits#00CC00:'Inbound '", "GPRINT:inputbits:MAX:'Max\:%8.2lf %sbps'", "GPRINT:inputbits:AVERAGE:'Average\:%8.2lf %sbps'", "GPRINT:inputbits:LAST:'Last\:%8.2lf %sbps\\n'", "LINE2:outputbits#0000FF:Outbound", "GPRINT:outputbits:MAX:'Max\:%8.2lf %sbps'", "GPRINT:outputbits:AVERAGE:'Average\:%8.2lf %sbps'", "GPRINT:outputbits:LAST:'Last\:%8.2lf %sbps\\n'", (isset($flip_legend)?"COMMENT:'".$flip_legend."'":""), ),$opts_GRAPH_end); $opts_header[] = "--vertical-label='Bits per Second'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH), $data_points); } ?> jffnms-0.9.3/engine/graphs/bgp_routes.inc.php0000644000175000017500000000154011716447477020523 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_bgp_routes ($data) { $opts_DEF = rrdtool_get_def($data,array("in"=>"accepted_routes", "out"=>"advertised_routes")); $opts_GRAPH = array( "LINE2:in#00CC00:'Accepted Routes '", "GPRINT:in:MAX:'Max\:%8.2lf %s'", "GPRINT:in:AVERAGE:'Average\:%8.2lf %s'", "GPRINT:in:LAST:'Last\:%8.2lf %s\\n'", "LINE2:out#0000FF:'Advertised Routes'", "GPRINT:out:MAX:'Max\:%8.2lf %s'", "GPRINT:out:AVERAGE:'Average\:%8.2lf %s'", "GPRINT:out:LAST:'Last\:%8.2lf %s'", ); $opts_header[] = "--vertical-label='Routes'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/tc_rate_aggregation.inc.php0000644000175000017500000000304411716447477022343 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //Linux TC Rate Aggregation function graph_tc_rate_aggregation ($data) { $color_array = array("0","7","D"); foreach ($color_array as $a) foreach ($color_array as $c) foreach ($color_array as $e) $colors[] = $a.$a.$c.$c.$e.$e; $color_array = array("3","9","F"); foreach ($color_array as $a) foreach ($color_array as $c) foreach ($color_array as $e) $colors[] = $a.$a.$c.$c.$e.$e; $defs = array(); $graph = array(); foreach ($data[id] as $id) { $interface=$data[$id]; $used_color = $colors[++$i*4]; $interface["interface"] = str_replace(":","\:",$interface["interface"]); $name = substr( substr(str_pad($interface["interface"]." ".$interface["description"],20," "),0,20). str_pad(($interface["rate"]/1000),5," ",STR_PAD_LEFT)." kbps" ,0,35); $defs = @array_merge ($defs, rrdtool_get_def($interface,array("bytes$id"=>"bytes")), array("CDEF:bits$id=bytes$id,UN,bytes$id,bytes$id,IF,8,*")); $graph = @array_merge ($graph, array( "LINE2:bits$id#$used_color:'$name'", "GPRINT:bits$id:MAX:'Max\:%8.2lf %sbps'", "GPRINT:bits$id:AVERAGE:'Average\:%8.2lf %sbps'", "GPRINT:bits$id:LAST:'Last\:%8.2lf %sbps\\n'", )); } $opts_header[] = "--vertical-label='Bits per Second'"; return array ($opts_header, @array_merge($defs,$graph)); } ?> jffnms-0.9.3/engine/graphs/css_vip_output_only_traffic.inc.php0000644000175000017500000000153411716447477024202 0ustar csmallcsmall Robert Bogdon * This program is licensed under the GNU GPL, full terms in the LICENSE file */ // output only traffic, for css vips function graph_css_vip_output_only_traffic ($data) { $opts_DEF = rrdtool_get_def($data,"output"); $opts_GRAPH = array( "CDEF:outputbits=output,UN,0,output,IF,8,*", "HRULE:".$options["bandwidth"]."#AA0000:'Total Outbound Bandwidth\: ".($options["bandwidth"]/1000)." kbps $aux\\n'", "AREA:outputbits#0000FF:Outbound", "GPRINT:outputbits:MAX:'Max\:%8.2lf %sbps'", "GPRINT:outputbits:AVERAGE:'Average\:%8.2lf %sbps'", "GPRINT:outputbits:LAST:'Last\:%8.2lf %sbps'" ); $opts_header[] = "--vertical-label='Bits per Second'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/iis_tptg.inc.php0000644000175000017500000000146411716447477020201 0ustar csmallcsmall Robert St.Denis * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_iis_tptg ($data) { $opts_DEF = rrdtool_get_def($data,array("tp","tg")); $opts_GRAPH = array( "AREA:tp#00CC00:'Posts Per Second '", "GPRINT:tp:MAX:'Max\:%8.0lf %s'", "GPRINT:tp:AVERAGE:'Average\:%8.0lf %s'", "GPRINT:tp:LAST:'Last\:%8.0lf %s\\n'", "STACK:tg#0000CC:'Gets Per Second '", "GPRINT:tg:MAX:'Max\:%8.0lf %s'", "GPRINT:tg:AVERAGE:'Average\:%8.0lf %s'", "GPRINT:tg:LAST:'Last\:%8.0lf %s\\n'", ); $opts_header[] = "--vertical-label='Per Second'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/alteon_failures_sessions.inc.php0000644000175000017500000000130111377440254023434 0ustar csmallcsmall Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_alteon_failures_sessions($data) { $opts_DEF = rrdtool_get_def($data,array('failures','total_sessions')); $opts_GRAPH = array( "CDEF:fail_pct=failures,100,*,total_sessions,/", "LINE3:fail_pct#FF0000:'Failures\: '", "GPRINT:fail_pct:MAX:'Max\: %8.4lf %s%%'", "GPRINT:fail_pct:AVERAGE:'Average\: %8.4lf %s%%'", "GPRINT:fail_pct:LAST:'Last\: %8.4lf %s%%\\n'", ); $opts_header[] = "--vertical-label='Failures by Sessions Rate'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } jffnms-0.9.3/engine/graphs/cisco_saagent_rtl.inc.php0000644000175000017500000000145011716447477022035 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //Cisco SA-Agent Round-Trip Latency grapher function graph_cisco_saagent_rtl ($data) { extract($data); $opts_DEF = rrdtool_get_def($data,array("rt_latency")); $opts_GRAPH = array( "AREA:rt_latency#00CC00:'Round-Trip Latency'", "GPRINT:rt_latency:MAX:'Max\:%5.0lf msec'", "GPRINT:rt_latency:AVERAGE:'Average\:%5.0lf msec'", "GPRINT:rt_latency:LAST:'Last\:%5.0lf msec \\n'" ); $opts_header[] = "--vertical-label='SA Agent Round-Trip Latency'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/tcpmib_connections.inc.php0000644000175000017500000000247111716447477022236 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_tcpmib_connections ($data) { $opts_DEF = rrdtool_get_def($data,array(a=>"tcp_active",p=>"tcp_passive",e=>"tcp_established")); $opts_GRAPH = array( "CDEF:tcp_established=e,300,*", "CDEF:tcp_active=a,300,*", "CDEF:tcp_passive=p,300,*", "AREA:tcp_established#00CC00:'Established Connections '", "GPRINT:tcp_established:MAX:'Max\:%8.0lf %s'", "GPRINT:tcp_established:AVERAGE:'Average\:%8.0lf %s'", "GPRINT:tcp_established:LAST:'Last\:%8.0lf %s\\n'", "LINE2:tcp_active#0000FF:'Outgoing Connection Attempts '", "GPRINT:tcp_active:MAX:'Max\:%8.0lf %s'", "GPRINT:tcp_active:AVERAGE:'Average\:%8.0lf %s'", "GPRINT:tcp_active:LAST:'Last\:%8.0lf %s\\n'", "LINE2:tcp_passive#FF0000:'Incoming Connection Attempts '", "GPRINT:tcp_passive:MAX:'Max\:%8.0lf %s'", "GPRINT:tcp_passive:AVERAGE:'Average\:%8.0lf %s'", "GPRINT:tcp_passive:LAST:'Last\:%8.0lf %s'" ); $opts_header[] = "--vertical-label='TCP Connections Status'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/error_rate.inc.php0000644000175000017500000000206311716447477020517 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //Errors by Packets function graph_error_rate ($data) { $opts_DEF = rrdtool_get_def($data,array("inpackets","outpackets",inputerr=>"inputerrors",outputerr=>"outputerrors")); $opts_GRAPH = array( "CDEF:input=inputerr,100,*,inpackets,inputerr,+,/", "CDEF:output=outputerr,100,*,outpackets,outputerr,+,/", "AREA:input#00CC00:'Input Errors'", "GPRINT:input:MAX:'Max\: %8.4lf %s%%'", "GPRINT:input:AVERAGE:'Average\: %8.4lf %s%%'", "GPRINT:input:LAST:'Last\: %8.4lf %s%%\\n'", "LINE2:output#0000FF:'Output Errors'", "GPRINT:output:MAX:'Max\: %8.4lf %s%%'", "GPRINT:output:AVERAGE:'Average\: %8.4lf %s%%'", "GPRINT:output:LAST:'Last\: %8.4lf %s%%'" ); $opts_header[] = "--vertical-label='Errors by Packets Rate'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/apache_tac_aggregation.inc.php0000644000175000017500000000170011716447477022767 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_apache_tac_aggregation ($data) { $opts_agg = array(); $str_cdef_tac .= 0; foreach ($data["id"] as $id) { $interface=$data[$id]; $opts_agg = array_merge($opts_agg,rrdtool_get_def($interface,array( "tac$id"=>"tac"))); $str_cdef_tac .=",tac$id,+"; } $cant = count($data["id"]); $opts_agg[] = "CDEF:tac=$str_cdef_tac"; $opts_GRAPH = array( "COMMENT:'Number of Servers:".$cant."\\n'", "AREA:tac#00CC00:'Hits Per Second '", "GPRINT:tac:MAX:'Max\:%8.0lf %s'", "GPRINT:tac:AVERAGE:'Average\:%8.0lf %s'", "GPRINT:tac:LAST:'Last\:%8.0lf %s\\n'", ); $opts_header[] = "--vertical-label='Hits / Second'"; return array ($opts_header, @array_merge($opts_agg,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/ibm_blade_power.inc.php0000644000175000017500000000142111716447477021462 0ustar csmallcsmall David LIMA * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_ibm_blade_power ($data) { $opts_DEF = rrdtool_get_def($data,array("fuelGaugePowerInUse")); $opts_GRAPH = array( "AREA:fuelGaugePowerInUse#0033AA:'Watts '", "GPRINT:fuelGaugePowerInUse:MAX:'Max\: %6.2lf %sWatts'", "GPRINT:fuelGaugePowerInUse:AVERAGE:'Average\: %6.2lf %sWatts'", "GPRINT:fuelGaugePowerInUse:LAST:'Last\: %6.2lf %sWatts\\n'", ); $opts_header[] = "--vertical-label='Power'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/inf_ldisk_totalque.inc.php0000644000175000017500000000254211377440254022222 0ustar csmallcsmall Sebastian van Dijk * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_inf_ldisk_totalque ($data) { $opts_DEF = rrdtool_get_def($data,array("curr_queue"=>"cur_disk_q","avg_queue"=>"avg_disk_q")); $opts_GRAPH = array( "CDEF:ldisk_rate_total=curr_queue,avg_queue,+", "CDEF:avg_queue_graph=avg_queue,-1,*", "COMMENT:' Disk Total '", "GPRINT:ldisk_rate_total:MAX:'Max\:%8.2lf %s '", "GPRINT:ldisk_rate_total:AVERAGE:'Average\:%8.2lf %s '", "GPRINT:ldisk_rate_total:LAST:'Last\:%8.2lf %s \\n'", "AREA:curr_queue#0000CC:'Curr. Disk Queue '", "GPRINT:curr_queue:MAX:'Max\:%8.2lf %s '", "GPRINT:curr_queue:AVERAGE:'Average\:%8.2lf %s '", "GPRINT:curr_queue:LAST:'Last\:%8.2lf %s \\n'", "AREA:avg_queue_graph#FF0000:'Avg. Disk Queue '", "GPRINT:avg_queue:MAX:'Max\:%8.2lf %s '", "GPRINT:avg_queue:AVERAGE:'Average\:%8.2lf %s '", "GPRINT:avg_queue:LAST:'Last\:%8.2lf %s \\n'" ); $opts_header[] = "--vertical-label='AVG/Curr Disk Queue'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/alteon_sessions.inc.php0000644000175000017500000000151411377440254021550 0ustar csmallcsmall Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_alteon_sessions ($data) { $opts_DEF = rrdtool_get_def($data,"current_sessions"); $opts_GRAPH = array( "AREA:current_sessions#00CC00:'Sessions'", "GPRINT:current_sessions:MAX:'Max\:%5.0lf '", "GPRINT:current_sessions:AVERAGE:'Average\:%5.0lf '", "GPRINT:current_sessions:LAST:'Last\:%5.0lf \\n'", ); if (!empty($data['max_connections'])) $opts_GRAPH[] = "COMMENT:' Maximum Connections: ".$data['max_connections']."'"; $opts_header[] = "--vertical-label='Sessions'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/inf_ldisk_rdwrque.inc.php0000644000175000017500000000251511377440254022055 0ustar csmallcsmall Sebastian van Dijk * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_inf_ldisk_rdwrque ($data) { $opts_DEF = rrdtool_get_def($data,array("rd_queue"=>"avg_disk_rdq","wr_queue"=>"avg_disk_wrq")); $opts_GRAPH = array( "CDEF:ldisk_rate_total=rd_queue,wr_queue,+", "CDEF:wr_queue_graph=wr_queue,-1,*", "COMMENT:' Disk Total '", "GPRINT:ldisk_rate_total:MAX:'Max\:%8.2lf %s '", "GPRINT:ldisk_rate_total:AVERAGE:'Average\:%8.2lf %s '", "GPRINT:ldisk_rate_total:LAST:'Last\:%8.2lf %s \\n'", "AREA:rd_queue#0000CC:'RD. Disk Queue '", "GPRINT:rd_queue:MAX:'Max\:%8.2lf %s '", "GPRINT:rd_queue:AVERAGE:'Average\:%8.2lf %s '", "GPRINT:rd_queue:LAST:'Last\:%8.2lf %s \\n'", "AREA:wr_queue_graph#FF0000:'WR. Disk Queue '", "GPRINT:wr_queue:MAX:'Max\:%8.2lf %s '", "GPRINT:wr_queue:AVERAGE:'Average\:%8.2lf %s '", "GPRINT:wr_queue:LAST:'Last\:%8.2lf %s \\n'" ); $opts_header[] = "--vertical-label='RD/WR Disk Queue'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/ups_power_aggregation.inc.php0000644000175000017500000000251311716447477022745 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_ups_power_aggregation ($data) { $color_array = array("2","9","F"); foreach ($color_array as $a) foreach ($color_array as $c) foreach ($color_array as $e) $colors[] = $e."0".$c."0".$a."0"; $opts_DEF = array(); $opts_GRAPH = array(); foreach ($data["id"] as $id) { $interface=$data[$id]; $defs = rrdtool_get_def($interface,array("power$id"=>"power")); $opts_DEF = @array_merge($opts_DEF, $defs); $description = substr(str_pad($interface["host_name"]." ".$interface["zone_shortname"],20," ",STR_PAD_RIGHT),0,20)." ". substr(str_pad($interface["interface"]." ".$interface["description"],20," ",STR_PAD_RIGHT),0,20); $used_color = $colors[++$i*2]; $opts_GRAPH = array_merge ($opts_GRAPH,array( "LINE2:power$id#$used_color:'".$description."\:'", "GPRINT:power$id:MAX:'Max\: %3.0lf %sW'", "GPRINT:power$id:AVERAGE:'Average\: %3.0lf %sW'", "GPRINT:power$id:LAST:'Last\: %3.0lf %sW\\n'" )); } $opts_header[] = "--vertical-label='Watts'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/pdu_load_aggregation.inc.php0000644000175000017500000000256011716447477022513 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file * Chris Wopat - me@falz.net Jan 2006 */ function graph_pdu_load_aggregation ($data) { $color_array = array("3","C","F"); foreach ($color_array as $a) foreach ($color_array as $c) foreach ($color_array as $e) $colors[] = $e."0".$c."0".$a."0"; $opts_DEF = array(); $opts_GRAPH = array(); foreach ($data["id"] as $id) { $interface=$data[$id]; $defs = rrdtool_get_def($interface,array("load$id"=>"load")); $opts_DEF = @array_merge($opts_DEF, $defs); $description = substr(str_pad($interface["host_name"]." ",STR_PAD_RIGHT),0,20)." ". substr(str_pad($interface["interface"]." ".$interface["description"],20," ",STR_PAD_RIGHT),0,20); $used_color = $colors[++$i*2]; $opts_GRAPH = array_merge ($opts_GRAPH,array( "LINE2:load$id#$used_color:'".$description."\:'", "GPRINT:load$id:MAX:'Max\: %3.1lf %sAmps'", "GPRINT:load$id:AVERAGE:'Average\: %3.1lf %sAmps'", "GPRINT:load$id:LAST:'Last\: %3.1lf %sAmps\\n'" )); } $opts_header[] = "--vertical-label='Amps'"; $opts_header[] = "--rigid"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/cisco_80211X_associated.inc.php0000644000175000017500000000134711377440254022526 0ustar csmallcsmall David LIMA * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_cisco_80211X_associated($data) { $opts_DEF = rrdtool_get_def($data,array("associated")); $opts_GRAPH = array( "AREA:associated#0033FF:'Associated clients '", "GPRINT:associated:MAX:'Max\: %3.0lf '", "GPRINT:associated:AVERAGE:'Average\: %3.0lf '", "GPRINT:associated:LAST:'Last\: %3.0lf \\n'", ); $opts_header[] = "--vertical-label='Cisco 802.11X clients'"; $opts_header[] = "--rigid"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/drop_packets.inc.php0000644000175000017500000000122611716447477021031 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_drop_packets ($data) { $opts_DEF = rrdtool_get_def($data,array("drops")); $opts_GRAPH = array( "AREA:drops#FF0000:'Drops '", "GPRINT:drops:MAX:'Max\:%4.0lf %sDps'", "GPRINT:drops:AVERAGE:'Average\:%4.0lf %sDps'", "GPRINT:drops:LAST:'Last\:%4.0lf %sDps\\n'" ); $opts_header[] = "--vertical-label='Packet Drops per Second'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/traffic_words.inc.php0000644000175000017500000000177511716447477021220 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_traffic_words ($data) { $opts_DEF = rrdtool_get_def($data,array('rx_words','tx_words')); $opts_DEF[] = 'CDEF:inputbits=rx_words,UN,rx_words,rx_words,IF,32,*'; $opts_DEF[] = 'CDEF:outputbits=tx_words,UN,tx_words,tx_words,IF,32,*'; $opts_GRAPH = array( "AREA:inputbits#00CC00:'Inbound '", "GPRINT:inputbits:MAX:'Max\:%8.2lf %sbps'", "GPRINT:inputbits:AVERAGE:'Average\:%8.2lf %sbps'", "GPRINT:inputbits:LAST:'Last\:%8.2lf %sbps \\n'", "LINE2:outputbits#0000FF:Outbound", "GPRINT:outputbits:MAX:'Max\:%8.2lf %sbps'", "GPRINT:outputbits:AVERAGE:'Average\:%8.2lf %sbps'", "GPRINT:outputbits:LAST:'Last\:%8.2lf %sbps'", ); $opts_header[] = "--vertical-label='Bits per Second'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/ups_load.inc.php0000644000175000017500000000123311716447477020157 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_ups_load ($data) { $opts_DEF = rrdtool_get_def($data,array("load")); $opts_GRAPH = array( "AREA:load#0033FF:'Load '", "GPRINT:load:MAX:'Max\: %3.0lf %%'", "GPRINT:load:AVERAGE:'Average\: %3.0lf %%'", "GPRINT:load:LAST:'Last\: %3.0lf %%\\n'", ); $opts_header[] = "--vertical-label='Load %'"; $opts_header[] = "--rigid"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/apache_tkb_aggregation.inc.php0000644000175000017500000000174211716447477023006 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_apache_tkb_aggregation ($data) { $opts_agg = array(); $str_cdef_tkb .= 0; foreach ($data["id"] as $id) { $interface=$data[$id]; $opts_agg = array_merge($opts_agg,rrdtool_get_def($interface,array( "tkb$id"=>"tkb"))); $str_cdef_tkb .=",tkb$id,+"; } $cant = count($data["id"]); $opts_agg[] = "CDEF:tkb=$str_cdef_tkb"; $opts_GRAPH = array( "COMMENT:'Number of Servers:".$cant."\\n'", "CDEF:bytes=tkb,1000,*", "AREA:bytes#00CC00:'Throughput '", "GPRINT:bytes:MAX:'Max\:%8.2lf %sbps'", "GPRINT:bytes:AVERAGE:'Average\:%8.0lf %sbps'", "GPRINT:bytes:LAST:'Last\:%8.2lf %sbps\\n'", ); $opts_header[] = "--vertical-label='Bytes/Sec'"; return array ($opts_header, @array_merge($opts_agg,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/iis_tbr.inc.php0000644000175000017500000000120711716447477020005 0ustar csmallcsmall * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_iis_tbr ($data) { $opts_DEF = rrdtool_get_def($data,array("tbr")); $opts_GRAPH = array( "AREA:tbr#00CC00:'Total Bytes Received '", "GPRINT:tbr:MAX:'Max\:%8.0lf %s'", "GPRINT:tbr:AVERAGE:'Average\:%8.0lf %s'", "GPRINT:tbr:LAST:'Last\:%8.0lf %s\\n'", ); $opts_header[] = "--vertical-label='Total Bytes Received'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/apache_tac.inc.php0000644000175000017500000000117511716447477020426 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_apache_tac ($data) { $opts_DEF = rrdtool_get_def($data,array("tac")); $opts_GRAPH = array( "AREA:tac#00CC00:'Hits Per Second '", "GPRINT:tac:MAX:'Max\:%8.0lf %s'", "GPRINT:tac:AVERAGE:'Average\:%8.0lf %s'", "GPRINT:tac:LAST:'Last\:%8.0lf %s\\n'", ); $opts_header[] = "--vertical-label='Hits/Second'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/css_vip_hits.inc.php0000644000175000017500000000130011716447477021041 0ustar csmallcsmall Robert Bogdon * This program is licensed under the GNU GPL, full terms in the LICENSE file */ // generic "hits" graph, for css vips function graph_css_vip_hits ($data) { $opts_DEF = rrdtool_get_def($data,"hits"); $opts_GRAPH = array( "CDEF:hitcount=hits,UN,0,hits,IF", "AREA:hitcount#0000FF:Hits", "GPRINT:hitcount:MAX:'Max\:%8.2lf %s hits'", "GPRINT:hitcount:AVERAGE:'Average\:%8.2lf %s hits/s'", "GPRINT:hitcount:LAST:'Last\:%8.2lf %s hits/s'" ); $opts_header[] = "--vertical-label='Hits per Second'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/ucd_load_average.inc.php0000644000175000017500000000312111716447477021613 0ustar csmallcsmall Robert Bogdon * This program is licensed under the GNU GPL, full terms in the LICENSE file */ // Load Average Graph, UCD-SNMP function graph_ucd_load_average ($data) { $opts_DEF = rrdtool_get_def($data,array("load_average_1","load_average_5","load_average_15")); $opts_GRAPH = array( "CDEF:la_1=load_average_1,UN,0,load_average_1,IF", "CDEF:la_5=load_average_5,UN,0,load_average_5,IF", "CDEF:la_15=load_average_15,UN,0,load_average_15,IF", "LINE1:load_average_1#FF0000:' 1 Minute Load Average'", "GPRINT:load_average_1:MAX:'Max\: %5.2lf'", "GPRINT:load_average_1:AVERAGE:'Average\: %5.2lf'", "GPRINT:load_average_1:LAST:'Last\: %5.2lf\\n'", "LINE2:load_average_5#0000FF:' 5 Minutes Load Average'", "GPRINT:load_average_5:MAX:'Max\: %5.2lf'", "GPRINT:load_average_5:AVERAGE:'Average\: %5.2lf'", "GPRINT:load_average_5:LAST:'Last\: %5.2lf\\n'", "LINE2:load_average_15#00CC00:'15 Minutes Load Average'", "GPRINT:load_average_15:MAX:'Max\: %5.2lf'", "GPRINT:load_average_15:AVERAGE:'Average\: %5.2lf'", "GPRINT:load_average_15:LAST:'Last\: %5.2lf\\n'"); $opts_header[] = "--vertical-label='Load Average'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/alteon_load_average.inc.php0000644000175000017500000000326111377440254022314 0ustar csmallcsmall Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_alteon_load_average($data) { $opts_DEF = rrdtool_get_def($data, array( 'cpua_1sec', 'cpua_4secs', 'cpua_64secs', 'cpub_1sec', 'cpub_4secs', 'cpub_64secs')); $opts_GRAPH = array( "LINE2:cpua_1sec#00FF00:' CPU A 1 Second Load Average'", "GPRINT:cpua_1sec:MAX:'Max\: %5.2lf'", "GPRINT:cpua_1sec:AVERAGE:'Average\: %5.2lf'", "GPRINT:cpua_1sec:LAST:'Last\: %5.2lf\\n'", "LINE2:cpua_4secs#808000:' CPU A 4 Second Load Average'", "GPRINT:cpua_4secs:MAX:'Max\: %5.2lf'", "GPRINT:cpua_4secs:AVERAGE:'Average\: %5.2lf'", "GPRINT:cpua_4secs:LAST:'Last\: %5.2lf\\n'", "LINE2:cpua_64secs#FFFF00:' CPU A 64 Second Load Average'", "GPRINT:cpua_64secs:MAX:'Max\: %5.2lf'", "GPRINT:cpua_64secs:AVERAGE:'Average\: %5.2lf'", "GPRINT:cpua_64secs:LAST:'Last\: %5.2lf\\n'", "LINE2:cpub_1sec#0000FF:' CPU B 1 Second Load Average'", "GPRINT:cpub_1sec:MAX:'Max\: %5.2lf'", "GPRINT:cpub_1sec:AVERAGE:'Average\: %5.2lf'", "GPRINT:cpub_1sec:LAST:'Last\: %5.2lf\\n'", "LINE2:cpub_4secs#800080:' CPU B 4 Second Load Average'", "GPRINT:cpub_4secs:MAX:'Max\: %5.2lf'", "GPRINT:cpub_4secs:AVERAGE:'Average\: %5.2lf'", "GPRINT:cpub_4secs:LAST:'Last\: %5.2lf\\n'", "LINE2:cpub_64secs#FF00FF:' CPU B 64 Second Load Average'", "GPRINT:cpub_64secs:MAX:'Max\: %5.2lf'", "GPRINT:cpub_64secs:AVERAGE:'Average\: %5.2lf'", "GPRINT:cpub_64secs:LAST:'Last\: %5.2lf\\n'", ); $opts_header[] = "--vertical-label='Load Average'"; return array($opts_header, @array_merge($opts_DEF, $opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/ups_voltage.inc.php0000644000175000017500000000124311716447477020702 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_ups_voltage ($data) { $opts_DEF = rrdtool_get_def($data,array("voltage")); $opts_GRAPH = array( "AREA:voltage#0033AA:'Voltage '", "GPRINT:voltage:MAX:'Max\: %3.0lf %sVolts'", "GPRINT:voltage:AVERAGE:'Average\: %3.0lf %sVolts'", "GPRINT:voltage:LAST:'Last\: %3.0lf %sVolts\\n'", ); $opts_header[] = "--vertical-label='Voltage'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/dell_om_temp.inc.php0000644000175000017500000000157511377440254021007 0ustar csmallcsmall jffnms-0.9.3/engine/graphs/apps_memory.inc.php0000644000175000017500000000144411716447477020710 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //HOSTMIB Application Used Memory function graph_apps_memory ($data) { $opts_DEF = rrdtool_get_def($data,array("used_memory_kb"=>"used_memory")); $opts_GRAPH = array( "CDEF:used_memory=used_memory_kb,1000,*", "AREA:used_memory#FF8800:'Memory\: \\n'", "GPRINT:used_memory:MAX:'Max\: %6.2lf %sB'", "GPRINT:used_memory:AVERAGE:'Average\: %6.2lf %sB'", "GPRINT:used_memory:LAST:'Last\: %6.2lf %sB\\n'", ); $opts_header[] = "--vertical-label='Used Memory'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/cisco_mac_bytes.inc.php0000644000175000017500000000245011716447477021501 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_cisco_mac_bytes ($data) { if ($data["flipinout"]==1) { $opts_DEF = rrdtool_get_def($data,array(output=>"input",input=>"output")); $flip_legend = " (In / Out Flipped)"; } else $opts_DEF = rrdtool_get_def($data,array("input","output")); $opts_GRAPH = array( "CDEF:inputbits=input,UN,0,input,IF,8,*", "CDEF:outputbits=output,UN,0,output,IF,8,*", "COMMENT:'".$data["description"].", IP Address: ".$data["address"]." on ".substr($data["interface"],0,strpos($data["interface"],":"))."\\n'", "AREA:inputbits#00CC00:'Inbound '", "GPRINT:inputbits:MAX:'Max\:%8.2lf %sbps'", "GPRINT:inputbits:AVERAGE:'Average\:%8.2lf %sbps'", "GPRINT:inputbits:LAST:'Last\:%8.2lf %sbps$flip_legend\\n'", "LINE2:outputbits#0000FF:'Outbound '", "GPRINT:outputbits:MAX:'Max\:%8.2lf %sbps'", "GPRINT:outputbits:AVERAGE:'Average\:%8.2lf %sbps'", "GPRINT:outputbits:LAST:'Last\:%8.2lf %sbps'" ); $opts_header[] = "--vertical-label='Bits per Second'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/packets_aggregation.inc.php0000644000175000017500000000260711716447477022360 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //it takes all the interfaces on ID and makes an aggregated graph function graph_packets_aggregation ($data) { $opts_agg = array(); $str_cdef_in = "CDEF:inputpackets=0,"; $str_cdef_out = "CDEF:outputpackets=0,"; foreach ($data[id] as $id) { $interface=$data[$id]; $opts_agg = @array_merge ($opts_agg,rrdtool_get_def($interface,array("input$id"=>"inpackets","output$id"=>"outpackets"))); $str_cdef_in .="input$id,UN,0,input$id,IF,+,"; $str_cdef_out .="output$id,UN,0,output$id,IF,+,"; } $opts_agg[] = $str_cdef_in; $opts_agg[] = $str_cdef_out; $opts_GRAPH = array( "AREA:inputpackets#00CC00:'Inbound '", "GPRINT:inputpackets:MAX:'Max\:%8.2lf %sPps'", "GPRINT:inputpackets:AVERAGE:'Average\:%8.2lf %sPps'", "GPRINT:inputpackets:LAST:'Last\:%8.2lf %sPps\\n'", "LINE2:outputpackets#0000FF:Outbound", "GPRINT:outputpackets:MAX:'Max\:%8.2lf %sPps'", "GPRINT:outputpackets:AVERAGE:'Average\:%8.2lf %sPps'", "GPRINT:outputpackets:LAST:'Last\:%8.2lf %sPps'" ); $opts_header[] = "--vertical-label='Packets per Second'"; return array ($opts_header, @array_merge($opts_agg,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/memory.inc.php0000644000175000017500000000277511716447477017675 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //Cisco Used Memory function graph_memory ($data) { $opts_DEF = rrdtool_get_def($data,array(mem_used_b=>"mem_used",mem_free_b=>"mem_free")); $opts_GRAPH = array( "CDEF:mem_used=mem_used_b", "CDEF:mem_free=mem_free_b", "CDEF:mem_total=mem_used,mem_free,+", "CDEF:mem_free_p=mem_free,100,*,mem_total,/", "CDEF:mem_used_p=mem_used,100,*,mem_total,/", "LINE3:mem_total#FF0000:'Total Memory\: '", "GPRINT:mem_total:MAX:'%6.0lf %sB\\n'", "AREA:mem_used#FF8800:'Used Memory '", "GPRINT:mem_used:MAX:'Max\: %6.2lf %sB'", "GPRINT:mem_used_p:MAX:'(%2.0lf %%)'", "GPRINT:mem_used:AVERAGE:'Average\: %6.2lf %sB'", "GPRINT:mem_used_p:AVERAGE:'(%2.0lf %%)'", "GPRINT:mem_used:LAST:'Last\: %6.2lf %sB'", "GPRINT:mem_used_p:LAST:'(%2.0lf %%)\\n'", "STACK:mem_free#00CC00:'Free Memory '", "GPRINT:mem_free:MAX:'Max\: %6.2lf %sB'", "GPRINT:mem_free_p:MAX:'(%2.0lf %%)'", "GPRINT:mem_free:AVERAGE:'Average\: %6.2lf %sB'", "GPRINT:mem_free_p:AVERAGE:'(%2.0lf %%)'", "GPRINT:mem_free:LAST:'Last\: %6.2lf %sB'", "GPRINT:mem_free_p:LAST:'(%2.0lf %%)\\n'", ); $opts_header[] = "--vertical-label='Used Memory'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/sensor_value.inc.php0000644000175000017500000000320111716447477021053 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_sensor_value ($data) { $def = rrdtool_get_def($data, "value"); switch (true) { case (strpos($data["interface"],"temp")!==false): $far = (isset($data["show_celcius"]) && ($data["show_celcius"]==0))?1:0; $graph = array ( "CDEF:temperature=value,".(($far==1)?"1.8,*,32,+":"1,*"), "AREA:temperature#DD0000:'Temperature in degrees ".(($far==1)?"Fahrenheit":"Celcius")."\:'", "GPRINT:temperature:MAX:'Max\:%5.2lf'", "GPRINT:temperature:AVERAGE:'Average\:%5.2lf'", "GPRINT:temperature:LAST:'Last\:%5.2lf \\n'" ); $label = "Temperature"; break; case (strpos($data["interface"],"in")!==false): $graph = array ( "AREA:value#0000DD:'Voltage\:'", "GPRINT:value:MAX:'Max\:%5.2lf %sV'", "GPRINT:value:AVERAGE:'Average\:%5.2lf %sV'", "GPRINT:value:LAST:'Last\:%5.2lf %sV\\n'" ); $label = "Voltage"; break; case (strpos($data["interface"],"fan")!==false): $graph = array ( "AREA:value#00DD00:'RPM\:'", "GPRINT:value:MAX:'Max\:%5.2lf rpm'", "GPRINT:value:AVERAGE:'Average\:%5.2lf rpm'", "GPRINT:value:LAST:'Last\:%5.2lf rpm\\n'" ); $label = "RPM"; break; default: // Should we have a Default Case? break; } return array ( array("--vertical-label='".$label."'"), @array_merge($def, $graph) ); } ?> jffnms-0.9.3/engine/graphs/alteon_memory.inc.php0000644000175000017500000000257711716447477021237 0ustar csmallcsmall Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_alteon_memory ($data) { $opts_DEF = rrdtool_get_def($data,array('mem_total', 'mem_used')); $opts_GRAPH = array( "CDEF:mem_free=mem_total,mem_used,-", "CDEF:mem_free_p=mem_free,100,*,mem_total,/", "CDEF:mem_used_p=mem_used,100,*,mem_total,/", "LINE3:mem_total#FF0000:'Total Memory\: '", "GPRINT:mem_total:MAX:'%6.0lf %sB\\n'", "AREA:mem_used#FF8800:'Used Memory '", "GPRINT:mem_used:MAX:'Max\: %6.2lf %sB'", "GPRINT:mem_used_p:MAX:'(%2.0lf %%)'", "GPRINT:mem_used:AVERAGE:'Average\: %6.2lf %sB'", "GPRINT:mem_used_p:AVERAGE:'(%2.0lf %%)'", "GPRINT:mem_used:LAST:'Last\: %6.2lf %sB'", "GPRINT:mem_used_p:LAST:'(%2.0lf %%)\\n'", "STACK:mem_free#00CC00:'Free Memory '", "GPRINT:mem_free:MAX:'Max\: %6.2lf %sB'", "GPRINT:mem_free_p:MAX:'(%2.0lf %%)'", "GPRINT:mem_free:AVERAGE:'Average\: %6.2lf %sB'", "GPRINT:mem_free_p:AVERAGE:'(%2.0lf %%)'", "GPRINT:mem_free:LAST:'Last\: %6.2lf %sB'", "GPRINT:mem_free_p:LAST:'(%2.0lf %%)\\n'", ); $opts_header[] = "--vertical-label='Used Memory'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/bgp_updates.inc.php0000644000175000017500000000244111716447477020650 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_bgp_updates ($data) { $opts_DEF = rrdtool_get_def($data,array(input=>"bgpin",output=>"bgpout",uptime_sec=>"bgpuptime")); $opts_GRAPH = array ( "CDEF:uptime_min=uptime_sec,60,/", "CDEF:uptime_hour=uptime_min,60,/", "CDEF:input_5min=input,300,*", "CDEF:output_5min=output,300,*", //"LINE1:uptime_sec#FF0000:'Peer Uptime\:'", "GPRINT:uptime_hour:LAST:'Peer Uptime\: %6.2lf Hours'", "GPRINT:uptime_sec:LAST:'(%9.0lf seconds)\\n'", "AREA:input_5min#00CC00:'Inbound Updates in 5 minutes'", "GPRINT:input_5min:MAX:'Max\:%4.0lf %s'", "GPRINT:input_5min:AVERAGE:'Average\:%4.0lf %s'", "GPRINT:input_5min:LAST:'Last\:%4.0lf %s\\n'", "LINE2:output_5min#0000FF:'Outbound Updates in 5 minutes'", "GPRINT:output_5min:MAX:'Max\:%4.0lf %s'", "GPRINT:output_5min:AVERAGE:'Average\:%4.0lf %s'", "GPRINT:output_5min:LAST:'Last\:%4.0lf %s'" ); $opts_header[] = "--vertical-label='BGP Updates per 5 Minutes'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/ups_charge_remaining.inc.php0000644000175000017500000000142411716447477022524 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_ups_charge_remaining ($data) { $opts_DEF = rrdtool_get_def($data,array("charge_remaining")); $opts_GRAPH = array( "AREA:charge_remaining#00DD00:'Charge Remaining\:'", "GPRINT:charge_remaining:MAX:'Max\: %3.0lf %%'", "GPRINT:charge_remaining:AVERAGE:'Average\: %3.0lf %%'", "GPRINT:charge_remaining:LAST:'Last\: %3.0lf %%\\n'", ); $opts_header[] = "--vertical-label='Charge Remaining %'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/temperature.inc.php0000644000175000017500000000157611716447477020720 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //Temperature function graph_temperature ($data) { $opts_DEF = rrdtool_get_def($data,array("temp_c"=>"temperature")); $far = (isset($data["show_celcius"]) && ($data["show_celcius"]==0))?1:0; $opts_GRAPH = array( "CDEF:temperature=temp_c,".(($far==1)?"1.8,*,32,+":"1,*"), "AREA:temperature#FF0000:'Temperature in degrees ".(($far==1)?"Fahrenheit":"Celcius")."\:'", "GPRINT:temperature:MAX:'Max\:%5.0lf'", "GPRINT:temperature:AVERAGE:'Average\:%5.0lf'", "GPRINT:temperature:LAST:'Last\:%5.0lf \\n'" ); $opts_header[] = "--vertical-label='Temperature'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/ups_power.inc.php0000644000175000017500000000122211716447477020372 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_ups_power ($data) { $opts_DEF = rrdtool_get_def($data,array("power")); $opts_GRAPH = array( "AREA:power#0033AA:'Watts '", "GPRINT:power:MAX:'Max\: %3.0lf %sWatts'", "GPRINT:power:AVERAGE:'Average\: %3.0lf %sWatts'", "GPRINT:power:LAST:'Last\: %3.0lf %sWatts\\n'", ); $opts_header[] = "--vertical-label='Watts'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/traffic_aggregation.inc.php0000644000175000017500000000457111716447477022346 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //it takes all the interfaces on ID and makes an aggregated graph function graph_traffic_aggregation ($data) { $opts_agg = array(); $bandwidth_agg_in=0; $bandwidth_agg_out=0; $str_cdef_in = "CDEF:input=0,"; $str_cdef_out = "CDEF:output=0,"; foreach ($data["id"] as $id) { $interface=$data[$id]; if ($interface["flipinout"]==1) { $opts_agg = @array_merge ($opts_agg,rrdtool_get_def($interface,array("output$id"=>"input","input$id"=>"output"))); $flip_legend = " (Some In / Out Flipped)"; } else $opts_agg = @array_merge ($opts_agg,rrdtool_get_def($interface,array("input$id"=>"input","output$id"=>"output"))); $bandwidthin += $interface["bandwidthin"]; $bandwidthout += $interface["bandwidthout"]; $str_cdef_in .="input$id,UN,0,input$id,IF,+,"; $str_cdef_out .="output$id,UN,0,output$id,IF,+,"; } $opts_agg[] = $str_cdef_in; $opts_agg[] = $str_cdef_out; $bandwidthin_k = $bandwidthin/1000; $bandwidthout_k = $bandwidthout/1000; $opts_GRAPH = array( "CDEF:inputbits=input,UN,0,input,IF,8,*", "CDEF:outputbits=output,UN,0,output,IF,8,*", //"CDEF:total_inputbits=inputbits,UN,0,inputbits,IF,300,*,PREV,UN,0,PREV,IF,+", //"CDEF:total_outputbits=outputbits,UN,0,outputbits,IF,300,*,PREV,UN,0,PREV,IF,+", "HRULE:$bandwidthin#FF0000:' '", "COMMENT:'Inbound Bandwidth: $bandwidthin_k kbps'", "HRULE:$bandwidthout#AA0000:' '", "COMMENT:'Outbound Bandwidth: $bandwidthout_k kbps\\n'", (!empty($flip_comment))?"COMMENT:'$flip_legend\\n'":"", "AREA:inputbits#00CC00:'Inbound '", "GPRINT:inputbits:MAX:'Max\:%8.2lf %sbps'", "GPRINT:inputbits:AVERAGE:'Average\:%8.2lf %sbps'", "GPRINT:inputbits:LAST:'Last\:%8.2lf %sbps\\n'", //"GPRINT:total_inputbits:MAX:'Total\:%8.2lf %sbps\\n'", "LINE2:outputbits#0000FF:Outbound", "GPRINT:outputbits:MAX:'Max\:%8.2lf %sbps'", "GPRINT:outputbits:AVERAGE:'Average\:%8.2lf %sbps'", "GPRINT:outputbits:LAST:'Last\:%8.2lf %sbps\\n'", //"GPRINT:total_outputbits:MAX:'Total\:%8.2lf %sbps'", ); $opts_header[] = "--vertical-label='Bits per Second'"; return array ($opts_header, @array_merge($opts_agg,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/sql_records.inc.php0000644000175000017500000000207011716447477020671 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_sql_records ($data) { $ds = "records_".(($data["absolute"]==1)?"absolute":"counter"); $opts_DEF = rrdtool_get_def($data,array($ds)); $opts_GRAPH = array( (is_numeric($data["max_records"])?"HRULE:".$data["max_records"]."#FF0000:'Max Records\: ".$data["max_records"]." records'":""), (is_numeric($data["min_records"])?"HRULE:".$data["min_records"]."#22FF22:'Min Records\: ".$data["min_records"]." records'":""), "LINE3:".$ds."#000066:'Current Records\: '", "GPRINT:".$ds.":LAST:'%8.2lf %s\\n'", ); $opts_header[] = "--vertical-label='Records'"; if (is_numeric($data["max_records"])) $opts_header[] = "--upper-limit=".round($data["max_records"]*1.2); if (is_numeric($data["min_records"])) $opts_header[] = "--lower-limit=".round($data["min_records"]*0.8); return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/iptables_rate_aggregation.inc.php0000644000175000017500000000262311716447477023542 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_iptables_rate_aggregation ($data) { $color_array = array("0","7","D"); foreach ($color_array as $a) foreach ($color_array as $c) foreach ($color_array as $e) $colors[] = $a.$a.$c.$c.$e.$e; $color_array = array("3","9","F"); foreach ($color_array as $a) foreach ($color_array as $c) foreach ($color_array as $e) $colors[] = $a.$a.$c.$c.$e.$e; $defs = array(); $graph = array(); foreach ($data[id] as $id) { $interface=$data[$id]; $used_color = $colors[++$i*4]; list(,$interface["interface"]) = explode (" ", $interface["interface"]); $defs = @array_merge ($defs, rrdtool_get_def($interface,array("bytes$id"=>"ipt_bytes")), array("CDEF:bits$id=bytes$id,UN,bytes$id,bytes$id,IF,8,*")); $graph = @array_merge ($graph, array( "LINE2:bits$id#$used_color:'".str_pad($interface["interface"],25)."'", "GPRINT:bits$id:MAX:'Max\:%8.2lf %sbps'", "GPRINT:bits$id:AVERAGE:'Average\:%8.2lf %sbps'", "GPRINT:bits$id:LAST:'Last\:%8.2lf %sbps\\n'", )); } $opts_header[] = "--vertical-label='Bits per Second'"; return array ($opts_header, @array_merge($defs,$graph)); } ?> jffnms-0.9.3/engine/graphs/apache_tkb.inc.php0000644000175000017500000000124011716447477020430 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_apache_tkb ($data) { $opts_DEF = rrdtool_get_def($data,array("tkb")); $opts_GRAPH = array( "CDEF:bytes=tkb,1000,*", "AREA:bytes#00CC00:'Throughput '", "GPRINT:bytes:MAX:'Max\:%8.2lf %sbps'", "GPRINT:bytes:AVERAGE:'Average\:%8.2lf %sbps'", "GPRINT:bytes:LAST:'Last\:%8.2lf %sbps\\n'", ); $opts_header[] = "--vertical-label='Bytes/Sec'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/alteon_octets.inc.php0000644000175000017500000000124211716447477021214 0ustar csmallcsmall Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_alteon_octets ($data) { $opts_DEF = rrdtool_get_def($data,'octets'); $opts_DEF['bits']='CDEF:bits=octets,UN,octets,octets,IF,8,*'; $opts_GRAPH = array( "AREA:bits#00CC00:'Traffic '", "GPRINT:bits:MAX:'Max\:%8.2lf %sbps'", "GPRINT:bits:AVERAGE:'Average\:%8.2lf %sbps'", "GPRINT:bits:LAST:'Last\:%8.2lf %sbps'", ); $opts_header[] = "--vertical-label='Bits per Second'"; return array ($opts_header, array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/storage.inc.php0000644000175000017500000000424311717644147020013 0ustar csmallcsmall Robert Bogdon * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //Used Storage Graph function graph_storage ($data) { $opts_DEF = rrdtool_get_def($data,array( 'storage_block_count_b'=>"storage_block_count", 'storage_block_size_b'=>"storage_block_size", 'storage_used_blocks_b'=>"storage_used_blocks")); $opts_GRAPH = array( "CDEF:storage_block_count=storage_block_count_b", "CDEF:storage_used_blocks=storage_used_blocks_b", "CDEF:storage_block_size=storage_block_size_b", "CDEF:storage_free_blocks=storage_block_count,storage_used_blocks,-", "CDEF:storage_free=storage_free_blocks,storage_block_size,*", "CDEF:storage_total=storage_block_count,storage_block_size,*", "CDEF:storage_used=storage_used_blocks,storage_block_size,*", "CDEF:storage_free_p=storage_free,100,*,storage_total,/", "CDEF:storage_used_p=storage_used,100,*,storage_total,/", "LINE3:storage_total#FF0000:'Total Storage\: '", "GPRINT:storage_total:MAX:'%6.0lf %sB\\n'", "AREA:storage_used#FF8800:'Used Storage '", "GPRINT:storage_used:MAX:'Max\: %6.2lf %sB'", "GPRINT:storage_used_p:MAX:'(%3.0lf %%)'", "GPRINT:storage_used:AVERAGE:'Average\: %6.2lf %sB'", "GPRINT:storage_used_p:AVERAGE:'(%3.0lf %%)'", "GPRINT:storage_used:LAST:'Last\: %6.2lf %sB'", "GPRINT:storage_used_p:LAST:'(%3.0lf %%)\\n'", "STACK:storage_free#00CC00:'Free Storage '", "GPRINT:storage_free:MAX:'Max\: %6.2lf %sB'", "GPRINT:storage_free_p:MAX:'(%3.0lf %%)'", "GPRINT:storage_free:AVERAGE:'Average\: %6.2lf %sB'", "GPRINT:storage_free_p:AVERAGE:'(%3.0lf %%)'", "GPRINT:storage_free:LAST:'Last\: %6.2lf %sB'", "GPRINT:storage_free_p:LAST:'(%3.0lf %%)\\n'", ); $opts_header[] = "--vertical-label='Used Storage'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/cisco_nat_packets.inc.php0000644000175000017500000000525311716447477022033 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_cisco_nat_packets ($data) { $result = array_merge( rrdtool_get_def($data, array( "icmp_in" => "cisco_nat_icmp_inbound", "tcp_in" => "cisco_nat_tcp_inbound", "udp_in" => "cisco_nat_udp_inbound", "other_in" => "cisco_nat_other_ip_inbound", "_icmp_out" => "cisco_nat_icmp_outbound", "_tcp_out" => "cisco_nat_tcp_outbound", "_udp_out" => "cisco_nat_udp_outbound", "_other_out" => "cisco_nat_other_ip_outbound" )),array( "CDEF:icmp_out=_icmp_out,-1,*", "CDEF:tcp_out=_tcp_out,-1,*", "CDEF:udp_out=_udp_out,-1,*", "CDEF:other_out=_other_out,-1,*", "LINE2:icmp_in#8D00BA:'+ Inbound ICMP '", "GPRINT:icmp_in:MAX:'Max\: %8.2lf %spps'", "GPRINT:icmp_in:AVERAGE:'Average\:%8.2lf %spps'", "GPRINT:icmp_in:LAST:'Last\:%8.2lf %spps \\n'", "LINE2:tcp_in#00CC00:'+ Inbound TCP '", "GPRINT:tcp_in:MAX:'Max\: %8.2lf %spps'", "GPRINT:tcp_in:AVERAGE:'Average\:%8.2lf %spps'", "GPRINT:tcp_in:LAST:'Last\:%8.2lf %spps\\n'", "LINE2:udp_in#FF0000:'+ Inbound UDP '", "GPRINT:udp_in:MAX:'Max\: %8.2lf %spps'", "GPRINT:udp_in:AVERAGE:'Average\:%8.2lf %spps'", "GPRINT:udp_in:LAST:'Last\:%8.2lf %spps \\n'", "LINE2:other_in#0090F0:'+ Inbound Other'", "GPRINT:other_in:MAX:'Max\: %8.2lf %spps'", "GPRINT:other_in:AVERAGE:'Average\:%8.2lf %spps'", "GPRINT:other_in:LAST:'Last\:%8.2lf %spps \\n'", "LINE2:icmp_out#8D00BA:'- Outbound ICMP '", "GPRINT:_icmp_out:MAX:'Max\: %8.2lf %spps'", "GPRINT:_icmp_out:AVERAGE:'Average\:%8.2lf %spps'", "GPRINT:_icmp_out:LAST:'Last\:%8.2lf %spps \\n'", "LINE2:tcp_out#00CC00:'- Outbound TCP '", "GPRINT:_tcp_out:MAX:'Max\: %8.2lf %spps'", "GPRINT:_tcp_out:AVERAGE:'Average\:%8.2lf %spps'", "GPRINT:_tcp_out:LAST:'Last\:%8.2lf %spps\\n'", "LINE2:udp_out#FF0000:'- Outbound UDP '", "GPRINT:_udp_out:MAX:'Max\: %8.2lf %spps'", "GPRINT:_udp_out:AVERAGE:'Average\:%8.2lf %spps'", "GPRINT:_udp_out:LAST:'Last\:%8.2lf %spps \\n'", "LINE2:other_out#0090F0:'- Outbound Other'", "GPRINT:_other_out:MAX:'Max\: %8.2lf %spps'", "GPRINT:_other_out:AVERAGE:'Average\:%8.2lf %spps'", "GPRINT:_other_out:LAST:'Last\:%8.2lf %spps \\n'" )); $opts_header[] = "--vertical-label='Packets per Second'"; return array ($opts_header, $result); } ?> jffnms-0.9.3/engine/graphs/tcp_conn_number_aggregation.inc.php0000644000175000017500000000175311716447477024102 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_tcp_conn_number_aggregation ($data) { $str_cdef = "CDEF:tcp_conn_number=0,"; $opts_agg = array(); foreach ($data["id"] as $id) { $interface=$data[$id]; $opts_agg = @array_merge ($opts_agg,rrdtool_get_def($interface,array("number$id"=>"tcp_conn_number"))); $str_cdef .="number$id,UN,0,number$id,IF,+,"; } $opts_agg[] = $str_cdef; $opts_GRAPH = array( "AREA:tcp_conn_number#00CC00:'Established Connections '", "GPRINT:tcp_conn_number:MAX:'Max\:%8.0lf %s'", "GPRINT:tcp_conn_number:AVERAGE:'Average\:%8.0lf %s'", "GPRINT:tcp_conn_number:LAST:'Last\:%8.0lf %s'", ); $opts_header[] = "--vertical-label='Established Connections'"; return array ($opts_header, @array_merge($opts_agg,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/ups_time_remaining.inc.php0000644000175000017500000000160311716447477022230 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_ups_time_remaining ($data) { $opts_DEF = rrdtool_get_def($data,array("minutes_remaining")); $opts_GRAPH = array( "CDEF:minutes_remaining_h=minutes_remaining,60,/", "AREA:minutes_remaining#00DD00:'Time Remaining\:'", "GPRINT:minutes_remaining:MAX:'Max\: %3.0lf min'", "GPRINT:minutes_remaining:AVERAGE:'Average\: %3.0lf min'", "GPRINT:minutes_remaining:LAST:'Last\: %3.0lf min'", "GPRINT:minutes_remaining_h:LAST:'(%3.2lf Hours)\\n'", ); $opts_header[] = "--vertical-label='Time Remaining'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/ups_current.inc.php0000644000175000017500000000124011716447477020720 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_ups_current ($data) { $opts_DEF = rrdtool_get_def($data,array("current")); $opts_GRAPH = array( "AREA:current#DD3300:'Current '", "GPRINT:current:MAX:'Max\: %3.0lf %sAmps'", "GPRINT:current:AVERAGE:'Average\: %3.0lf %sAmps'", "GPRINT:current:LAST:'Last\: %3.0lf %sAmps\\n'", ); $opts_header[] = "--vertical-label='Current'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/ups_voltage_aggregation.inc.php0000644000175000017500000000253411716447477023255 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_ups_voltage_aggregation ($data) { $color_array = array("4","B","D"); foreach ($color_array as $a) foreach ($color_array as $c) foreach ($color_array as $e) $colors[] = $e."0".$c."0".$a."0"; $opts_DEF = array(); $opts_GRAPH = array(); foreach ($data["id"] as $id) { $interface=$data[$id]; $defs = rrdtool_get_def($interface,array("voltage$id"=>"voltage")); $opts_DEF = @array_merge($opts_DEF, $defs); $description = substr(str_pad($interface["host_name"]." ".$interface["zone_shortname"],20," ",STR_PAD_RIGHT),0,20)." ". substr(str_pad($interface["interface"]." ".$interface["description"],20," ",STR_PAD_RIGHT),0,20); $used_color = $colors[++$i*2]; $opts_GRAPH = array_merge ($opts_GRAPH,array( "LINE2:voltage$id#$used_color:'".$description."\:'", "GPRINT:voltage$id:MAX:'Max\: %3.0lf %sV'", "GPRINT:voltage$id:AVERAGE:'Average\: %3.0lf %sV'", "GPRINT:voltage$id:LAST:'Last\: %3.0lf %sV\\n'" )); } $opts_header[] = "--vertical-label='Voltages'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/apache_bpr.inc.php0000644000175000017500000000120511716447477020434 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_apache_bpr ($data) { $opts_DEF = rrdtool_get_def($data,array("bpr")); $opts_GRAPH = array( "AREA:bpr#00CC00:'Bytes Per Request '", "GPRINT:bpr:MAX:'Max\:%8.0lf %s'", "GPRINT:bpr:AVERAGE:'Average\:%8.0lf %s'", "GPRINT:bpr:LAST:'Last\:%8.0lf %s\\n'", ); $opts_header[] = "--vertical-label='Bytes Per Request'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/alteon_sessionrate.inc.php0000644000175000017500000000134011377440254022236 0ustar csmallcsmall Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_alteon_sessionrate ($data) { $opts_DEF = rrdtool_get_def($data,"total_sessions"); $opts_GRAPH = array( "AREA:total_sessions#00CC00:'Session Rate'", "GPRINT:total_sessions:MAX:'Max\:%5.2lf %sSps'", "GPRINT:total_sessions:AVERAGE:'Average\:%5.2lf %sSps'", "GPRINT:total_sessions:LAST:'Last\:%5.2lf %sSps'" ); $opts_header[] = "--vertical-label='Sessions/second'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/cisco_saagent_packetloss.inc.php0000644000175000017500000000212211716447477023401 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //Cisco SA Agent Packetloss grapher function graph_cisco_saagent_packetloss ($data) { extract($data); $opts_DEF = rrdtool_get_def($data,array("forward_packetloss","backward_packetloss")); $opts_GRAPH = array( "AREA:forward_packetloss#00CC00:'Forward % Packet Loss'", "GPRINT:forward_packetloss:MAX:'Max\:%5.0lf'", "GPRINT:forward_packetloss:AVERAGE:'Average\:%5.0lf'", "GPRINT:forward_packetloss:LAST:'Last\:%5.0lf \\n'", "LINE1:backward_packetloss#0000FF:'Backward % Packet Loss'", "GPRINT:backward_packetloss:MAX:'Max\:%5.0lf'", "GPRINT:backward_packetloss:AVERAGE:'Average\:%5.0lf'", "GPRINT:backward_packetloss:LAST:'Last\:%5.0lf \\n'", ); $opts_header[] = "--vertical-label='SA Agent % Packet Loss'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/packetloss.inc.php0000644000175000017500000000120311524622541020476 0ustar csmallcsmall JFFNMS Authors * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //Only Packet Loss function graph_packetloss ($data) { $opts_DEF = rrdtool_get_def($data,array('plraw'=>'packetloss')); $opts_GRAPH = array( "LINE1:plraw#FF0000:'Packet Loss '", "GPRINT:plraw:MAX:'Max\:%5.0lf'", "GPRINT:plraw:AVERAGE:'Average\:%5.0lf'", "GPRINT:plraw:LAST:'Last\:%5.0lf \\n'" ); $opts_header[] = "--vertical-label='Lost Packets'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/dell_om_fan.inc.php0000644000175000017500000000174611377440254020606 0ustar csmallcsmall jffnms-0.9.3/engine/graphs/error_packets.inc.php0000644000175000017500000000162011716447477021214 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_error_packets ($data) { $opts_DEF = rrdtool_get_def($data,array(input=>"inputerrors",output=>"outputerrors")); $opts_GRAPH = array( "AREA:input#00CC00:'Input Errors '", //"GPRINT:input:MAX:'Max\:%4.0lf %sEps'", "GPRINT:input:AVERAGE:'Average\:%4.0lf %sEps'", "GPRINT:input:LAST:'Last\:%4.0lf %sEps\\n'", "LINE2:output#0000FF:'Output Errors'", //"GPRINT:output:MAX:'Max\:%4.0lf %sEps'", "GPRINT:output:AVERAGE:'Average\:%4.0lf %sEps'", "GPRINT:output:LAST:'Last\:%4.0lf %sEps'"); $opts_header[] = "--vertical-label='Errors per Second'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/pm_serial.inc.php0000644000175000017500000000406411716447477020331 0ustar csmallcsmall Javier Szyszlican * Copyright (C) <2004> Thomas Mangin * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_pm_serial ($data) { $opts_DEF = rrdtool_get_def($data,array("pm_serial_free","pm_serial_connecting","pm_serial_established","pm_serial_disconnecting","pm_serial_command","pm_serial_noservice")); $opts_GRAPH = array( "AREA:pm_serial_free#00FF00:'Number of Connections Free '", "GPRINT:pm_serial_free:MAX:'Max\:%5.0lf'", "GPRINT:pm_serial_free:AVERAGE:'Average\:%5.0lf'", "GPRINT:pm_serial_free:LAST:'Last\:%5.0lf \\n'", "STACK:pm_serial_connecting#000066:'Number of Connections '", "GPRINT:pm_serial_connecting:MAX:'Max\:%5.0lf'", "GPRINT:pm_serial_connecting:AVERAGE:'Average\:%5.0lf'", "GPRINT:pm_serial_connecting:LAST:'Last\:%5.0lf \\n'", "STACK:pm_serial_established#0000FF:'Number of Connections Established '", "GPRINT:pm_serial_established:MAX:'Max\:%5.0lf'", "GPRINT:pm_serial_established:AVERAGE:'Average\:%5.0lf'", "GPRINT:pm_serial_established:LAST:'Last\:%5.0lf \\n'", "STACK:pm_serial_disconnecting#006666:'Number of Disconnections '", "GPRINT:pm_serial_disconnecting:MAX:'Max\:%5.0lf'", "GPRINT:pm_serial_disconnecting:AVERAGE:'Average\:%5.0lf'", "GPRINT:pm_serial_disconnecting:LAST:'Last\:%5.0lf \\n'", "STACK:pm_serial_command#FF0000:'Number in Command '", "GPRINT:pm_serial_command:MAX:'Max\:%5.0lf'", "GPRINT:pm_serial_command:AVERAGE:'Average\:%5.0lf'", "GPRINT:pm_serial_command:LAST:'Last\:%5.0lf \\n'", "STACK:pm_serial_noservice#000000:'Number in No Service '", "GPRINT:pm_serial_noservice:MAX:'Max\:%5.0lf'", "GPRINT:pm_serial_noservice:AVERAGE:'Average\:%5.0lf'", "GPRINT:pm_serial_noservice:LAST:'Last\:%5.0lf \\n'" ); $opts_header[] = "--vertical-label='Number of Lines'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/acct_packets.inc.php0000644000175000017500000000134011716447477020774 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //Accounting Packets function graph_acct_packets ($data) { $opts_DEF = rrdtool_get_def($data,array(packets=>"acct_packets")); $opts_GRAPH = array( "AREA:packets#00CC00:'Accounting Packets (Probably Outbound)\\n'", "GPRINT:packets:MAX:'Max\:%6.0lf %sPps'", "GPRINT:packets:AVERAGE:'Average\:%6.0lf %sPps'", "GPRINT:packets:LAST:'Last\:%6.0lf %sPps'" ); $opts_header[] = "--vertical-label='Accounting Packets per Second'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/tc_rate.inc.php0000644000175000017500000000210011716447477017764 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //Linux TC Rate function graph_tc_rate ($data) { $opts_DEF = rrdtool_get_def($data,array("bytes","packets")); $opts_DEF["bits"]="CDEF:bits=bytes,UN,bytes,bytes,IF,8,*"; $opts_GRAPH = array( "HRULE:".$data["rate"]."#FF0000:'Configured Rate \: ".($data["rate"]/1000)." kbps\\n'", "HRULE:".$data["ceil"]."#AAAAAA:'Configured Ceil \: ".($data["ceil"]/1000)." kbps\\n'", "AREA:bits#00CC00:'Rate '", "GPRINT:bits:MAX:'Max\:%8.2lf %sbps'", "GPRINT:bits:AVERAGE:'Average\:%8.2lf %sbps'", "GPRINT:bits:LAST:'Last\:%8.2lf %sbps\\n'", "LINE2:packets#0000FF:Packets", "GPRINT:packets:MAX:'Max\:%8.0lf %spps'", "GPRINT:packets:AVERAGE:'Average\:%8.0lf %spps'", "GPRINT:packets:LAST:'Last\:%8.0lf %spps'", ); $opts_header[] = "--vertical-label='Bits per Second'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/tcp_conn_number.inc.php0000644000175000017500000000133011716447477021522 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_tcp_conn_number ($data) { $opts_DEF = rrdtool_get_def($data,array("tcp_conn_number")); $opts_GRAPH = array( "AREA:tcp_conn_number#00CC00:'Established Connections '", "GPRINT:tcp_conn_number:MAX:'Max\:%8.0lf %s'", "GPRINT:tcp_conn_number:AVERAGE:'Average\:%8.0lf %s'", "GPRINT:tcp_conn_number:LAST:'Last\:%8.0lf %s'", ); $opts_header[] = "--vertical-label='Established Connections'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/inf_ldisk_time.inc.php0000644000175000017500000000237111716447477021335 0ustar csmallcsmall David LIMA * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_inf_ldisk_time ($data) { $opts_DEF = rrdtool_get_def($data,array("read_time"=>"inf_d_read_time","write_time"=>"inf_d_write_time")); $opts_GRAPH = array( "CDEF:idle_time=100,read_time,-,write_time,-", "AREA:read_time#0000CC:'Disk Read Time'", "GPRINT:read_time:MAX:'Max\: %6.2lf %%'", "GPRINT:read_time:AVERAGE:'Average\: %6.2lf %%'", "GPRINT:read_time:LAST:'Last\: %6.2lf %% \\n'", "STACK:write_time#FF0000:'Disk Write Time'", "GPRINT:write_time:MAX:'Max\: %6.2lf %%'", "GPRINT:write_time:AVERAGE:'Average\: %6.2lf %%'", "GPRINT:write_time:LAST:'Last\: %6.2lf %% \\n'", "STACK:idle_time#00CC00:'Disk Idle Time'", "GPRINT:idle_time:MAX:'Max\: %6.2lf %%'", "GPRINT:idle_time:AVERAGE:'Average\: %6.2lf %%'", "GPRINT:idle_time:LAST:'Last\: %6.2lf %% \\n'" ); $opts_header[] = "--vertical-label='Disk Time Usage'"; $opts_header[] = "--rigid"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/apps_instances.inc.php0000644000175000017500000000150011716447477021360 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //Application Instances function graph_apps_instances ($data) { $opts_DEF = rrdtool_get_def($data,array("current_instances")); $opts_GRAPH = array( "HRULE:".$data["instances"]."#00FF00:'Instances when added\: ".$data["instances"]."\\n'", "LINE3:current_instances#FF0000:'Instances\: '", "GPRINT:current_instances:MAX:'Max\:%5.0lf'", "GPRINT:current_instances:AVERAGE:'Average\:%5.0lf'", "GPRINT:current_instances:LAST:'Last\:%5.0lf \\n'" ); $opts_header[] = "--vertical-label='Number of Threads'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/apc_time_remaining.inc.php0000644000175000017500000000201311716447477022160 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //apc_time_remaining function graph_apc_time_remaining ($data) { $opts_DEF = rrdtool_get_def($data,array("time_remaining_tt"=>"time_remaining")); $opts_GRAPH = array( "CDEF:time_remaining_sec=time_remaining_tt,100,/", "CDEF:time_remaining_min=time_remaining_sec,60,/", "CDEF:time_remaining_h=time_remaining_min,60,/", "AREA:time_remaining_min#00DD00:'Time Remaining\:'", "GPRINT:time_remaining_min:MAX:'Max\:%5.0lf Minutes'", "GPRINT:time_remaining_min:AVERAGE:'Average\:%5.0lf Minutes'", "GPRINT:time_remaining_min:LAST:'Last\:%5.0lf Minutes'", "GPRINT:time_remaining_h:LAST:'(%3.2lf Hours)\\n'", ); $opts_header[] = "--vertical-label='Time Remaining'"; return array ($opts_header, array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/alteon_sessions_aggregation.inc.php0000644000175000017500000000261011377440254024115 0ustar csmallcsmall Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_alteon_sessions_aggregation ($data) { $color_array = array("0","7","D"); foreach ($color_array as $a) foreach ($color_array as $c) foreach ($color_array as $e) $colors[] = $a.$a.$c.$c.$e.$e; $color_array = array("3","9","F"); foreach ($color_array as $a) foreach ($color_array as $c) foreach ($color_array as $e) $colors[] = $a.$a.$c.$c.$e.$e; $graph_type='AREA'; foreach ($data[id] as $id) { $interface = $data[$id]; $used_color = $colors[++$i*4]; $interace['interface'] = str_replace(':','\:',$interface['interface']); $name = $interface['interface'].' '.$interface['description']; $defs = @array_merge ($defs, rrdtool_get_def($interface,array("sessions$id" =>"current_sessions"))); $graph = @array_merge($graph, array( "$graph_type:sessions$id#$used_color:'$name'", "GPRINT:sessions$id:MAX:'Max\:%5.2lf '", "GPRINT:sessions$id:AVERAGE:'Average\:%5.2lf '", "GPRINT:sessions$id:LAST:'Last\:%5.2lf\\n'" )); $graph_type='STACK'; } $opts_header[] = "--vertical-label='Sessions'"; return array ($opts_header, @array_merge($defs,$graph)); } ?> jffnms-0.9.3/engine/graphs/storage_aggregation.inc.php0000644000175000017500000000444011716447477022367 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //Aggregated Used Storage Graph function graph_storage_aggregation ($data) { $color_array = array("0","9","C","F","4"); foreach ($color_array as $a) foreach ($color_array as $c) foreach ($color_array as $e) $colors[] = $a."0".$c."0".$e."0"; $opts_DEF = array(); $opts_GRAPH = array(); foreach ($data["id"] as $id) { $interface=$data[$id]; $defs = rrdtool_get_def($interface,array( "storage_block_count_b$id"=>"storage_block_count", "storage_block_size_b$id"=>"storage_block_size", "storage_used_blocks_b$id"=>"storage_used_blocks")); $aux = @array_merge ($defs,array ( "CDEF:storage_block_count$id=storage_block_count_b$id", "CDEF:storage_used_blocks$id=storage_used_blocks_b$id", "CDEF:storage_block_size$id=storage_block_size_b$id", "CDEF:storage_free_blocks$id=storage_block_count$id,storage_used_blocks$id,-", "CDEF:storage_free$id=storage_free_blocks$id,storage_block_size$id,*", "CDEF:storage_total$id=storage_block_count$id,storage_block_size$id,*", "CDEF:storage_used$id=storage_used_blocks$id,storage_block_size$id,*", "CDEF:storage_free_p$id=storage_free$id,100,*,storage_total$id,/", "CDEF:storage_used_p$id=storage_used$id,100,*,storage_total$id,/" )); $opts_DEF = @array_merge ($opts_DEF, $aux); $description = substr(str_pad($interface["host_name"]." ".$interface["interface"],60," ",STR_PAD_RIGHT),0,25); $description = str_replace (":","\:",$description); //escape : for Windows Disks $used_color = $colors[++$i*2]; $opts_GRAPH = @array_merge ($opts_GRAPH,array( "LINE2:storage_used$id#$used_color:'$description'", "GPRINT:storage_total$id:MAX:'%6.0lf %sB'", "GPRINT:storage_used$id:AVERAGE:'Used Avg\: %6.2lf %sB'", "GPRINT:storage_used_p$id:AVERAGE:'(%3.0lf %%)'", "GPRINT:storage_used$id:LAST:'Last\: %6.2lf %sB'", "GPRINT:storage_used_p$id:LAST:'(%3.0lf %%)\\n'", )); } $opts_header[] = "--vertical-label='Used Storage'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/frames.inc.php0000644000175000017500000000160511716447477017631 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_frames ($data) { $opts_DEF = rrdtool_get_def($data,array(input=>"rx_frames",output=>"tx_frames")); $opts_GRAPH = array( "AREA:input#00CC00:'Input Frms '", //"GPRINT:input:MAX:'Max\:%8.2lf %sFps'", "GPRINT:input:AVERAGE:'Average\:%8.2lf %sFps'", "GPRINT:input:LAST:'Last\:%8.2lf %sFps\\n'", "LINE2:output#0000FF:'Output Frms'", //"GPRINT:output:MAX:'Max\:%8.2lf %sFps'", "GPRINT:output:AVERAGE:'Average\:%8.2lf %sFps'", "GPRINT:output:LAST:'Last\:%8.2lf %sFps'" ); $opts_header[] = "--vertical-label='Frames per Second'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/ucd_cpu_linux_aggregation.inc.php0000644000175000017500000000445711716447477023574 0ustar csmallcsmall Robert St.Denis * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_ucd_cpu_linux_aggregation ($data) { $opts_agg = array(); $str_cdef_user .= "CDEF:cpu_user=0"; $str_cdef_nice .= "CDEF:cpu_nice=0"; $str_cdef_system .= "CDEF:cpu_system=0"; $str_cdef_idle .= "CDEF:cpu_idle=0"; foreach ($data["id"] as $id) { $interface=$data[$id]; $opts_agg = array_merge($opts_agg,rrdtool_get_def($interface,array( "cpu_user_ticks$id"=>"cpu_user_ticks", "cpu_idle_ticks$id"=>"cpu_idle_ticks", "cpu_nice_ticks$id"=>"cpu_nice_ticks", "cpu_system_ticks$id"=>"cpu_system_ticks"))); $cant += $interface["cpu_num"]; $str_cdef_user .= ",cpu_user_ticks$id,+"; $str_cdef_nice .= ",cpu_nice_ticks$id,+"; $str_cdef_system.= ",cpu_system_ticks$id,+"; $str_cdef_idle .= ",cpu_idle_ticks$id,+"; } $str_cdef_user .= ",$cant,/"; $str_cdef_nice .= ",$cant,/"; $str_cdef_system .= ",$cant,/"; $str_cdef_idle .= ",$cant,/"; $opts_GRAPH = array( $str_cdef_user, $str_cdef_nice, $str_cdef_system, $str_cdef_idle, "COMMENT:'Number of Processors:".$cant."\\n'", "AREA:cpu_user#FF0000:'Average User CPU Time'", "GPRINT:cpu_user:MAX:'Max\:%8.2lf %%'", "GPRINT:cpu_user:AVERAGE:'Average\:%8.2lf %%'", "GPRINT:cpu_user:LAST:'Last\:%8.2lf %%\\n'", "STACK:cpu_nice#0000FF:'Average Nice CPU Time'", "GPRINT:cpu_nice:MAX:'Max\:%8.2lf %%'", "GPRINT:cpu_nice:AVERAGE:'Average\:%8.2lf %%'", "GPRINT:cpu_nice:LAST:'Last\:%8.2lf %%\\n'", "STACK:cpu_system#FFFF00:'Average System CPU Time'", "GPRINT:cpu_system:MAX:'Max\:%8.2lf %%'", "GPRINT:cpu_system:AVERAGE:'Average\:%8.2lf %%'", "GPRINT:cpu_system:LAST:'Last\:%8.2lf %%\\n'", "STACK:cpu_idle#00CC00:'Average Idle CPU Time'", "GPRINT:cpu_idle:MAX:'Max\:%8.2lf %%'", "GPRINT:cpu_idle:AVERAGE:'Average\:%8.2lf %%'", "GPRINT:cpu_idle:LAST:'Last\:%8.2lf %%\\n'" ); $opts_header[] = "--vertical-label='CPU Usage'"; $opts_header[] = "--rigid"; $opts_header[] = "--upper-limit=100"; return array ($opts_header, @array_merge($opts_agg,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/apache_workers.inc.php0000644000175000017500000000153311716447477021351 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_apache_workers ($data) { $opts_DEF = rrdtool_get_def($data,array("bw","iw")); $opts_GRAPH = array( "AREA:bw#DD2200:'Busy Workers '", "GPRINT:bw:MAX:'Max\:%8.0lf %s'", "GPRINT:bw:AVERAGE:'Average\:%8.0lf %s'", "GPRINT:bw:LAST:'Last\:%8.0lf %s\\n'", "STACK:iw#00CC00:'Idle Workers '", "GPRINT:iw:MAX:'Max\:%8.0lf %s'", "GPRINT:iw:AVERAGE:'Average\:%8.0lf %s'", "GPRINT:iw:LAST:'Last\:%8.0lf %s'" ); $opts_header[] = "--lower-limit=0"; $opts_header[] = "--vertical-label='Workers'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/temperature_aggregation.inc.php0000644000175000017500000000310311716447477023253 0ustar csmallcsmall Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_temperature_aggregation ($data) { $color_array = array("0","9","C","F","4"); foreach ($color_array as $a) foreach ($color_array as $c) foreach ($color_array as $e) $colors[] = $e."0".$c."0".$a."0"; $opts_DEF = array(); $opts_GRAPH = array(); foreach ($data["id"] as $id) { $interface=$data[$id]; $defs = rrdtool_get_def($interface,array( "temp_c$id"=>"temperature")); $opts_DEF = @array_merge($opts_DEF, $defs); $far = (isset($interface["show_celcius"]) && ($interface["show_celcius"]==0))?1:0; $description = substr(str_pad($interface["host_name"]." ".$interface["location"],20," ",STR_PAD_RIGHT),0,20)." ". substr(str_pad(str_replace("temperature","",$interface["description"]),20," ",STR_PAD_RIGHT),0,20)." ". str_pad((($far==1)?"Fahrenheit":"Celcius"),10," "); $used_color = $colors[++$i*2]; $opts_GRAPH = array_merge ($opts_GRAPH,array( "CDEF:temperature$id=temp_c$id,".(($far==1)?"1.8,*,32,+":"1,*"), "LINE2:temperature$id#$used_color:'".$description."\:'", "GPRINT:temperature$id:MAX:'Max\:%5.0lf'", "GPRINT:temperature$id:AVERAGE:'Average\:%5.0lf'", "GPRINT:temperature$id:LAST:'Last\:%5.0lf \\n'" )); } $opts_header[] = "--vertical-label='Temperature'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/inf_ldisk_rate.inc.php0000644000175000017500000000243611377440254021321 0ustar csmallcsmall David LIMA * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_inf_ldisk_rate ($data) { $opts_DEF = rrdtool_get_def($data,array("read_rate"=>"inf_d_read_rate","write_rate"=>"inf_d_write_rate")); $opts_GRAPH = array( "CDEF:ldisk_rate_total=read_rate,write_rate,+", "CDEF:write_rate_graph=write_rate,-1,*", "COMMENT:' Disk Total '", "GPRINT:ldisk_rate_total:MAX:'Max\:%8.2lf %sBps '", "GPRINT:ldisk_rate_total:AVERAGE:'Average\:%8.2lf %sBps '", "GPRINT:ldisk_rate_total:LAST:'Last\:%8.2lf %sBps \\n'", "AREA:read_rate#0000CC:'Disk Reads '", "GPRINT:read_rate:MAX:'Max\:%8.2lf %sBps '", "GPRINT:read_rate:AVERAGE:'Average\:%8.2lf %sBps '", "GPRINT:read_rate:LAST:'Last\:%8.2lf %sBps \\n'", "AREA:write_rate_graph#FF0000:'Disk Writes'", "GPRINT:write_rate:MAX:'Max\:%8.2lf %sBps '", "GPRINT:write_rate:AVERAGE:'Average\:%8.2lf %sBps '", "GPRINT:write_rate:LAST:'Last\:%8.2lf %sBps \\n'" ); $opts_header[] = "--vertical-label='Disk Rate (Bytes per Second)'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/traffic_util.inc.php0000644000175000017500000000272611716447477021034 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_traffic_util ($data) { if ($data["flipinout"]==1) { $opts_DEF = rrdtool_get_def($data,array(output=>"input",input=>"output")); $flip_legend = " (In / Out Flipped)"; } else $opts_DEF = rrdtool_get_def($data,array("input","output")); $opts_GRAPH = array( "CDEF:inputbits=input,UN,0,input,IF,8,*", "CDEF:outputbits=output,UN,0,output,IF,8,*", "HRULE:100#FF0000:" ); if ($data["bandwidthin"] > 0) $opts_GRAPH = array_merge($opts_GRAPH,array( "CDEF:input1=inputbits,100,*,". $data["bandwidthin"]. ",/", "AREA:input1#00CC00:'Input Utilization '", "GPRINT:input1:MAX:'Max\:%8.2lf %%'", "GPRINT:input1:AVERAGE:'Average\:%8.2lf %%'", "GPRINT:input1:LAST:'Last\:%8.2lf %%$flip_legend\\n'", )); if ($data["bandwidthout"] > 0) $opts_GRAPH = array_merge($opts_GRAPH,array( "CDEF:output1=outputbits,100,*,".$data["bandwidthout"].",/", "LINE2:output1#0000FF:'Output Utilization'", "GPRINT:output1:MAX:'Max\:%8.2lf %%'", "GPRINT:output1:AVERAGE:'Average\:%8.2lf %%'", "GPRINT:output1:LAST:'Last\:%8.2lf %%'" )); $opts_header[] = "--vertical-label='Utilization %'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/apc_voltages.inc.php0000644000175000017500000000156411716447477021027 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_apc_voltages ($data) { $opts_DEF = rrdtool_get_def($data,array("in_voltage","out_voltage")); $opts_GRAPH = array( "LINE2:in_voltage#FF0000:'Input Voltage\: '", "GPRINT:in_voltage:MAX:'Max\:%5.0lf VAC'", "GPRINT:in_voltage:AVERAGE:'Average\:%5.0lf VAC'", "GPRINT:in_voltage:LAST:'Last\:%5.0lf VAC\\n'", "LINE2:out_voltage#0000FF:'Output Voltage\: '", "GPRINT:out_voltage:MAX:'Max\:%5.0lf VAC'", "GPRINT:out_voltage:AVERAGE:'Average\:%5.0lf VAC'", "GPRINT:out_voltage:LAST:'Last\:%5.0lf VAC\\n'" ); $opts_header[] = "--vertical-label='Voltage'"; return array ($opts_header, array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/rtt.inc.php0000644000175000017500000000136311716447477017166 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ // Round Trip Time function graph_rtt ($data) { $opts_DEF = rrdtool_get_def($data,"rtt"); $opts_GRAPH = array( "AREA:rtt#00CC00:'Round Trip Time\\n'", "GPRINT:rtt:MAX:'Max\:%5.0lf msec'", "GPRINT:rtt:AVERAGE:'Average\:%5.0lf msec'", "GPRINT:rtt:LAST:'Last\:%5.0lf msec'" ); if (!empty($data["peer"])) $opts_GRAPH[]="COMMENT:'Peer IP Address: ".$data["peer"]."'"; $opts_header[] = "--vertical-label='RTT in Milliseconds'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/cisco_saagent_jitter.inc.php0000644000175000017500000000201711716447477022535 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //Cisco SA Agent Jitter grapher function graph_cisco_saagent_jitter ($data) { extract($data); $opts_DEF = rrdtool_get_def($data,array("forward_jitter","backward_jitter")); $opts_GRAPH = array( "AREA:forward_jitter#00CC00:'Forward Jitter '", "GPRINT:forward_jitter:MAX:'Max\:%5.0lf'", "GPRINT:forward_jitter:AVERAGE:'Average\:%5.0lf'", "GPRINT:forward_jitter:LAST:'Last\:%5.0lf \\n'", "LINE1:backward_jitter#0000FF:'Backward Jitter '", "GPRINT:backward_jitter:MAX:'Max\:%5.0lf'", "GPRINT:backward_jitter:AVERAGE:'Average\:%5.0lf'", "GPRINT:backward_jitter:LAST:'Last\:%5.0lf \\n'", ); $opts_header[] = "--vertical-label='SA Agent Jitter'"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/apc_load_capacity.inc.php0000644000175000017500000000151311716447477021771 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_apc_load_capacity ($data) { $opts_DEF = rrdtool_get_def($data,array("capacity","load")); $opts_GRAPH = array( "LINE2:capacity#FF0000:'Battery Capacity\:'", "GPRINT:capacity:MAX:'Max\:%5.0lf %%'", "GPRINT:capacity:AVERAGE:'Average\:%5.0lf %%'", "GPRINT:capacity:LAST:'Last\:%5.0lf %%\\n'", "LINE2:load#0000FF:'Output Load\: '", "GPRINT:load:MAX:'Max\:%5.0lf %%'", "GPRINT:load:AVERAGE:'Average\:%5.0lf %%'", "GPRINT:load:LAST:'Last\:%5.0lf %%\\n'" ); $opts_header[] = "--vertical-label='Percentage'"; return array ($opts_header, array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/ucd_cpu_linux.inc.php0000644000175000017500000000345111716447477021216 0ustar csmallcsmall Robert Bogdon * Copyright (C) <2005> Robert St.Denis (SMP Aggregation) * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_ucd_cpu_linux ($data) { $limit = 100; $opts_DEF = rrdtool_get_def($data,array("cpu_user_ticks","cpu_idle_ticks","cpu_nice_ticks","cpu_system_ticks")); $opts_GRAPH = array( "HRULE:$limit#990000:'Number of Processors\: ".$data["cpu_num"]."\\n'", "CDEF:cpu_user=cpu_user_ticks,".$data["cpu_num"].",/", "CDEF:cpu_nice=cpu_nice_ticks,".$data["cpu_num"].",/", "CDEF:cpu_system=cpu_system_ticks,".$data["cpu_num"].",/", "CDEF:cpu_idle=cpu_idle_ticks,".$data["cpu_num"].",/", "AREA:cpu_user#FF0000:'User CPU Time'", "GPRINT:cpu_user:MAX:'Max\:%8.2lf %%'", "GPRINT:cpu_user:AVERAGE:'Average\:%8.2lf %%'", "GPRINT:cpu_user:LAST:'Last\:%8.2lf %%\\n'", "STACK:cpu_nice#0000FF:'Nice CPU Time'", "GPRINT:cpu_nice:MAX:'Max\:%8.2lf %%'", "GPRINT:cpu_nice:AVERAGE:'Average\:%8.2lf %%'", "GPRINT:cpu_nice:LAST:'Last\:%8.2lf %%\\n'", "STACK:cpu_system#FFFF00:'System CPU Time'", "GPRINT:cpu_system:MAX:'Max\:%8.2lf %%'", "GPRINT:cpu_system:AVERAGE:'Average\:%8.2lf %%'", "GPRINT:cpu_system:LAST:'Last\:%8.2lf %%\\n'", "STACK:cpu_idle#00CC00:'Idle CPU Time'", "GPRINT:cpu_idle:MAX:'Max\:%8.2lf %%'", "GPRINT:cpu_idle:AVERAGE:'Average\:%8.2lf %%'", "GPRINT:cpu_idle:LAST:'Last\:%8.2lf %%\\n'"); $opts_header[] = "--vertical-label='CPU Usage'"; $opts_header[] = "--rigid"; $opts_header[] = "--upper-limit=$limit"; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/brocade_sensor.inc.php0000644000175000017500000000201511660564076021331 0ustar csmallcsmall Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_brocade_sensor($data) { switch($data['sensor_type']) { case 'fan': $legend = 'Speed'; $vlabel = 'RPM'; $graph_type='LINE2'; $colour='FF00FF'; break; case 'temperature': $legend = 'Temperature in DegC'; $vlabel = 'Degrees C'; $graph_type='AREA'; $colour='FF0000'; break; case 'power': $legend = 'Power'; $vlabel = 'Volts?'; $graph_type='AREA'; $colour='FF0000'; break; default: return; } $opts_DEF = rrdtool_get_def($data,array('value'=>'sensor_value')); $opts_GRAPH = array( "$graph_type:value#$colour:'$legend\:'", "GPRINT:value:MAX:'Max\:%5.0lf'", "GPRINT:value:AVERAGE:'Average\:%5.0lf'", "GPRINT:value:LAST:'Last\:%5.0lf \\n'" ); $opts_header[] = "--vertical-label='$vlabel'"; return array($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } jffnms-0.9.3/engine/graphs/cpu_os400.inc.php0000644000175000017500000000160711716447477020072 0ustar csmallcsmall David LIMA * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_cpu_os400 ($data) { $opts_DEF = rrdtool_get_def($data,"cpu400"); $opts_DEF[]="CDEF:cpu400real=cpu400,100,/"; $limit = 100; $opts_GRAPH = array( "HRULE:".$limit."#FF0000:", "AREA:cpu400real#00CC00:'CPU Utilization '", "LINE1:cpu400real#0000FF:''", "GPRINT:cpu400real:MAX:'Max\:%8.2lf %%'", "GPRINT:cpu400real:AVERAGE:'Average\:%8.2lf %%'", "GPRINT:cpu400real:LAST:'Last\:%8.2lf %%'" ); $opts_header[] = "--vertical-label='CPU Utilization %'"; $opts_header[] = "--rigid"; $opts_header[] = "--upper-limit=".$limit; return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/cpu_util_aggregation.inc.php0000644000175000017500000000213411716447477022545 0ustar csmallcsmall Robert St.Denis * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_cpu_util_aggregation ($data) { $opts_agg = array(); $str_cdef_cpu .= "CDEF:cpu=0"; $cant = count($data["id"]); foreach ($data["id"] as $id) { $interface=$data[$id]; $opts_agg = @array_merge($opts_agg,rrdtool_get_def($interface,array( "cpu$id"=>"cpu"))); $str_cdef_cpu .=",cpu$id,UN,0,cpu$id,IF,+"; } $str_cdef_cpu .= ",$cant,/"; $opts_GRAPH = array( $str_cdef_cpu, "COMMENT:'Number of Processors:".$cant."\\n'", "AREA:cpu#00CC00:'Average CPU Utilization '", "LINE1:cpu#0000FF:''", "GPRINT:cpu:MAX:'Max\:%8.2lf %%'", "GPRINT:cpu:AVERAGE:'Average\:%8.2lf %%'", "GPRINT:cpu:LAST:'Last\:%8.2lf %%'" ); $opts_header[] = "--vertical-label='CPU Utilization %'"; $opts_header[] = "--rigid"; $opts_header[] = "--upper-limit=100"; return array ($opts_header, @array_merge($opts_agg,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/graphs/cisco_nat_active.inc.php0000644000175000017500000000147411716447477021655 0ustar csmallcsmall Karl S. Hagen * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function graph_cisco_nat_active ($data) { extract($data); $opts_DEF = rrdtool_get_def($data,array("cisco_nat_active_binds")); $opts_GRAPH = array( "LINE3:cisco_nat_active_binds#00CC00:'Cisco NAT Active Binds '", "GPRINT:cisco_nat_active_binds:MAX:'Max\:%5.0lf'", "GPRINT:cisco_nat_active_binds:AVERAGE:'Average\:%5.0lf'", "GPRINT:cisco_nat_active_binds:LAST:'Last\:%5.0lf \\n'" ); $opts_header[] = "--vertical-label='Active NAT Binds'"; return array ($opts_header, array_merge($opts_DEF,$opts_GRAPH)); } ?> jffnms-0.9.3/engine/tftp_get_host_config.php0000644000175000017500000001504111730332007020467 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ require_once('../conf/config.php'); $Config = new JffnmsConfig(); config_load_libs('engine', 0); $opt_host=0; // main { $Hosts = new JffnmsHosts(); $HostsConfig = new JffnmsHosts_configs(); $time_total = time_msec(); parse_commandline(); if ($opt_host) $hostid_filter = "= $opt_host"; else $hostid_filter = "> 0"; $query_config= " SELECT hosts.id as host_id, hosts.ip as host_ip, hosts.rwcommunity, hosts.tftp as tftp_server, hosts_config_types.command FROM hosts, hosts_config_types WHERE hosts.id $hostid_filter AND hosts.config_type = hosts_config_types.id AND hosts.config_type > 1 ORDER BY hosts.id"; $result_config = db_query ($query_config) or die ('Query failed - T2 - '.db_error()); $config_included_files = array(); while ($config_row = db_fetch_array($result_config)) { $config_time = time_msec(); $config_file = $Config->get('jffnms_real_path').'/engine/configs/'. $config_row["command"].'.inc.php'; $config_get_command = 'config_'.$config_row['command'].'_get'; $config_wait_command = 'config_'.$config_row['command'].'_wait'; $now = date("Y-m-d H:i:s",time()); if (array_key_exists($config_file, $config_included_files)) { if ($config_included_files[$config_file] === FALSE) // already failed continue; } else { if (!is_readable($config_file)) { host_config_logger($config_row, $config_time, "ERROR: Unable to load config plugin file '$config_file'.\n"); $config_included_files[$config_file] = FALSE; continue; } require_once($config_file); if (!function_exists($config_get_command)) { host_config_logger($config_row, $config_time, "ERROR: Config get function '$config_get_command' does not exist in config file '$config_file'.\n"); $config_included_files[$config_file] = FALSE; continue; } if (!function_exists($config_wait_command)) { host_config_logger($config_row, $config_time, "ERROR: Config wait function '$config_wait_command' does not exist in config file '$config_file'.\n"); $config_included_files[$config_file] = FALSE; continue; } $config_included_files[$config_file] = TRUE; } $tftp_filename = uniqid('').'.dat'; //generate random filename $real_tftp_filename = $Config->get('tftp_real_path').'/'.$tftp_filename; if (!touch($real_tftp_filename)) { host_config_logger($config_row, $config_time, "ERROR: Unable to create temporary TFTP filename '$real_tftp_filename'\n"); continue; } if (!chmod($real_tftp_filename, 0666)) { host_config_logger($config_row, $config_time, "Error: Unable to chmod temporary TFTP filename '$real_tftp_filename'.\n"); unlink($real_tftp_filename); continue; } $function_data = array($config_row['host_ip'],$config_row['rwcommunity'], $config_row['tftp_server'],$real_tftp_filename); if (call_user_func_array($config_get_command, $function_data) === FALSE) { host_config_logger($config_row, $config_time, 'WARNING: Failed to get config file from host'); unlink($real_tftp_filename); continue; } if (call_user_func_array($config_wait_command, $function_data) === FALSE) { host_config_logger($config_row, $config_time, 'WARNING: Failed waiting for file transfer'); unlink($real_tftp_filename); continue; } clearstatcache(); if (!file_exists($real_tftp_filename) || filesize($real_tftp_filename) == 0) { host_config_logger($config_row, $config_time, 'WARNING: file did not transfer'); unlink($real_tftp_filename); continue; } $config_data_new = file_get_contents($real_tftp_filename); unlink($real_tftp_filename); $db_host_configs = $HostsConfig->get_all(NULL, $config_row['host_id'],NULL,1); $config_data_old = $db_host_configs[0]['config']; $config_id_old = $db_host_configs[0]['id']; //Cisco Router NTP fix $config_data_new = preg_replace('/ntp clock-period \S+/', '', $config_data_new); if (md5 ($config_data_new) != md5 ($config_data_old)) { $config_data_new = str_replace ("'","\'",$config_data_new); //escape ' $data = array( 'host'=>$config_row['host_id'], 'date'=>$now, 'config'=>$config_data_new ); $config_id = $HostsConfig->add(); $result = $HostsConfig->update($config_id,$data); //save the config in the DB $info = "new config id $config_id"; } else $info = "same config as last one ($config_id_old)"; host_config_logger($config_row, $config_time,'', $info); } //while row $time_total = time_msec_diff($time_total); logger( "TIMES \t: Total Time $time_total msec.\n"); db_close(); } function host_config_logger(&$config_row, $config_time, $error, $info='') { global $Config; $config_time = time_msec_diff ($config_time); if ($error != '') { $Events = new JffnmsEvents(); $Events->add(date("Y-m-d H:i:s",time()), $Config->get('jffnms_administrative_type'), $config_row['host_id'],'CPU','error','host_config', 'Host Config Transfer: '.addslashes($error),0,0); } else $error = "OK $info"; logger(' : H '.str_pad($config_row['host_id'],3,' ',STR_PAD_LEFT). ' : '.$config_row['host_ip']. ' : '.$config_row['command']." : $error ($config_time msec)\n"); flush(); } function parse_commandline() { global $opt_host; $longopts = array( 'help', 'version', 'host:'); if ( ($opts = getopt('h:v?', $longopts)) === FALSE) { return; } foreach($opts as $opt => $opt_val) { switch ($opt) { case 'help': case '?': print_help(); break; case 'host': case 'h': if (intval($opt_val) == 0) print_help("Host ID must be an integer value not \"$opt_val\"\n"); $opt_host = $opt_val; break; case 'version': case 'v': print_version(); break; } } } function print_help($errmsg='') { if (!empty($errmsg)) print $errmsg; print " Usage: php -q tftp_get_host_config.php [-hv] [-t hostid] JFFNMS Consolidator -h,--help Show this help text -h,--host ID Only attempt transfer from host with id ID -v,--version Show version information "; die(); } ?> jffnms-0.9.3/engine/actions/0002755000175000017500000000000011731201052015215 5ustar csmallcsmalljffnms-0.9.3/engine/actions/none.inc.php0000644000175000017500000000037311465656265017466 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //Do Nothing function action_none ($data) { return 0; } ?> jffnms-0.9.3/engine/actions/email.inc.php0000644000175000017500000000457011716447477017623 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //Send eMail function action_email ($data) { global $Config; $body = array(); if (!function_exists('mail')) { logger('Mail function does not exists.\n'); return 0; } $from = $data['parameters']['from']; $to = $data['parameters']['to']; $subject = $data['parameters']['subject']; $short = FALSE; if (array_key_exists('short', $data['parameters'])) { $short = TRUE; $signature = ''; } else { if (array_key_exists('fullname', $data['user'])) $fullname = $data['user']['fullname']; else $fullname = ''; $body[] = "Hello $fullname:\n"; $signature = "---------------------------------------------------------------------\nJFFNMS - Just for Fun Network Management System\n"; } if (array_key_exists('alarm', $data)) { $alarm = $data['alarm']; $body[] = "Alarm Time:\t$alarm[date_start]" . ($alarm['alarm_state'] == ALARM_UP?" To $alarm[date_stop]":'')."\n". "Alarm Type:\t$alarm[type_description] $alarm[state_description] ". ($short?"":"\n"); } if (array_key_exists('interface', $data)) { $interface = $data['interface']; $body[] = "Interface:\t $interface[type_description] $interface[host_name]". "$interface[zone_shortname] $interface[interface] ". "$interface[client_name] $interface[description]\n"; } if (array_key_exists('event', $data) && !$short) { $events_data = $data['event']; $Events = new JffnmsEvents(); foreach ($events_data as $event) $body[] = "Event:\t $event[date] $event[type_description] $event[host_name] ". "$event[zone]\n". "Event:\t". $Events->replace_vars($event,$event['text'])."\n"; } if (array_key_exists('comment', $data['parameters']) && !$short) $body[] = "\nComment: $data[parameters][comment]\n"; $body_text = join($body,"\n")."\n$signature"; if ($short) $body_text = str_replace("\t",' ',$body_text); $headers = 'From: JFFNMS@'.$Config->get('jffnms_site')." <$from>\r\n". 'X-Mailer: JFFNMS '.JFFNMS_VERSION." ( http://www.jffnms.org )\r\n"; if ((strpos($to,'@') > 1) && $subject && $body && $headers) return mail($to,$subject,$body_text,$headers,"-f$from"); return 0; } ?> jffnms-0.9.3/engine/actions/smsclient.inc.php0000644000175000017500000000236511465656714020532 0ustar csmallcsmall Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function action_smsclient ($data) { global $Config; $smsclient = $Config->get('smsclient_executable'); if (!is_executable($smsclient)) return "smsclient program '$smsclient' not executable"; if (!array_key_exists('smsname', $data['parameters'])) return 'Profile Option SMS Alias not set'; $smsname = $data['parameters']['smsname']; $alarm = $data['alarm']; $events = $data['event']; $interface = $data['interface']; $message = "JFFNMS "; if (is_array($alarm)) $message .= "Alarm: $alarm[type_description] $alarm[state_description]"; if (is_array($events) && !is_array($alarm)) foreach ($events as $key=>$event) $message .= " Event: $event[date] $event[type] $event[host_name] $event[zone] ".events_replace_vars($event,$event['text']).' ||'; if (is_array($interface)) $message .= " Interface: $interface[host_name] $interface[interface] $interface[description]"; $message = substr ($message,0,140); $command = "$smsclient $smsname \"$message\""; return exec($command); } ?> jffnms-0.9.3/engine/consolidate.php0000644000175000017500000000616211575771717016627 0ustar csmallcsmall JFFNMS Authors * This program is licensed under the GNU GPL, full terms in the LICENSE file */ { include_once('../conf/config.php'); $Config = new JffnmsConfig(); config_load_libs('engine', 0); $Alarms = new JffnmsAlarms(); $Events = new JffnmsEvents(); $Triggers = new JffnmsTriggers(); $total_run_time = 60; //60 seconds $interval = 15; //15 seconds interval between runs $opt_times = 3; $opt_force = FALSE; parse_commandline(); $i = 0; $date_start = time(); if (!$opt_force && is_process_running(NULL,2) !== false) //check if a process named as myself is already running (one instance is me) { logger ("Another instance of Consolidator is running, aborting...\n"); db_close(); die(); } detach(); $consolidators = array('alarms', 'events', 'logfiles', 'syslog', 'tacacs', 'traps'); foreach($consolidators as $con) require_once("consolidate/$con.php"); logger ("Consolidator Starting: looping $opt_times times...\n"); do { $time_consolidate_loop = time_msec(); $i++; consolidate_syslog($Events); consolidate_tacacs($Events); consolidate_traps(); consolidate_logfiles($Events); consolidate_events($Events, $Alarms, $Triggers); consolidate_alarms($Alarms, $Triggers); $time_consolidate_loop = time_msec_diff($time_consolidate_loop); logger ("Partial time: $time_consolidate_loop msec.\n"); if ($i < $opt_times) sleep($interval); $time_elapsed = time() - $date_start; logger ("Elapsed time $time_elapsed sec.\n"); } while (($i < $opt_times) && ($time_elapsed < $total_run_time)); $time_total = time() - $date_start; logger("Total time: $time_total sec.\n"); db_close(); } //main() function parse_commandline() { global $opt_times, $opt_force; $longopts = array( 'help', 'version', 'repeat:', 'force'); if ( ($opts = getopt('r:FHV', $longopts)) === FALSE) { return; } if (sizeof($opts) == 0) { if (count($_SERVER['argv']) > 1) $opt_times = $_SERVER['argv'][1]; if (intval($opt_times) == 0 ) print_help("Direct number of repeats must be an integer not \"$opt_times\"\n"); return; } foreach($opts as $opt => $opt_val) { switch ($opt) { case 'force': case 'F': $opt_force = TRUE; break; case 'help': case 'H': print_help(); break; case 'repeat': case 'r': if (intval($opt_val) == 0) print_help("Repeat option must have integer value not \"$opt_val\"\n"); $opt_times = $opt_val; break; case 'version': case 'V': print_version(); break; } } } function print_help($errmsg='') { if (!empty($errmsg)) print $errmsg; print " Usage: php -q consolidate.php [-hv] [-r repeat] JFFNMS Consolidator -r, --repeat num Repeat consolidator num times -F, --force Force consolidator to run -H, --help Show this help text -V, --version Show version information "; die(); } ?> jffnms-0.9.3/engine/trap_receiver.sh0000755000175000017500000000010411377440254016756 0ustar csmallcsmall#!/bin/bash JFFNMS=`dirname $0` cd $JFFNMS php -q trap_receiver.php jffnms-0.9.3/engine/autodiscovery_interfaces.php0000644000175000017500000001337211743372775021425 0ustar csmallcsmall JFFNMS AUTHORS * This program is licensed under the GNU GPL, full terms in the LICENSE file */ require_once 'common_parent.inc.php'; define('CHILD_FILE', 'iad_child.php'); define('MAX_IAD_TIME', 240); // Maximum autodiscovery time is 4 minutes // Set the defaults $opt_host = FALSE; $opt_itype = FALSE; $opt_children = FALSE; $opt_force = FALSE; parse_commandline(); if (!$opt_force && is_process_running(join(' ', $_SERVER['argv']),2)) die("Autodiscovery interfaces already running.\n"); iad_main($opt_host, $opt_itype, $opt_children); function parse_commandline() { global $opt_host, $opt_itype, $opt_children, $opt_force; $num_params = $GLOBALS['argc']-1; $longopts = array( 'help', 'version', 'host:', 'children:', 'type::', 'force'); if ( ($opts = getopt('c:h:t::FVH', $longopts)) === FALSE) return; foreach ($opts as $opt => $opt_val) { switch ($opt) { case 'children': case 'c': $num_params-= 2; $opt_children = $opt_val; break; case 'host': case 'h': $num_params-= 2; $opt_host = $opt_val; if (!is_numeric($opt_host)) print_help('host id option must be numeric'); break; case 'force': case 'F': $opt_force=TRUE; $num_params-= 1; break; case 'type': case 't': $num_params-= 2; if ($opt_val === FALSE) print_itypes(); $opt_itype = $opt_val; if (!is_numeric($opt_itype)) print_help('interface type option must be numeric'); break; case 'help': case 'H': print_help(); break; case 'version': case 'V': print_version(); }// switch }//for if ($num_params > 0) print_help('Problem with command line options.'); } function print_help($errmsg = FALSE) { if ($errmsg) print "$errmsg\n"; print $_SERVER['SCRIPT_NAME'] . ' [options] -c, --children # Fork with this number of child processes -h, --host Discover all interfaces for host -t, --type Discover interface type only Omit the id to get a list of interface types -F, --force Force running this process -H, --help Print this help -V, --version Print version information '; die; } function print_itypes() { $ITypes = new JffnmsInterface_types(); $num_itypes = $ITypes->get(); print "Known interface types ($num_itypes)\n"; while ($row = $ITypes->fetch()) { echo "$row[id]\t$row[description]\n"; } die; } function iad_main($opt_host, $opt_itype, $opt_children) { $Parent = new JffnmsEngineParent($opt_children); $finish_loop_time = time() + MAX_IAD_TIME; do { $loop_start_time = time(); if (!isset($starting_count)) { // Get all of the hosts we are going to autodiscover $Parent->items_new(iad_get_hosts($opt_host, $opt_itype)); $starting_count = $Parent->waiting_count; logger("ITEMS Added $starting_count items\n"); } $Parent->check_children(); $Parent->item_check_poll_time(); $Parent->children_start(); iad_read_children($Parent); $Parent->work_children(); $Parent->print_status(); $loop_time = time() - $loop_start_time; if ($loop_time < ENGINE_HEARTBEAT) { if ($Parent->polling_count > 0 || ($Parent->polling_count==0 && $Parent->waiting_count==0)) sleep(1); else sleep(ENGINE_HEARTBEAT - $loop_time); } if ($finish_loop_time < time()) { logger("**ERROR** Interface Autodiscovery took longer than maximum time ".MAX_IAD_TIME." seconds. Waiting/Polling: ". $Parent->waiting_count.'/'.$Parent->polling_count."\n"); $Parent->stop_all_children('Autodiscovery loop exceeded.'); } } while ($Parent->waiting_count > 0 || $Parent->polling_count > 0); } // iad_main_loop function iad_get_hosts($host_id,$itype_id) { global $opt_force; if ($host_id === FALSE) $hostid_match = '> 1'; else $hostid_match = "= $host_id"; $query_hosts = " SELECT id, ip, rocommunity, autodiscovery_default_customer, autodiscovery, sysobjectid FROM hosts WHERE hosts.id $hostid_match"; if (!$opt_force) $query_hosts .= " AND hosts.poll = 1 AND hosts.autodiscovery > 1"; $result_hosts = db_query($query_hosts) or die ('Query failed - iad_get_hosts() '.db_error()); $hosts = array(); while ($host = db_fetch_array($result_hosts)) { $host_id = $host['id']; $hosts[$host_id] = array( 'host_id' => $host_id, 'host_ip' => $host['ip'], 'rocommunity' => $host['rocommunity'], 'autodiscovery_default_customer' =>$host['autodiscovery_default_customer'], 'autodiscovery_id' => $host['autodiscovery'], 'sysobjectid' => $host['sysobjectid'], 'tries' => 0, 'itype' => $itype_id ); } return $hosts; } function iad_read_children(&$Parent) { $read_timeout = max(time() + ENGINE_HEARTBEAT/$Parent->max_children,2); while (time() < $read_timeout) { if ($Parent->read_children('iad_read_callback') == FALSE) return; } } function iad_read_callback(&$Parent, $child_id, $child_data) { switch($child_data['cmd']) { case 'DONE': $item_id = $Parent->child_done_job($child_id); break; case 'NOTDONE': $Parent->child_notdone_job($child_id); break; } } //iad_read_callback() ?> jffnms-0.9.3/engine/poller-old.php0000644000175000017500000003402511407652260016354 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ require_once('../conf/config.php'); $Config = new JffnmsConfig(); config_load_libs('engine', 0); $host_id = 0; parse_commandline(); // if (!$my_sat_id) $my_sat_id = 1; //only master but with URL set $my_sat_id = 1; if ($host_id == 0) { $query_hosts='Select id, satellite from hosts where id > 1 and poll = 1'; $result_hosts = db_query ($query_hosts) or die ('Query failed - R2 - '.db_error()); while ($host = db_fetch_array($result_hosts)) { $paths = satellite_get_paths($host['satellite']); if (is_array($paths)) $paths = satellite_get_first_distribution_path($paths); else if ($host['satellite'] == $my_sat_id) //local $paths[]=$my_sat_id; if (is_array($paths)) foreach ($paths as $sat_id) if ($sat_id==$my_sat_id) //local: I'm the one defined to poll this host { spawn (false, $host['id']." 0 $sat_id 0 0"); //fork myself with this paremeters sleep(3); //wait before spawning new proceses } }//while db_close(); exit; } $time_start = time_usec(); if ($sat_id < 1) $sat_id = $my_sat_id; $masters=array_keys(satellite_get_masters($my_sat_id)); //get Masters from DB if (count($masters)<1) $masters=array($my_sat_id); //Only One $cant_masters = count($masters); foreach ($masters as $master) { if ($my_sat_id!=$master) //I'm not a master { $paths = satellite_get_paths($master); //get paths to master if (is_array($paths)) { $paths = satellite_clean_poller_path($paths,$my_sat_id); //get only paths from me to master $paths_description = array(); foreach ($paths as $path) $paths_description[] = join(array_reverse($path),'->'); $peers = satellite_get_last_distribution_path($paths); //get my peers on those paths logger(' : H '.str_pad($host_id,3,' ',STR_PAD_LEFT)." : Possible Paths to $master... ".join($paths_description,", ")."\n"); logger(' : H '.str_pad($host_id,3,' ',STR_PAD_LEFT)." : Testing Satellite Conexions to $master...\n"); $working_paths[$master] = array(); foreach ($peers as $key=>$peer) //test all peers to the master { $sat = current(satellite_get($peer)); $ping = satellite_send_ping($sat,$master,"get","$my_sat_id-elect"); if ($ping['result']==true) //test if my peer can get to the master $working_paths[$master][count($paths[$key])][$sat['id']]=array('url'=>$sat['url'],'session'=>$ping['session']); } } } else $working_paths[$master][0][$my_sat_id]=array('url'=>'Local'); //put me as the master local //select the best path //var_dump($working_paths[$master]); ksort ($working_paths[$master]); //sort by hops $best_paths = current($working_paths[$master]); //get all paths from the least number of hops if (!is_array($best_paths)) $best_paths=Array(); $cant = count($best_paths); if ($cant > 0) //ok we have some destinations { if ($cant > 1) //we dont want to amplify the poller, send this only once $pos = rand (0,$cant-1); //pick one random path else $pos = 0; $keys = array_keys($best_paths); $peer_to_master[$master] = array($keys[$pos]=>$best_paths[$keys[$pos]]); //select only one peer per master if (($cant_masters > 1) || ($my_sat_id != $master)) logger(' : H '.str_pad($host_id,3,' ',STR_PAD_LEFT).' : Using direct connexion to Satellite '.$keys[$pos].": ".$peer_to_master[$master][$keys[$pos]][url]."\n"); } else { //no destinations were ok logger(' : H '.str_pad($host_id,3,' ',STR_PAD_LEFT)." : No Available Peer Satellites to $master.\n"); } } $poller_plan_filter = array('interface'=>$interface_id,'host'=>$host_id,'pos'=>$poller_pos,'type'=>$itype); //take care of Designated Main Interfaces (DMII) if ((empty($interface_id) || ($interface_id=="dmii")) && empty($poller_pos)) { if (is_array($peer_to_master)) foreach ($peer_to_master as $master_id=>$peer) { if ($my_sat_id!=$master_id) //I'm not the master { list ($peer_sat_id,$peer_data) = each ($peer); $message = array ( 'sat_id' => $master_id, 'class' => 'hosts', 'method' => 'status_dmii', 'session' => $peer_data['session'], 'params' => array($host_id) ); $dmii = satellite_query ($peer_data['url'],$message); } else $dmii = hosts_status_dmii($host_id); break; } if ($dmii && ($interface_id != 'dmii')) //we have DMII down, inform and filter the poller plan { $poller_plan_filter['interfaces'] = $dmii; logger(' : H '.str_pad($host_id,3,' ',STR_PAD_LEFT).' : Designated Main Interface(s) '.join(',',$dmii).' is/are down, only polling them\n'); if ($my_sat_id!=$master_id) //I'm not the master { $message = array ( 'sat_id'=>$master_id, 'class'=>'events', 'method'=>'add', 'session'=>$peer_data['session'], 'params'=>array(date('Y-m-d H:i:s',time()),25,$host_id,'Polling','down','poller','Failed',1) ); satellite_query ($peer_data['url'],$message,NULL,2); } else insert_event(date('Y-m-d H:i:s',time()),25,$host_id,'Polling','down','poller','Failed',1); } if ($interface_id=='dmii') //just poll DMII $poller_plan_filter['interface'] = hosts_dmii_interfaces_list($host_id); } $poller_plan_result = poller_plan ($poller_plan_filter); //Get the Poller Plan (things to poll) logger(' : H '.str_pad($host_id,3,' ',STR_PAD_LEFT).' : Poller Start : '.$poller_plan_result['items'].' Items.\n'); flush(); $times = array(); if (is_array($peer_to_master)) while ($poller_data = poller_plan_next($poller_plan_result)) { $poller_command = $poller_data['poller_command']; $backend_command = $poller_data['backend_command']; $poller_filename = "$jffnms_real_path/engine/pollers/$poller_command.php"; $backend_filename = "$jffnms_real_path/engine/backends/$backend_command.php"; //unset result variables unset($poller_result); $backend_result=array(); $backend_result_description=array(); $times_description=array(); if ((file_exists($poller_filename)==TRUE) && (file_exists($backend_filename)==TRUE)) { $time_poller_query = time_usec(); include_once($poller_filename); $poller_result = call_user_func_array("poller_$poller_command",Array($poller_data)); $time_poller_query = time_usec_diff($time_poller_query); foreach ($peer_to_master as $master_id=>$peer) { $time_backend_query = time_usec(); if ($my_sat_id!=$master_id) //I'm not the master { list ($peer_sat_id,$peer_data) = each ($peer); $comment = "src:$my_sat_id-pos:$poller_pos-int:".$poller_data["interface_id"]; $message = array ( 'sat_id'=>$master_id, 'method'=>'poller', 'session'=>$peer_data['session'], 'params'=>array( //only one parameter array( //an array with this values 'host_id'=>$poller_data['host_id'], 'interface_id'=>$poller_data['interface_id'], 'poller_pos'=>$poller_data['poller_pos'], 'poller_result'=>$poller_result, )) ); //var_dump($message); $result = satellite_query ($peer_data[url],$message,$comment,0); //var_dump ($result); //see complete answer $backend_result[$master_id] = $result[backend_result]; } else { //I'm the master execute locally include_once($backend_filename); $backend_result[$master_id] = call_user_func_array("backend_$backend_command",Array($poller_data,$poller_result)); } // Profiling if (isset($result['times'])) $times[$master_id]=$result['times']; //copy the result profiling data $times[$master_id]['backend_query'][$my_sat_id]=time_usec_diff($time_backend_query); //backend local o remote time $times[$master_id]['poller_query'][$my_sat_id]=$time_poller_query; //polling time if (isset($result['times'])) { $times[$master_id]['real_total'][$my_sat_id]=$times[$master_id]['backend_query'][$my_sat_id]+$times[$master_id]['poller_query'][$my_sat_id]; $times[$master_id]['step_total'][$my_sat_id]=$times[$master_id]['real_total'][$my_sat_id]-$times[$master_id]['real_total'][$peer_sat_id]; } } //foreach master } else //no poller files logger("ERROR: $poller_command or $backend_command Modules not Found...",0); //only to show better output $times_description[]='P:'.$time_poller_query; //my polling time unset ($old_data); foreach ($backend_result as $master_id=>$data) { $time_data = $times[$master_id]; //result data verification if (isset($old_data) && ($data!=$old_data)) logger("ERROR: Backend Result MissMatch ($data != $old_data)\n"); $old_data = $data; if ($master_id == $my_sat_id) $sat = 'L'; else $sat = "S$master_id"; if ($cant_masters > 1) { $backend_result_description[]="$sat:$data"; $times_description[]="$sat:".$time_data["backend_query"][$my_sat_id]; } else { $backend_result_description[]=$data; $times_description[]=$time_data["backend_query"][$my_sat_id]; } } //Cut the Poller Parameters String if (array_key_exists('poller_parameters', $poller_data)) $poller_param_description = $poller_data['poller_parameters']; else $poller_param_description = ''; if ($aux = strlen($poller_param_description) > 10) $poller_param_description = substr($poller_param_description,0,4)."..".substr($poller_param_description,strlen($aux)-4,4); //debug output logger( ' : H '.str_pad($host_id,3,' ',STR_PAD_LEFT). ' : I '.str_pad($poller_data['interface_id'],3,' ',STR_PAD_LEFT). ' : P '.str_pad($poller_data['poller_pos'],3,' ',STR_PAD_LEFT). ' : '.(($backend_command=="buffer")?"$poller_command:":"").$poller_data["poller_name"]."(".$poller_param_description."): $poller_result ". "-> $backend_command(".$poller_data["backend_parameters"]."): ".join($backend_result_description," | "). " (time ".join($times_description," | ").") ". "\n" //.vd($times) //profiling data ); flush(); $time_poller_aux = time_usec(); } //while else //if no masters logger(' : H '.str_pad($host_id,3,' ',STR_PAD_LEFT)." : Couldn't Find any Peers to any Master.\n"); //destroy the established sessions if (is_array($working_paths)) { foreach ($working_paths as $master_id=>$aux) foreach ($aux as $aux1) foreach ($aux1 as $peer_sat_id=>$peer_sat) if (isset($peer_sat['session'])) //if we have established a session with this peer { $message=array('sat_id'=>$master_id,'method'=>'none',session_destroy=>1,'session'=>$peer_sat['session']); //var_dump($message); $result = satellite_query ($peer_sat["url"],$message,"$my_sat_id-destroy",0); //var_dump($result); //see session_destory confimations if ($peer_to_master[$master_id][$peer_sat_id]["session"]) $use='Used'; else $use='Tested'; if (!is_array($result['session_destroy'])) $result['session_destroy'] = array($result); logger(" : H ".str_pad($host_id,3," ",STR_PAD_LEFT)." : Closing $use Satellite Conexion for $master_id to $peer_sat_id ... ".join(array_reverse(array_keys($result[session_destroy])),"->")."\n"); } } $time = time_usec_diff($time_start); logger(" : H ".str_pad($host_id,3," ",STR_PAD_LEFT)." : Poller End, Total Time: $time msec.\n"); adm_hosts_update($host_id,array('last_poll_date'=>time(), 'last_poll_time'=>round($time/1000))); function parse_commandline() { $longopts = array ('help', 'version', 'host:', 'interface:', 'poller:', 'type:'); if ( ($opts = getopt('?vh:i:p:t:', $longopts)) === FALSE) return; if (sizeof($opts) == 0) { switch($_SERVER['argc']) { case 6: $itype = $_SERVER['argv'][5]; if (!is_numeric($itype)) die("Interface type \"$itype\" must be a number"); case 5: $poller_pos = $_SERVER['argv'][4]; if (!is_numeric($poller_pos)) die("Poller position \"$poller_pos\" must be a number"); case 4: case 3: $interface_id = $_SERVER['argv'][2]; if (!is_numeric($interface_id)) die("Interface ID \"$interface_id\" must be a number"); case 2: $host_id = $_SERVER['argv'][1]; if (!is_numeric($host_id)) die("Host ID \"$host_id\" must be a number"); }//switch return; } foreach($opts as $opt => $opt_val) { switch($opt) { case 'host': case 'h': $host_id = $opt_val; if (!is_numeric($host_id)) die("Host ID \"$host_id\" must be a number"); break; case 'interface': case 'i': $interface_id = $opt_val; if (!is_numeric($interface_id)) die("Interface ID \"$interface_id\" must be a number"); break; case 'poller': case 'p': $poller_pos = $opt_val; if (!is_numeric($poller_pos)) die("Poller position \"$poller_pos\" must be a number"); break; case 'type': case 't': $itype = $opt_val; if (!is_numeric($itype)) die("Interface type \"$itype\" must be a number"); break; case 'help': case '?': print_help(); break; case 'version': case 'v': print_version(); break; } //switch } } function print_help($errmsg='') { if (!empty($errmsg)) print $errmsg; print " Usage: php -q poller.php [options] JFFNMS Consolidator -i,--interface ID Poll only interface -p,--position POS Only poll poller item POS in the group -t,--type ID Poll interfaces of type -?,--help Show this help text -v,--version Show version information "; die(); } function print_version() { global $Config; print "JFFNMS Version ".$Config->get('jffnms_version')." "; die; } ?> jffnms-0.9.3/engine/cleanup_raw_tables.php0000644000175000017500000001077411560125063020136 0ustar csmallcsmall Kovacs Andrei * Copyright (C) <2003> Javier Szyszlican (Modifications) * This program is licensed under the GNU GPL, full terms in the LICENSE file */ require_once('../conf/config.php'); $Config = new JffnmsConfig(); config_load_libs('engine',0); parse_commandline(); cleanup_raw_events(); cleanup_events(); cleanup_host_configs(); cleanup_repair_tables(); db_close(); function cleanup_raw_events() { global $Config; $raw_days = $Config->get('raw_events_store'); if ($raw_days <= 0) return; $period=time()-(60*60*24*$raw_days); $dtdelete=date("Y-m-d 00:00:00",$period); logger ("Cleaning up raw messages older than $dtdelete ($raw_days days)...\n"); // Traps cleanup $query_traps = 'select id from traps where date <= '.$period; $result_traps = db_query ($query_traps) or die ('Query failed - TC1 - '.db_error()); $result_del_varbinds = 0; while ($rows_traps = db_fetch_array($result_traps)) { $id = $rows_traps['id']; $query='delete from traps_varbinds where trapid = '.$id; $result_del_varbinds = db_query ($query) or die ('Query failed: TC2 - Delete varbinds - '.db_error()); } $query = "delete from traps where date <= ".$period; $result_del_traps = db_query ($query) or die ('Query failed: TC3 - Delete traps - '.db_error()); logger ("Cleanup of traps/traps_varbinds tables finished... ($result_del_traps, $result_del_varbinds)\n"); // END Traps cleanup // Acct cleanup $query = "delete from acct where date <= '$dtdelete'"; $result_del_acct = db_query ($query) or die ('Query failed: AC1 - Delete acct - '.db_error()); logger ("Cleanup of acct table finished... ($result_del_acct)\n"); // END Acct cleanup // Syslog cleanup $query = "delete from syslog where date <= '$dtdelete'"; $result_del_syslog = db_query ($query) or die ('Query failed: SC1 - Delete syslog - '.db_error()); logger ("Cleanup of syslog table finished... ($result_del_syslog)\n"); // END Syslog cleanup } function cleanup_events() { global $Config; $days = $Config->get('events_store'); if ($days <= 0) return; $period=time()-(60*60*24*$days); $dtdelete=date("Y-m-d 00:00:00",$period); logger ("Cleaning up Events/Alarms older than $dtdelete ($days days)...\n"); // Alarms cleanup $query = "delete from alarms where date_stop <= '$dtdelete' and not (date_stop <= '0001-01-01 00:00:00') "; //this will just delete finished alarms which end is older than dtdelete $result_del_alarms = db_query ($query) or die ("Query failed: AC2 - Delete Alarms - ".db_error()); logger ("Cleanup of alarms table finished... ($result_del_alarms)\n"); // END Alarms cleanup // Events cleanup $query = "delete from events where date <= '$dtdelete'"; $result_del_events = db_query ($query) or die ("Query failed: EC1 - Delete Events - ".db_error()); logger ("Cleanup of events table finished... ($result_del_events)\n"); // END Events cleanup } function cleanup_host_configs() { global $Config; $config_days = $Config->get('host_configs_store'); if ($config_days <= 0) return; $period=time()-(60*60*24*$config_days); $dtdelete=date("Y-m-d 00:00:00",$period); logger ("Cleaning up Host Configs older than $dtdelete ($config_days days)...\n"); $query = "delete from hosts_config where date <= '$dtdelete' and id > 1"; $result_del_config = db_query ($query) or die ("Query failed: CC1 - Delete hosts_config - ".db_error()); logger ("Cleanup of hosts_config table finished... ($result_del_config)\n"); } //cleaup_host_configs function cleanup_repair_tables() { $tables_to_repair = array('events','alarms','traps','syslog','acct','hosts_config'); foreach ($tables_to_repair as $table) { logger ("Repairing $table table..."); $result = db_repair ($table); logger ("done, $result\n"); } } function parse_commandline() { $longopts = array( 'help', 'version'); if ( ($opts = getopt('VH', $longopts)) === FALSE) { return; } if (sizeof($opts) == 0) return; foreach($opts as $opt => $opt_val) { switch ($opt) { case 'help': case 'H': print_help(); break; case 'version': case 'V': print_version(); break; } } } function print_help($errmsg='') { if (!empty($errmsg)) print $errmsg; print " Usage: php -q cleanup_raw_tables.php [-HV] JFFNMS raw table cleanup -H, --help Show this help text -V, --version Show version information "; die(); } ?> jffnms-0.9.3/engine/tools/0002755000175000017500000000000011716447477014747 5ustar csmallcsmalljffnms-0.9.3/engine/tools/none.inc.php0000644000175000017500000000054311716447477017167 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function tool_none_info() { return array(); } function tool_none_get() { return false; } function tool_none_set() { return false; } ?> jffnms-0.9.3/engine/tools/tcp_cnx.inc.php0000644000175000017500000000331411716447477017665 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function tool_tcp_cnx_info() { $info = array ( "type"=>"table", "param"=>array( "fields"=>array("Remote IP","Remote Port","State"), "action_field"=>"Close Connection" ), "state_label"=>"closed", "description_label"=>"Connection" ); return $info; } function tool_tcp_cnx_get($int) { if (!$GLOBALS["tcpConnEntry"] && (!empty($int["host_rocommunity"]))) $GLOBALS["tcpConnEntry"] = snmp_walk ($int["host_ip"],$int["host_rocommunity"],".1.3.6.1.2.1.6.13.1.1",1); $tcpConnEntry = $GLOBALS["tcpConnEntry"]; $values = array(); if (is_array($tcpConnEntry)) { reset($tcpConnEntry); while (list($key,$state) = each ($tcpConnEntry)) if (strpos($state,"5")!==FALSE) { //only established $entry = explode(".",$key); $entry = array_slice ($entry, count($entry)-10,10); //get only the last 10 items (SRC-IP(4) + srcport + DEST-IP(4) + destport) $entry_port = $entry[4]; //srcport (local) if ($int["port"]==$entry_port) //if the search and found ports are equal $values[join(".",$entry)]=array(join(".",array_slice($entry,5,4)),$entry[9],substr($state,0,strpos($state,"("))); } } return $values; } function tool_tcp_cnx_set($int, $values) { $final_result = true; if (is_array($values)) { foreach ($values as $value) $result[] = snmp_set($int["host_ip"],$int["host_rwcommunity"],".1.3.6.1.2.1.6.13.1.1.".$value,"i",12); foreach ($result as $res) if ($res!=true) $final_result = false; } return $final_result; } ?> jffnms-0.9.3/engine/tools/if_alias.inc.php0000644000175000017500000000123411716447477017775 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function tool_if_alias_info() { return array ("type"=>"text","param"=>array("size"=>40)); } function tool_if_alias_get($int) { $value = snmp_get($int["host_ip"],$int["host_rocommunity"],".1.3.6.1.2.1.31.1.1.1.18.".$int["interfacenumber"]); return $value; } function tool_if_alias_set($int, $value) { $result = snmp_set($int["host_ip"],$int["host_rwcommunity"],".1.3.6.1.2.1.31.1.1.1.18.".$int["interfacenumber"],"s",$value); return $result; } ?> jffnms-0.9.3/engine/tools/if_admin.inc.php0000644000175000017500000000131211716447477017771 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function tool_if_admin_info() { return array ("type"=>"select","param"=>array(1=>"UP",2=>"DOWN")); } function tool_if_admin_get($int) { $value = snmp_get($int["host_ip"],$int["host_rocommunity"],".1.3.6.1.2.1.2.2.1.7.".$int["interfacenumber"]); $value = substr($value,strlen($value)-2,1); return $value; } function tool_if_admin_set($int, $value) { $result = snmp_set($int["host_ip"],$int["host_rwcommunity"],".1.3.6.1.2.1.2.2.1.7.".$int["interfacenumber"],"i",$value); return $result; } ?> jffnms-0.9.3/engine/tools/separator.inc.php0000644000175000017500000000042111716447477020223 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function tool_separator_info() { return array("type"=>"separator"); } ?> jffnms-0.9.3/engine/launcher.inc.php0000644000175000017500000004256211446626004016661 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function launcher_empty_items () { return array(); } function launcher_system_init() { return true; } function launcher_heartbeat() { ob_end_clean(); echo "."; flush(); ob_flush(); ob_start(); } function read_child($child, $wait = 1) { $r = array($child['output']); if (($wait===false) || ($nr = stream_select($r, $w = NULL, $e = NULL, $wait)) !== false) { $ret1 = fgets($child['output']); if ($ret1!=false) $ret .= rtrim($ret1,"\n"); } return $ret; } function write_child($child, $text) { return fputs($child['input'], $text."\n"); } function start_child ($heartbeat) { global $Config; $command = $Config->get('php_executable').' -q '.$_SERVER['argv'][0]." - $heartbeat"; $res = proc_open($command, array(0=> array('pipe','r'), 1=>array('pipe','w')), $pipes); sleep(1); //PHP Startup wait time if (is_resource($res)) { stream_set_blocking($pipes[1], false); $child = array('resource'=>$res, 'input'=>$pipes[0], 'output'=>$pipes[1], 'status'=>READY); list(,,$child['pid']) = explode(' ',read_child($child,10)); logger(str_pad('START',10).'Started child with PID '.$child['pid'].'\n'); return $child; } return false; } function stop_child($child, $reason = '') { $text = 'Stopping child with PID '.$child['pid'].", reason: $reason and it"; fputs ($child['input'],"quit\n"); $goodbye = str_replace('.','',read_child($child)); if ($goodbye!=='') $text .= " exited normally saying: $goodbye"; else { $result = posix_kill($child['pid'], 9); $text .= ' had to be Killed!'; } fclose($child['input']); fclose($child['output']); //proc_close($child["resource"]); unset ($child['resource']); logger(str_pad('STOP',10).$text."\n"); sleep(1); return ($result==0)?true:false; } function launcher_system_status ($time_passed, &$remaining_items, &$pending_items, &$bad_items, &$done_items, &$childs, &$childs_ids, $running_childs, $number_of_items) { for ($id = 0; $id < count($childs_ids); $id++) if (is_array($childs[$childs_ids[$id]])) // Create a Scoreboard-type list of the childs status $childs_status .= (($childs[$childs_ids[$id]]["status"]==READY)?"R":(($childs[$childs_ids[$id]]["status"]==BUSY)?"W":"I")); //Output everything logger (str_pad('STATUS',10).'Remaining/Pending/Done/Bad=Total items: '. count($remaining_items)."/".count($pending_items)."/". count($done_items)."/".count($bad_items)."=".$number_of_items. ", Childs: ".$running_childs.":".$childs_status.", Time ".$time_passed."\n"); } function child_status ($child, $result) { if (current(explode(' ', $result)) == 'OK') { logger (str_pad('WORK',10).'Child '.str_pad($child['pid'],7).' '. 'finished working on item '.str_pad($child['item'],3). " Status: $result\n"); return TRUE; } logger (str_pad('WORK',10).'Child '.str_pad($child['pid'],7).' '. 'had a problem with item '.str_pad($child["item"],3). " Status: $result\n"); return FALSE; } // Program Body require_once('../conf/config.php'); $Config = new JffnmsConfig(); config_load_libs('engine', 0); // Select the launcher mode // TODO Windows expcetions to the new master if (!isset($launcher_mode) && (!isset($_SERVER['argv'][1]))) $launcher_mode = 'old_master'; if (!isset($launcher_mode) && ($_SERVER['argv'][1]=='master')) $launcher_mode = 'master'; if (!isset($launcher_mode) && ($_SERVER['argv'][1]=='-')) $launcher_mode = 'managed'; if (!isset($launcher_mode) && (count($_SERVER['argv']) > 0)) $launcher_mode = 'old_child'; if (!isset($launcher_item_source)) $launcher_item_source = 'launcher_empty_items'; if (!isset($launcher_mode)) { logger ('Launcher Mode could not be defined.\n'); exit; } if ($launcher_mode=='master') { sleep(5); if (is_process_running(join(' ', $_SERVER['argv']),2)) die ("Process Already Running.\n"); $time_start = time(); set_time_limit(0); // child Status define ('READY', 0); define ('BUSY', 1); define ('RESTING', 2); // Configuration $number_of_childs_at_start = (!is_numeric($_SERVER['argv'][2])?5:$_SERVER['argv'][2]); if (!isset($launcher_detach)) $launcher_detach = true; if (!isset($timeout)) $timeout = 30; if (!isset($max_tries)) $max_tries = 2; if (!isset($rest_time)) $rest_time = 3; if (!isset($read_timeout)) $read_timeout = 3; if (!isset($heartbeat)) $heartbeat = 5; if (!isset($refresh_time)) $refresh_time = 120; if (!isset($refresh_items)) $refresh_items = true; if (!isset($max_refresh_time)) $max_refresh_time = (60*60*1); if (!isset($launcher_init)) $launcher_init = "launcher_system_init"; if (!isset($launcher_status)) $launcher_status = "launcher_system_status"; if (!isset($launcher_child_status)) $launcher_child_status = "child_status"; if (!isset($launcher_time_status)) $launcher_time_status = 1; if (!isset($launcher_start_end_status)) $launcher_start_end_status = true; if ($launcher_detach==true) detach(); //internal data $remaining_items = array(); $pending_items = array(); $done_items = array(); $bad_items = array(); $running_childs = 0; $number_of_items = 0; $childs = array(); $childs_ids = array(); $first_run = true; call_user_func_array($launcher_init, array()); if ($launcher_start_end_status) logger("Launcher Starting. Parameters: childs: $number_of_childs_at_start, Timeout: $timeout, ". "item Retries: $max_tries, Rest Time: $rest_time secs, ". "Read Timeout: $read_timeout, Child Hearbeat every $heartbeat secs.\n"); while (true) { if ((!$refresh_items && $first_run) || ($refresh_items && ($old_refresh_time + $refresh_time) < $now)) { //item List db_close(); //DB is not longer needed $items = call_user_func_array($launcher_item_source, array($refresh_items)); db_close(); //DB is not longer needed $number_of_items = count($items); foreach ($items as $item) $remaining_items[$item]=0; //Put each item with 0 tries unset ($items); logger (str_pad("ITEMS",10)."Added ".$number_of_items." items\n"); $number_of_childs = ((count($remaining_items)>$number_of_childs_at_start) // we have more items than childs ?$number_of_childs_at_start // thats ok :count($remaining_items)); // if we have more childs, then we will only need as much items we have $old_refresh_time = $now; $first_run = false; } $read_fd = array(); //Get the Output FDs from each child for ($id = 0; $id < count($childs_ids); $id++) if (is_array($childs[$childs_ids[$id]]) && is_resource($childs[$childs_ids[$id]]["output"])) $read_fd[] = $childs[$childs_ids[$id]]["output"]; if (count($childs_ids) == 0) sleep($read_timeout); if (($running_childs > 0) && (false !== ($nr = stream_select($read_fd, $write = NULL, $except = NULL, $read_timeout)))) for ($o = 0; $o < count($childs_ids); $o++) if (is_array($childs[$childs_ids[$o]]) && in_array($childs[$childs_ids[$o]]["output"], $read_fd)) { //to see if his FD had data $id = $childs_ids[$o]; $data = read_child($childs[$id], false); // Read data from the child in question if ($data!="") $childs[$id]["time"] = $now; // Update the last communication timestamp $data = str_replace(".","",$data); // Remove the dots from the input because it may also contain a response if ($data!=="") { // If it had something else than the dots $item = $childs[$id]["item"]; //get the running item $childs[$id]["status"] = RESTING; //This child finished its work, now to rest // Call Child Status function $result = call_user_func_array($launcher_child_status, array($childs[$id], $data)); if ($result) { //if the response was OK and it did all the items $done_items[$item]=$pending_items[$item]; // Copy the item to the done list unset ($pending_items[$item]); // Remove it from the pending list $childs[$id]["item"] = NULL; // This child is not working on this item now } else { // If it was not OK, then it was an error $remaining_items[$item] = $pending_items[$item]; // Get the item back to the remaining list unset ($pending_items[$item]); // Remove it from the pending list stop_child($childs[$id]); } } else // Data was just dots (ie it has been doing something), so we only needed to update the timestamp ;//logger (str_pad("WORK",10)."child $id, is working on item $item\n"); } $items_put_to_work = 0; for ($o = 0; $o < count($childs_ids); $o++) if (is_array($childs[$childs_ids[$o]])) { $id = $childs_ids[$o]; // Let the childs rest if (($childs[$id]["status"]==RESTING) && // its busy (($childs[$id]["time"] + $rest_time) < $now)) // it has passed the rest time $childs[$id]["status"] = READY; // mark it as ready // Give childs Work if (($childs[$id]["status"]==READY) && (count($remaining_items) > 0)) { // if its ready and we've remaining items reset($remaining_items); while (list($item) = each ($remaining_items)) if (!isset($pending_items[$item]) && // it was not in the pending list ($remaining_items[$item] < $max_tries)) { // tries not excedded $remaining_items[$item]++; // count that we're trying this item one more time logger(str_pad("WORK",10)."Child ".str_pad($childs[$id]["pid"],7)." was ready, putting it to work on item $item, Try: ".($remaining_items[$item])."\n"); write_child($childs[$id], $item); // Tell this child to do this item $pending_items[$item]=$remaining_items[$item]; // Copy this item data to the pending list unset ($remaining_items[$item]); // Remove it from the Remaining List $childs[$id]["item"] = $item; // Save that this child is working on this item $childs[$id]["status"] = BUSY; // Mark it as busy $childs[$id]["time"] = $now; // Update the last communication with the child timestamp if (++$items_put_to_work > 10) break 2; break; } } // Restart hanged childs if (($timeout!==false) && // TimeOut Enabled //($childs[$id]["status"]==BUSY) && // its busy (($childs[$id]["time"] + $timeout) < $now)) { // it has passed timeout $item = $childs[$id]["item"]; $remaining_items[$item] = $pending_items[$item]; // Copy this item from the pending to the remaining list unset ($pending_items[$item]); // Remove it from the pending list stop_child($childs[$id], "timeout"); // Stop this child unset ($childs[$id]); // Remove it from the childs list $running_childs--; // count one less break; // Don't do anything else } // Stop useless childs if (($refresh_items==false) && ($childs[$id]["status"]!=BUSY) && // its ready and we're not going to refresh ((count($pending_items) + count($remaining_items)) < $running_childs)) {// Less pending than childs stop_child($childs[$id], "is not needded"); // kill a child unset ($childs[$id]); $running_childs--; // count one less $number_of_childs--; // We will need only child less } } // Bad items foreach ($remaining_items as $item=>$aux) if ($remaining_items[$item] >= $max_tries) { //If this item has been tried more than our max. logger(str_pad("WORK",10)."Item $item re-tries excedded (".$remaining_items[$item]."), giving up.\n"); $bad_items[$item]=$remaining_items[$item]; // Copy it to the bad items list unset ($remaining_items[$item]); // Remove it from the Remaining list } // Start childs $number_of_childs_started = 0; if ((count($pending_items) + count($remaining_items)) > $running_childs) // if there are more reaminign items than needed childs while ($running_childs < $number_of_childs) { // If we have less running childs than we should $child = start_child($heartbeat); // Start one more if (is_array($child)) { $childs[]=$child; // Add it to the childs list $running_childs++; // Count one more } if (++$number_of_childs_started > 5) break; } $now = time(); $childs_ids = array_keys($childs); // Status output if ($time_status_old + $launcher_time_status < $now) { // if more than X seconds passed since last $time_passed = $now - $time_start; // Count how much time has passed if (isset($launcher_status)) call_user_func_array($launcher_status, array($time_passed, $remaining_items, $pending_items, $bad_items, $done_items, $childs, $childs_ids, $running_childs, $number_of_items)); $time_status_old = $now; } if (!$refresh_items && (count($remaining_items)==0) && (count($pending_items)==0)) // While we have Remaining or Pending items break; if (($max_refresh_time!==false) && ($time_start + $max_refresh_time < $now)) // While we have Remaining or Pending items break; } //while (true) for ($o = 0; $o < count($childs_ids); $o++) if (is_array($childs[$childs_ids[$o]])) { $id = $childs_ids[$o]; stop_child($childs[$id], "is not needded"); // kill a child unset ($childs[$id]); } if ($launcher_start_end_status) { $time_passed = $now - $time_start; // Count how much time has passed ksort($bad_items); logger("Launcher Ended. Parameters: childs: $number_of_childs_at_start, Timeout: $timeout, ". "item Retries: $max_tries, Rest Time: $rest_time secs, ". "Read Timeout: $read_timeout, child Hearbeat every $heartbeat secs. ". "Total Time: $time_passed sec\n". ((count($bad_items) > 0) ?"We couldn't finish processing the following items: ".join(", ",array_keys($bad_items)) :"All Items were processed correctly."). "\n"); } } // OLD child system if ($launcher_mode == 'old_master') { if (!isset($refresh_items)) $refresh_items = TRUE; $items = call_user_func_array($launcher_item_source, array($refresh_items)); $cant = count($items); if (!isset($items_per_child)) $items_per_child = 2; for ($i = 0; $i < $cant; $i += $items_per_child) { spawn (false, join(',',array_slice($items, $i, $items_per_child)).' 0 0 0'); //fork myself with this paremeters sleep(2); //wait before spawning new proceses } } // Managed child if ($launcher_mode == 'managed') { $heartbeat = is_numeric($_SERVER["argv"][2])?$_SERVER["argv"][2]:5; if (!isset($read_timeout)) $read_timeout = 3; if (!isset($launcher_goodbye)) $launcher_goodbye = true; set_time_limit(0); $fp = fopen("php://stdin","r"); echo "READY PID ".posix_getpid()."\n"; $gc_save_vars = array(); while (!feof($fp) && ($input!="QUIT")) { $read_fd = array($fp); $input = ""; if (false !== ($nr = stream_select($read_fd, $write = NULL, $except = NULL, $read_timeout))) if ($nr > 0) { $input = strtoupper(trim(fgets($fp))); $heartbeat_timer = time(); } if (($heartbeat_timer > 0) && ($heartbeat_timer + ($heartbeat*50)) < time()) { $input = "QUIT"; $launcher_goodbye = false; } if (($input!=="") && ($input!="QUIT")) { $input = "POLL ".trim(str_replace("POLL","",$input)); $params = array_slice(explode(" ",$input),1); //remove the first item if (count($gc_save_vars)==0) { //GC: save all tue current variables foreach ($GLOBALS as $key=>$val) $gc_save_vars[$key]=$key; $gc_save_vars["gc_save_vars"]=true; } if (count ($params) > 0) { if (isset ($launcher_function)) { if (isset($launcher_param_managed_handler)) $params = call_user_func($launcher_param_managed_handler, $params); $result = call_user_func_array($launcher_function, $params); $result = "OK ".join(" ",$result); } else $result = "ERROR Function not set"; } else $result = "ERROR item not set"; echo $result."\n"; $heartbeat_timer = time(); //GC: unset all globals that are not in the gc_save_vars array foreach ($GLOBALS as $key=>$val) if (!isset($gc_save_vars[$key])) { unset($GLOBALS[$key]); unset($$key); } } } if ($launcher_goodbye) echo "BYE Quit.\n"; } // Old System Child if ($launcher_mode == "old_child") { if (isset ($launcher_function)) { $params = array_slice($_SERVER["argv"],1); //remove the first item if (isset($launcher_param_normal_handler)) $params = call_user_func($launcher_param_normal_handler, $params); call_user_func_array($launcher_function,$params); } } ?> jffnms-0.9.3/engine/satellite/0002755000175000017500000000000011716447477015575 5ustar csmallcsmalljffnms-0.9.3/engine/satellite/ping.inc.php0000644000175000017500000000050711716447477020013 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //a ping system to be sure that the parent can get to the master function satellite_ping() { return Array(result=>TRUE); } ?> jffnms-0.9.3/engine/satellite/distribution.inc.php0000644000175000017500000000246011716447477021575 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //imports object data from parent (and master) satellites function satellite_distribution ($params) { $jffnms = $GLOBALS["jffnms"]; //object broker $my_sat_id = $GLOBALS["my_sat_id"]; $response = array(); $masters = array_keys(satellite_get_masters()); if (!in_array($my_sat_id,$masters)) { //Master don't accept disitribution if (is_array($params)) extract($params); if ($data_class && is_array($data)) { $response["added"]=0; $response["deleted"]=0; $response["modified"]=0; $response["items"]=0; $obj = $jffnms->get($data_class); //get all the ids we have for this data type $data_old = $obj->export($filter); $pos_ids = array_unique(array_merge(array_keys($data),array_keys($data_old))); foreach ($pos_ids as $pos_id) { $result = $obj->import($data[$pos_id],$data_old[$pos_id]); //import the data if (isset($result["add"])) $response["added"]++; if (isset($result["del"])) $response["deleted"]++; if ($result["mod"]==1) $response["modified"]++; $response["items"]++; } unset($data_old); } } return $response; } ?> jffnms-0.9.3/engine/satellite/poller.inc.php0000644000175000017500000000400611716447477020351 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function satellite_poller ($params) { $my_sat_id = $GLOBALS["my_sat_id"]; if ((isset($params["interface_id"]) || isset($params["host_id"])) && isset($params["poller_pos"])) { $mode = (isset($params["mode"]))?$params["mode"]:"pos"; //default mode is POS switch ($mode) { case "host": //store all the host polling plan in the session $buffer = &$GLOBALS["session_vars"]["poller_plan"]; if (!is_array($buffer)) $buffer = poller_plan(array("host"=>$params["host_id"])); reset ($buffer["plan"]); break; case "interface": //store each interface polling plan in the session $buffer = &$GLOBALS["session_vars"]["poller_plan"][$params["interface_id"]]; if (!is_array($buffer)) $buffer = poller_plan(array("interface"=>$params["interface_id"])); reset ($buffer["plan"]); break; case "pos": //just query this position for this interface, don't store anything $buffer = poller_plan(array("interface"=>$params["interface_id"],"pos"=>$params["poller_pos"])); break; } while ($poller_data = poller_plan_next($buffer)) if (($poller_data["interface_id"]==$params["interface_id"]) && //find the specified position ($poller_data["poller_pos"]==$params["poller_pos"])) { $backend_filename = get_config_option("jffnms_real_path")."/engine/backends/".$poller_data["backend_command"].".php"; if (file_exists($backend_filename)==true) { include_once($backend_filename); $response["backend_result"] = call_user_func_array("backend_".$poller_data["backend_command"],array($poller_data,$params["poller_result"])); } else $response["error"][$my_sat_id][]="ERROR: ".$poller_data["backend_command"]." Module not Found..."; }//while } return $response; } ?> jffnms-0.9.3/engine/iad_child.php0000644000175000017500000003510311737556523016214 0ustar csmallcsmallstdin); $write_fds = NULL; $except_fds = NULL; $nr = stream_select($read_fds, $write_fds, $except_fds, 1); if ($nr === FALSE) { $Child->send_error("Child process had error on select."); continue; } if ($nr == 0) { $old_time = $Child->check_heartbeat($old_time); continue; } $line = fgets($Child->stdin,4096); $params = unserialize($line); if (!is_array($params)) { $Child->send_error("Received bad line from parent, not an array"); continue; } if (!array_key_exists('cmd', $params)) { $Child->send_error("Recieved array from parent with no cmd field."); continue; } switch($params['cmd']) { case 'DIE': die(); break; case 'POLL': if (child_discover_interfaces($params) === TRUE) $Child->send_array('DONE'); else $Child->send_array('NOTDONE'); break; default: $Child->send_error("Received unknown command '".$params['cmd']."'"); }//switch cmd $old_time = $Child->check_heartbeat($old_time); } } function child_discover_interfaces($params) { global $Config, $Child; $iad_time = time_msec(); $Interfaces = new JffnmsInterfaces(); $InterfaceTypesFields = new JffnmsInterface_types_fields(); $Events = new JffnmsEvents(); $ad_policy = iad_get_autodiscovery($params['autodiscovery_id']); $interface_types = iad_get_interface_types($params['itype']); if ($interface_types === FALSE) return FALSE; if ($params['sysobjectid'] == NULL && $params['rocommunity'] != '') $params['sysobjectid'] = update_sysobject_id($params['host_id'], $params['host_ip'], $params['rocommunity']); // loop through itypes foreach($interface_types as $it_id => $itype) { discovery_logger($params['host_id'], $it_id, FALSE, 'Autodiscovering '.$itype['description']); // skip it if the sysobjectids don't match if ($itype['snmp_oid'] != NULL && $itype['snmp_oid'] != '') { if ($params['rocommunity'] == '' ) { discovery_logger($params['host_id'], $it_id, FALSE, " Skipping: No host RO community to find OID $itype[snmp_oid]"); continue; } if (sysobjectid_matches($params['sysobjectid'], $itype['snmp_oid']) == FALSE) { discovery_logger($params['host_id'], $it_id, FALSE, " Skipping: Host sysObjectId $params[sysobjectid] != $itype[snmp_oid]"); continue; } } $db_interfaces = iad_interfaces_from_db($Interfaces, $params['host_id'], $it_id); $ad_interfaces = iad_interfaces_from_discovery( $itype['autodiscovery_function'], $params['host_ip'], $params['rocommunity'], $params['host_id'], $itype['autodiscovery_parameters']); $fields = $InterfaceTypesFields->get_all (NULL, array('itype'=>$itype['id'],'exclude_types'=>20)); if (is_array($ad_interfaces) && count($ad_interfaces) > 0) { $unique_interfaces = array_unique(array_merge(array_keys($ad_interfaces), array_keys($db_interfaces))); asort($unique_interfaces); reset($unique_interfaces); foreach($unique_interfaces as $key) { if ($key < 0) continue; $processed = FALSE; if (isset($db_interfaces[$key])) ksort($db_interfaces[$key]); if (isset($ad_interfaces[$key])) ksort($ad_interfaces[$key]); discovery_logger($params['host_id'], $itype['id'], $key, 'DB : '.(isset($db_interfaces[$key])?iad_show_interface($fields,$db_interfaces[$key]):'Not Found')); discovery_logger($params['host_id'], $itype['id'], $key, 'HOST: '.(isset($ad_interfaces[$key])?iad_show_interface($fields,$ad_interfaces[$key]):'Not Found')); // Not in DB but in Host = add new if (!isset($db_interfaces[$key]) && isset($ad_interfaces[$key])) { if (iad_permit_new($ad_interfaces[$key], $ad_policy,$itype)) { $text = ''; discovery_logger($params['host_id'], $itype['id'], $key, 'RES : New Interface Found'); //if the AD policy permits adding an interface. if ($ad_policy['permit_add']==1) { //if the AD policy says use default poller if ($ad_policy['poller_default']==1) ad_set_default ($ad_interfaces[$key]['poll'],$itype['autodiscovery_default_poller']); //use the interface type default poller for this new interface ad_set_default ($ad_interfaces[$key]['client'],$params['autodiscovery_default_customer']); ad_set_default ($ad_interfaces[$key]['sla'],$itype['sla_default']); //Find the Index Field foreach ($fields as $fdata) if ($fdata['ftype']==3) { $index_field = $fdata['name']; break; } //add the index field as data to use when adding a record $ad_interfaces[$key][$index_field]=$key; //delete the status fields, because they will not be found in the db unset ($ad_interfaces[$key]['admin']); unset ($ad_interfaces[$key]['oper']); $interface_id = $Interfaces->add(array('host'=>$params['host_id'],'type'=>$itype['id'])); //add new record $Interfaces->update($interface_id,$ad_interfaces[$key]); //update it with the data $text = '- Added'; } // permit add $Events->add(date("Y-m-d H:i:s",time()), $Config->get('jffnms_administrative_type'), $params['host_id'], $ad_interfaces[$key]['interface'], //add informative event 'alert','autodiscovery',trim('Found '.$text),0); $processed = 1; } // if allow add continue; } // In Host not DB if (!isset($ad_interfaces[$key]) && isset($db_interfaces[$key])) { if ($itype['autodiscovery_validate']==1 && $db_interfaces[$key]['poll'] > 1) { discovery_logger($params['host_id'], $itype['id'], $key, 'RES : Not Found in Host'); $test=''; if ($ad_policy['permit_del']==1 && $ad_policy['permit_disable']==0) { $Interfaces->del($db_interfaces[$key]['id']); $text = '- Deleted'; } if ($ad_policy['permit_del']==0 && $ad_policy['permit_disable']==1) { $Interfaces->update($db_interfaces[$key]['id'], array('poll'=>1, 'show_rootmap'=>2)); $text = '- Disabled'; } if ($ad_policy['alert_del']==1) $Events->add(date("Y-m-d H:i:s",time()), $Config->get('jffnms_administrative_type'), $params['host_id'], $db_interfaces[$key]['interface'], //add informative event 'alert', 'autodiscovery', trim('Not Found in Host '.$text),0); } continue; } // Found in both and polling enabled if (isset($ad_interfaces[$key]) && isset($db_interfaces[$key])) { if ($itype['autodiscovery_validate']==1) { $fields_to_modify = array(); $track_fields = array(); $track_fields['interface']='Interface Name'; foreach ($fields as $fdata) if ($fdata['tracked']==1) $track_fields[$fdata['name']] = $fdata['description']; foreach ($track_fields as $track_field=>$track_field_descr) { if (!empty($ad_interfaces[$key][$track_field]) && (strncmp($ad_interfaces[$key][$track_field], $db_interfaces[$key][$track_field], 30) != 0)) { discovery_logger($params['host_id'], $itype['id'], $key, "RES : $track_field_descr changed from ". $db_interfaces[$key][$track_field].' to '. $ad_interfaces[$key][$track_field]); $fields_to_modify[$track_field]=$ad_interfaces[$key][$track_field]; } // fields not equal if (count($fields_to_modify) > 0) { $changed_fields = array(); foreach ($fields_to_modify as $field_name=>$field_value) $changed_fields[] = $track_fields[$field_name].' to '.$field_value.' was '.$db_interfaces[$key][$field_name]; $changed_fields = join(' and ',$changed_fields); if ($ad_policy['permit_mod']==1) { $Interfaces->update($db_interfaces[$key]['id'], $fields_to_modify); if (array_key_exists('interface', $fields_to_modify)) $interface_name = $ad_interfaces[$key]['interface']; else $interface_name = $db_interfaces[$key]['interface']; $event_comment = '- Changed '.$changed_fields; } else { $interface_name = $db_interfaces[$key]['interface']; $event_comment = '- NOT Changed '.$changed_fields; } $Events->add(date("Y-m-d H:i:s",time()), $Config->get('jffnms_administrative_type'), $params['host_id'], $interface_name, 'alert', 'autodiscovery', trim('detected modification '.$event_comment),0); } } } // Check for interfaces with no client assigned if ($db_interfaces[$key]['client'] <= 1) { discovery_logger($params['host_id'], $itype['id'], $key, 'RES : No Customer Selected'); $Events->add(date("Y-m-d H:i:s",time()), $Config->get('jffnms_administrative_type'), $params['host_id'], $db_interfaces[$key]['interface'], 'alert', 'autodiscovery', 'Incomplete interface setup (Customer not selected)', 0); continue; } } discovery_logger($params['host_id'], $itype['id'], $key, 'RES : Nothing done.'); } // foreach unique interfaces } //ad_interfaces > 0 } //interface types $iad_time = round(time_msec_diff($iad_time)); $Child->logger('H '.str_pad($params['host_id'],3,' ',STR_PAD_LEFT)." : Autodiscovery took ".$iad_time." msec.\n"); return TRUE; } function iad_get_autodiscovery($autodiscovery_id) { static $autodiscovery_cache = array(); if (array_key_exists($autodiscovery_id, $autodiscovery_cache)) return $autodiscovery_cache[$autodiscovery_id]; $iad_query = ' SELECT poller_default, permit_add, permit_del, permit_mod, permit_disable, skip_loopback, check_state, check_address, alert_del FROM autodiscovery WHERE id = '.$autodiscovery_id; $iad_result = db_query($iad_query) or die ('Query failed - iad cache - '.db_error()); if (!($iad_row = db_fetch_array($iad_result))) return FALSE; $autodiscovery_cache[$autodiscovery_id] = $iad_row; return $iad_row; } //iad_get_autodiscovery() function iad_get_interface_types($itype_id=FALSE) { static $itypes_cache = FALSE; if (!is_array($itypes_cache)) { //fill the cache $itype_query = ' SELECT id, autodiscovery_validate, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, description, sla_default, snmp_oid FROM interface_types WHERE id > 1 AND autodiscovery_enabled = 1 ORDER BY id'; $itype_result = db_query($itype_query) or die ('Query failed - iad_get_interface_types() - '.db_error()); while ($itype_row = db_fetch_array($itype_result)) { $id = $itype_row['id']; $itypes_cache[$id] = $itype_row; } }//cache fill if (is_numeric($itype_id)) { if (!array_key_exists($itype_id, $itypes_cache)) return FALSE; return array($itype_id => $itypes_cache[$itype_id]); } return $itypes_cache; } // iad_get_interface_types() function discovery_logger($host, $itype, $intid, $result) { global $Child; $Child->logger( 'H '.str_pad($host,3,' ',STR_PAD_LEFT).' : '. 'IT '.str_pad($itype,3,' ',STR_PAD_LEFT).' : '. ($intid?'I '.str_pad($intid,4,' ',STR_PAD_LEFT).' : ':''). "$result.\n"); } function iad_show_interface ($fields,$data) { $fields = array_merge(array(array('name'=>'interface', 'ftype'=>1, 'ftype_handler'=>'none')),$fields); $text = array(); foreach ($fields as $fdata) if (isset($fdata['ftype']) && ($fdata['ftype']!=3) && isset($fdata['ftype_handler']) && ($fdata['ftype_handler']!='bool')) $text[] = substr($fdata['name'],0,4).': '.(isset($data[$fdata['name']])?$data[$fdata['name']]:''); $text = join(" | ",$text); return $text; } // Not in database but found in host - is it really supposed to be there? function iad_permit_new(&$host_data, &$ad_policy, &$itype) { if ($itype['autodiscovery_validate'] == 0) return TRUE; # If we skip looback and have a loopback address - dont add it if ( // Possibly check for loopback $ad_policy['skip_loopback'] == 1 && ( ( preg_match('/(loopback.*|null.*|lo\d*)$/i', $host_data['interface']) != 0) || ( array_key_exists('address', $host_data) && $host_data['address'] == '127.0.0.1') )) { return FALSE; // Skip loopback and loopback detected } # Valid address? if ( $ad_policy['check_address'] == 1 && (array_key_exists('address', $host_data) == TRUE) && ($host_data['address'] == '' || $host_data['address'] == '0.0.0.0') ) return FALSE; // Found address and its invalid $Alarms = new JffnmsAlarms(); if ($ad_policy['check_state'] == 1 && $Alarms->lookup($host_data['oper']) != ALARM_UP) return FALSE; return TRUE; } function update_sysobject_id($host_id, $host_ip, $rocommunity) { $oid = '.1.3.6.1.2.1.1.2.0'; $sysObjectId = snmp_get($host_ip, $rocommunity, $oid); if ($sysObjectId === FALSE) return NULL; $sysObjectId = str_replace('SNMPv2-SMI::enterprises','ent', $sysObjectId); db_update('hosts', $host_id, array('sysobjectid' => $sysObjectId)); return $sysObjectId; } function sysobjectid_matches($host_id, $itype_id) { if ($itype_id == '') return TRUE; if ($itype_id == '.' && $host_id != '') return TRUE; $host_id = substr(preg_replace('/^'.ENTERPRISES_OID.'\./','ent.', $host_id), 0, strlen($itype_id)); return ($host_id == $itype_id); } jffnms-0.9.3/engine/consolidate/0002755000175000017500000000000011731203345016070 5ustar csmallcsmalljffnms-0.9.3/engine/consolidate/syslog.php0000644000175000017500000001150511462402565020127 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ // Match, and parse Syslog Messages, then put them in the events table function consolidate_syslog(&$Events) { $query_syslog = 'select id, date_logged as date, host, message from syslog where analized = 0 order by id asc'; $result_syslog = db_query ($query_syslog) or die ('Query failed - SY2 - '.db_error()); logger( 'SYSLOG Events to Process: '.db_num_rows($result_syslog)."\n"); $fields = array('interface','state','username','info'); while ($syslog_record = db_fetch_array($result_syslog)) { logger( 'S '.$syslog_record['id'].':= '.$syslog_record['date'].' '.$syslog_record['host'].' '.$syslog_record['message']."\n"); $values = array(); $event_type_id = 1; // Default event, if we have no match //Sanitize $syslog_record['message'] = trim($syslog_record['message']); $syslog_record['message'] = str_replace("\n",' ',$syslog_record['message']); $query_stypes = 'SELECT id, type, interface, username, state, info, match_text FROM syslog_types WHERE id > 1 ORDER BY pos asc, id'; $result_stypes = db_query($query_stypes) or die ('Query failed - SY3 - '.db_error()); //var_dump($syslog_record[message]); while ( ($stype_rows = db_fetch_array($result_stypes))) { //loop thru all syslog_types until we find a match (or dont) if (strpos($stype_rows['match_text'],'(')===FALSE) //take care of legacy (non-regexp) matches, that does not have a '(' $stype_rows['match_text'].='.+'; if (preg_match('/'.$stype_rows['match_text'].'/i', $syslog_record['message'], $parts)) { $event_type_id = $stype_rows['type']; if (count($parts)==1) $parts=explode(' ',$parts[0]); logger( 'S '.$syslog_record['id'].':= Matched '.$stype_rows['match_text']."\n"); break; //stop processing regexps as this one matches } } //var_dump($parts); if ($event_type_id == 1) //we didnt found a match, default (unknown) event $values['info'] = $syslog_record['message']; //put complete message as the info else foreach ($fields as $field_name) //foreach field to be completed if (!empty($stype_rows[$field_name])) { //if it has something in the db unset ($value); switch ($stype_rows[$field_name]) { case '*': //complete message $value = $syslog_record['message']; //this way we get the complete message break; case 'D': //only the data, not the match unset ($parts[0]); $value = join(' ',$parts); // all the parts without the 0 (complete) break; default: //No Special Case if (is_numeric($stype_rows[$field_name])) // if field has a number is refereing to a part match $value = $parts[$stype_rows[$field_name]]; // Value is the part signaled by the field value else // it was not numeric $value = $stype_rows[$field_name]; // so, we take it as a literal break; } $values[$field_name] = $value; } //final touchs to the values foreach ($fields as $field_name) $values[$field_name]=addslashes(trim(str_replace(',','',$values[$field_name]))); //trim them and scape the ' //FIXME, why? do I need to add more? $values['info'] = str_replace('(','',str_replace(')','',$values['info'])); //replace ( and ) // Get the Host ID based on the IP or the Name unset ($host_ip); if (ip2long($syslog_record['host']) === -1) //its not an IP address $host_ip = gethostbyname($syslog_record['host']); //try to resolve the IP $query_router=' SELECT hosts.id FROM hosts WHERE hosts.ip = \''.$syslog_record['host'].'\' OR hosts.name =\''.$syslog_record['host'].'\''. (isset($host_ip)?' OR hosts.ip =\''.$host_ip.'\'':''); $result_router = db_query ($query_router) or die ('Query failed - SY4 - '.db_error()); if (db_num_rows ($result_router) > 0) // there is a record $host_id = current(db_fetch_array($result_router)); // use the first one else { $host_id = 1; //Unknown Host //if host is unknown and event type is unknown put the host ip as the interface //FIXME get a better way to include the host ip in the event when the host is unknown if ($event_type_id == 1) $values['interface'] = $syslog_record['host']; else $values['info'] .= $syslog_record['host']; } $output_text = array(); $output_text[] = "Host: $host_id"; foreach ($fields as $field_name) if (!empty($stype_rows[$field_name])) $output_text[]= "$field_name(".$stype_rows[$field_name]."): ".$values[$field_name]; logger( 'S '.$syslog_record['id'].':= '.join(' - ',$output_text)."\n"); $Events->add($syslog_record['date'],$event_type_id,$host_id,$values['interface'],strtolower($values['state']),$values['username'],$values['info'],$syslog_record['id']); db_update("syslog",$syslog_record['id'], array('analized'=>1)); } } ?> jffnms-0.9.3/engine/consolidate/traps.php0000644000175000017500000001111411466146771017744 0ustar csmallcsmall Javier Szyszlican * Copyright (C) <2005> Erno Rigo * This program is licensed under the GNU GPL, full terms in the LICENSE file * * 2005-04-01 Extensive rewrite to support trap_receiver plugins by Erno Rigo * 2005-04-06 Re-wrote again, implementing receiver positions following directions from Javier - Erno Rigo */ function consolidate_traps () { global $Config; $jffnms_real_path = $Config->get('jffnms_real_path'); $query_traps = 'SELECT id, date, ip, trap_oid FROM traps WHERE analized = 0 ORDER BY id asc'; $result_traps = db_query ($query_traps) or die ('Query failed - TA2 - '.db_error()); logger( 'SNMP Traps to Process: '.db_num_rows($result_traps)."\n"); while ($trap = db_fetch_array($result_traps)) { $matched = false; // d ($trap); // Get Host ID $query_host="SELECT id FROM hosts WHERE hosts.ip = '$trap[ip]' OR hosts.name = '$trap[ip]'"; $result_host = db_query ($query_host) or die ('Query failed - TA5 - '.db_error()); $host_id = 1; if (db_num_rows($result_host) > 0) $host_id = current(db_fetch_array($result_host)); $query_varbinds = 'SELECT trap_oid, value, oidid FROM traps_varbinds WHERE trapid = '.$trap['id'].' ORDER BY oidid'; $result_varbinds = db_query($query_varbinds) or die ("Query failed (".$query_varbinds.") - get varbinds - ".db_error()); //save all varbinds with key and value $trap_vars = array(); $trap_vars_oid = array(); if (db_num_rows ($result_varbinds) != 0) while ($rows_varbinds = db_fetch_array($result_varbinds)) { $trap_vars[$rows_varbinds['oidid']] = $rows_varbinds['value']; // indexed by VarBind ID (reception order) $trap_vars_oid[$rows_varbinds['trap_oid']] = $rows_varbinds['value']; // indexed by VarBind OID } $query_receiver = " SELECT tr.match_oid, tr.position, tr.interface_type, tr.stop_if_matches, tr.command as receiver_command, tr.parameters as receiver_parameters, rb.command as backend_command, rb.parameters as backend_parameters FROM trap_receivers tr, pollers_backend rb WHERE rb.id = tr.backend ORDER BY tr.position"; $result_receiver = db_query($query_receiver) or die ('Query failed ('.$query_receiver.') - get trap receiver - '.db_error()); while ($record = db_fetch_array($result_receiver)) if (preg_match('/'.$record['match_oid'].'/', $trap['trap_oid']) && !$matched) // if this trap regexp matches the trap OID { $receiver_command = $record['receiver_command']; $receiver_filename = "$jffnms_real_path/engine/trap_receivers/$receiver_command.inc.php"; $backend_command = $record['backend_command']; $backend_filename = "$jffnms_real_path/engine/backends/$backend_command.php"; if (file_exists($receiver_filename) && file_exists($backend_filename)) { require_once($backend_filename); require_once($receiver_filename); $parameters = array_merge($record, array( 'trap' => $trap, 'trap_vars' => $trap_vars, 'trap_vars_oid' => $trap_vars_oid, 'host_id' => $host_id, 'host_ip' => $trap['ip'])); list($receiver_matched, $receiver_result) = call_user_func_array('trap_receiver_'.$receiver_command, array($parameters)); if ($receiver_matched) { $backend_parameters = array_merge ($parameters, $receiver_result); $backend_result = call_user_func_array('backend_'.$backend_command, array($backend_parameters, NULL)); // Log the results logger("T $trap[id]:= $receiver_command($trap[trap_oid]): -> $backend_command(): $backend_result\n"); #logger( # "T $trap[id]:= Recevier $receiver_command(".vd($parameters). # ") => Backend $backend_command (".vd($receiver_result). # ") => $backend_result\n"); if ($record['stop_if_matches']==1) $matched = TRUE; } else logger( "T $trap[id]:= Receiver $receiver_command did not match.\n"); } else logger( "T $trap[id]:= ERROR: Receiver '$receiver_command' or Backend '$backend_command' does not exists.\n"); } if (!$matched) logger( "T $trap[id]:= Did not match any receiver.\n"); db_update('traps', $trap['id'], array('analized'=>1)); }//while } ?> jffnms-0.9.3/engine/consolidate/logfiles.php0000644000175000017500000001202111466227777020423 0ustar csmallcsmall * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function consolidate_logfiles(&$Events) { $fields = array('interface','state','username','info'); $query_logfiles = 'SELECT id,filename,last_poll_date,file_offset FROM logfiles'; $result_logfiles = db_query($query_logfiles) or die("Query failed - LF1 - ".db_error()); while ($logfile_record = db_fetch_array($result_logfiles)) { $lfid = $logfile_record['id']; logger('LF '.$lfid.':='.$logfile_record['filename']."\n"); if (!is_readable($logfile_record['filename'])) { logger("LF $lfid:= file no readable, skipping.\n"); continue; } $stat = @stat($logfile_record['filename']); if(!$stat) { logger("LF $lfid:= Cannot stat logfile, skipping.\n"); continue; } $logfile_offset = $logfile_record['file_offset']; // Has it changed, ie has the modtime changed if ($stat['mtime'] <= $logfile_record['last_poll_date']) { logger("LF $lfid:= Logfile hasn't change size last poll, skipping.\n"); continue; } // New file? if ($stat['ctime'] > $logfile_record['last_poll_date']) { logger("LF $lfid:= Logfile new, resetting offset to 0.\n"); $logfile_offset = 0; } elseif ($stat['size'] == $logfile_offset) { logger("LF $lfid:= Logfile hasn't grown, skipping.\n"); continue; } elseif ($stat['size'] < $logfile_offset) { logger("LF $lfid:= Logfile has shrunk!! Resetting offset to 0.\n"); $logfile_offset = 0; } if (($fp = fopen($logfile_record['filename'], 'r')) == NULL) { logger("LF $lfid:= Cannot open logfile for reading.\n"); continue; } //Line up the matches $match_records = get_db_list( array('logfiles_match_items', 'logfiles_match_groups'), null,//ids array('logfiles_match_items.*'), array( array('logfiles_match_groups.logfile','=',$logfile_record['id']), array('logfiles_match_groups.match_item','=','logfiles_match_items.id'), ), array( array('logfiles_match_groups.pos','asc'), ) ); fseek($fp, $logfile_offset); $lines_read=0; while(!feof($fp)) { $line = fread($fp, 4096); $lines_read++; foreach ($match_records as $match) { if (preg_match('/'.$match['match_text'].'/',$line,$regs)) { $logger_text = array(); //logger("LF $lfid:= Matched ".$match['match_text'].".\n"); foreach ($fields as $field_name) { if (!empty($match[$field_name])) { $values[$field_name] = logfile_parse_field($match[$field_name],$line, $regs); $logger_text[] = $field_name . '('.$match[$field_name].'): '.$values[$field_name]; } } // Get and parse the host $host = logfile_parse_field($match[$field_name], $line, $regs); $host_id = logfile_get_hostid($host); logger("LF $lfid := Host: $host_id - ".join(' - ',$logger_text)."\n"); $Events->add(date('Y-m-d H:i:s', time()), $match['type'], $host_id, $values['interface'], strtolower($values['state']), $values['username'], $values['info'], 1); }//matched } } $logfile_offset = ftell($fp); fclose($fp); logfile_update($lfid,$logfile_offset); } } /** * logfile_parse_field - Extract a field from a logfile * @field_name : selects that the field will be * @line: current logfile line * @regs: matches from regular expressions */ function logfile_parse_field($field_name, $line, $regs) { $retval = $field_name; // Default is literal switch($field_name) { case '*': // complete message $retval = $line; break; case 'D': // Only data $retval = join(' ',$regs); break; default: if (is_numeric($field_name)) if (array_key_exists($field_name,$regs)) $retval = $regs["$field_name"]; else $retval = ''; } // No parsing, so its a literal return addslashes(trim(str_replace(',','',$retval))); } /** * logfile_get_hostid - Find the internal ID for a host * @host : IP address or hostname of the host * */ function logfile_get_hostid($host) { $host_long = ip2long($host); if ($host_long === -1 || $host_long === FALSE) $host_ip = gethostbyname($host); else $host_ip = $host; $query_routerid = ' SELECT hosts.id FROM hosts WHERE hosts.ip = "'.$host_ip.'" OR hosts.name = "'.$host.'"'; $result_routerid = db_query($query_routerid); if ( ($result_routerid === FALSE) || (db_num_rows($result_routerid) < 1)) return 1; return(current(db_fetch_array($result_routerid))); } /** * logfile_update - Update offset and last time in database * @lfid : Logfile id * @offset : File offset * */ function logfile_update($lfid,$logfile_offset) { return db_update('logfiles',$lfid, array('file_offset'=>$logfile_offset, 'last_poll_date' => time())); } ?> jffnms-0.9.3/engine/consolidate/alarms.php0000644000175000017500000000124011530444273020057 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function consolidate_alarms(&$Alarms, &$Triggers) { $down_alarms = $Alarms->alarms_list(0, array('triggered'=>0, 'alarm_state'=> ALARM_DOWN)); logger('Active Alarms for Triggers: '.count($down_alarms)."\n"); foreach ( $down_alarms as $alarm ) { logger( "A $alarm[id]:= @$alarm[date_start] - state: $alarm[alarm_state]". " ($alarm[state_description]) - int: $alarm[interface]". " - type: $alarm[type]\n"); $Triggers->analyze('alarm', $alarm); } } ?> jffnms-0.9.3/engine/consolidate/tacacs.php0000644000175000017500000000455411716447477020070 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function consolidate_tacacs(&$Events) { $query_tacacs = " SELECT acct.id as id_tacacs, acct.date,acct.usern as value_user, acct.c_name as source_ip, acct.elapsed_time, acct.type, acct.cmd as command, hosts.id as id_host FROM acct, hosts WHERE (hosts.ip_tacacs = acct.s_name OR hosts.ip = acct.s_name) AND analized = 0 ORDER BY acct.id asc"; $result_tacacs = db_query ($query_tacacs) or die ('Query failed - TAC1'); logger( 'TACACS+ Events to Process: '.db_num_rows($result_tacacs)."\n"); $event_id = get_command_event_type(); while ($tacacs = db_fetch_array($result_tacacs)) { logger( "TACACS+ Event: ID: $tacacs[id_tacacs] // date: $tacacs[date] //". " host: $tacacs[id_host] // user: $tacacs[value_user] // ". "origin: $tacacs[source_ip] // time: $tacacs[elapsed_time] //". " type: $tacacs[type] // cmd: $tacacs[command]\n"); $value_interface = "command"; if ($tacacs['command'] == '') { switch($tacacs['type']) { case 'START': $value_info = "Session Start from $tacacs[source_ip]"; break; case 'STOP': $value_info = "Session Finished $tacacs[elapsed_time] sec, $tacacs[source_ip]"; break; case 'REJECT': $value_info = "Rejected Password, connection from $tacacs[source_ip]"; $value_state = strtolower($type); break; }//switch } else { $value_info = addslashes(str_replace(array('limit',"'",'offset'),'',$tacacs['command'])); $value_state = "active"; } $Events->add($tacacs['date'], $event_id, $tacacs['id_host'], $value_interface, $value_state, $tacacs['value_user'], $value_info, $tacacs['id_tacacs']); db_update('acct',$tacacs['id_tacacs'],array('analized'=>1)); } //while } function get_command_event_type() { $cmd_event_type = 8; // Event type 8 is a command event, as shipped $query_types = "SELECT id FROM types WHERE description = 'Command' LIMIT 1"; if ( ($result_types = db_query($query_types))) { if (db_num_rows($result_types)) { $types_row = db_fetch_array($result_types); $cmd_event_type = $types_row['id']; } } return $cmd_event_type; } ?> jffnms-0.9.3/engine/consolidate/events_latest.php0000644000175000017500000000066511462402361021466 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //Make Latest Events //============================= //DISABLED because of new filtering on events (FIXME make this an option) //$return = make_events_latest($events_latest_max); //logger("Make Latest Events 1=OK: $return\n"); ?> jffnms-0.9.3/engine/consolidate/events.php0000644000175000017500000000764711533625166020132 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function consolidate_events(&$Events, &$Alarms, &$Triggers) { $query_events = " SELECT /*! HIGH_PRIORITY */ events.id, events.date, events.type, alarm_states.state, interfaces.id as interface, alarm_states.id as alarm, types.alarm_up, types.alarm_duration FROM events, types, interfaces, alarm_states WHERE events.interface != '' AND events.state != '' AND events.type = types.id and events.interface = interfaces.interface and events.host = interfaces.host and types.generate_alarm = 1 and events.analized = 0 and alarm_states.description = events.state and interfaces.check_status = 1 GROUP BY events.id, events.date, events.type, alarm_states.state, interfaces.id, alarm_states.id, types.alarm_up, types.alarm_duration ORDER BY events.date asc, events.id asc, interfaces.id"; //var_dump ($query_events); $result_events = db_query ($query_events) or die ('Query failed - consolidate events - '.db_error()); logger('Events to Process: '.db_num_rows($result_events)."\n"); while ($event = db_fetch_array($result_events)) { $processed = 0; if (($event['alarm_up']) && ($event['alarm_up'] > 1)) $event['type'] = $event['alarm_up']; // override type logger("E $event[id]:= @$event[date] - state: $event[state] ". "- int: $event[interface] - type: $event[type]\n"); //find a down $other_alarm = $Alarms->status($event['interface'],$event['type'],array(ALARM_DOWN,ALARM_TESTING)); //verify down or testing logger("E $event[id]:= Other Down Alarms: $other_alarm[count]\n"); if ($event['state']==ALARM_ALERT) //alert SLA or administrative { $date_stop = date('Y-m-d H:i:s',(strtotime($event['date'])+$event['alarm_duration']+30)); // add the alarm duration + 30 sec logger("E $event[id]:= ALERT Interface $event[interface]\n"); $Alarms->insert($Triggers, $event['date'],$date_stop,$event['interface'],$event['type'],$event['alarm'],$event['id'],$event['id']); $processed = 1; unset($date_stop); } if (($other_alarm['count'] > 0) && ($processed==0)) { //We have found other active (down,testing) alarms of this interface //and the event was not an ALERT event (not already processed) then is a new DOWN or an UP //FIXME Flapping $alarm_data = array('date_stop'=>$event['date'], 'referer_stop'=>$event['id']); if (($event['state']==ALARM_DOWN) || ($event['state']==ALARM_TESTING)) { $other_alarm['count']=0; //let the next if enter. $alarm_data['active'] = ALARM_UP; //here we play because in the first 4 alarm_states the id is equal to the state //FIXME This is a FLAP also } else $alarm_data['active'] = $event['alarm']; logger("E $event[id]:= UP Interface $event[interface]\n"); $Alarms->update($other_alarm['alarm']['start_id'],$alarm_data); //bring up the older event //mark this, and the other alarm referer_start events as ACK (for events console) $Events->set_ack($event['id'],1); $Events->set_ack($other_alarm['alarm']['referer_start'],1); $processed = 1; unset ($alarm_data); } if ((($event['state']==ALARM_DOWN) || ($event['state']==ALARM_TESTING)) && ($other_alarm['count'] == 0)) //and we dont have any other active alarm, then is a DOWN/TESTING { logger("E $event[id]:= DOWN/TESTING Interface $event[interface]\n"); $Alarms->insert($Triggers, $event['date'],'',$event['interface'],$event['type'],$event['alarm'],$event['id'],''); $processed = 1; } if (($processed==1) || ($event['state']==ALARM_UP) || ($event['state']==ALARM_DOWN) || ($event['state']==ALARM_TESTING)) { $Events->set_analized($event['id']); } } // while } ?> jffnms-0.9.3/engine/poller2.php0000644000175000017500000001447511464356565015705 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ $launcher_function = 'real_poller'; $launcher_param_normal_handler = 'poller_params'; $launcher_param_managed_handler = 'poller_params_managed'; $launcher_child_status ='poller_status'; $launcher_item_source = 'hosts_random_list'; $refresh_items = true; $refresh_time = 20; $timeout = (3*60); include ('launcher.inc.php'); function hosts_random_list($interval = false) { $query_hosts=" SELECT hosts.id, count(interfaces.id) as cant_interfaces, hosts.last_poll_date FROM hosts, interfaces WHERE hosts.id > 1 and hosts.poll = 1 and interfaces.id > 1 and interfaces.poll > 1 and interfaces.host = hosts.id". (($interval)?" and ((hosts.last_poll_date + hosts.poll_interval - (hosts.last_poll_time/2)) < ".time().")":""). "\n\t GROUP BY hosts.id, hosts.last_poll_date ORDER BY hosts.last_poll_date asc"; $result_hosts = db_query ($query_hosts) or die ("Query failed - R2 - ".db_error()); $hosts = array(); while ($host = db_fetch_array($result_hosts)) if ($host['cant_interfaces'] > 0) $hosts[]=$host['id']; return $hosts; } function poller_status ($poller, $result) { list ($status, $items_total, $items_ok, $time) = explode (" ", $result); if ($status == 'OK') { logger ( 'Poller '.$poller['pid'].' finished working on host '.$poller['item']. ' in '.time_hms(round($time/1000)).", Items $items_ok/$items_total\n"); return TRUE; } logger ( 'Poller '.$poller['pid'].' failed when polling host '.$poller["item"]. ": $result\n"); return FALSE; } function poller_params($params) { $base = array(NULL,NULL,NULL,NULL,NULL,NULL); $params[4] = true; foreach ($params as $pos=>$value) $base[$pos] = $value; return $base; } function poller_params_managed($params) { $base = array(NULL,NULL,NULL,NULL,NULL,NULL); $params[4] = false; foreach ($params as $pos=>$value) $base[$pos] = $value; return $base; } function real_poller ($host_id = NULL , $interface_id = NULL, $poller_pos = NULL, $itype = NULL, $output = true) { global $Config; global $heartbeat; $time_start = time_msec(); // Validate input if ($host_id != NULL && !is_numeric($host_id)) { logger("ERROR: Host '$host_id' is not NULL or numeric.\n"); return; } if ($interface_id != NULL && !is_numeric($interface_id) && $interface_id != 'dmii') { logger("ERROR: Interface '$interface_id' is not NULL, numeric or dmii.\n"); return; } $poller_plan_filter = array("interface"=>$interface_id,"host"=>$host_id,"pos"=>$poller_pos,"type"=>$itype); $poller_plan_result = poller_plan ($poller_plan_filter); // Get the Poller Plan (things to poll) if ($output) logger(" : H ".str_pad($host_id,3," ",STR_PAD_LEFT)." : Poller Start : ".$poller_plan_result["items"]." Items.\n"); else ob_start(); $times = array(); $included_files = array(); $items_ok = 0; $jffnms_real_path = $Config->get('jffnms_real_path'); while ($poller_data = poller_plan_next($poller_plan_result)) { $poller_command = $poller_data['poller_command']; $backend_command = $poller_data['backend_command']; $poller_filename = "$jffnms_real_path/engine/pollers/$poller_command.php"; $backend_filename = "$jffnms_real_path/engine/backends/$backend_command.php"; //unset result variables unset($poller_result); unset($backend_result); $ok = true; if (!isset($included_files[$poller_filename])) { if (file_exists($poller_filename)) { include_once($poller_filename); $included_filenames[$poller_filename]=true; } else $ok = false; } if (!isset($included_files[$backend_filename])) { if (file_exists($backend_filename)) { include_once($backend_filename); $included_filenames[$backend_filename]=true; } else $ok = false; } if ($ok) { $time_poller_query = time_msec(); $poller_result = call_user_func_array("poller_$poller_command",array($poller_data)); $time_poller_query = time_msec_diff($time_poller_query); $time_backend_query = time_msec(); $backend_result = call_user_func_array("backend_$backend_command",array($poller_data,$poller_result)); $time_backend_query = time_msec_diff($time_backend_query); $items_ok++; } else //no poller files logger("ERROR: $poller_command or $backend_command Modules not Found...",0); //debug output if ($output) { //Cut the Poller Parameters String $poller_param_description = isset($poller_data["poller_parameters"])?$poller_data["poller_parameters"]:""; if ($aux = strlen($poller_param_description) > 10) $poller_param_description = substr($poller_param_description,0,4)."..".substr($poller_param_description,strlen($aux)-4,4); logger( " : H ".str_pad($poller_data["host_id"],3," ",STR_PAD_LEFT). " : I ".str_pad($poller_data["interface_id"],3," ",STR_PAD_LEFT). " : P ".str_pad($poller_data["poller_pos"],3," ",STR_PAD_LEFT). " : ".(($backend_command=="buffer")?"$poller_command:":"").$poller_data["poller_name"]."(".$poller_param_description."): $poller_result ". "-> $backend_command(".$poller_data["backend_parameters"]."): $backend_result". " (time P: $time_poller_query | B: $time_backend_query) ". "\n"); } else { ob_end_clean(); if (($old_time + $heartbeat) > time()) // if $heartbeat seconds have passed since last time echo "."; // Output a dot is sign of a heartbeat for the master flush(); ob_flush(); ob_start(); $old_time = time(); } } //while $time = round(time_msec_diff($time_start)); if ($output) logger(" : H ".str_pad($host_id,3," ",STR_PAD_LEFT)." : Poller End, Total Time: $time msec.\n"); else ob_end_clean(); // Update Host(s) Last Poll Date/Time $host_ids = explode(",",$host_id); // in case we're being called to poll multiple hosts foreach ($host_ids as $host_id) adm_hosts_update($host_id,array("last_poll_date"=>time(), "last_poll_time"=>round($time/1000))); return array('items'=>$poller_plan_result['items'], 'items_ok'=>$items_ok, 'time'=>$time); } ?> jffnms-0.9.3/engine/analyzers/0002755000175000017500000000000011744204462015601 5ustar csmallcsmalljffnms-0.9.3/engine/analyzers/sla.inc.php0000644000175000017500000001063211716447477017657 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function replace_vars ($text, $values = NULL) { if (is_array($values)) { if (isset($values["input"])) { //addtions and aliases $values["in"]=$values["input"]*8; $values["out"]=$values["output"]*8; $values["inerrors"]=$values["inputerrors"]; $values["outerrors"]=$values["outputerrors"]; } //print_r($values); foreach ($values as $key=>$value) if (!is_array($value)) $text = str_replace("<$key>",$value,$text); } return $text; } function analyzer_sla ($interface, $values) { $Interfaces = new JffnmsInterfaces(); $Events = new JffnmsEvents(); $sla_cond_active = array(); $output = array(); $cond_num = -1; $interface_data = $Interfaces->values($interface["id"],array("exclude_types"=>20)); $values = array_merge($values,$interface_data["values"][$interface["id"]]); unset ($interface_data); $query_sla=" SELECT slas_cond.cond, slas_cond.description, slas_cond.event, slas_sla_cond.show_in_result, slas_cond.variable_show, slas_cond.variable_show_info FROM slas_cond, slas_sla_cond WHERE slas_sla_cond.sla = ".$interface["sla"]." and slas_sla_cond.cond = slas_cond.id order by slas_sla_cond.pos"; $result_sla = db_query ($query_sla) or die ("Query failed - analyzer_sla() - ".db_error()); //logger("$query_sla\n"); while ($sla = db_fetch_array($result_sla)) { $sla_cond = replace_vars(trim($sla["cond"]),$values); $sla_variable_show = replace_vars(trim($sla["variable_show"]),$values); $sla_variable_show_info = replace_vars(trim($sla["variable_show_info"]),$values); $sla["event"] = replace_vars(trim($sla["event"]),$values); //Execute the Variable show expression, and round it if ($sla_variable_show) { $eval_express = "\$sla_variable_show = round(($sla_variable_show),2);"; eval($eval_express); } if (($sla_cond!="AND") and ($sla_cond!="OR")) { //If its not AND or OR //Execute the SLA condition $cond_num++; $sla_cond_activate = 0; $test_cond = "if ($sla_cond) \$sla_cond_activate = 1;"; eval($test_cond); $show_info[$cond_num] = $sla["event"].": $sla_variable_show $sla_variable_show_info"; $output[] = str_pad("Cond$cond_num: $sla_cond",45)." = $sla_cond_activate ".(($sla_cond_activate==1)?" -TRUE- ":" -FALSE- ").$show_info[$cond_num]; if (($sla_cond_activate==0) or //if the test condition was TRUE ($sla["show_in_result"]==0)) //and the condition state that it was to show unset ($show_info[$cond_num]); $sla_cond_active[$cond_num] = $sla_cond_activate; } else { //if it was OR or AND $cond_num--; $output[] = str_pad("Cond".($cond_num)."= Eval ".($cond_num+1)." vs ".($cond_num).": ". $sla_cond_active[$cond_num+1]." $sla_cond ".$sla_cond_active[$cond_num]."",45); if ( (($sla_cond=="AND") and (($sla_cond_active[$cond_num+1]) && ($sla_cond_active[$cond_num]))) or (($sla_cond=="OR") and (($sla_cond_active[$cond_num+1]) || ($sla_cond_active[$cond_num])))) { //Eval was true unset($sla_cond_active[$cond_num+1]); $sla_cond_active[$cond_num]=1; } else { //Eval was False unset($sla_cond_active[$cond_num+1]); //delete both conditions information unset($show_info[$cond_num+1]); unset($show_info[$cond_num]); $sla_cond_active[$cond_num]=0; } $output[count($output)-1] .= " = ".$sla_cond_active[$cond_num]; } } //while conditions if (count($sla_cond_active)==1) { // if there is only one result left if ($sla_cond_active[0]==1) { //if all conditions are true(1) $show_info = $interface["info"]." ".join(", ",$show_info); $Events->add(date("Y-m-d H:i:s",time()),$interface["event_type"],$interface["host"],$interface["interface"], $interface["state"],"rrd_analizer_sla",$show_info,$interface["sla"]); $output[] = "Final Eval: True. INFO: $show_info"; } else $output[] = "Final Eval: False."; } else if (count($sla_cond_active) > 1) $output[] = "STACK UNDERFLOW, REVIEW THE SLA ".$interface["sla"]." !!, stack elements: ".(count($sla_cond_active)); else $output[] = "STACK OVERFLOW, REVIEW THE SLA ".$interface["sla"]." !!, stack elements: ".(count($sla_cond_active)); return $output; } ?> jffnms-0.9.3/engine/common_parent.inc.php0000644000175000017500000004412311732223745017717 0ustar csmallcsmall JFFNMS Authors * This program is licensed under the GNU GPL, full terms in the LICENSE file */ require_once('../conf/config.php'); define ('ENGINE_READ_TIMEOUT', 3); define ('ENGINE_MAX_TRIES', 2); define ('ENGINE_HEARTBEAT', 30); define ('ENGINE_MAX_POLL_TIME', 180); define ('ENGINE_DIE_TIME', 5); define ('ENGINE_MAX_CHILDREN', 5); define ('ENGINE_SELECT_USEC', 2000); //PHP RECOMMENDATION is 200,000 require_once('../conf/config.php'); $Config = new JffnmsConfig(); config_load_libs('basic', 0); class JffnmsEngineParent { public $min_children=0; public $max_children=ENGINE_MAX_CHILDREN; public $polling_items = array(); public $waiting_items = array(); public $polling_count = 0; public $waiting_count = 0; public $child_procs = array(); function __construct($opt_children) { if ($opt_children !== FALSE) { if (!preg_match('/^(\d+)(?:,(\d+)|)$/', $opt_children, $regs)) print_help('children option must be MIN,MAX'); if (count($regs) > 2) { $this->min_children = $regs[1]; $this->max_children = $regs[2]; } else $this->max_children = $regs[2]; if ($this->max_children < $this->min_children) print_help('maximum children must be greater than minimum'); if ($this->min_children < 0) print_help('minimum children must be 0 or more'); } } // __construct ################################################################ # # Item functions # public function items_new($new_items) { foreach ($new_items as $item_id => &$item) { if (!array_key_exists($item_id, $this->waiting_items)) $this->waiting_count++; $this->waiting_items[$item_id] = $item; } } // items_new private function items_recount() { $new_wait = count($this->waiting_items); if ($this->waiting_count != $new_wait) { logger("PAR: Waiting count adjusted to $new_wait (was ".$this->waiting_count.")\n"); $this->waiting_count = $new_wait; } $new_poll = count($this->polling_items); if ($this->polling_count != $new_poll) { logger("PAR: Polling count adjusted to $new_poll (was ".$this->polling_count.")\n"); $this->polling_count = $new_poll; } } private function item_set_done($item_id) { if (!is_numeric($item_id)) { $this->items_recount(); return; } if (!array_key_exists($item_id, $this->polling_items)) { logger("PAR: ** ERROR ** item_set_done(): Item $item_id does not exist in poller items.\n"); $this->items_recount(); return; } unset($this->polling_items[$item_id]); $this->polling_count--; } // item_set_done public function item_set_waiting($item_id) { if (!is_numeric($item_id)) { $this->items_recount(); return; } if (!array_key_exists($item_id, $this->polling_items)) { logger("PAR: ** ERROR ** item_set_waiting(): Item $item_id does not exist in poller items.\n"); $this->items_recount(); return; } if ($this->polling_items[$item_id]['tries'] > ENGINE_MAX_TRIES) { logger("PAR: Cannot process item $item_id after ".ENGINE_MAX_TRIES." attempts.\n"); } else { $this->waiting_items[$item_id] = $this->polling_items[$item_id]; $this->waiting_count++; } unset($this->polling_items[$item_id]); $this->polling_count--; } // item_set_waiting public function item_set_polling($item_id) { if (!is_numeric($item_id)) { $this->items_recount(); return; } if (!array_key_exists($item_id, $this->waiting_items)) { logger("PAR: ** ERROR ** item_set_polling(): Item $item_id does not exist in waiting items.\n"); $this->items_recount(); return; } $this->polling_items[$item_id] = $this->waiting_items[$item_id]; unset($this->waiting_items[$item_id]); $this->polling_count++; $this->waiting_count--; } // item_set_polling /* * item_check_poll_time() * Scans the list of items and checks that the poller for these * items has not hung. If so, kill that child and retry it later */ public function item_check_poll_time() { // Time where the poller started, earlier than this is a dead proc $min_poll_time = time() - ENGINE_MAX_POLL_TIME; foreach ($this->polling_items as $item_id => &$item) { if ($item['poll_time'] < $min_poll_time) { $this->stop_child($item['child_id'], 'item past max poll time'); $this->item_set_waiting($item_id); } } } // item_check_poll_time() ################################################################ # # Children fnuctions # /* * children_start * Checks required number of children and starts them if needed * returns number of children started */ public function children_start() { $children_started = 0; $children_count = count($this->child_procs); if ($children_count >= $this->max_children) return 0; $required_children = min($this->max_children, ($this->waiting_count + $this->polling_count)); if ($required_children < $this->min_children) $required_children = $this->min_children; while ($children_count < $required_children) { $new_child = $this->start_child(); if ($new_child === FALSE) return $children_started; $this->child_procs[$this->get_child_id()] = $new_child; $children_count++; $children_started++; } return $children_started; } // children_start() public function get_child_id() { $id=0; while(TRUE) { if (!array_key_exists($id, $this->child_procs)) return $id; $id++; } } public function stop_all_children($reason) { foreach ($this->child_procs as $child_id => $child) $this->stop_child($child_id, $reason); } public function stop_child($child_id, $reason) { if (!array_key_exists($child_id, $this->child_procs)) { logger("PAR: ** FATAL ** Child ID $child_id stopped but doesn't exist.\n"); die(); } logger("CH$child_id (".$this->child_procs[$child_id]['pid']."): stopped: $reason.\n"); $this->item_set_waiting($this->child_procs[$child_id]['item_id']); $this->child_procs[$child_id]['item_id']=FALSE; $this->child_procs[$child_id]['state']='DEAD'; $this->child_procs[$child_id]['killtime'] = time(); $this->send_to_child($child_id, 'DIE'); } // stop_child public function check_children() { $child_count = count($this->child_procs); $waiting = $this->waiting_count; $now = time(); foreach ($this->child_procs as $child_id => $child) { // Check that the child process actually exists $child_stat = proc_get_status($child['resource']); if ($child_stat === FALSE ) { logger("CH:$child_id no status - removing.\n"); $this->item_set_waiting($child['item_id']); unset($this->child_procs[$child_id]); $child_count--; continue; } if ($child_stat['running'] === FALSE) { if ($child['state'] != 'DEAD') logger("CH:$child_id No longer running - removing.\n"); $this->item_set_waiting($child['item_id']); proc_close($child['resource']); unset($this->child_procs[$child_id]); $child_count--; continue; } // Make sure we've heard from our kids if ($now - $child['lastseen'] > (ENGINE_HEARTBEAT*3)) { if ($child['state'] == 'DEAD') { posix_kill($child['pid']); proc_close($child['resource']); unset($this->child_procs[$child_id]); } else { $this->stop_child($child_id, 'heartbeat expired'); } } switch ($child['state']) { case 'IDLE': // Kill off any excess if ($child_count > $this->min_children && --$waiting <= 0) { $this->stop_child($child_id, 'not needed'); $child_count--; } break; case 'DEAD': if ($child['killtime'] + ENGINE_DIE_TIME < $now) { logger("CH:$child_id ($child[pid]): took too long to die.\n"); proc_close($child['resource']); unset($this->child_procs[$child_id]); $child_count--; } break; }// switch state } // foreach children } public function read_children($callback_function) { $read_fds = array(); $write_fds = NULL; $except_fds = NULL; $now = time(); foreach($this->child_procs as $child_id => &$child_proc) if (is_resource($child_proc['output'])) $read_fds[] = $child_proc['output']; if (sizeof($read_fds) == 0) return FALSE; $child_had_data = FALSE; if ( ($nr = stream_select($read_fds, $write_fds, $except_fds, 0)) !== FALSE) { if ($nr == 0) return FALSE; foreach($this->child_procs AS $child_id => &$child_proc) { if ( in_array($child_proc['output'], $read_fds)) { if ( ($raw_data = fgets($child_proc['output'])) === FALSE) continue; $child_proc['lastseen'] = $now; $child_data = @unserialize($raw_data); //print_r($child_data); if (!is_array($child_data)) { // If unserialise fails, it needs to be logged logger("CH$child_id : RAW:".preg_replace('/^\d\d\:\d\d\:\d\d /','',$raw_data)); $child_had_data = TRUE; continue; } if (!array_key_exists('cmd', $child_data)) { logger("CH#$child_id: ERROR sent data with no cmd."); $child_had_data = TRUE; continue; } switch($child_data['cmd']) { case 'HEARTBEAT': $child_had_data = TRUE; break; case 'START': if ($child_proc['state'] != 'STARTING') { logger("CH$child_id ($child_proc[pid]): sending START after starting.\n"); } else { if (array_key_exists('pid', $child_data)) { $child_proc['pid'] = $child_data['pid']; $child_proc['state'] = 'IDLE'; logger("CH:$child_id ($child_proc[pid]): START and idle.\n"); } else { logger("CH:$child_id (unknown): ERROR: child started and did not return PID.\n"); } } $child_had_data = TRUE; break; case 'DEBUG': if (array_key_exists('msg', $child_data)) { logger("CH:$child_id ($child_proc[pid]): DEBUG\n"); foreach ($child_data['msg'] as $line) logger(" $line\n"); } else logger("CH:$child_id ($child_proc[pid]): got DEBUG with no message\n"); $child_had_data = TRUE; break; case 'LOGGER': if (array_key_exists('msg', $child_data)) { $msg = stripslashes($child_data['msg']); logger("CH:$child_id ($child_proc[pid]): $msg\n"); } else logger("CH:$child_id ($child_proc[pid]): logger called with no msg.\n"); $child_had_data = TRUE; break; case 'ERROR': if (array_key_exists('msg', $child_data)) logger("CH$child_id ($child_proc[pid]): ERROR: \"$child_data[msg]\"\n"); else logger("CH$child_id ($child_proc[pid]): got error \"unknown error\"\n"); $child_had_data = TRUE; break; default: call_user_func_array($callback_function,array(&$this, $child_id, $child_data)); $child_had_data = TRUE; break; }// case }//child output inarry }//foreach }//nr not false return $child_had_data; } // read_children() /* * work_children * * Check the current items we have and send jobs to idle children */ function work_children() { $worked_child=FALSE; if ($this->waiting_count == 0) return FALSE; foreach ($this->waiting_items as $item_id => &$item) { $found_idle_child=FALSE; foreach($this->child_procs as $child_id => &$child) { if ($child['state'] != 'IDLE') continue; $found_idle_child=TRUE; $worked_child=TRUE; $child['state'] = 'BUSY'; $child['item_id'] = $item_id; $item['child_id'] = $child_id; $item['tries']++; $item['poll_time'] = time(); $this->item_set_polling($item_id); logger("PAR: Child $child_id was idle, working on item $item_id Try $item[tries]\n"); $this->send_to_child($child_id, 'POLL',$item); break; }// foreach child if ($found_idle_child === FALSE) return $worked_child; // no point looping when everyone is busy }//foreach waiting items return $worked_child; }//work_children public function print_status() { $child_count = array('starting'=>0, 'idle'=>0, 'busy'=>0,'dead'=>0, 'other'=>0, 'total'=>0 ); logger('PAR: Items Waiting/Polling=Total: '. $this->waiting_count.'/'.$this->polling_count."\n"); foreach($this->child_procs as $child) { $child_count['total']++; switch($child['state']) { case 'STARTING': $child_count['starting']++; break; case 'IDLE': $child_count['idle']++; break; case 'BUSY': $child_count['busy']++; break; case 'DEAD': $child_count['dead']++; break; default: $child_count['other']++; break; } } logger('PAR: Childn Min/Max Idl/Bsy/Srt/Ded/Otr=Tot: '. $this->min_children.'/'. $this->max_children.' '. "$child_count[idle]/$child_count[busy]/$child_count[starting]/$child_count[dead]/$child_count[other]=$child_count[total]\n"); } //children_print_status() // Returns the item ID public function child_done_job($child_id) { if (array_key_exists($child_id, $this->child_procs)) { $item_id = $this->child_procs[$child_id]['item_id']; $this->item_set_done($item_id); $this->child_procs[$child_id]['state'] = 'IDLE'; $this->child_procs[$child_id]['item_id']=FALSE; return $item_id; } logger("** ERROR ** child_done_job(): Child ID $child_id not found.\n"); return FALSE; } // child_done_job public function child_notdone_job($child_id) { if (array_key_exists($child_id, $this->child_procs)) { $child = $this->child_procs[$child_id]; $item_id = $child['item_id']; logger("CH:$child_id (): ** ERROR ** failed to process item $item_id.\n"); $this->item_set_waiting($item_id); $this->child_procs[$child_id]['state'] = 'IDLE'; $this->child_procs[$child_id]['item_id'] = FALSE; return $item_id; } logger("CH: $child_id(): ** ERROR ** child_notdone_job(): Child ID $child_id not found.\n"); return FALSE; } // child_notdone_job() ############################################################ # # Private methods private function start_child() { global $Config; $command = $Config->get('php_executable').' -q '.CHILD_FILE.' '.ENGINE_HEARTBEAT; if ($Config->get('os_type') == 'unix') $command = 'exec '. $command; // exec means replace the shell $res = proc_open($command, array(0=> array('pipe','r'), 1=>array('pipe','w')), $pipes); sleep(1); if (is_resource($res)) { stream_set_blocking($pipes[1], false); $child = array('resource'=>$res, 'input'=>$pipes[0], 'output'=>$pipes[1], 'state'=>'STARTING','lastseen'=>time(),'pid'=>-1); return $child; } return FALSE; } //start_child() private function send_to_child($child_id, $cmd, $args=array()) { $args['cmd'] = $cmd; $msg = serialize($args)."\n"; $msglen = strlen($msg); if ( fwrite($this->child_procs[$child_id]['input'], $msg, $msglen) != $msglen) logger("CH:$child_id(): ** ERROR ** Parent unable to send message to child.\n"); fflush($this->child_procs[$child_id]['input']); } } //class ?> jffnms-0.9.3/engine/backends/0002755000175000017500000000000011734571777015362 5ustar csmallcsmalljffnms-0.9.3/engine/backends/no_backend.php0000644000175000017500000000037311466135155020143 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function backend_no_backend($options,$result) { return 0; } ?> jffnms-0.9.3/engine/backends/rrd.php0000644000175000017500000000600411732226143016636 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function backend_rrd($options,$result) { jffnms_load_api('rrdtool'); global $Config; global $poller_buffer; $Interfaces = new JffnmsInterfaces(); $ret = -1; $filename = $Config->get('rrd_real_path').'/interface-'.$options['interface_id'].'.rrd'; $type_info = $Interfaces->get_type_info($options['interface_id']); //RRD File Creation if ($type_info['rrd_mode']==1) //one file if (file_exists($filename)==FALSE) $ret = rrdtool_create_file($filename,$type_info['rrd_structure_def'],$type_info['rrd_structure_rra'], $type_info['rrd_structure_res'],$type_info['rrd_structure_step']); if ($type_info["rrd_mode"]==2) //multiple files { $rrd_struct = explode (' ',$type_info['rrd_structure_def']); foreach ($rrd_struct as $dsn=>$data) { $filename_ds = str_replace(".rrd","-$dsn.rrd",$filename); $aux = explode(':',$data); $aux[1]='data'; if (file_exists($filename_ds)==FALSE) $ret = rrdtool_create_file($filename_ds,join(':',$aux),$type_info['rrd_structure_rra'], $type_info['rrd_structure_res'],$type_info['rrd_structure_step']); } } $dss = $Interfaces->parse_rrd_structure ($type_info['rrd_structure_def']); $num_ds = count($dss); if ( $ret == 0 ) { $err = rrdtool_error(); logger( "RRD error: $err",0); return 0; } else { // RRD File update $output = array(); $rrd_options[0] = 'N'; if ($options['backend_parameters']=='*') //ALL DS's { foreach ($dss as $ds_name=>$ds_number) { $buffer_name = "$ds_name-".$options["interface_id"]; if (isset($poller_buffer[$buffer_name])) $rrd_options[$ds_number+1] = $poller_buffer[$buffer_name]; } } else { //only one DS if ($type_info['rrd_mode']==1) //all DS's on the same file sleep(1); //to avoid errors $rrd_options[$dss[$options['poller_name']]+1] = $result; } for ($i = 1; $i < $num_ds+1; $i++) if (!isset($rrd_options[$i]) || !is_numeric($rrd_options[$i])) //if its not valid $rrd_options[$i]='U'; //Put in NaN if ($type_info['rrd_mode']==1) //all DS's on the same file { $ret = rrdtool_update($filename,join (':',$rrd_options)); $output[] = 'ALL='.join (':',$rrd_options); } if ($type_info['rrd_mode']==2) //only one DS by file { $ds_names = array_keys($dss); for ($dsn = 0; $dsn < $num_ds; $dsn++) if (is_numeric($rrd_options[$dsn+1])) //if there is a value { $filename_ds = str_replace('.rrd',"-$dsn.rrd",$filename); $ret = rrdtool_update($filename_ds,$rrd_options[0].':'.$rrd_options[$dsn+1]); $output[] = $ds_names[$dsn].':'.$rrd_options[$dsn+1]; } unset ($ds_names); } if ( $ret == 0 ) logger( 'RRD error: '.rrdtool_error(),0); return join(' - ',$output); } } ?> jffnms-0.9.3/engine/backends/db.php0000644000175000017500000000263511466134733016451 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ // Allows changes to the DB based on the result, // paramters expected like db_field,down=1|up=2,0 // so if result = down, and the actual value is not 0, db_field will be set to 1 function backend_db ($options,$poller_result) { $Interfaces = new JffnmsInterfaces(); $db_value = ''; $id = $options['interface_id']; list($field,$aux_options,$skip_value) = explode (',',$options['backend_parameters']); if (!empty($aux_options)) //if we have options { $aux_options = explode ('|',$aux_options); foreach ($aux_options as $aux_option) { list ($key,$value) = explode ('=',$aux_option); if ($key==$poller_result) $db_value = $value; } } else //if we don't have options, then use the result value to modify the db $db_value = $poller_result; if (!empty($db_value) && (empty($skip_value) || ($options[$field]!=$skip_value))) //if we have a value to use and the old value is not the skip { if (!isset($options[$field]) || ($options[$field]!=$db_value)) //if the value is different than the old value $result = $Interfaces->update($id,array($field=>$db_value)); //update the db else $result = 0; //already modified } else $result = -1; //not modified return $result; } ?> jffnms-0.9.3/engine/backends/verify_interface_number.php0000644000175000017500000000143711530371370022747 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function backend_verify_interface_number($options,$result) { $Interfaces = new JffnmsInterfaces(); $ints = $Interfaces->values($options['interface_id'],array('ftype'=>3)); //get the index field $index_field = key(current($ints['values'])); if (($result!=$options[$index_field]) && (!empty($result)) && ($result!='-1')) //if valid result and result different than older value { $data = array($index_field=>$result); $Interfaces->update($options['interface_id'],$data); return "$index_field changed ".$options[$index_field]." -> ".$result; } return "$index_field not changed"; } ?> jffnms-0.9.3/engine/backends/event.php0000644000175000017500000000170511466147450017202 0ustar csmallcsmall Erno Rigo * This program is licensed under the GNU GPL, full terms in the LICENSE file * * Unconditionally inserts an event based on parameters. */ function backend_event($params, $dummy) { $Events = new JffnmsEvents(); $event_type_id = $params['backend_parameters']; if ($params['host_id'] == 1) $params['info'] .= ' From: '.$params['host_ip']; //record the HostIP in the info field if (empty($params['username'])) $params['username'] = $params['receiver_command']; if (!array_key_exists('interface', $params)) $params['interface'] = ''; if (!array_key_exists('status', $params)) $params['status'] = ''; $event_id = $Events->add($params['date'], $event_type_id, $params['host_id'], $params['interface'], $params['status'], $params['username'], $params['info'], $params['referer'], 1); return "Inserted Event ID ".$event_id; } ?> jffnms-0.9.3/engine/backends/buffer.php0000644000175000017500000000123611500034724017315 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //Temp store the results so other backend or poller can use them (probably the rrd backend) function backend_buffer($options,$result) { global $poller_buffer; if (!empty($option['backend_parameters'])) $buffer_name = $options['backend_parameters']; else $buffer_name = $options['poller_name'].'-'.$options['interface_id']; if (!array_key_exists($buffer_name, $poller_buffer)) $poller_buffer[$buffer_name] = $result; return count($poller_buffer); } ?> jffnms-0.9.3/engine/backends/multi_buffer.php0000644000175000017500000000132511466744676020557 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //Temp store the results so other backend or poller can use them (probably the rrd backend) function backend_multi_buffer($options,$result) { global $poller_buffer; $var_names = explode (',',$options['poller_name']); $values = explode ('|',$result); foreach ($var_names as $key=>$name) { $buffer_name = $name.'-'.$options['interface_id']; if (!array_key_exists($buffer_name, $poller_buffer) && !empty($values[$key])) $poller_buffer[$buffer_name] = $values[$key]; } return count($poller_buffer); } ?> jffnms-0.9.3/engine/backends/alarm.php0000644000175000017500000000721011716447477017164 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ // backend_parameters = EventTypeId (to generate the alarm),[alarm_state|nothing] (if result is empty what to use), time_wait (seconds to wait before between down and up events function backend_alarm($options,$alarm_description) { $Alarms = new JffnmsAlarms(); $Events = new JffnmsEvents(); $event_info = ''; if (is_string($alarm_description)) // This is used with the pollers { //if we recieved an | in the result, parse it to use the right part as th event_info for the new event if (strpos($alarm_description,'|')!==FALSE) list ($alarm_description,$event_info) = explode ('|',$alarm_description); if (strpos($alarm_description,';')!==FALSE) list ($alarm_description,$event_info) = explode (';',$alarm_description); } else { // this is used by the trap system if (array_key_exists('status', $options)) $alarm_description = $options['status']; if (array_key_exists('info', $options)) $event_info = $options['info']; } // Parse paramters $backend_params = explode(',',$options['backend_parameters']); $event_type_id = $backend_params[0]; if (array_key_exists(1, $backend_params)) $assume = $backend_params[1]; else $assume = ''; if (array_key_exists(2, $backend_params)) $time_wait = $backend_params[2]; else $time_wait = 60; if (empty($alarm_description)) //if no result { if (empty($assume)) //and assume is not set $alarm_description = 'down'; //assume 'down' else if ($assume!='nothing') $alarm_description = $assume; //assume that as the result } $alarm_state = $Alarms->lookup($alarm_description); //get the internal state from the descriptive name (closed => ALARM_DOWN) if ($event_type_id && $alarm_state) { $now = time(); $now_date = (isset($options['date'])?$options['date']:date('Y-m-d H:i:s',$now)); // use date set in the params (traps), or now $processed = 0; $other_alarm = $Alarms->status($options['interface_id'],$event_type_id,array(ALARM_DOWN,ALARM_TESTING)); //var_dump($other_alarm); if ($alarm_state == ALARM_ALERT) //I got an ALERT result, then create the alert event $processed = 1; if (($alarm_state == ALARM_UP) && ($other_alarm['count'] > 0)) //I got an UP and there was a down event, update it { $start_date_unix = strtotime($other_alarm['alarm']['start_date']); $date_aux = $start_date_unix+$time_wait; //logger("Verify: $start_date_unix + 3min = $date_aux - now: ".time()."\n"); if ($now > $date_aux )//if it has 3 minutes down, for not colliding with the consolidate events $processed = 1; } //FIXME Detect flapping, I got an UP 3 minutes after the DOWN } if ((($alarm_state == ALARM_DOWN) || ($alarm_state == ALARM_TESTING)) && (($other_alarm['count']==0) || ($other_alarm['alarm']['alarm_state']!=$alarm_state))) { //we got a down/testing, and there is not another event or the event found is the NOT same as this one, then add it if ($alarm_state == ALARM_TESTING) $event_info = '(looped)'; $processed = 1; } if (array_key_exists('poller_name', $options)) $poller_name = $options['poller_name']; else $poller_name = ''; if ($processed==1) { $event_id = $Events->add($now_date,$event_type_id,$options['host_id'],$options['interface'],$alarm_description,$poller_name,$event_info,0,0); return "Event Added: $event_id"; } return "Nothing was done"; } ?> jffnms-0.9.3/engine/handlers/0002755000175000017500000000000011716447477015407 5ustar csmallcsmalljffnms-0.9.3/engine/handlers/none.inc.php0000644000175000017500000000046711716447477017634 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //Data comes as a reference to real data function handler_none ($id, $data = NULL, $old_data = NULL) { } ?> jffnms-0.9.3/engine/handlers/tcp_ports.inc.php0000644000175000017500000000243511533562514020672 0ustar csmallcsmall JFFNMS Authors * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //Data comes as a reference to real data function handler_tcp_ports ($id, $data, $old_data) { $i=0; $Interfaces = new JffnmsInterfaces(); $port = (!empty($data['port'])?$data['port']:$old_data['port']); $aux_interface_name = "Port $port"; $data['port']=$port; //Duplicate avoidance Logic (because of manual add) if ($old_data['port']!=$port) { //if the user is trying to change the port number if ($id!==false) { $aux = current($Interfaces->get_all($id)); //Get the Host ID of the interface $host_id = $aux["host"]; unset ($aux); } else $host_id = 1; $exists = 1; while ($exists > 0) { $ids = $Interfaces->get_all(NULL,array("host"=>$host_id,"interface"=>$aux_interface_name)); unset ($ids[$id]); //remove my id from the list $exists = count($ids); if ($exists > 0) { //if we've any record with this interface name already, then add an identifier $data["port"] = $port." ".$i++; //changes the record $aux_interface_name = "Port ".$data["port"]; } } } $data["interface"] = $aux_interface_name; } ?> jffnms-0.9.3/engine/handlers/rrd_ds.inc.php0000644000175000017500000000074511716447477020151 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //Values comes as a reference to real data function handler_rrd_ds ($name, $value) { if ($value["auto_max"]==1) $value["max"]="<".$value["max_field"].">"; if (empty($value["min"])) $value["min"] = 0; $value = "DS:$name:".$value["type"].":600:".$value["min"].":".$value["max"]; } ?> jffnms-0.9.3/engine/handlers/bool.inc.php0000644000175000017500000000050511716447477017621 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //Values comes as a reference to real data function handler_bool ($name, $value) { if (empty($value)) $value = 0; } ?> jffnms-0.9.3/engine/poller.php0000644000175000017500000002363111734601375015605 0ustar csmallcsmallwaiting_count == 0 && $last_interface_get + $poll_interval < $loop_start_time) { $hosts_lpd_updated = FALSE; // Collect all the interfaces we want to poll in this loop list($polled_hosts, $new_interfaces) = poller_get_interfaces($opt_host, $poll_interval); poller_update_hosts_lpd($polled_hosts, 0); $Parent->items_new($new_interfaces); $last_interface_get = $loop_start_time; $start_count = $Parent->waiting_count; logger("ITEMS Added $start_count items\n"); } $Parent->check_children(); $Parent->item_check_poll_time(); $Parent->children_start(); poller_read_children($Parent); $Parent->work_children(); $Parent->print_status(); $loop_time = time() - $loop_start_time; if ($loop_time > $poll_interval) logger("ERROR Polling loop took $loop_time seconds, poll interval is $poll_interval\n"); if ($Parent->waiting_count == 0 && $Parent->polling_count == 0) { // Done all the current polling if ($opt_once && count($Parent->child_procs) == 0) break; } if ($loop_time < ENGINE_HEARTBEAT) { if ($Parent->polling_count > 0 || ($Parent->polling_count==0 && $Parent->waiting_count==0 && $opt_once) ) sleep(1); else sleep(ENGINE_HEARTBEAT - $loop_time); } }// while true } // Read all the children's chatter function poller_read_children(&$Parent) { $read_timeout = max(time() + ENGINE_HEARTBEAT/$Parent->max_children,2); while (time() < $read_timeout) if ($Parent->read_children('poller_read_callback') == FALSE) return; } function poller_read_callback(&$Parent, $child_id, $child_data) { switch($child_data['cmd']) { case 'DONE': $item_id = $Parent->child_done_job($child_id); if ($item_id !== FALSE) poller_set_interface_lpd($item_id); break; case 'NOTDONE': $Parent->child_notdone_job($child_id); break; } } function parse_commandline() { global $opt_host, $opt_interface, $opt_once, $opt_children, $opt_force; $num_params = $GLOBALS['argc']-1; $longopts = array( 'help', 'version', 'host:', 'children:', 'interface:', 'once', 'force'); if ( ($opts = getopt('c:h:i:oFVH', $longopts)) === FALSE) { return; } foreach ($opts as $opt => $opt_val) { switch ($opt) { case 'children': case 'c': $num_params-= 2; $opt_children=$opt_val; break; case 'force': case 'F': $num_params-= 1; $opt_force = TRUE; $opt_once = TRUE; break; case 'host': case 'h': $num_params-= 2; $opt_host = $opt_val; if (!is_numeric($opt_host)) print_help('host id option must be numeric'); break; case 'interface': case 'i': $num_params-= 2; $opt_interface = $opt_val; if (!is_numeric($opt_interface)) print_help('interface ID option must be numeric'); break; case 'once': case 'o': $num_params-= 1; $opt_once = TRUE; break; case 'help': case 'H': print_help(); break; case 'version': case 'V': print_version(); }// switch }//for if ($num_params > 0) print_help('Problem with command line options.'); } function print_help($errmsg = FALSE) { if ($errmsg) print "$errmsg\n"; print $_SERVER['SCRIPT_NAME'] . ' [options] -c, --children # Fork with this number of child processes -h, --host Poll all interfaces for host -i, --interface Poll interface only -o, --once Poll once and then exit -F, --force Force polling, implies --once -H, --help Print this help -V, --version Print version information '; die; } /* * Returns: list of interfaces, with dmii ones ordered first */ function poller_get_interfaces($host_id, $poll_interval) { global $opt_interface, $opt_force; $Interfaces = new JffnmsInterfaces(); $Maps = new JffnmsMaps(); if ($opt_interface) $where_intid = " interfaces.id=$opt_interface "; else $where_intid = ' interfaces.id > 1'; if (!$opt_force) { $poll_time = time() + $poll_interval; $where_polltime = ' AND ((hosts.last_poll_date + hosts.poll_interval) < \''.$poll_time.'\') AND ( (interfaces.poll_interval = 0 AND (interfaces.last_poll_date + hosts.poll_interval) < '.$poll_time.') OR ( (interfaces.last_poll_date + interfaces.poll_interval) < '.$poll_time.') )'; } else $where_polltime = ''; $int_query = ' SELECT interfaces.id AS interface_id, interfaces.interface, interfaces.poll AS poller_group, interfaces.check_status, interfaces.show_rootmap, hosts.id AS host_id, hosts.ip AS host_ip, hosts.rwcommunity, hosts.rocommunity, hosts.dmii, hosts.sysobjectid FROM interfaces, hosts WHERE '.($host_id===FALSE?'':"hosts.id=$host_id AND ").' interfaces.host = hosts.id AND hosts.id > 1 AND hosts.poll = 1 AND '.$where_intid.' AND interfaces.poll > 1' . $where_polltime . ' ORDER BY interfaces.last_poll_date ASC'; $int_result = db_query($int_query) or die ('Query failed - poller_get_interfaces() - '.db_error()); $dmii_interfaces = array(); $dmii_maps = array(); $candidate_interfaces = array(); while ($row = db_fetch_array($int_result)) { $id = $row['interface_id']; $candidate_interfaces[$id] = array( 'interface_id' => $row['interface_id'], 'interface' => $row['interface'], 'poller_group' => $row['poller_group'], 'show_rootmap' => $row['show_rootmap'], 'host_id' => $row['host_id'], 'host_ip' => $row['host_ip'], 'rw_community' => $row['rwcommunity'], 'ro_community' => $row['rocommunity'], 'sysobjectid' => $row['sysobjectid'], 'check_status' => $row['check_status'], 'tries' => 0, 'is_dmii' => FALSE, 'dmii_up' => 1 ); if (($row['dmii'] != '1') && preg_match('/^(MI)(\d+)$/',$row['dmii'], $regs)) { if ($regs[1] == 'I') { if (!array_key_exists($regs[2], $dmii_interfaces)) $dmii_interfaces[$regs[2]] = $Interfaces->is_up($regs[2]); $candidate_interfaces[$interface_id]['dmii_up'] = $dmii_interfaces[$regs[2]]; } elseif ($regs[1] == 'M') { if (!array_keys_exists($regs[2], $dmii_maps)) $dmii_maps[$regs[2]] = !($Maps->status_all_down($Interfaces, $regs[2])); $candidate_interfaces[$interface_id]['dmii_up'] = $dmii_maps[$regs[2]]; } } }//while $polling_interfaces = array(); // DMII interfaces are always polled foreach ($dmii_interfaces as $dmii_id => $dmii_status) if (!array_key_exists($dmii_id, $polling_interfaces)) $polling_interfaces[$dmii_id] = $candidate_interfaces[$dmii_id]; // Interfaces in a DMII map are always polled foreach ($dmii_maps as $dmii_map_id => $dmii_status) { $dmii_map_interfaces = poller_get_map_interface_ids($dmii_map_id); foreach($dmii_map_interfaces as $dmii_id) if (!array_key_exists($dmii_id, $polling_interfaces)) $polling_interfaces[$dmii_id] = $candidate_interfaces[$dmii_id]; } // Finally, all candidate interfaces with their host dmii up are polled foreach ($candidate_interfaces as $cand_id => $cand_data) if ($cand_data['dmii_up'] == 1 && !array_key_exists($cand_id, $polling_interfaces)) $polling_interfaces[$cand_id] = $cand_data; // Scan all interfaces to find polling hosts $polling_hosts = array(); reset($polling_interfaces); foreach ($polling_interfaces as $int_id => $int_data) if (!array_key_exists($int_data['host_id'], $polling_hosts)) $polling_hosts[$int_data['host_id']] = FALSE; return array($polling_hosts, $polling_interfaces); } function poller_set_interface_lpd($interface_id) { global $opt_force; if (!$opt_force) db_update('interfaces', $interface_id, array('last_poll_date' => time())); } function poller_update_hosts_lpd($hosts, $poll_time) { global $opt_force; if ($opt_force || count($hosts) == 0) return; $host_ids = join(',', array_keys($hosts)); $now = time(); $lpd_query = 'UPDATE hosts ' . "SET last_poll_date = '$now', " . "last_poll_time = '$poll_time' " . "WHERE id IN ($host_ids)"; db_query($lpd_query) or die ("Query failed - poller_update_hosts_lpd() - ".db_error()); logger("LPD: Updated hosts ($host_ids) to LPD $now\n"); } function poller_get_map_interface_ids($dmii_map_id) { $ids = array(); $query = "SELECT interface FROM maps_interfaces WHERE map='$dmii_map_id'"; if ( ($result = db_query($query)) === FALSE) return $ids; if (db_num_rows($result) == 0) return $ids; while ($row = db_fwtch_array($result)) $ids[] = $row['interface']; return $ids; } jffnms-0.9.3/engine/tmpwatch.sh0000644000175000017500000000104011377440254015750 0ustar csmallcsmall#!/bin/sh basedir=$1; hours="24"; dirs="$basedir/../htdocs/images/temp $basedir/temp $basedir/../logs"; tmpwatch="tmpwatch" #default location tmpwatch_locations="/usr/sbin/tmpwatch /usr/local/sbin/tmpwatch"; for AUX in $tmpwatch_locations; do if [ -f $AUX ]; then tmpwatch=$AUX fi done; tmpwatch_cmd="$tmpwatch -c -f $hours"; for DIR in $dirs do echo -n "Cleaning $hours hs. old files in $DIR ..."; if [ -d "$DIR" ]; then $tmpwatch_cmd $DIR touch $DIR/.check echo "done."; else echo "error."; fi done jffnms-0.9.3/engine/nad_child.php0000644000175000017500000000435211526136267016216 0ustar csmallcsmallFALSE, 'pipes'=>array()); $heartbeat = $argv[1]; if (empty($heartbeat)) die ("No heartbeat given.\n"); nad_child_main_loop($heartbeat); function nad_child_main_loop($heartbeat) { $fp = fopen('php://stdin', 'r'); stream_set_blocking($fp, false); if ( ($pid = getmypid()) === FALSE) die("getmypid() returned false"); child_send_array('START', array('pid'=> $pid)); $old_time = 0; while(TRUE) { //child_send_pong(); $read_fds = array($fp); $write_fds = NULL; $except_fds = NULL; $nr = stream_select($read_fds, $write_fds, $except_fds, 1); if ($nr === FALSE) { child_send_error("Child process had error on select.\n"); continue; } if ($nr == 0) { $old_time = check_heartbeat($old_time, $heartbeat); continue; } $line = fgets($fp,4096); $params = unserialize($line); if (!is_array($params)) { logger("Received bad line from parent, not an array\n"); continue; } if (!array_key_exists('cmd', $params)) { logger("Recieved array from parent with no cmd field.\n"); continue; } switch($params['cmd']) { case 'DIE': die(); break; case 'DISCOVER': if (child_discover_network($params) === TRUE) child_send_array('DONE'); else child_send_array('NOTDONE'); break; default: logger("Received unknown command '".$params['cmd']."'\n"); }//switch cmd $old_time = check_heartbeat($old_time, $heartbeat); } } function child_discover_network($params) { return TRUE; } function nmap_pipe ($target, $data) { global $Config; if (!is_resource($nmap_pipes['res'])) { $nmap_pipes['res'] = proc_open( $Config->get('nmap_executable') . ' -sP -PB --randomize_hosts -T3 -iL - -oG -', array(0=>array('pipe','r'), 1=>array('pipe','w'), 2=>array('pipe','r')), $nmap_pipes['pipes']); fwrite($nmap_pipes['pipes'][0], $target."\n"); fclose($nmap_pipes['pipes'][0]); } if (false !== ($ret = fgets($nmap_pipes["pipes"][1]))) if ($ret != "# Nmap run completed") return rtrim($ret,"\n"); $nmap_pipes['res']=FALSE; return false; } jffnms-0.9.3/engine/common_child.inc.php0000644000175000017500000000527511726370003017507 0ustar csmallcsmallheartbeat = $argv[1]; if (empty($this->heartbeat)) die ("No heartbeat given on command line.\n"); $this->stdin = fopen('php://stdin', 'r'); $this->stdout = fopen('php://stdout', 'w'); stream_set_blocking($this->stdin, 0); stream_set_blocking($this->stdout, 0); if ( ($pid = getmypid()) === FALSE) die('getmypid() returned FALSE'); $this->send_array('START', array('pid'=>$pid)); } public function send_array($cmd, $args=array()) { $args['cmd'] = $cmd; $msg = serialize($args)."\n"; $msglen = strlen($msg); if ( fwrite($this->stdout, $msg, $msglen) != $msglen) die("Cannot write message to parent.\n"); fflush($this->stdout); } public function debug($item) { $debug_msg = explode("\n", print_r($item, TRUE)); $this->send_array("DEBUG",array('msg'=>$debug_msg)); } public function logger($msg) { $this->send_array('LOGGER', array('msg'=>addslashes(rtrim($msg)))); } public function send_error($msg) { $this->send_array('ERROR', array('msg'=>rtrim($msg))); } public function check_heartbeat($old_time) { if ( ($old_time + $this->heartbeat) < time()) { $this->send_array('HEARTBEAT'); $old_time = time(); } return $old_time; } // check_heartbeat /* * returns TRUE if found FALSE if not */ public function require_file($filename, $command) { if (array_key_exists($filename,$this->included_files)) return $this->included_files[$filename]; if (!is_readable($filename)) { logger("ERROR: $filename is not readable",0); $this->included_files[$filename] = FALSE; return FALSE; } require_once($filename); if (!function_exists($command)) { $this->included_files[$filename] = FALSE; logger("ERROR: Command '$command' not found in file '$filename'.\n",0); return FALSE; } $this->included_files[$filename] = TRUE; return TRUE; } // require_file } // class JffmnsEngineChild function child_debug($item) { global $Child; $Child->debug($item); } ?> jffnms-0.9.3/engine/trap_receiver.php0000644000175000017500000000521311533422704017130 0ustar csmallcsmall Aaron Daubman * Copyright (C) <2003> Craig Small * Copyright (C) <2002> Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ /* NOTES - To receive traps: * snmptrapd.conf: * traphandle default cd /opt/jffnms/engine && php -q trap_receiver.php * command-line: * snmptrapd needs to have the -On option turned on to make numeric * OIDs, the rest doesn't matter too much. */ # Number of seconds to detect duplicate traps define('TRAP_DUPLICATE_WINDOW', 5); require_once('../conf/config.php'); $Config = new JffnmsConfig(); config_load_libs('basic', 0); receive_trap(); function receive_trap() { $hostname = trim(fgets(STDIN,4096)) or die('Could not get hostname'); $line = trim(fgets(STDIN,4096)) or die('Could not get IP'); $ipaddr = parse_ipaddr($line); $uptime = trim(fgets(STDIN,4096)) or die('Could not get uptime'); $trapoid = fgets(STDIN,4096) or die("Could not get trapoid"); $trapoid = preg_replace('/^\S+\s+(\S+)\s*$/', '$1', $trapoid); if (trap_duplicate($trapoid)) { logger("T --:= @$uptime - ip: $ipaddr oid: $trapoid (duplicate)\n"); return; } $varbinds = array(); $varbind_text = ''; $linenum=0; while($line=trim(fgets(STDIN,4096))) { $linenum++; if (preg_match ("/^(\S+)\s+=?\s?\"?([^\" \t]+)\"?$/", $line, $matches)) { $varbinds[$matches[1]] = $matches[2]; $varbind_text .= " L$linenum: $matches[1] ==> $matches[2]\n"; } else $varbind_text .= " L$linenum: (no match) $line\n"; } // Insert into database: $trap_id = db_insert ('traps',array('date'=>time(), 'ip'=>$ipaddr, 'trap_oid'=>$trapoid)); $oidid = 1; foreach ($varbinds as $varbind_oid =>$varbind_value) db_insert('traps_varbinds', array( 'trapid'=>$trap_id, 'oidid'=>$oidid++, 'trap_oid'=>$varbind_oid, 'value'=>$varbind_value)); db_close(); logger("T $trap_id:= @$uptime - ip: $ipaddr oid: $trapoid\n$varbind_text\n"); } function trap_duplicate ($current_oid) { $trap_query = "SELECT id FROM traps WHERE trap_oid = '$current_oid' AND date > ". (time()-TRAP_DUPLICATE_WINDOW)." ORDER BY id desc"; $trap_result = db_query($trap_query) or die ('Query failed - trap_duplicate() - '.db_error()); if (db_num_rows($trap_result) > 0) return TRUE; return FALSE; } function parse_ipaddr($text) { if (preg_match('/^UDP: \[(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\]/', $text, $regs)) return $regs[1]; return gethostbyname($ipaddr); } ?> jffnms-0.9.3/engine/poller_helper.php0000644000175000017500000000325311430742271017134 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ $jffnms_functions_include="engine"; include_once("../conf/config.php"); $poller_helper_time = time_usec(); $my_sat_id = satellite_my_id(); $jffnms_poller_command = "poller.php"; $query_hosts="SELECT * FROM hosts WHERE id > 1 AND poll > 0 AND satellite = $my_sat_id"; $result_hosts = db_query ($query_hosts) or die ("Query failed - R2 - ".db_error()); while ($host = db_fetch_array($result_hosts)) { $host_id = $host["id"]; // Poll DMIIs // ---------- if ($host["dmii"]!=1) { logger(" : H ".str_pad($host["id"],3," ",STR_PAD_LEFT)." : Polling DMIIs.\n"); spawn ("$php_executable -q poller.php","$host_id dmii",1); sleep(2); } // Poll Alarmed Interfaces // ----------------------- $alarms = alarms_list(0,array("alarm_state"=>ALARM_DOWN,"host"=>$host["id"])); unset ($interface_id); foreach ( $alarms as $alarm ) { //get all the interface ids from this host $int = current(interfaces_list ($alarm["interface"])); if ($int["poll"] > 0) $interface_id[]=$alarm["interface"]; } if (count($interface_id) > 0) { logger( " : H ".str_pad($host["id"],3," ",STR_PAD_LEFT)." : Polling Alarmed/Down: ".count($interface_id)." Interfaces.\n"); spawn ("$php_executable -q poller.php","$host_id ".join(",",$interface_id),1); sleep(5); } } $poller_helper_time = time_usec_diff($poller_helper_time); logger(" : Poller Helper Ended, Total Time: $poller_helper_time msec.\n"); ?> jffnms-0.9.3/engine/configs/0002755000175000017500000000000011725221320015210 5ustar csmallcsmalljffnms-0.9.3/engine/configs/cisco_cc.inc.php0000644000175000017500000000315611716447477020270 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //CISCO-CONFIG-COPY-MIB Configuration Downloader Implementation //from: http://www.cisco.com/warp/public/477/SNMP/copy_configs_snmp.shtml // waiting(1), running(2), successful(3), failed(4) function config_cisco_cc_get ($ip, $rwcommunity, $server, $filename) { if ($ip && $rwcommunity && $server && $filename) { $oid = ".1.3.6.1.4.1.9.9.96.1.1.1.1"; $result = snmp_set($ip,$rwcommunity,"$oid.14.999","i",6); //destroy if ($result==true) { snmp_set($ip,$rwcommunity,"$oid.14.999","i","5"); //create and wait snmp_set($ip,$rwcommunity,"$oid.2.999","i","1"); //tftp snmp_set($ip,$rwcommunity,"$oid.3.999","i","4"); //running snmp_set($ip,$rwcommunity,"$oid.4.999","i","1"); //network snmp_set($ip,$rwcommunity,"$oid.5.999","a",$server); //server snmp_set($ip,$rwcommunity,"$oid.6.999","s",$filename); //filename snmp_set($ip,$rwcommunity,"$oid.14.999","i","1"); //activate sleep (2); $result = snmp_get($ip,$rwcommunity,"$oid.10.999"); if ($result != 4) return true; } } return false; } function config_cisco_cc_wait ($ip, $rwcommunity, $server, $filename) { $i = 1; $result = 1; $oid = ".1.3.6.1.4.1.9.9.96.1.1.1.1"; while ((($result == 1) or ($result == 2)) and ($i++ < 30)) { $result = snmp_get($ip,$rwcommunity,"$oid.10.999"); sleep(2); } if (($result == 3) or (preg_match("/^successful/",$result))) return true; return false; } ?> jffnms-0.9.3/engine/configs/cisco_catos.inc.php0000644000175000017500000000360311716447477021011 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //CISCO-STACK-MIB Configuration Downloader Implementation for CatOS (tested on 5513) //from: http://www.cisco.com/warp/public/477/SNMP/move_files_images_snmp.html //thanks to Paul Stewart from Nexicom for let me use his hardware. //tftpResult Values: (1) : inProgress, (2) : success, >= 3 Errors function config_cisco_catos_get ($ip, $rwcommunity, $server, $filename) { if ($ip && $rwcommunity && $server && $filename) { $tftpHostOID = ".1.3.6.1.4.1.9.5.1.5.1.0"; $tftpFileOID = ".1.3.6.1.4.1.9.5.1.5.2.0"; $tftpModuleOID = ".1.3.6.1.4.1.9.5.1.5.3.0"; $tftpActionOID = ".1.3.6.1.4.1.9.5.1.5.4.0"; $tftpResultOID = ".1.3.6.1.4.1.9.5.1.5.5.0"; $resultHost = snmp_set($ip,$rwcommunity,$tftpHostOID,"s",$server); //set the TFTP Server if ($resultHost==true) $resultFile = snmp_set($ip,$rwcommunity,$tftpFileOID,"s",$filename); //set the Filename if ($resultFile==true) $resultModule = snmp_set($ip,$rwcommunity,$tftpModuleOID,"i",2); //set Supervisor Module (FIXME this could change) if ($resultModule==true) $resultAction = snmp_set($ip,$rwcommunity,$tftpActionOID,"i",3); //set the action to Upload if ($resultAction==true) $result = snmp_get($ip,$rwcommunity,$tftpResultOID); //get Status of the transfer if ($result < 3) return true; } return false; } function config_cisco_catos_wait ($ip, $rwcommunity, $server, $filename) { $i = 1; $result = 1; $tftpResultOID = ".1.3.6.1.4.1.9.5.1.5.5.0"; while (($result == 1) and ($i++ < 30)) { $result = snmp_get($ip,$rwcommunity,$tftpResultOID); sleep(2); } if ($result == 2) return true; return false; } ?> jffnms-0.9.3/engine/configs/cisco_sys.inc.php0000644000175000017500000000144711716447477020522 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //OLD-CISCO-SYSTEM-MIB Configuration Downloader Implementation //from: http://www.cisco.com/warp/public/477/SNMP/11_7910.shtml function config_cisco_sys_get ($ip, $rwcommunity, $server, $filename) { if ($ip && $rwcommunity && $server && $filename) { $oid = ".1.3.6.1.4.1.9.2.1.55.$server"; $result = snmp_set($ip,$rwcommunity,$oid,"s",$filename, 4); if ($result==true) return true; } return false; } function config_cisco_sys_wait ($ip, $rwcommunity, $server, $filename) { return true; //we dont wait because the snmp_set returns when the tftp has been completed } ?> jffnms-0.9.3/engine/configs/none.inc.php0000644000175000017500000000051111716447477017452 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ //Do Nothing function hosts_config_none_get () { return NULL; } function hosts_config_none_wait () { return NULL; } ?> jffnms-0.9.3/engine/configs/alteon_webos.inc.php0000644000175000017500000000236111725217713021165 0ustar csmallcsmall Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ // agGeneral .1.3.6.1.4.1.1872.2.1.2.1 define('agTftpServer', '.1.3.6.1.4.1.1872.2.1.2.1.18.0'); define('agTftpCfgFileName', '.1.3.6.1.4.1.1872.2.1.2.1.19.0'); define('agTftpAction', '.1.3.6.1.4.1.1872.2.1.2.1.21.0'); define('cfg-get', '3'); define('agTftpLastActionStatus', '.1.3.6.1.4.1.1872.2.1.2.1.22.0'); function config_alteon_webos_get($ip, $community, $server, $filename) { if ($ip && $community && $server && $filename) { if ( snmp_set($ip, $community, agTftpServer, 's', $server) !== FALSE && snmp_set($ip, $community, agTftpCfgFileName, 's', $filename) !== FALSE && snmp_set($ip, $community, agTftpAction, 'i', 4) ) { $status = snmp_get($ip, $community, agTftpLastActionStatus); if (!preg_match('/Success"$/',$status)) { logger(" : H ??? : $ip : config_alteon_webos_get(): $status\n"); return false; } return true; } } return false; } function config_alteon_webos_wait($ip, $rwcommunity, $server, $filename) { sleep(2); return true; } // vim:et:sw=4:ts=4: ?> jffnms-0.9.3/engine/temp/0000755000175000017500000000000011377440254014537 5ustar csmallcsmalljffnms-0.9.3/engine/temp/.check0000644000175000017500000000000011377440254015603 0ustar csmallcsmalljffnms-0.9.3/engine/autodiscovery_network.php0000644000175000017500000004560411716447477021000 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ $launcher_function = "discovery_network"; $launcher_item_source = "nad_core"; $launcher_init = "nad_init"; $launcher_child_status ="nad_status"; $launcher_status = "show_networks"; $launcher_param_managed_handler = "nad_params_managed"; $refresh_items = true; $refresh_time = 10; $timeout = 60*4; //$launcher_detach = false; require ("launcher.inc.php"); //-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= function nad_load_ips() { $query_ips = "SELECT ip, type FROM nad_ips WHERE id > 1"; $result_ips = db_query ($query_ips) or die ("Query Error - ".db_error()); $ips = array(); while ($rip = db_fetch_array ($result_ips)) $ips[$rip["ip"]] = $rip["type"]; return $ips; } function ip_to_str2 ($ip_ip) { $ip_bin = decbin($ip_ip); $ip_bin = str_pad($ip_bin,32,"0",STR_PAD_LEFT); $parte1 = substr($ip_bin,0,8); $parte2 = substr($ip_bin,8,8); $parte3 = substr($ip_bin,16,8); $parte4 = substr($ip_bin,24,8); $string = bindec($parte1).".".bindec($parte2).".".bindec($parte3).".".bindec($parte4); return $string; } function str_to_ip ($strIP){ $Arr = explode (".",$strIP); return ($Arr[3] + $Arr[2] * pow(2,8) + $Arr[1] * pow(2,16) + $Arr[0] * pow(2,24)); } function ip_to_bitsmask ($mask){ $r = pow(2,32) - $mask; $ret = round (32 - (log($r + 1)/log(2))); return $ret; } function bitsmask_to_mask ($bmask) { $b = round(pow(2,32) - pow(2,32 - $bmask)); $b = ip_to_str2 ($b); return $b; } function ip_same_network ($ip1, $ip2, $mask) { $mask_bit = str_to_ip($mask); $ip1_bit = str_to_ip($ip1); $ip2_bit = str_to_ip($ip2); $net1_bit = $ip1_bit & $mask_bit; $net2_bit = $ip2_bit & $mask_bit; if ($net1_bit == $net2_bit) return true; return false; } function nad_private_net ($ip) { $private_nets = array("10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16", "127.0.0.0/8", "192.169.0.0/16"); foreach ($private_nets as $priv) { list ($private_net, $private_mask) = explode ("/", $priv); list ($net, $net_mask) = explode ("/", $ip); if ( (ip_same_network($net, $private_net, bitsmask_to_mask($private_mask))) || // base net is the same network as a private net (ip_same_network($net, "0.0.0.0", bitsmask_to_mask($net_mask))) || // base net is 0.0.0.0 (ip_same_network($net, "0.0.0.0", bitsmask_to_mask(24))) // base net is 0.0.0.0 ) return true; } return false; } function nmap_pipe ($target, &$data) { global $Config; if (!is_array($data[$target])) { $data[$target]["res"] = proc_open( $Config->get("nmap_executable"). " -sP -PB --randomize_hosts -T3 -iL - -oG -", array(0=>array("pipe","r"), 1=>array("pipe","w"), 2=>array("pipe","r")), $data[$target]["pipes"]); fwrite($data[$target]["pipes"][0], $target."\n"); fclose($data[$target]["pipes"][0]); } if (false !== ($ret = fgets($data[$target]["pipes"][1]))) if ($ret != "# Nmap run completed") return rtrim($ret,"\n"); return false; } function discovery_network ($network, $output = true) { $nad_time_start = time(); $hosts_up = 0; $hosts_unique = 0; $net_data = current(nad_load_networks($network)); if (!$output) ob_start(); logger ("N ".str_pad($net_data["id"], 4)." : ". "Scanning Network ".$network.", deep ".$net_data["deep"]."\n"); nad_network_status ($net_data["id"], 2); //Running while ($line = nmap_pipe($network, $nmap_data)) if (preg_match ("/Host\: (.*) \((.*)\).*Status\: (.*)/", $line ,$parts)) { if (!$output) launcher_heartbeat(); $host_ip = trim($parts[1]); $host_name = $parts[2]; $log = "N ".str_pad($net_data["id"], 4)." : Scanning Host ".$host_ip; $host_ip_parts = explode(".",$host_ip); if (($host_ip_parts[3]!=0) && ($host_ip_parts[3]!=255)) { if ($parts[3]=="Up") { $hosts_up++; if (array_key_exists($host_ip, nad_load_ips())==false) { $host_id = nad_add_host (); $hosts_unique++; logger ($log." Responded to Ping added as H $host_id\n"); $ip_id = nad_add_ip ($host_ip); $ips_found = discovery_host ($host_id, $host_ip, $net_data["communities"], $net_data, $ip_id); if (!$ips_found) nad_update_ip ($ip_id, $host_name, $host_id, $net_data["id"]); } else logger ($log." Already Added\n"); } else logger ($log." Down\n"); } else logger ($log." Invalid\n"); } nad_network_status ($net_data["id"], 3); //done ob_end_clean(); return array("OK", $hosts_up, $hosts_unique, time()-$nad_time_start); } function discovery_host ($host_id, $host_ip, $communities, $net, $host_ip_id) { $system_description_oid = ".1.3.6.1.2.1.1.1.0"; $system_name_oid = ".1.3.6.1.2.1.1.5.0"; $ipadent_oid = ".1.3.6.1.2.1.4.20.1.1"; $ipadentmask_oid = ".1.3.6.1.2.1.4.20.1.3"; $ipadentint_oid = ".1.3.6.1.2.1.4.20.1.2"; $inttype_oid = ".1.3.6.1.2.1.2.2.1.3"; $ipforwarding_oid = ".1.3.6.1.2.1.4.1.0"; $ipnettomedia_oid = ".1.3.6.1.2.1.4.22.1.2"; $intstatus_oid = ".1.3.6.1.2.1.2.2.1.8"; $invalid_ips = array("127.0.0.1","0.0.0.0"); if (!is_array($communities)) $communities = array(); $result = false; while ((list (, $comm) = each ($communities)) && (!$snmp_name)) if (($snmp_name = snmp_get($host_ip, $comm, $system_name_oid, 1))!==false) { $log = "N ".str_pad($net["id"], 4)." : H ".str_pad($host_id,3)." : "; logger ($log." Has SNMP $comm - $snmp_name\n"); $snmp_ips_data = snmp_walk ($host_ip, $comm, $ipadent_oid); if ($snmp_ips_data!==false) { $host_ips = array(); // Create IPs Table foreach ($snmp_ips_data as $key=>$aux_ip) { $aux_ip = trim($aux_ip); if (strpos(" ", $aux_ip)!==false) list(,$aux_ip) = explode (" ",$aux_ip); if (!in_array($aux_ip,$invalid_ips)) { if ($aux_ip!=$host_ip) // If IP is different than the host IP $ip_id = nad_add_ip($aux_ip); // Add IP to DB else $ip_id = $host_ip_id; // Use ID of the Already added IP $host_ips[$aux_ip] = array("ip_id"=>$ip_id , "pos"=>$key); //add IP to the Array } } unset ($snmp_ips_data); // Do other SNMP reads $snmp_mask_data = snmp_walk ($host_ip, $comm, $ipadentmask_oid); $snmp_int_data = snmp_walk ($host_ip, $comm, $ipadentint_oid); // Populate the IPs table with Mask and Type data foreach ($host_ips as $aux_ip=>$ipd) { if (strpos(" ", $aux_mask)!==false) list(,$aux_mask) = explode (" ",$snmp_mask_data[$ipd["pos"]]); else $aux_mask = $snmp_mask_data[$ipd["pos"]]; if (empty($aux_mask)) $aux_mask = "255.255.255.0"; // Fix for broken IP-MIB implementations $if_index = $snmp_int_data[$ipd["pos"]]; list(,$if_status) = split("[()]",snmp_get($host_ip, $comm, $intstatus_oid.".".$if_index)); //$if_status = 1; if ($if_status == 1) { // Its UP unset ($if_type); list(,$if_type) = split("[()]",snmp_get($host_ip, $comm, $inttype_oid.".".$if_index)); $host_ips[$aux_ip]["mask"] = $aux_mask; $host_ips[$aux_ip]["type"] = $if_type; } else { // Its Down nad_del_ip($host_ips[$aux_ip]["ip_id"]); // Delete the IP from the DB unset ($host_ips[$aux_ip]); // remove it from the list used to add networks } } unset ($snmp_mask_data); unset ($snmp_int_data); // Add other IP addresses based on the ARP table (mine not remote) $snmp_physical = snmp_walk ($host_ip, $comm, $ipnettomedia_oid, 1); if ($snmp_physical != false) { $snmp_net_to_media = array(); // Make Net-To-Media Table foreach ($snmp_physical as $k=>$aux_mac) { $k = explode (".",$k); $aux_ip = join(".",array_slice($k,count($k)-4,4)); $snmp_net_to_media[$aux_ip]=$aux_mac; $snmp_media_to_net[$aux_mac][]=$aux_ip; } unset ($snmp_physical_data); // Find out if there are others ips on the same network with my IP's MAC address (more than 1 IP on the same network) // And add it to the IPs list foreach ($host_ips as $ip=>$ipd) if (array_key_exists($ip, $snmp_net_to_media)) foreach ($snmp_media_to_net[$snmp_net_to_media[$ip]] as $new_ip) if (!array_key_exists($new_ip,$host_ips) && ip_same_network($ip, $new_ip, $ipd["mask"])) { $host_ips[$new_ip] = $ipd; //copy the other type and mask $host_ips[$new_ip]["ip_id"] = nad_add_ip ($new_ip); //put in my own IP id } unset ($snmp_net_to_media); unset ($snmp_media_to_net); } foreach ($host_ips as $ip=>$ipd) { $ipd["dns"] = gethostbyaddr($ip); // Resolve Reverse DNS for this IP if ($ipd["dns"]==$ip) unset ($ipd["dns"]); // Do not add the DNS if this IP doesn't have a reverse logger ($log." Has IP $ip - ".$ipd["mask"]." - ".$ipd["dns"]."\n"); $new_net_id = nad_add_network ($ip, $ipd["mask"], $net["deep"]+1, $net["id"], $net["seed"]); if (!is_numeric($new_net_id)) $new_net_id = $net["id"]; nad_update_ip ($ipd["ip_id"], $ipd["dns"], $host_id, $new_net_id, $ipd["type"]); // Update the IP DB $result = true; //we found some ip's } } // Get Description $snmp_description = snmp_get ($host_ip, $comm, $system_description_oid); // Findout if the Host has IP Forwarding (Router) Enabled list(,$host_forwarding) = split("[()]",snmp_get($host_ip, $comm, $ipforwarding_oid)); if ($host_forwarding==2) $host_forwarding = 0; // Update Host information nad_update_host ($host_id, array("description"=>$snmp_description, "snmp_name"=>$snmp_name, "snmp_community"=>$comm, "forwarding"=>$host_forwarding)); } return $result; } function nad_add_network ($ip, $mask, $deep, $parent_net, $seed_id, $id=NULL) { if (empty($mask)) { // /24 list($ip, $bitmask) = explode("/",$ip); $mask = bitsmask_to_mask ($bitmask); } $ip_bit = str_to_ip($ip); $mask_bit = str_to_ip($mask); $net_bit = $ip_bit & $mask_bit; $net = ip_to_str2 ($net_bit); if (($net != "127.0.0.0") && ($net!="0.0.0.0")) { $oper_status = 0; $mask_prefix = ip_to_bitsmask ($mask_bit); if ($mask_prefix < 22) $mask_prefix = 22; if ($mask_prefix == 31) $mask_prefix = 32; if (($mask_prefix == 32) && ($parent_net!=1)) $oper_status = 3; $aux ="$net/$mask_prefix"; $networks = nad_load_networks(); /* logger ("***** Trying to add Path to network $aux ". (isset($networks["aux"])?"(Alredy added as ".$networks["aux"]["id"].") ":""). "via NET_ID $parent_net, Deep $deep\n"); */ if (!isset($networks[$aux])) { $fields = array("network"=>$aux, "deep"=>$deep, "parent"=>$parent_net, "oper_status"=>$oper_status, "seed"=>$seed_id, "oper_status_changed"=>time()); if ($id!==NULL) $fields["id"] = $id; return db_insert("nad_networks",$fields); } else return $networks[$aux]["id"]; // return the network id } } function nad_load_networks($network="") { $query_networks = " SELECT nad_networks.*, zones.max_deep, zones.communities, zones.admin_status, zones.refresh, zones.allow_private FROM nad_networks, zones WHERE nad_networks.id > 1 AND nad_networks.seed = zones.id ".(!empty($network)?" AND network = '$network'":""); $result_networks = db_query ($query_networks) or die ("Query Error - ".db_error()); $networks = array(); while ($rnet = db_fetch_array ($result_networks)) $networks[$rnet["network"]] = array ("deep"=>$rnet["deep"], "oper_status"=>$rnet["oper_status"], "admin_status"=>$rnet["admin_status"], "parent"=>$rnet["parent"], "id"=>$rnet["id"], "communities"=>explode(",",$rnet["communities"]), "max_deep"=>$rnet["max_deep"], "seed"=>$rnet["seed"], "oper_status_changed"=>$rnet["oper_status_changed"], "refresh"=>$rnet["refresh"], "allow_private"=>$rnet["allow_private"]); return $networks; } function nad_add_ip ($ip, $dns = "", $host = 1, $network = 1, $type = 1) { $data = compact("ip","dns","host","type","network"); return db_insert ("nad_ips",$data); } function nad_update_ip ($ip_id, $dns, $host, $network, $type = 1) { $data = compact("ip","dns","host","type","network"); return db_update ("nad_ips",$ip_id, $data); } function nad_del_ip ($ip_id) { return db_delete ("nad_ips",$ip_id); } function nad_add_host () { return db_insert ("nad_hosts",array("date_added"=>time())); } function nad_update_host ($host_id, $host_data) { return db_update("nad_hosts", $host_id, $host_data); } function nad_network_status($net_id, $status) { return db_update("nad_networks",$net_id, array("oper_status"=>$status, "oper_status_changed"=>time())); } function nad_cleanup_network ($net_id) { $hosts_query = " SELECT nad_hosts.id FROM nad_hosts, nad_ips WHERE nad_ips.host = nad_hosts.id AND nad_ips.network = ".$net_id; $hosts_result = db_query ($hosts_query) or die ("Query Error - ".db_error()); $hosts = array(); while ($rhost = db_fetch_array($hosts_result)) $hosts[]=$rhost["id"]; if (count($hosts) > 0) { $hosts_query = "DELETE FROM nad_hosts WHERE id = ".join(" OR id = ",$hosts); $hosts_result = db_query ($hosts_query) or die ("Query Error - Hosts Delete - ".db_error()); } $ips_query = "DELETE FROM nad_ips WHERE network = ".$net_id; $ips_result = db_query ($ips_query) or die ("Query Error - IPs Delete - ".db_error()); $net_query = "DELETE FROM nad_networks WHERE id = ".$net_id; $net_result = db_query ($net_query) or die ("Query Error - Net Delete - ".db_error()); db_repair("nad_networks"); db_repair("nad_hosts"); db_repair("nad_ips"); return ($ips_result && $hosts_result && $net_query); } function nad_params_managed($params) { $params[1] = false; return $params; } function nad_load_seeds ($networks = array()) { $seeds_query = "SELECT id, seeds, refresh FROM zones where id > 1 and seeds != '' and admin_status = 1"; $seeds_result = db_query ($seeds_query) or die ("Query Error - ".db_error()); $something_changed = false; while ($rseed = db_fetch_array($seeds_result)) { //read each seed $seeds = explode (",",$rseed["seeds"]); foreach ($seeds as $seed) { //foreach seed $seed = trim($seed); $total_seeds++; if (!isset($networks[$seed])) { //if its not already in the networks list nad_add_network($seed,"",1,1,$rseed["id"]); //its new, then add it to the DB. $something_changed = true; //tell the caller that something has changed } } } if ($total_seeds==0) $something_changed = true; return $something_changed; } function nad_init () { db_repair("nad_networks"); db_repair("nad_hosts"); db_repair("nad_ips"); nad_load_seeds(nad_load_networks()); return true; } function nad_status ($child, $result) { list (,$status, $hosts_total, $hosts_new, $time) = explode (" ", $result); $ok = $status=="OK"?true:false; logger ( "NAD ".$child["pid"]." ". ($ok ?"finished discovering network ".$child["item"]." in ".time_hms($time).", Hosts $hosts_new/$hosts_total" :"failed when discovering network ".$child["item"].": ".$result) .".\n"); return $ok; } function show_networks () { $network_admin_status=array(0=>"stopped","started"); $network_oper_status=array(0=>"pending",1=>"starting",2=>"running",3=>"done", 4=>"other path", 5=>"error"); $networks = nad_load_networks(); logger ("Number Network Deep/Max Status Changed IDs\n"); foreach ($networks as $network=>$net_data) { logger ( str_pad(++$i,5," ",STR_PAD_LEFT). "\t".str_pad($network,18). "\t".str_pad($net_data["deep"]."/".$net_data["max_deep"],7). str_pad($network_admin_status[$net_data["admin_status"]]. "/".$network_oper_status[$net_data["oper_status"]],16). " ".str_pad((time()-$net_data["oper_status_changed"])." secs ago",15," ",STR_PAD_LEFT). "\tNID ".str_pad($net_data["id"],5). "PID ".$net_data["parent"]. "\n"); } logger(str_repeat("=-",45)."\n"); } function nad_core () { global $pending_items, $timeout; $pending = array(); $nets = nad_load_networks(); $done_networks = 0; while (list($network, $net_data) = each ($nets)) { if (($net_data["admin_status"]==1) && // admin up ($net_data["deep"] <= $net_data["max_deep"])) { // deep is less than max deep // First Start if ($net_data["oper_status"]==0) // oper status pending if (($net_data["allow_private"]==1) || !nad_private_net($network)) {// seed allows private or this IP is not private nad_network_status ($net_data["id"], 1); // mark it as Starting logger("Changing Network ".$network." status to Starting.\n"); $pending[]=$network; } else { //Private IP nad_network_status ($net_data["id"], 5); // mark it as error logger("Discarded Network $network, because its private space.\n"); } // Hanged Starting if (($net_data["oper_status"] == 1) && // oper starting (time()-$net_data["oper_status_changed"] > $timeout)) { // it didn't start correctly nad_network_status ($net_data["id"], 0); // mark it as Pending logger("Changed Network $network to Pending, because it was hanged starting\n"); } // Hanged Running if (($net_data["oper_status"] == 2) && // if its Running !isset($pending_items[$network])) { // and its not in the pending list //nad_network_status ($net_data["id"], 5); // mark it as error logger("Changed Network $network to Error, because it was hanged running\n"); } // Refresh if (($net_data["oper_status"] >= 3) && // oper done or error (time()-$net_data["oper_status_changed"] > $net_data["refresh"])) { // and has been for more time than refresh logger ("Cleaning Network ".$network."\n"); nad_cleanup_network ($net_data["id"]); // Cleanup this network data logger("Reloading Network ".$network."\n"); nad_add_network ($network, "", $net_data["deep"], $net_data["parent"], $net_data["seed"], $net_data["id"]); $net_data["oper_status"] = 0; // do not count as done now } } else // Admin Down or Max Deep if ($net_data["oper_status"] != 5) { // Not already Error nad_network_status ($net_data["id"], 5); // mark it as error logger("Discarded Network $network, because its admin/down or out of reach because of deep.\n"); } // Done or Error if (($net_data["oper_status"] == 3) || ($net_data["oper_status"] == 5)) // if its Done or Error $done_networks++; } if ((count($pending)==0) && ($done_networks==count($nets))) // Nothing else to do $GLOBALS["refresh_items"] = false; // stop refreshing the list/exit return $pending; } ?> jffnms-0.9.3/engine/windows/0002755000175000017500000000000011377440254015266 5ustar csmallcsmalljffnms-0.9.3/engine/windows/autodiscovery_interfaces.bat0000644000175000017500000000011011377440254023047 0ustar csmallcsmall@c:\php\php.exe -q c:\jffnms\engine\autodiscovery_interfaces.php > nul: jffnms-0.9.3/engine/windows/rrd_analizer.bat0000644000175000017500000000007511377440254020432 0ustar csmallcsmall@c:\php\php.exe -f c:\jffnms\engine\rrd_analizer.php > nul: jffnms-0.9.3/engine/windows/cleanup_raw_tables.bat0000644000175000017500000000010311377440254021600 0ustar csmallcsmall@c:\php\php.exe -f c:\jffnms\engine\cleanup_raw_tables.php > nul: jffnms-0.9.3/engine/windows/consolidate.bat0000644000175000017500000000007411377440254020261 0ustar csmallcsmall@c:\php\php.exe -f c:\jffnms\engine\consolidate.php > nul: jffnms-0.9.3/engine/windows/poller.bat0000644000175000017500000000006711377440254017254 0ustar csmallcsmall@c:\php\php.exe -f c:\jffnms\engine\poller.php > nul: jffnms-0.9.3/engine/windows/tftpget_hosts.bat0000644000175000017500000000010511377440254020645 0ustar csmallcsmall@c:\php\php.exe -f c:\jffnms\engine\tftp_get_host_config.php > nul: jffnms-0.9.3/rrd/0000755000175000017500000000000011760060411013101 5ustar csmallcsmalljffnms-0.9.3/rrd/.check0000644000175000017500000000000011760060411014145 0ustar csmallcsmalljffnms-0.9.3/tftpd/0000755000175000017500000000000011760060411013433 5ustar csmallcsmalljffnms-0.9.3/tftpd/.check0000644000175000017500000000000011760060411014477 0ustar csmallcsmalljffnms-0.9.3/BUGS0000644000175000017500000000072211760060424013002 0ustar csmallcsmallIf your find a bug please report it at sourceforge.net 1. Mailing-List: jffnms-users@lists.sourceforge.net Archives: http://marc.theaimsgroup.com/?l=jffnms-users or http://lists.sourceforge.net/lists/listinfo/jffnms-users or http://www.mail-archive.com/jffnms-users@lists.sourceforge.net/ 2. Forums : http://sourceforge.net/forum/?group_id=46041 3. Bugs: http://sourceforge.net/tracker/?atid=444844&group_id=46041&func=browse jffnms-0.9.3/INSTALL0000644000175000017500000001524111760060424013352 0ustar csmallcsmall'Just For Fun' Network Management System Version 0.9.3 By Javier Szyszlican and Craig Small ====================================================== Requirements: ============= -Operating System: . *NIX (Development is on GNU/Linux, It has been tested on FreeBSD and Solaris too) . Windows 2000/XP also works (A good crond for windows will be useful). If you are installing on Windows please read the INSTALL.win32.txt file. -Apache ( > 1.3.x or > 2.0.x) -MySQL ( > 3.23.x or > 4.0.x ) or PostgreSQL ( Tested with 7.4.6 ) -RRDtool (www.rrdtool.org) (> 1.0.33 ) -PHP ( > 5.0.x ) Extensions: snmp, ssl, gd, sockets, mysql or pgsql, pcre, posix, ob, pcntl and session -NET-SNMP utilities and trapd server (optional) -GNU Diff -TFTP Server (optional) -JFF NMS Integration Packages (TACACS+ & Syslog) (optional, useful on routers) -Graphviz & WebFonts (http://www.graphviz.org) (optional) -NMAP PortScanner > 2.54B (http://www.insecure.org/nmap/) for TCP Port Discovery (optional) -Fping (http://www.fping.com) for Reachability (Only on Linux/*NIX) -tmpwatch (http://linux.maruhn.com/sec/tmpwatch.html) (Only on Linux/*NIX) Used for deleting all temporary files Steps: ====== . Compile and/or Install MySQL / PgSQL . Compile and/or Install Apache . Compile and/or Install Graphviz and WebFonts (optional) . Compile and/or Install NMAP Nmap should be set-uid root if you want UDP port monitoring & discovery to work. Execute: # chmod +s /usr/bin/nmap # chmod a+x /usr/bin/nmap . Compile and/or Install Fping Verify that the user running the cron jobs, is able to execute fping and that it is set-uid root. Execute: # chmod +s /usr/sbin/fping # chmod a+x /usr/sbin/fping And you should see something like this: -rwsr-xr-x 1 root adm 28291 May 31 22:14 /usr/sbin/fping . Compile and/or Install RRDtool . Compile and/or Install PHP I M P O R T A N T ----------------- PHP Modules Needed: sockets, snmp, gd, (pgsql and/or mysql), wddx (for satellites), pcre (syslog parsing) Be sure to add the required modules to your /etc/php.ini file. Remember to verify that your modules are loaded with /admin/adm/test.php or the JFFNMS setup screen. A N D --------------------------------------------------- --------------------------------------------------- Change This in your php.ini file. register_globals = On register_argc_argv = On error_reporting = E_ALL & ~E_NOTICE allow_url_fopen = On include_path = .:/usr/share/pear short_open_tag = On --------------------------------------------------- --------------------------------------------------- Also check if your Apache is loading mod_php. Any change to the PHP ini file (ie. /etc/php.ini) requires Apache to be restarted to take effect. -------------------------------------------------------------- . Read the docs/* files, these are examples of configuration. -------------------------------------------------------------- . Optional: Install Integration Packages tac_plus and msyslog (read the README and INSTALL files of each program). Hints: -If you have problems with mysql when compiling (mysql.h lines ~245 & ~256) change DB to db (lowercase); -If you have a linking problem with compress add -lz to the Makefile libraries -msyslog: Remember to change your init.d/syslog to the new binary and command line options. (read the example) . Create User & Group Note: replace apache by your Apache user (like apache, httpd, www-data, etc) # groupadd jffnms # useradd -g jffnms -d /opt/jffnms -s /bin/false -c 'JFFNMS User' jffnms # usermod -G jffnms apache . Unpack the release: # tar xvzf jffnms-0.9.3.tar.gz You will get a directory called jffnms-0.9.3/ # mv jffnms-0.9.3 /opt/jffnms . Permissions # chown -R jffnms:jffnms /opt/jffnms # chmod 770 /opt/jffnms # chmod -R ug+rw /opt/jffnms . Crontab Install the JFFNMS crontab file # crontab -u jffnms /opt/jffnms/docs/unix/crontab Now modify the values at the top if they don't match your system: # crontab -e -u jffnms Allow JFFNMS to run cron jobs (AFAIK only needed in Solaris) # echo jffnms >> /etc/cron.allow . Create the Databases Manually create the database "jffnms", set the permissions and then import the schema and data. Replace the 'x' with the jffnms version number. MySQL: ====== # mysql -u -p mysql> CREATE DATABASE jffnms; mysql> GRANT ALL PRIVILEGES ON jffnms.* TO jffnms@localhost IDENTIFIED BY 'jffnms'; mysql> FLUSH PRIVILEGES; mysql> quit # mysql -u jffnms -pjffnms jffnms < docs/install/jffnms-0.9.3.mysql PostgreSQL: =========== # psql template1 postgres template1=# create user jffnms password 'jffnms' createdb; template1=# \connect template1 jffnms template1=# create database jffnms; template1=# \q # psql jffnms jffnms < docs/install/jffnms-0.9.3.pgsql This will create the jffnms Tables and required records. . Configure Apache as follows (from docs/*): 1. As a Virtual Host (if you control a DNS server): ServerAdmin you@yournet.com DocumentRoot /opt/jffnms/htdocs ServerName nms.yournet.com LimitRequestLine 20000 2. As a sym-link (in Unix): ln -s /opt/jffnms/htdocs /var/www/html/jffnms (or the path your Apache uses). JFFNMS needs to be at the main Document Root, a VirtualHost or a SymLink. . Restart/Reload Apache, MySQL or PgSQL, xINETD (tftpd) . PHP Module Load Errors are reported to /var/log/httpd/error_log (RedHat) or /var/log/apache/error_log (Gentoo) . Point your browser to http://www.yourserver.com/jffnms or http://nms.yournet.com/ (depending on what you choose) You should see the Setup screen, it should have auto-discovered your configuration. Verify that everything is correct (OK, YES in green) before saving the config. . Point your browser (again) to http://www.yourserver.com/jffnms or http://nms.yournet.com/ (depending on what you choose) Username: admin Password: admin And now, you are inside the system. . You can read the manual at http://www.jffnms.org ========================================================================= If you need anything, contact us at: jffnms-users@lists.sourceforge.net Thank You for trying 'Just For Fun' Network Management System Don't forget to Donate to the project if you find it useful for your work. ========================================================================= Javier Szyszlican aka SzYsZ Buenos Aires, Argentina javier@jffnms.org (please try the mailing list first) ICQ #397319 jffnms-0.9.3/conf/0002755000175000017500000000000011760060424013245 5ustar csmallcsmalljffnms-0.9.3/conf/jffnms.conf.defaults0000644000175000017500000001477711760060424017223 0ustar csmallcsmalljffnms_site:description = Site Name jffnms_site:default = Your Site Name jffnms_site:size = 20 db_section:description = Database Configuration db_section:type = menu db_type:description = Database Type db_type:type = enum db_type:default = mysql db_type:values = MySQL:mysql;PostgreSQL:pg dbhost:description = Database Server dbhost:size = 15 dbhost:default = localhost db:description = Database Name db:default = jffnms db:size = 15 dbuser:description = Database Username dbuser:default = jffnms dbuser:size = 15 dbpass:description = Database Password dbpass:default = jffnms dbpass:size = 15 db_working:description = Is The Database Working? db_working:type = db system:description = System Configuration system:type = menu os_type:description = Operating System os_type:type = enum os_type:default = unix os_type:values = Unix-like:unix;Windows:windows jffnms_access_method:description = GUI Access Method jffnms_access_method:default = local jffnms_access_method:type = enum jffnms_access_method:values = Local:local;Via Satellite:satellite jffnms_satellite_server_uri:description = Satellite Server - optional jffnms_satellite_server_uri:type = satellite jffnms_satellite_server_uri:default = none jffnms_satellite_uri:description = Satellite URI or 'none' jffnms_satellite_uri:default = none jffnms_satellite_uri:type = uri paths:description = Paths Configuration paths:type = menu jffnms_real_path:description = Absolute Path jffnms_real_path:type = directory jffnms_real_path:default = /opt/jffnms jffnms_rel_path:description = WebServer Relative Path jffnms_rel_path:type = relative_directory jffnms_rel_path:default = /jffnms tftp_real_path:description = TFTP Server Files Path tftp_real_path:type = directory tftp_real_path:default = /opt/jffnms/tftpd rrd_real_path:description = RRD Files Path rrd_real_path:type = directory rrd_real_path:default = /opt/jffnms/rrd engine_temp_path:description = Engine Temp Files Path engine_temp_path:type = directory engine_temp_path:default = /opt/jffnms/engine/temp log_path:description = Log Files Path log_path:type = directory log_path:default = /opt/jffnms/logs images_real_path:description = Temp Images Absolute Path images_real_path:type = directory images_real_path:default = /opt/jffnms/htdocs/images/temp images_rel_path:description = WebServer Temp Images Relative Path images_rel_path:type = relative_directory images_rel_path:default = /jffnms/images/temp php_executable:description = PHP Executable Path php_executable:type = file php_executable:default = /usr/bin/php neato_executable:description = GraphViz Neato Executable Path neato_executable:type = file neato_executable:default = /usr/bin/neato rrdtool_executable:description = RRDTool Executable Path rrdtool_executable:type = file rrdtool_executable:default = /usr/bin/rrdtool rrdtool_font:description = RRDTool Font rrdtool_font:type = file rrdtool_font:default = /opt/jffnms/engine/fonts/LucidaTypewriterRegular.ttf diff_executable:description = GNU Diff Executable Path diff_executable:type = file diff_executable:default = /usr/bin/diff nmap_executable:description = NMAP PortScanner Executable Path nmap_executable:type = file nmap_executable:default = /usr/bin/nmap fping_executable:description = FPing Executable Path fping_executable:type = file fping_executable:default = /usr/sbin/fping smsclient_executable:description = SMSClient for SMS via Modem smsclient_executable:type = file smsclient_executable:default = /usr/bin/smsclient ntpq_executable:description = NTPQ Executable ntpq_executable:type = file ntpq_executable:default = /usr/bin/ntpq php_configs:description = PHP Status php_configs:type = menu allow_url_fopen:description = Allow URL fopen set to On allow_url_fopen:type = phpconf allow_url_fopen:value = allow_url_fopen snmp:description = SNMP Module Loaded? snmp:type = phpmodule snmp:value = snmp sockets:description = Sockets Module Loaded? sockets:type = phpmodule sockets:value = sockets gd:description = GD Module Loaded? gd:type = phpmodule gd:value = gd mysql:description = MySQL Module Loaded? mysql:type = phpmodule mysql:value = mysql pgsql:description = PostgreSQL Module Loaded? pgsql:type = phpmodule pgsql:value = pgsql pcre:description = PCRE Module Loaded? pcre:type = phpmodule pcre:value = pcre wddx:description = WDDX Module Loaded? wddx:type = phpmodule wddx:value = wddx gui:description = GUI Options gui:type = menu jffnms_auth_method:description = GUI Auth/Login Method jffnms_auth_method:type = enum jffnms_auth_method:default = login jffnms_auth_method:values = HTTP:http;Login Screen:login logo_image:description = Login Screen Image URL logo_image:type = uri logo_image:default = /jffnms/images/jffnms.png logo_image_url:description = Login Screen Image Link URL logo_image_url:type = uri logo_image_url:default = http://www.jffnms.org jffnms_custom_css:description = Custom CSS Stylesheet URL jffnms_custom_css:type = uri internal:description = Internal Options internal:type = menu jffnms_administrative_type:description = Administrative Event Type jffnms_administrative_type:type = hidden jffnms_administrative_type:default = 25 jffnms_internal_type:description = Internal Event Type jffnms_internal_type:type = hidden jffnms_internal_type:default = 43 jffnms_debug:description = Debugging/Logging Enabled jffnms_debug:type = bool jffnms_debug:default = 0 events_store:description = Number of days to store Events/Alarms events_store:default = 60 raw_events_store:description = Number of days to store Raw Syslog/Tacacs/Trap records raw_events_store:default = 7 host_configs_store:description = Number of days to store Host Configs host_configs_store:default = 30 events_latest_max:description = Events Latest (in Minutes) events_latest_max:default = 1440 map_refresh:description = Default Map Refresh in secs map_refresh:default = 20 events_refresh:description = Default Events Refresh in secs events_refresh:default = 20 events_sound:description = Events Sound Alert events_sound:type = text events_sound:default = tling.wav map_sound_renew_time:description = Replay Active Alarms Every in minutes map_sound_renew_time:default = 60 jffnms_initial_config_finished:description = Request Authentication to acess Setup jffnms_initial_config_finished:type = bool jffnms_initial_config_finished:default = 0 jffnms_site_help:description = URL containing the JFFNMS Setup Help Page jffnms_site_help:type = hidden jffnms_site_help:default = http://www.jffnms.org/docs/installing.html#sec:setup jffnms_configured:description = Are we configured yet? jffnms_configured:type = hidden jffnms_configured:default = 0 jffnms-0.9.3/conf/config.php0000644000175000017500000001347611760060424015234 0ustar csmallcsmall Javier Szyszlican * Copyright (C) 2012 Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ #error_reporting(E_ALL | E_STRICT); if (function_exists('snmp_set_output_format')) snmp_set_output_format(SNMP_OID_OUTPUT_NUMERIC); if (function_exists('snmp_set_quick_print')) snmp_set_quick_print(1); define('JFFNMS_VERSION', '0.9.3'); class JffnmsConfig { public $config_dir; private $configs = array(); public $default_configs = array(); function __construct() { $default_filename = 'jffnms.conf.defaults'; $config_filename = 'jffnms.conf'; if ( ($this->config_dir = $this->_find_config_dir($default_filename)) === FALSE) die("Cannot find configuration default file \"$default_filename\"."); $this->_parse_defaults_file($this->config_dir.'/'.$default_filename); $this->_parse_config_file($this->config_dir.'/'.$config_filename); $this->_check_configuration(); } function get($key) { if (!array_key_exists($key, $this->configs)) return FALSE; return $this->configs[$key]; } function set($key, $value) { $this->configs[$key] = $value; } function save() { $new_config_name = $this->config_dir . '/jffnms.conf.'. date('Y-m-d',time()); $config_file = $this->config_dir.'/jffnms.conf'; $new_config = ''; foreach($this->configs as $key => $value) { if ($key == 'logging_file') continue; if (!array_key_exists($key, $this->default_configs) || !array_key_exists('type', $this->default_configs[$key])) $config_type='plain'; else $config_type = $this->default_configs[$key]['type']; switch($config_type) { case 'db': case 'menu': case 'phpmodule': case 'phpconf': break; # this lot dont get saved default: if (!array_key_exists($key, $this->default_configs) || !array_key_exists('default', $this->default_configs[$key]) || $value != $this->default_configs[$key]['default']) $new_config .= "$key = $value\n"; } } if ( ($fp = fopen($new_config_name, 'w+', FALSE)) === FALSE) die("Cannot open new config file '$new_config_name'"); fputs($fp, $new_config); fclose($fp); if (file_exists($new_config_name)) copy($new_config_name, $config_file); } private function _find_config_dir($filename) { $config_dirs = array('..','.','../conf','../../../conf','../../conf','/etc/jffnms'); foreach ($config_dirs as $dir) if (file_exists($dir.'/'.$filename)) return $dir; return FALSE; } private function _parse_defaults_file($filename) { if ( ($fp = fopen($filename, 'r', FALSE)) === FALSE) die ("Cannot open default config file '$filename'"); while ($fp != feof($fp)) { $line = fgets($fp); if (preg_match('/^([a-z0-9_]+):([a-z]+)\s*=\s*(\S.*)$/i', $line, $regs)) { $value = trim($regs[3]); $this->default_configs["$regs[1]"]["$regs[2]"] = $value; if ($regs[2] == 'default') $this->configs["$regs[1]"] = $value; } } fclose($fp); } # _parse_defaults_file() private function _parse_config_file($filename) { if (!is_readable($filename)) return; if ( ($fp = fopen($filename, 'r', FALSE)) === FALSE) return; while ($fp != feof($fp)) { $line = fgets($fp); if (preg_match('/^([a-z_]+)\s*=\s*(.*)$/i', $line, $regs)) { $value = trim($regs[2]); $this->configs["$regs[1]"] = $value; } } fclose($fp); } # _parse_config_file() private function _check_configuration() { $jffnms_setup_page = '/admin/setup.php'; if ($this->get('access_method') === FALSE) $this->set('access_method', 'local'); if ($this->get('jffnms_configured') !=1) { // Not yet configured and we are running on a website if (PHP_SAPI != 'cli' && strpos($_SERVER['REQUEST_URI'],$jffnms_setup_page) === false) { $jffnms_rel_path = str_replace($jffnms_setup_page,"",$_SERVER['REQUEST_URI']); //we are not in the setup page if ($_SERVER['HTTPS']) { $jffnms_setup_location = 'https://'.$_SERVER['HTTP_HOST'].str_replace('//','/',$jffnms_rel_path.$jffnms_setup_page); } else { $jffnms_setup_location = 'http://'.$_SERVER['HTTP_HOST'].str_replace('//','/',$jffnms_rel_path.$jffnms_setup_page); } header('Location: '.$jffnms_setup_location); //redirect to setup die(); } else { // Help setup with its real path $this->set('jffnms_real_path', str_replace('/conf', '', str_replace('\conf', '', dirname(__FILE__)))); $this->set('jffnms_rel_path', str_replace($jffnms_setup_page, '', $_SERVER['PHP_SELF'])); } } } # check_configuration() } function config_load_libs($include_type = 'gui', $jffnms_init_classes=0) { global $Config, $Sanitizer; $Config->set('logging_file', $_SERVER['SCRIPT_NAME']); // everything except none gets the following $jffnms_includes = array('api', 'api.network', 'api.db', 'api.classes' ); switch ($include_type) { case 'none': return; break; case 'basic': break; case 'gui': $jffnms_includes = array_merge($jffnms_includes, array( 'gui', 'gui.toolkit', 'gui.admin', 'gui.controls')); }//case //Include the Lib Files. #$error_level = error_reporting(E_ERROR | E_WARNING | E_PARSE); $jffnms_real_path = $Config->get('jffnms_real_path'); foreach ($jffnms_includes as $jffnms_include) { require_once("$jffnms_real_path/lib/$jffnms_include.inc.php"); } #error_reporting($error_level); if ($include_type == 'gui') { $Sanitizer = new Sanitizer; } } ?> jffnms-0.9.3/docs/0002755000175000017500000000000011760060411013244 5ustar csmallcsmalljffnms-0.9.3/docs/install/0000755000175000017500000000000011760060424014714 5ustar csmallcsmalljffnms-0.9.3/docs/install/jffnms-0.9.3.mysql0000644000175000017500000041645011760060424017745 0ustar csmallcsmall-- MySQL dump 10.13 Distrib 5.1.61, for debian-linux-gnu (x86_64) -- -- Host: localhost Database: jffnms-release -- ------------------------------------------------------ -- Server version 5.1.61-2 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `acct` -- DROP TABLE IF EXISTS `acct`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `acct` ( `id` int(15) NOT NULL AUTO_INCREMENT, `usern` char(15) NOT NULL DEFAULT '', `s_name` char(30) NOT NULL DEFAULT '', `c_name` char(30) NOT NULL DEFAULT '', `elapsed_time` int(11) NOT NULL DEFAULT '0', `bytes_in` int(11) DEFAULT '0', `bytes_out` int(11) DEFAULT '0', `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `cmd` char(250) NOT NULL DEFAULT '', `type` char(15) NOT NULL DEFAULT '0', `analized` tinyint(2) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `id_2` (`id`), KEY `analized` (`analized`), KEY `s_name` (`s_name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `acct` -- LOCK TABLES `acct` WRITE; /*!40000 ALTER TABLE `acct` DISABLE KEYS */; /*!40000 ALTER TABLE `acct` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `actions` -- DROP TABLE IF EXISTS `actions`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `actions` ( `id` int(10) NOT NULL AUTO_INCREMENT, `description` char(40) NOT NULL DEFAULT '', `command` char(60) NOT NULL DEFAULT 'none', `internal_parameters` char(120) NOT NULL DEFAULT '', `user_parameters` char(120) NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY `command` (`command`) ) ENGINE=MyISAM AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COMMENT='Actions activated by Triggers'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `actions` -- LOCK TABLES `actions` WRITE; /*!40000 ALTER TABLE `actions` DISABLE KEYS */; INSERT INTO `actions` VALUES (1,'No Action','none','',''),(2,'Send Mail','email','from:nms,to:,subject:NMS','from:From,subject:Subject,comment:Comment'),(3,'Send SMS via Modem','smsclient','smsname:',''),(4,'Send SMS via Mail','email','short:1,from:nms,to:,subject:NMS','from:From,subject:Subject'); /*!40000 ALTER TABLE `actions` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `alarm_states` -- DROP TABLE IF EXISTS `alarm_states`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `alarm_states` ( `id` int(10) NOT NULL AUTO_INCREMENT, `description` char(30) NOT NULL DEFAULT '', `activate_alarm` tinyint(1) NOT NULL DEFAULT '0', `sound_in` char(30) NOT NULL DEFAULT '', `sound_out` char(30) NOT NULL DEFAULT '', `state` int(10) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `id_2` (`id`), KEY `description` (`description`) ) ENGINE=MyISAM AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `alarm_states` -- LOCK TABLES `alarm_states` WRITE; /*!40000 ALTER TABLE `alarm_states` DISABLE KEYS */; INSERT INTO `alarm_states` VALUES (1,'down',10,'down.wav','up.wav',1),(2,'up',100,'','',2),(3,'alert',60,'boing.wav','',3),(4,'testing',40,'','',4),(5,'running',100,'','',2),(6,'not running',20,'','',1),(7,'open',100,'','',2),(8,'closed',15,'','',1),(9,'error',90,'boing.wav','',3),(10,'invalid',30,'','',1),(11,'valid',110,'','',2),(12,'reachable',100,'','',2),(13,'unreachable',5,'','',1),(14,'lowerlayerdown',10,'down.wav','up.wav',1),(15,'synchronized',100,'','',2),(16,'unsynchronized',6,'','',1),(17,'battery normal',100,'','',2),(18,'battery low',4,'','',1),(19,'battery unknown',2,'','',1),(20,'on battery',3,'','',1),(21,'on line',90,'','',2),(22,'ok',100,'','',2),(23,'out of bounds',10,'','',1),(24,'unavailable',10,'down.wav','up.wav',1),(25,'available',100,'','',2),(26,'battery depleted',3,'','',1),(27,'other',10,'','',1),(28,'unknown',10,'','',1),(29,'noncritical',90,'','',1),(30,'critical',10,'','',1),(31,'nonrecoverabl',10,'','',1),(32,'warning',80,'down.wav','up.wav',1); /*!40000 ALTER TABLE `alarm_states` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `alarms` -- DROP TABLE IF EXISTS `alarms`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `alarms` ( `id` int(10) NOT NULL AUTO_INCREMENT, `date_start` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `date_stop` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `interface` int(10) NOT NULL DEFAULT '0', `type` int(10) NOT NULL DEFAULT '0', `active` int(10) NOT NULL DEFAULT '1', `referer_start` int(10) NOT NULL DEFAULT '0', `referer_stop` int(10) NOT NULL DEFAULT '0', `triggered` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `type` (`type`), KEY `interface` (`interface`), KEY `active` (`active`), KEY `triggered` (`triggered`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `alarms` -- LOCK TABLES `alarms` WRITE; /*!40000 ALTER TABLE `alarms` DISABLE KEYS */; /*!40000 ALTER TABLE `alarms` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `auth` -- DROP TABLE IF EXISTS `auth`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `auth` ( `id` int(10) NOT NULL AUTO_INCREMENT, `usern` char(60) NOT NULL DEFAULT '', `passwd` varchar(200) DEFAULT NULL, `fullname` char(60) NOT NULL DEFAULT '', `router` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `usern` (`usern`) ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `auth` -- LOCK TABLES `auth` WRITE; /*!40000 ALTER TABLE `auth` DISABLE KEYS */; INSERT INTO `auth` VALUES (1,'No User','$1$txVdymrd$AO3Qa8js9lVNkyscQ552b1','No User Name',0),(2,'admin','adpexzg3FUZAk','Administrator',0); /*!40000 ALTER TABLE `auth` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `autodiscovery` -- DROP TABLE IF EXISTS `autodiscovery`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `autodiscovery` ( `id` int(10) NOT NULL AUTO_INCREMENT, `description` char(40) NOT NULL DEFAULT '0', `poller_default` tinyint(1) NOT NULL DEFAULT '1', `permit_add` tinyint(1) NOT NULL DEFAULT '0', `permit_del` tinyint(1) NOT NULL DEFAULT '0', `permit_mod` tinyint(1) NOT NULL DEFAULT '0', `permit_disable` tinyint(1) NOT NULL DEFAULT '0', `skip_loopback` tinyint(1) NOT NULL DEFAULT '0', `check_state` tinyint(1) NOT NULL DEFAULT '1', `check_address` tinyint(1) NOT NULL DEFAULT '1', `alert_del` tinyint(1) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `autodiscovery` -- LOCK TABLES `autodiscovery` WRITE; /*!40000 ALTER TABLE `autodiscovery` DISABLE KEYS */; INSERT INTO `autodiscovery` VALUES (1,'No Autodiscovery',1,0,0,0,0,0,1,1,1),(2,'Standard',1,1,0,0,1,1,1,1,1),(3,'Automagic',1,1,1,1,0,1,1,1,1),(4,'Administrative',0,1,1,0,1,1,1,1,1),(5,'Just Inform',0,0,0,0,0,0,1,1,1),(6,'Standard (for Switches)',1,1,0,1,0,1,1,0,1); /*!40000 ALTER TABLE `autodiscovery` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `clients` -- DROP TABLE IF EXISTS `clients`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `clients` ( `id` int(10) NOT NULL AUTO_INCREMENT, `username` char(60) NOT NULL DEFAULT '', `password` char(30) NOT NULL DEFAULT '', `name` char(60) NOT NULL DEFAULT '', `shortname` char(30) NOT NULL DEFAULT '', `enabled` tinyint(1) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `clients` -- LOCK TABLES `clients` WRITE; /*!40000 ALTER TABLE `clients` DISABLE KEYS */; INSERT INTO `clients` VALUES (1,'unkclient','','Unknown Customer','Unknown',1),(2,'','','New Customer','Customer1',1); /*!40000 ALTER TABLE `clients` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `events` -- DROP TABLE IF EXISTS `events`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `events` ( `id` int(10) NOT NULL AUTO_INCREMENT, `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `type` int(10) NOT NULL DEFAULT '0', `host` int(10) NOT NULL DEFAULT '0', `interface` char(150) NOT NULL, `state` char(40) NOT NULL DEFAULT '', `username` char(40) NOT NULL DEFAULT '', `info` char(150) NOT NULL DEFAULT '', `referer` int(10) NOT NULL DEFAULT '0', `ack` int(10) NOT NULL DEFAULT '0', `analized` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `host` (`host`), KEY `interface` (`interface`), KEY `username` (`username`), KEY `ack` (`ack`), KEY `type` (`type`), KEY `state` (`state`), KEY `date` (`date`), KEY `analized` (`analized`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `events` -- LOCK TABLES `events` WRITE; /*!40000 ALTER TABLE `events` DISABLE KEYS */; /*!40000 ALTER TABLE `events` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `events_latest` -- DROP TABLE IF EXISTS `events_latest`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `events_latest` ( `id` int(10) NOT NULL AUTO_INCREMENT, `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `type` int(10) NOT NULL DEFAULT '0', `host` int(10) NOT NULL DEFAULT '0', `interface` char(40) NOT NULL DEFAULT '', `state` char(40) NOT NULL DEFAULT '', `username` char(40) NOT NULL DEFAULT '', `info` char(150) NOT NULL DEFAULT '', `referencia` int(10) NOT NULL DEFAULT '0', `ack` int(10) NOT NULL DEFAULT '0', `analized` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `tipo` (`type`), KEY `host` (`host`), KEY `interface` (`interface`), KEY `analized` (`analized`), KEY `date` (`date`), KEY `username` (`username`), KEY `ack` (`ack`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `events_latest` -- LOCK TABLES `events_latest` WRITE; /*!40000 ALTER TABLE `events_latest` DISABLE KEYS */; /*!40000 ALTER TABLE `events_latest` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `filters` -- DROP TABLE IF EXISTS `filters`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `filters` ( `id` int(10) NOT NULL AUTO_INCREMENT, `description` char(40) NOT NULL DEFAULT '', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `id_2` (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `filters` -- LOCK TABLES `filters` WRITE; /*!40000 ALTER TABLE `filters` DISABLE KEYS */; INSERT INTO `filters` VALUES (1,'All Events'),(4,'Severity Level > Warning'),(5,'Dont Show SLA or Commands'),(8,'Dont Show SLA'),(10,'BGP Events'),(13,'Commands Only'),(17,'Interfaces'),(18,'UnACK Events'),(19,'Windows Events'),(20,'PIX'); /*!40000 ALTER TABLE `filters` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `filters_cond` -- DROP TABLE IF EXISTS `filters_cond`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `filters_cond` ( `id` int(10) NOT NULL AUTO_INCREMENT, `filter_id` int(10) NOT NULL DEFAULT '1', `pos` int(5) NOT NULL DEFAULT '1', `field_id` int(10) NOT NULL DEFAULT '1', `op` char(10) NOT NULL DEFAULT '=', `value` char(60) NOT NULL DEFAULT '', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `id_2` (`id`), KEY `filter` (`filter_id`), KEY `field` (`field_id`) ) ENGINE=MyISAM AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `filters_cond` -- LOCK TABLES `filters_cond` WRITE; /*!40000 ALTER TABLE `filters_cond` DISABLE KEYS */; INSERT INTO `filters_cond` VALUES (1,1,1,1,'=','1'),(2,5,1,2,'!=','12'),(3,4,1,3,'>','30'),(4,5,3,2,'!=','8'),(5,5,2,4,'=',''),(6,8,1,2,'!=','12'),(10,10,1,2,'=','6'),(13,13,1,2,'=','8'),(20,17,1,11,'>','1'),(21,18,1,12,'=','0'),(22,19,1,2,'=','46'),(23,19,5,5,'=',''),(24,19,10,2,'=','47'),(25,19,15,5,'=',''),(26,19,20,2,'=','48'),(27,19,25,5,'=',''),(28,19,30,2,'=','49'),(29,20,2,5,'=',''),(30,20,3,2,'=','63'),(31,20,4,5,'=',''),(32,20,5,2,'=','62'),(33,20,6,5,'=',''),(34,20,7,2,'=','65'),(35,20,9,2,'=','67'),(37,20,10,5,'=',''),(38,20,11,2,'=','61'),(39,20,12,5,'=',''),(40,20,13,2,'=','66'),(41,20,1,2,'=','64'),(43,20,8,5,'=',''),(44,20,14,5,'=',''),(45,20,15,2,'=','29'),(46,20,16,5,'=',''),(47,20,17,2,'=','28'); /*!40000 ALTER TABLE `filters_cond` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `filters_fields` -- DROP TABLE IF EXISTS `filters_fields`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `filters_fields` ( `id` int(10) NOT NULL AUTO_INCREMENT, `description` char(40) NOT NULL DEFAULT '', `field` char(40) NOT NULL DEFAULT '', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `id_2` (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=10002 DEFAULT CHARSET=utf8 COMMENT='Fields that can be used for filtering'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `filters_fields` -- LOCK TABLES `filters_fields` WRITE; /*!40000 ALTER TABLE `filters_fields` DISABLE KEYS */; INSERT INTO `filters_fields` VALUES (1,'ALL',''),(2,'Event Type','types.id'),(3,'Severity Level','severity.level'),(4,'AND','AND'),(5,'OR','OR'),(6,'Host','hosts.id'),(7,'Zone','zones.id'),(11,'Interface ID','interfaces.id'),(12,'Acknowledge','events.ack'); /*!40000 ALTER TABLE `filters_fields` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `graph_types` -- DROP TABLE IF EXISTS `graph_types`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `graph_types` ( `id` int(10) NOT NULL AUTO_INCREMENT, `description` char(30) NOT NULL DEFAULT '', `type` int(10) NOT NULL DEFAULT '1', `graph1` char(60) NOT NULL DEFAULT '', `graph2` char(60) NOT NULL DEFAULT '', `sizex1` int(4) NOT NULL DEFAULT '0', `sizey1` int(4) NOT NULL DEFAULT '0', `sizex2` int(4) NOT NULL DEFAULT '0', `sizey2` int(4) NOT NULL DEFAULT '0', `allow_aggregation` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `id_2` (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COMMENT='Performance Graph Types'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `graph_types` -- LOCK TABLES `graph_types` WRITE; /*!40000 ALTER TABLE `graph_types` DISABLE KEYS */; INSERT INTO `graph_types` VALUES (1,'No Graph Selected',1,'','',0,0,0,0,0),(3,'Traffic',4,'traffic','',500,150,0,0,1),(4,'Utilization',4,'traffic_util','',500,150,0,0,0),(5,'Packets',4,'packets','error_packets',275,170,250,170,1),(6,'Error Rate',4,'error_rate','',500,170,0,0,0),(7,'RTT & Packet Loss',4,'rtt','traffic_pl',275,155,260,140,0),(8,'Interface Packet Loss',4,'packetloss','',500,180,0,0,0),(9,'Cisco CPU Usage',3,'cpu_util','',500,175,0,0,1),(10,'Cisco Memory',3,'memory','',510,150,0,0,0),(11,'Drops',4,'drop_packets','',500,175,0,0,0),(14,'BGP Updates',6,'bgp_updates','',500,150,0,0,0),(15,'Used Storage',8,'storage','',500,150,0,0,1),(16,'CSS VIP Hits',9,'css_vip_hits','',500,150,0,0,0),(17,'CSS VIP Traffic',9,'css_vip_output_only_traffic','',500,150,0,0,0),(18,'Solaris Memory Usage',10,'ucd_memory','',500,180,0,0,0),(19,'Solaris Load Average',10,'ucd_load_average','',500,150,0,0,0),(20,'Solaris CPU Usage',10,'ucd_cpu_solaris','',500,175,0,0,0),(21,'CPU Usage',11,'ucd_cpu_linux','',500,175,0,0,1),(22,'Load Average',11,'ucd_load_average','',500,150,0,0,1),(23,'Established Connections',2,'tcp_conn_number','',500,175,0,0,1),(24,'Connection Delay',2,'tcp_conn_delay','',500,175,0,0,0),(25,'IP Accounting',3,'acct_bytes','acct_packets',275,170,260,170,0),(26,'Processes / Users',12,'hostmib_users_procs','',500,170,0,0,0),(27,'TCP Connection Status',12,'tcpmib_connections','',500,150,0,0,0),(28,'Processor Utilization',12,'cpu_util','',500,175,0,0,0),(29,'Processes / Users',11,'hostmib_users_procs','',500,170,0,0,0),(30,'TCP Connection Status',11,'tcpmib_connections','',500,150,0,0,0),(31,'TCP Connection Status',3,'tcpmib_connections','',500,150,0,0,0),(32,'Accounted Packets',13,'cisco_mac_packets','',500,150,0,0,0),(33,'Accounted Bytes',13,'cisco_mac_bytes','',500,150,0,0,0),(34,'SP RTT & Loss',14,'rtt','packetloss',270,170,265,170,0),(35,'Median RTT',14,'rtt','',500,175,0,0,0),(36,'Packets Lost',14,'packetloss','',500,175,0,0,0),(37,'Temperature',17,'temperature','',500,180,0,0,1),(38,'SA Agent Round-Trip Latency',19,'cisco_saagent_rtl','',500,150,0,0,0),(39,'SA Agent Jitter',19,'cisco_saagent_jitter','',500,150,0,0,0),(40,'SA Agent % Packet Loss',19,'cisco_saagent_packetloss','',500,150,0,0,0),(41,'Host Round Trip Time',20,'rtt','',500,150,0,0,0),(42,'Host Packet Loss',20,'packetloss','',500,175,0,0,0),(43,'TC Class Rate',21,'tc_rate','',500,150,0,0,1),(44,'Instances/Memory',15,'apps_instances','apps_memory',250,175,280,175,0),(45,'Connection Delay',23,'tcp_conn_delay','',500,175,0,0,0),(46,'Temperature',26,'temperature','',500,175,0,0,1),(47,'Packets New',4,'packets_new','',610,170,0,0,0),(48,'Livingston Portmaster Serial',28,'pm_serial','',500,175,0,0,0),(49,'CGI Requests',27,'iis_tcgir','',500,150,0,0,0),(50,'POSTs and GETs',27,'iis_tptg','',500,150,0,0,0),(51,'Files Sent',27,'iis_tfs','',500,150,0,0,0),(52,'Bytes Received',27,'iis_tbr','',500,150,0,0,0),(53,'Hits',29,'apache_tac','',500,175,0,0,1),(54,'KBytes',29,'apache_tkb','',500,175,0,0,1),(55,'Apache CPU Load',29,'apache_cplo','',500,175,0,0,0),(59,'Bytes Per Request',29,'apache_bpr','',500,175,0,0,0),(60,'Workers',29,'apache_workers','',500,175,0,0,0),(61,'Load/Capacity',31,'apc_load_capacity','',500,175,0,0,0),(62,'Voltages',31,'apc_voltages','',500,150,0,0,0),(63,'Time Remaining',31,'apc_time_remaining','',500,150,0,0,0),(64,'Temperature',31,'temperature','',500,150,0,0,0),(65,'Records',30,'sql_records','',500,150,0,0,0),(66,'Traffic',32,'alteon_octets','',500,175,0,0,1),(67,'Session Rate',32,'alteon_sessionrate','',500,175,0,0,1),(68,'Failures',32,'alteon_failures_sessions','',500,175,0,0,0),(69,'Current Sessions',32,'alteon_sessions','',500,175,0,0,1),(70,'Current Sessions',33,'alteon_sessions','',500,175,0,0,1),(71,'Sessions Rate',33,'alteon_sessionrate','',500,175,0,0,1),(72,'Octets',33,'alteon_octets','',500,175,0,0,1),(73,'Response Time',34,'response_time','',500,175,0,0,0),(74,'Memory',35,'alteon_memory','',500,175,0,0,0),(75,'CPU Load',35,'alteon_load_average','',500,175,0,0,0),(76,'TCP Connections',35,'tcpmib_connections','',500,150,0,0,0),(77,'Sensor Value',36,'brocade_sensor','',500,175,0,0,0),(78,'Frames',37,'frames','',500,175,0,0,0),(79,'Traffic',37,'traffic_words','',500,175,0,0,0),(80,'Cisco Dialup Usage',38,'cisco_serial','',500,175,0,0,0),(81,'Time Usage',39,'inf_ldisk_time','',500,150,0,0,0),(82,'I/O Rate',39,'inf_ldisk_rate','',500,150,0,0,0),(83,'Battery Temperature',40,'temperature','',500,150,0,0,0),(84,'Time Remaining',40,'ups_time_remaining','',500,150,0,0,0),(85,'UPS Voltage',41,'ups_voltage','',500,150,0,0,1),(86,'UPS Current',41,'ups_current','',500,150,0,0,1),(87,'UPS Load',41,'ups_load','',500,150,0,0,1),(88,'Charge Remaining',40,'ups_charge_remaining','',500,150,0,0,0),(89,'IPTables Rate',42,'iptables_rate','',500,150,0,170,1),(90,'Routes',6,'bgp_routes','',500,150,0,0,0),(91,'PIX Connections',43,'pix_connections','',500,175,0,0,0),(92,'NAT Active Binds',44,'cisco_nat_active','',500,150,0,0,0),(93,'NAT Packets',44,'cisco_nat_packets','',500,150,0,0,0),(94,'Sensor Value',45,'sensor_value','',500,150,0,0,0),(95,'OS/400 CPU Usage',46,'cpu_os400','',500,150,0,0,0),(96,'Dell OpenManage Ambient Temp',47,'dell_om_temp','',500,150,0,0,0),(97,'Dell OpenManage Fan RPM',47,'dell_om_fan','',500,150,0,0,0),(98,'UPS Power',41,'ups_power','',500,150,0,0,1),(99,'PDU Load',49,'pdu_load','',500,150,0,0,1),(102,'Time Usage',57,'inf_ldisk_time','',500,175,0,0,0),(103,'I/O Byte Rate',57,'inf_ldisk_rate','',500,175,0,0,0),(104,'I/O Ops Rate',57,'inf_ldisk_opsrate','',500,175,0,0,0),(105,'FC Frames',52,'frames','',500,175,0,0,0),(106,'IBM Blade CPU Temp',51,'ibm_blade_cpu_temp','',500,150,0,0,0),(107,'IBM Blade Power',54,'ibm_blade_power','',500,150,0,0,0),(101,'Wireless Associated',53,'cisco_80211X_associated','',500,175,0,0,0); /*!40000 ALTER TABLE `graph_types` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `hosts` -- DROP TABLE IF EXISTS `hosts`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `hosts` ( `id` int(10) NOT NULL AUTO_INCREMENT, `ip_tacacs` char(16) NOT NULL DEFAULT '', `ip` varchar(39) NOT NULL DEFAULT '', `name` char(255) NOT NULL, `rocommunity` char(100) NOT NULL DEFAULT '', `rwcommunity` char(100) NOT NULL DEFAULT '', `zone` int(10) NOT NULL DEFAULT '0', `tftp` char(20) NOT NULL DEFAULT '', `autodiscovery` int(10) NOT NULL DEFAULT '1', `config_type` int(10) NOT NULL DEFAULT '1', `autodiscovery_default_customer` int(10) NOT NULL DEFAULT '1', `satellite` int(10) NOT NULL DEFAULT '1', `dmii` char(10) NOT NULL DEFAULT '1', `lat` decimal(12,2) NOT NULL DEFAULT '0.00', `lon` decimal(12,2) NOT NULL DEFAULT '0.00', `show_host` tinyint(1) NOT NULL DEFAULT '1', `poll` tinyint(1) NOT NULL DEFAULT '1', `creation_date` int(10) NOT NULL DEFAULT '0', `modification_date` int(10) NOT NULL DEFAULT '0', `last_poll_date` int(10) NOT NULL DEFAULT '0', `last_poll_time` int(10) NOT NULL DEFAULT '0', `poll_interval` int(10) NOT NULL DEFAULT '300', `dmii_up` tinyint(1) NOT NULL DEFAULT '1', `sysobjectid` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `zone` (`zone`), KEY `ip` (`ip`), KEY `ip_tacacs` (`ip_tacacs`), KEY `autodiscovery_default_customer` (`autodiscovery_default_customer`), KEY `autodiscovery` (`autodiscovery`), KEY `satellite` (`satellite`), KEY `poll` (`poll`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `hosts` -- LOCK TABLES `hosts` WRITE; /*!40000 ALTER TABLE `hosts` DISABLE KEYS */; INSERT INTO `hosts` VALUES (1,'','','Unknown','','',1,'',1,1,1,1,'1','0.00','0.00',1,1,0,0,1232673711,0,300,1,NULL); /*!40000 ALTER TABLE `hosts` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `hosts_config` -- DROP TABLE IF EXISTS `hosts_config`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `hosts_config` ( `id` int(10) NOT NULL AUTO_INCREMENT, `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `host` int(10) NOT NULL DEFAULT '0', `config` longtext NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `host` (`host`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='Hosts Config Files'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `hosts_config` -- LOCK TABLES `hosts_config` WRITE; /*!40000 ALTER TABLE `hosts_config` DISABLE KEYS */; INSERT INTO `hosts_config` VALUES (1,'0000-00-00 00:00:00',1,'No Config'); /*!40000 ALTER TABLE `hosts_config` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `hosts_config_types` -- DROP TABLE IF EXISTS `hosts_config_types`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `hosts_config_types` ( `id` int(10) NOT NULL AUTO_INCREMENT, `description` char(60) NOT NULL DEFAULT '', `command` char(30) NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COMMENT='Host Config Commands'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `hosts_config_types` -- LOCK TABLES `hosts_config_types` WRITE; /*!40000 ALTER TABLE `hosts_config_types` DISABLE KEYS */; INSERT INTO `hosts_config_types` VALUES (1,'No Configuration Transfer','none'),(2,'Cisco IOS, Newer than 12.0 (CONFIG-COPY-MIB)','cisco_cc'),(3,'Cisco IOS, Older than 12.0 (SYS-MIB)','cisco_sys'),(4,'Cisco CatOS, Catalyst Switches (STACK-MIB)','cisco_catos'),(5,'Alteon WebOS Switches (DANGEROUS)','alteon_webos'); /*!40000 ALTER TABLE `hosts_config_types` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `interface_types` -- DROP TABLE IF EXISTS `interface_types`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `interface_types` ( `id` int(10) NOT NULL AUTO_INCREMENT, `description` varchar(40) NOT NULL DEFAULT '', `autodiscovery_validate` tinyint(1) NOT NULL DEFAULT '0', `autodiscovery_enabled` tinyint(1) NOT NULL DEFAULT '0', `autodiscovery_function` varchar(40) NOT NULL DEFAULT '', `autodiscovery_parameters` varchar(200) NOT NULL DEFAULT '', `autodiscovery_default_poller` int(10) NOT NULL DEFAULT '1', `have_graph` tinyint(1) NOT NULL DEFAULT '0', `rrd_structure_rra` text NOT NULL, `rrd_structure_res` varchar(20) NOT NULL DEFAULT '', `rrd_structure_step` int(4) NOT NULL DEFAULT '300', `graph_default` int(10) NOT NULL DEFAULT '1', `break_by_card` tinyint(1) NOT NULL DEFAULT '0', `update_handler` varchar(30) NOT NULL DEFAULT 'none', `allow_manual_add` tinyint(1) NOT NULL DEFAULT '0', `sla_default` int(10) NOT NULL DEFAULT '1', `have_tools` tinyint(1) NOT NULL DEFAULT '0', `snmp_oid` varchar(255) NOT NULL DEFAULT '.', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `id_2` (`id`), KEY `autodiscovery_enabled` (`autodiscovery_enabled`) ) ENGINE=MyISAM AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `interface_types` -- LOCK TABLES `interface_types` WRITE; /*!40000 ALTER TABLE `interface_types` DISABLE KEYS */; INSERT INTO `interface_types` VALUES (1,'No Interface Type',0,0,'none','',1,0,'','',300,1,0,'none',0,1,0,'.'),(2,'TCP Ports',0,1,'tcp_ports','-sT -p1-500,600-1024',5,1,'RRA:LAST:0.5:1:','103680',300,23,0,'tcp_ports',1,1,1,''),(3,'Cisco System Info',1,1,'host_information','cisco,9.1,9.5',3,1,'RRA:AVERAGE:0.5:1:','103680',300,9,0,'none',0,7,0,'ent.9'),(4,'Physical Interfaces',1,1,'snmp_interfaces','',61,1,'RRA:AVERAGE:0.5:1:','103680',300,3,1,'none',0,1,1,'.'),(6,'BGP Neighbors',1,1,'bgp_peers','',8,1,'RRA:AVERAGE:0.5:1:','103680',300,90,0,'none',0,1,0,'.'),(8,'Storage',1,1,'storage','',9,1,'RRA:AVERAGE:0.5:1:','103680',300,15,0,'none',0,9,0,'.'),(9,'CSS VIPs',0,1,'css_vips','',10,1,'RRA:AVERAGE:0.5:1:','103680',300,17,0,'none',0,1,0,'ent.9'),(10,'Solaris System Info',1,1,'host_information','solaris,sparc,sun,11.2.3.10,8072.3.2.3',12,1,'RRA:AVERAGE:0.5:1:','103680',300,20,0,'none',0,1,0,'.'),(11,'Linux/Unix System Info',1,1,'host_information','2021.250.10,linux,2021.250.255,freebsd,netSnmp,8072',11,1,'RRA:AVERAGE:0.5:1:','103680',300,21,0,'none',0,10,0,'.'),(12,'Windows System Info',1,1,'host_information','enterprises.311',13,1,'RRA:AVERAGE:0.5:1:','103680',300,28,0,'none',0,11,0,'.'),(13,'Cisco MAC Accounting',1,1,'cisco_accounting','',14,1,'RRA:AVERAGE:0.5:1:','103680',300,33,0,'none',0,1,0,'.'),(14,'Smokeping Host',1,1,'smokeping','/var/lib/smokeping',15,1,'RRA:AVERAGE:0.5:1:','103680',300,34,0,'none',0,8,0,''),(15,'Applications',1,0,'hostmib_apps','',16,1,'RRA:AVERAGE:0.5:1:','103680',300,44,0,'none',0,1,0,'.'),(16,'Cisco Power Supply',1,1,'cisco_envmib','PowerSupply,5.1.2,5.1.3',17,0,'','103680',300,1,1,'none',0,1,0,'ent.9'),(17,'Cisco Temperature',1,1,'cisco_envmib','Temperature,3.1.2,3.1.6',18,1,'RRA:AVERAGE:0.5:1:','103680',300,37,1,'none',0,1,0,'ent.9'),(18,'Cisco Voltage',1,1,'cisco_envmib','Voltage,2.1.2,2.1.7',19,0,'','103680',300,1,1,'none',0,1,0,'ent.9'),(19,'Cisco SA Agent',1,1,'cisco_saagent','',20,1,'RRA:AVERAGE:0.5:1:','103680',300,39,0,'none',0,1,0,'ent.9'),(20,'Reachable',1,1,'reachability','',21,1,'RRA:AVERAGE:0.5:1:','103680',300,41,0,'none',0,1,0,''),(21,'Linux Traffic Control',1,1,'linux_tc','.1.3.6.1.4.1.2021.5001',22,1,'RRA:AVERAGE:0.5:1:','103680',300,43,1,'none',0,1,0,'.'),(22,'NTP',0,1,'ntp_client','',23,0,'RRA:AVERAGE:0.5:1:','103680',300,1,0,'none',0,1,0,''),(23,'UDP Ports',0,0,'tcp_ports','-sU -p1-500,600-1024 --host_timeout 15000',24,1,'RRA:AVERAGE:0.5:1:','103680',300,45,0,'tcp_ports',1,1,0,''),(24,'Compaq Physical Drives',0,1,'cpqmib','phydrv',25,0,'RRA:AVERAGE:0.5:1:','103680',300,1,0,'none',0,1,0,'.'),(25,'Compaq Fans',0,1,'cpqmib','fans',26,0,'RRA:AVERAGE:0.5:1:','103680',300,1,0,'none',0,1,0,'.'),(26,'Compaq Temperature',0,1,'cpqmib','temperature',27,1,'RRA:AVERAGE:0.5:1:','103680',300,46,0,'none',0,1,0,'.'),(27,'IIS Webserver Information',0,1,'iis_info','',28,1,'RRA:AVERAGE:0.5:1:','103680',300,50,0,'none',0,1,0,'.'),(28,'Livingston Serial Port',0,1,'livingston_serial_port','',29,1,'RRA:AVERAGE:0.5:1:','103680',300,48,0,'none',0,1,0,'.'),(29,'Apache',0,1,'apache','',30,1,'RRA:AVERAGE:0.5:1:','103680',300,53,0,'none',1,1,0,''),(30,'SQL Query',0,1,'none','',32,1,'RRA:AVERAGE:0.5:1:','103680',300,65,0,'none',1,1,0,''),(31,'APC',1,1,'apc','enterprises.318',31,1,'RRA:AVERAGE:0.5:1:','103680',300,61,0,'none',0,1,0,'.'),(32,'Alteon Real Server',1,1,'alteon_realservers','',33,1,'RRA:AVERAGE:0.5:1:','103680',300,66,0,'none',0,1,0,'ent.1872'),(33,'Alteon Virtual Server',0,1,'alteon_virtualservers','',34,1,'RRA:AVERAGE:0.5:1:','103680',300,70,0,'none',0,1,0,'ent.1872'),(34,'Alteon Real Services',0,1,'alteon_realservices','',35,1,'RRA:AVERAGE:0.5:1:','103680',300,73,0,'none',0,1,0,'ent.1872'),(35,'Alteon System Info',1,1,'host_information','enterprises.1872',36,1,'RRA:AVERAGE:0.5:1:','103680',300,75,0,'none',0,1,0,'ent.1872'),(36,'Brocade Sensors',0,0,'brocade_sensors','',37,1,'RRA:AVERAGE:0.5:1:','103680',300,77,0,'none',0,1,0,'ent.1588'),(37,'Brocade FC Ports',0,0,'brocade_fcports','',38,1,'RRA:AVERAGE:0.5:1:','103680',300,78,0,'none',0,1,0,'ent.1588'),(38,'Cisco Dialup Usage',1,1,'cisco_serial_port','',39,1,'RRA:AVERAGE:0.5:1:','103680',300,80,0,'none',0,1,0,'ent.9'),(39,'Windows Logical Disks',1,1,'informant_ldisks','',40,1,'RRA:AVERAGE:0.5:1:','103680',300,82,0,'none',0,1,0,'.'),(40,'UPS',1,1,'ups','',41,1,'RRA:AVERAGE:0.5:1:','103680',300,84,0,'none',0,1,0,'.'),(41,'UPS Lines',0,1,'ups_lines','',42,1,'RRA:AVERAGE:0.5:1:','103680',300,85,0,'none',0,1,0,'.'),(42,'IPTables Chains',1,1,'linux_iptables','.1.3.6.1.4.1.2021.5002',43,1,'RRA:AVERAGE:0.5:1:','103680',300,89,1,'none',0,1,0,'.'),(43,'Cisco PIX',1,1,'pix_connections','',44,1,'RRA:AVERAGE:0.5:1:','103680',300,91,0,'none',0,1,0,'ent.9'),(44,'Cisco NAT',0,1,'simple','.1.3.6.1.4.1.9.10.77.1.2.1.0,NAT',45,1,'RRA:AVERAGE:0.5:1:','103680',300,93,0,'none',0,1,0,'ent.9'),(45,'Sensors',1,1,'sensors','',46,1,'RRA:AVERAGE:0.5:1:','103680',300,94,1,'none',0,1,0,'.'),(46,'OS/400 System Info',1,1,'simple','.1.3.6.1.4.1.2.6.4.5.1.0,OS400',47,1,'RRA:AVERAGE:0.5:1:','103680',300,95,0,'none',0,1,0,'.'),(47,'Dell Chassis',1,1,'simple','.1.3.6.1.4.1.674.10892.1.200.10.1.2.1,Chassis status',48,0,'RRA:AVERAGE:0.5:1:','103680',300,1,0,'none',0,1,0,'.'),(48,'PDU',1,1,'pdu','',49,0,'RRA:AVERAGE:0.5:1:','103680',300,1,0,'none',0,1,0,'.'),(49,'PDU Banks',0,1,'pdu_banks','',50,1,'RRA:AVERAGE:0.5:1:','103680',300,99,0,'none',0,1,0,'.'),(50,'IBM Component Health',1,0,'ibm_ComponentHealth','',57,0,'RRA:AVERAGE:0.5:1:','103680',300,1,0,'none',0,1,0,'.'),(51,'IBM Blade server',1,0,'ibm_blade_servers','',51,1,'RRA:AVERAGE:0.5:1:','103680',300,106,0,'none',0,1,0,'.'),(52,'Generic FC Ports',1,0,'fc_ports','',52,1,'RRA:AVERAGE:0.5:1:','103680',300,105,0,'none',0,1,0,'.'),(53,'Cisco Wireless Device',1,0,'simple','.1.3.6.1.4.1.9.9.273.1.1.2.1.1.1,Cisco AP',53,1,'RRA:AVERAGE:0.5:1\r\n:','103680',300,101,0,'none',0,1,0,'ent.9'),(54,'IBM Blade Power',1,0,'ibm_blade_power','',54,1,'RRA:AVERAGE:0.5:1:','103680',300,107,0,'none',0,1,0,'.'),(55,'Compaq Power Supply',1,0,'cpqmib','powersupply',55,0,'RRA:AVERAGE:0.5:1:','103680',300,1,0,'none',0,1,0,'.'),(56,'IBM Storage Controller',0,0,'ibm_ds_storage','storagesubsystem',56,0,'RRA:AVERAGE:0.5:1:','103680',300,1,0,'none',0,1,0,'.'),(57,'Informant Disks 64',1,1,'informant_adv_ldisks','',58,1,'RRA:AVERAGE:0.5:1:','103680',300,102,0,'none',0,1,0,'.'); /*!40000 ALTER TABLE `interface_types` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `interface_types_field_types` -- DROP TABLE IF EXISTS `interface_types_field_types`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `interface_types_field_types` ( `id` int(10) NOT NULL AUTO_INCREMENT, `description` char(30) NOT NULL DEFAULT '', `handler` char(30) NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `interface_types_field_types` -- LOCK TABLES `interface_types_field_types` WRITE; /*!40000 ALTER TABLE `interface_types_field_types` DISABLE KEYS */; INSERT INTO `interface_types_field_types` VALUES (1,'Unknown','none'),(3,'Index','text'),(5,'Boolean','bool'),(7,'Description','text'),(8,'Other','text'),(20,'RRDTool DS','rrd_ds'); /*!40000 ALTER TABLE `interface_types_field_types` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `interface_types_fields` -- DROP TABLE IF EXISTS `interface_types_fields`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `interface_types_fields` ( `id` int(10) NOT NULL AUTO_INCREMENT, `description` char(40) NOT NULL DEFAULT '', `name` char(40) NOT NULL DEFAULT '', `pos` int(3) NOT NULL DEFAULT '10', `itype` int(10) NOT NULL DEFAULT '1', `ftype` int(10) NOT NULL DEFAULT '1', `showable` tinyint(1) NOT NULL DEFAULT '1', `overwritable` tinyint(1) NOT NULL DEFAULT '1', `tracked` tinyint(1) NOT NULL DEFAULT '0', `default_value` char(250) NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY `ftype_itype` (`ftype`,`itype`), KEY `ftype` (`ftype`) ) ENGINE=MyISAM AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `interface_types_fields` -- LOCK TABLES `interface_types_fields` WRITE; /*!40000 ALTER TABLE `interface_types_fields` DISABLE KEYS */; INSERT INTO `interface_types_fields` VALUES (1,'Unknown','unknown',10,1,1,0,0,0,''),(3,'SNMP IFIndex','interfacenumber',60,4,3,1,1,0,''),(4,'Description','description',10,4,7,1,1,1,''),(5,'IP Address','address',30,4,7,1,1,0,''),(6,'Input Bandwidth','bandwidthin',50,4,8,1,1,0,'1'),(7,'Port Number','port',10,2,3,1,1,0,''),(9,'Check Content','check_content',30,2,5,2,1,0,'0'),(10,'Port Description','description',20,2,7,1,1,0,''),(11,'Input Bytes','input',10,4,20,0,0,0,'DS:input:COUNTER:600:0:'),(12,'Established Connections','tcp_conn_number',10,2,20,0,0,0,'DS:tcp_conn_number:GAUGE:600:0:10000'),(13,'Check Content URL','check_url',40,2,8,2,1,0,''),(14,'Output Bytes','output',20,4,20,0,0,0,'DS:output:COUNTER:600:0:'),(15,'Input Packets','inpackets',70,4,20,0,0,0,'DS:inpackets:COUNTER:600:0:'),(16,'Flip In Out in Graphs','flipinout',70,4,5,2,1,0,'0'),(20,'Connection Delay','conn_delay',20,2,20,0,0,0,'DS:conn_delay:GAUGE:600:0:100000'),(21,'Output Bandwidth','bandwidthout',51,4,8,2,1,0,'1'),(22,'Peer Address','peer',36,4,8,1,1,0,''),(23,'Input Errors','inputerrors',30,4,20,0,0,0,'DS:inputerrors:COUNTER:600:0:'),(24,'Output Errors','outputerrors',40,4,20,0,0,0,'DS:outputerrors:COUNTER:600:0:'),(25,'Round Trip Time','rtt',50,4,20,0,0,0,'DS:rtt:GAUGE:600:0:10000'),(26,'PacketLoss','packetloss',60,4,20,0,0,0,'DS:packetloss:GAUGE:600:0:1000'),(27,'Output Packets','outpackets',80,4,20,0,0,0,'DS:outpackets:COUNTER:600:0:'),(28,'Drops','drops',90,4,20,0,0,0,'DS:drops:COUNTER:600:0:'),(29,'Not Used','aux4',100,4,20,0,0,0,'DS:aux4:COUNTER:600:0:'),(30,'Saved Input Bandwidth','bandwidthin',110,4,20,0,0,0,'DS:bandwidthin:GAUGE:600:0:'),(31,'Saved Output Bandwidth','bandwidthout',120,4,20,0,0,0,'DS:bandwidthout:GAUGE:600:0:'),(32,'Index','index',10,12,3,0,0,0,''),(33,'Description','description',20,12,7,1,0,1,'System Information'),(34,'Number of Processors','cpu_num',30,12,8,1,1,0,'1'),(35,'Index','index',10,11,3,0,0,0,''),(36,'Description','description',20,11,7,1,0,1,'System Information'),(37,'Number of CPUs','cpu_num',30,11,8,1,1,0,'1'),(43,'CPU','cpu',10,3,20,0,0,0,'DS:cpu:GAUGE:600:0:100'),(44,'Mem Used','mem_used',20,3,20,0,0,0,'DS:mem_used:GAUGE:600:0:100000000000'),(45,'Mem Free','mem_free',30,3,20,0,0,0,'DS:mem_free:GAUGE:600:0:100000000000'),(46,'Acct Packets','acct_packets',40,3,20,0,0,0,'DS:acct_packets:ABSOLUTE:600:0:100000000000'),(47,'Acct Bytes','acct_bytes',50,3,20,0,0,0,'DS:acct_bytes:GAUGE:600:0:100000000000'),(48,'Tcp Active','tcp_active',60,3,20,0,0,0,'DS:tcp_active:COUNTER:600:0:10000000'),(49,'Tcp Passive','tcp_passive',70,3,20,0,0,0,'DS:tcp_passive:COUNTER:600:0:1000000'),(50,'Tcp Established','tcp_established',80,3,20,0,0,0,'DS:tcp_established:COUNTER:600:0:1000000'),(51,'Bgpin','bgpin',10,6,20,0,0,0,'DS:bgpin:COUNTER:600:0:10000000'),(52,'Bgpout','bgpout',20,6,20,0,0,0,'DS:bgpout:COUNTER:600:0:10000000'),(53,'Bgpuptime','bgpuptime',30,6,20,0,0,0,'DS:bgpuptime:GAUGE:600:0:10000000'),(56,'Storage Block Size','storage_block_size',10,8,20,0,0,0,'DS:storage_block_size:GAUGE:600:0:'),(57,'Storage Block Count','storage_block_count',20,8,20,0,0,0,'DS:storage_block_count:GAUGE:600:0:'),(58,'Storage Used Blocks','storage_used_blocks',30,8,20,0,0,0,'DS:storage_used_blocks:GAUGE:600:0:'),(59,'Output','output',10,9,20,0,0,0,'DS:output:COUNTER:600:0:'),(60,'Hits','hits',20,9,20,0,0,0,'DS:hits:COUNTER:600:0:'),(61,'Cpu User Ticks','cpu_user_ticks',10,10,20,0,0,0,'DS:cpu_user_ticks:COUNTER:600:0:86400'),(62,'Cpu Idle Ticks','cpu_idle_ticks',20,10,20,0,0,0,'DS:cpu_idle_ticks:COUNTER:600:0:86400'),(63,'Cpu Wait Ticks','cpu_wait_ticks',30,10,20,0,0,0,'DS:cpu_wait_ticks:COUNTER:600:0:86400'),(64,'Cpu Kernel Ticks','cpu_kernel_ticks',40,10,20,0,0,0,'DS:cpu_kernel_ticks:COUNTER:600:0:86400'),(65,'Swap Total','swap_total',50,10,20,0,0,0,'DS:swap_total:GAUGE:600:0:10000000000'),(66,'Swap Available','swap_available',60,10,20,0,0,0,'DS:swap_available:GAUGE:600:0:10000000000'),(67,'Mem Total','mem_total',70,10,20,0,0,0,'DS:mem_total:GAUGE:600:0:10000000000'),(68,'Mem Available','mem_available',80,10,20,0,0,0,'DS:mem_available:GAUGE:600:0:10000000000'),(69,'Load Average 1','load_average_1',90,10,20,0,0,0,'DS:load_average_1:GAUGE:600:0:1000'),(70,'Load Average 5','load_average_5',100,10,20,0,0,0,'DS:load_average_5:GAUGE:600:0:1000'),(71,'Load Average 15','load_average_15',110,10,20,0,0,0,'DS:load_average_15:GAUGE:600:0:1000'),(72,'Cpu User Ticks','cpu_user_ticks',10,11,20,0,0,0,'DS:cpu_user_ticks:COUNTER:600:0:86400'),(73,'Cpu Idle Ticks','cpu_idle_ticks',20,11,20,0,0,0,'DS:cpu_idle_ticks:COUNTER:600:0:86400'),(74,'Cpu Nice Ticks','cpu_nice_ticks',30,11,20,0,0,0,'DS:cpu_nice_ticks:COUNTER:600:0:86400'),(75,'Cpu System Ticks','cpu_system_ticks',40,11,20,0,0,0,'DS:cpu_system_ticks:COUNTER:600:0:86400'),(76,'Load Average 1','load_average_1',50,11,20,0,0,0,'DS:load_average_1:GAUGE:600:0:1000'),(77,'Load Average 5','load_average_5',60,11,20,0,0,0,'DS:load_average_5:GAUGE:600:0:1000'),(78,'Load Average 15','load_average_15',70,11,20,0,0,0,'DS:load_average_15:GAUGE:600:0:1000'),(79,'Num Users','num_users',80,11,20,0,0,0,'DS:num_users:GAUGE:600:0:100000'),(80,'Num Procs','num_procs',90,11,20,0,0,0,'DS:num_procs:GAUGE:600:0:10000000'),(81,'Tcp Active','tcp_active',100,11,20,0,0,0,'DS:tcp_active:COUNTER:600:0:10000000'),(82,'Tcp Passive','tcp_passive',110,11,20,0,0,0,'DS:tcp_passive:COUNTER:600:0:1000000'),(83,'Tcp Established','tcp_established',120,11,20,0,0,0,'DS:tcp_established:COUNTER:600:0:1000000'),(84,'CPU','cpu',10,12,20,0,0,0,'DS:cpu:GAUGE:600:0:100'),(85,'Num Users','num_users',20,12,20,0,0,0,'DS:num_users:GAUGE:600:0:100000'),(86,'Num Procs','num_procs',30,12,20,0,0,0,'DS:num_procs:GAUGE:600:0:10000000'),(87,'Tcp Active','tcp_active',40,12,20,0,0,0,'DS:tcp_active:COUNTER:600:0:10000000'),(88,'Tcp Passive','tcp_passive',50,12,20,0,0,0,'DS:tcp_passive:COUNTER:600:0:1000000'),(89,'Tcp Established','tcp_established',60,12,20,0,0,0,'DS:tcp_established:COUNTER:600:0:1000000'),(90,'Input','input',10,13,20,0,0,0,'DS:input:COUNTER:600:0:10000000000'),(91,'Output','output',20,13,20,0,0,0,'DS:output:COUNTER:600:0:10000000000'),(92,'Inputpackets','inputpackets',30,13,20,0,0,0,'DS:inputpackets:COUNTER:600:0:10000000000'),(93,'Outputpackets','outputpackets',40,13,20,0,0,0,'DS:outputpackets:COUNTER:600:0:10000000000'),(94,'RTT','rtt',10,14,20,0,0,0,'DS:rtt:GAUGE:600:0:10000'),(95,'Packetloss','packetloss',20,14,20,0,0,0,'DS:packetloss:GAUGE:600:0:1000'),(98,'Temperature','temperature',10,17,20,0,0,0,'DS:temperature:GAUGE:600:0:100'),(100,'Forward Jitter','forward_jitter',10,19,20,0,0,0,'DS:forward_jitter:GAUGE:600:0:100'),(101,'Backward Jitter','backward_jitter',20,19,20,0,0,0,'DS:backward_jitter:GAUGE:600:0:100'),(102,'Rt Latency','rt_latency',30,19,20,0,0,0,'DS:rt_latency:GAUGE:600:0:100'),(103,'Forward Packetloss','forward_packetloss',40,19,20,0,0,0,'DS:forward_packetloss:GAUGE:600:0:100'),(104,'Backward Packetloss','backward_packetloss',50,19,20,0,0,0,'DS:backward_packetloss:GAUGE:600:0:100'),(105,'RTT','rtt',10,20,20,0,0,0,'DS:rtt:GAUGE:600:0:10000'),(106,'Packetloss','packetloss',20,20,20,0,0,0,'DS:packetloss:GAUGE:600:0:1000'),(107,'Bytes','bytes',10,21,20,0,0,0,'DS:bytes:COUNTER:600:0:'),(108,'Packets','packets',20,21,20,0,0,0,'DS:packets:COUNTER:600:0:'),(109,'Disk Type','storage_type',10,8,7,1,0,1,''),(110,'Size (Bytes)','size',20,8,7,1,1,1,'0'),(111,'Description','description',30,8,7,1,1,0,''),(112,'Index','index',40,8,3,0,0,0,''),(113,'Index','index',10,10,3,1,0,0,''),(114,'Description','description',20,10,7,1,0,1,'System Information'),(115,'Number of Processors','cpu_num',30,10,8,1,1,0,'1'),(116,'Index','index',10,14,3,1,0,0,''),(117,'Description','description',20,14,7,1,1,0,''),(118,'Index','index',10,20,3,0,0,0,''),(119,'Description','description',20,20,7,1,0,1,''),(120,'Rate','rate',20,21,7,1,0,1,''),(121,'Ceil','ceil',30,21,7,1,0,1,''),(122,'Index','index',50,21,3,1,0,0,''),(123,'Description','description',40,21,7,2,1,0,''),(124,'Index','index',10,9,3,1,0,0,''),(125,'Owner','owner',20,9,7,1,0,1,''),(126,'VIP Address','address',30,9,7,1,0,1,''),(127,'Bandwidth','bandwidth',40,9,8,1,1,0,'1'),(128,'Description','description',20,18,7,1,1,0,''),(129,'Description','description',20,17,7,1,1,0,''),(130,'Description','description',20,16,7,1,1,0,''),(131,'Index','index',30,18,3,1,0,0,''),(132,'Index','index',30,17,3,1,0,0,''),(133,'Index','index',10,16,3,1,0,0,''),(134,'Number of Processors','cpu_num',30,3,8,1,1,0,'1'),(135,'Index','index',10,3,3,1,0,0,''),(136,'Description','description',20,3,7,1,0,1,'System Information'),(137,'Index','index',10,19,3,1,0,0,''),(138,'Description','description',20,19,7,1,1,0,''),(139,'Description','description',20,13,7,1,1,0,''),(140,'Index','index',35,13,3,1,0,0,''),(141,'MAC Address','mac',30,13,8,0,0,1,''),(142,'Interface Index','ifindex',40,13,8,2,0,1,''),(143,'IP Address','address',25,13,7,1,0,1,''),(144,'Flip Graph In/Out','flipinout',45,13,5,2,1,0,'0'),(145,'Local IP','local',30,6,7,1,0,1,''),(146,'Remote IP','remote',40,6,3,1,0,0,''),(147,'Autonomous System','asn',20,6,7,1,0,1,''),(149,'Description','description',50,6,7,2,1,0,''),(150,'Process Name','process_name',10,15,3,2,0,0,''),(151,'Description','description',20,15,7,1,1,0,''),(153,'Instances at Discovery','instances',30,15,8,1,1,0,'1'),(154,'Pings to Send','pings',80,4,8,2,1,0,'50'),(155,'Pings to Send','pings',30,20,8,2,1,0,'50'),(156,'PL Threshold %','threshold',40,20,8,2,1,0,'70'),(157,'Interval (ms)','interval',50,20,8,2,1,0,'300'),(158,'Check Content RegExp','check_regexp',50,2,8,2,1,0,''),(159,'Current Instances','current_instances',10,15,20,0,0,0,'DS:current_instances:GAUGE:600:0:99999'),(160,'Index','index',10,22,3,0,0,0,'1'),(161,'Fixed Admin Status','fixed_admin_status',99,4,5,2,1,0,'0'),(162,'Usage Threshold %','usage_threshold',40,8,8,2,1,0,'80'),(164,'Used Memory','used_memory',20,15,20,0,0,0,'DS:used_memory:GAUGE:600:0:9999999'),(165,'IP Mask','mask',32,4,8,2,1,1,''),(167,'Show in Celcius','show_celcius',40,17,5,2,1,0,'1'),(168,'Port Number','port',10,23,3,1,1,0,''),(169,'Port Description','description',20,23,7,1,1,0,''),(170,'Connection Delay','conn_delay',10,23,20,0,0,0,'DS:conn_delay:GAUGE:600:0:100000'),(171,'Controller','controller',10,24,7,1,0,1,''),(172,'Drive','drvindex',11,24,7,1,0,1,''),(173,'Drive Model','model',15,24,8,1,0,1,''),(174,'Index','index',5,24,3,0,0,0,''),(175,'Index','index',5,25,3,0,0,0,''),(176,'Chassis','chassis',10,25,8,1,0,1,''),(177,'Fan','fanindex',11,25,8,1,0,1,''),(178,'Location','location',20,25,7,1,0,1,''),(179,'Index','index',5,26,3,0,1,0,''),(180,'Chassis','chassis',10,26,7,1,0,1,''),(181,'Sensor','tempindex',11,26,7,1,0,1,''),(182,'Location','location',2,26,7,1,0,1,''),(183,'Temperature','temperature',80,26,20,0,0,0,'DS:temperature:GAUGE:600:0:1000'),(184,'Index','index',10,27,3,0,0,0,'1'),(185,'Total Bytes Received','tbr',10,27,20,0,0,0,'DS:tbr:COUNTER:600:0:999999999'),(186,'Total CGI Requests','tcgir',20,27,20,0,0,0,'DS:tcgir:COUNTER:600:0:999999999'),(187,'Total Files Sent','tfs',30,27,20,0,0,0,'DS:tfs:COUNTER:600:0:999999999'),(188,'Total Gets','tg',40,27,20,0,0,0,'DS:tg:COUNTER:600:0:999999999'),(189,'Total Posts','tp',50,27,20,0,0,0,'DS:tp:COUNTER:600:0:999999999'),(190,'Serial Lines Free','pm_serial_free',10,28,20,1,0,0,'DS:pm_serial_free:GAUGE:600:0:5000'),(191,'Serial Lines Connecting','pm_serial_connecting',20,28,20,1,0,0,'DS:pm_serial_connecting:GAUGE:600:0:5000'),(192,'Serial Lines Established','pm_serial_established',30,28,20,1,0,0,'DS:pm_serial_established:GAUGE:600:0:5000'),(193,'Serial Lines Disconnecting','pm_serial_disconnecting',40,28,20,1,0,0,'DS:pm_serial_disconnecting:GAUGE:600:0:5000'),(194,'Serial Lines Command','pm_serial_command',50,28,20,1,0,0,'DS:pm_serial_command:GAUGE:600:0:5000'),(195,'Serial Lines NoService','pm_serial_noservice',60,28,20,1,0,0,'DS:pm_serial_noservice:GAUGE:600:0:5000'),(196,'Index','index',10,28,3,0,0,0,'1'),(197,'Process Threshold','proc_threshold',40,12,8,2,1,0,'100'),(199,'Description','description',20,29,7,2,1,0,'Apache Stats'),(200,'Total Accesses','tac',30,29,20,0,0,0,'DS:tac:COUNTER:600:0:100000'),(201,'IP:Port','ip_port',10,29,3,1,1,0,''),(202,'Total KBytes','tkb',20,29,20,0,0,0,'DS:tkb:COUNTER:600:0:10000000'),(203,'CPU Load','cplo',60,29,20,0,0,0,'DS:cplo:GAUGE:600:0:1000'),(204,'Uptime','up',10,29,20,0,0,0,'DS:up:GAUGE:600:0:99999999999999'),(205,'Bytes Per Request','bpr',40,29,20,0,0,0,'DS:bpr:GAUGE:600:0:10000000'),(208,'Busy Workers','bw',90,29,20,0,0,0,'DS:bw:GAUGE:600:0:1000'),(209,'Idle Workers','iw',50,29,20,0,0,0,'DS:iw:GAUGE:600:0:1000'),(210,'Index','index',10,31,3,0,0,0,'1'),(211,'Description','description',20,31,7,1,0,1,''),(212,'Battery Capacity','capacity',10,31,20,0,0,0,'DS:capacity:GAUGE:600:0:100'),(213,'Output Load','load',20,31,20,0,0,0,'DS:load:GAUGE:600:0:100'),(214,'Input Voltage','in_voltage',31,31,20,0,0,0,'DS:in_voltage:GAUGE:600:0:400'),(215,'Output Voltage','out_voltage',40,31,20,0,0,0,'DS:out_voltage:GAUGE:600:0:400'),(216,'Time Remaining','time_remaining',50,31,20,0,0,0,'DS:time_remaining:GAUGE:600:0:9999999999'),(217,'Temperature','temperature',60,31,20,0,0,0,'DS:temperature:GAUGE:600:0:200'),(218,'Show Temp in Celcius','show_celcius',31,31,5,2,1,0,'1'),(220,'Index','index',10,30,3,1,1,0,'1'),(221,'Description','description',20,30,7,1,1,0,''),(222,'DSN','dsn',30,30,8,2,1,0,''),(223,'Username','username',40,30,8,2,1,0,''),(224,'Password','password',50,30,8,2,1,0,''),(225,'Max Records','max_records',60,30,8,2,1,0,''),(226,'Min Records','min_records',70,30,8,2,1,0,''),(227,'Counter Records','records_counter',10,30,20,0,0,0,'DS:records_counter:COUNTER:600:0:9999999999'),(228,'Query','query',55,30,8,2,1,0,''),(229,'Absolute Records','records_absolute',20,30,20,0,0,0,'DS:records_absolute:GAUGE:600:0:9999999999'),(230,'Is Absolute?','absolute',80,30,5,1,1,0,'0'),(231,'Percentile','percentile',55,4,8,2,1,0,''),(232,'Index','index',10,32,3,0,0,0,''),(233,'Hostname','hostname',20,32,7,1,1,0,''),(234,'Max Connections','max_connections',30,32,8,2,1,0,''),(235,'Total Sessions','total_sessions',50,32,20,0,0,0,'DS:total_sessions:COUNTER:600:0:100000000'),(236,'Current Sessions','current_sessions',55,32,20,0,0,0,'DS:current_sessions:GAUGE:600:0:'),(237,'Failures','failures',60,32,20,0,0,0,'DS:failures:COUNTER:600:0:10000'),(238,'Octets','octets',65,32,20,0,0,0,'DS:octets:COUNTER:600:0:1000000000'),(239,'Index','index',10,33,3,0,0,1,''),(240,'Hostname','hostname',20,33,7,1,1,0,''),(241,'Total Sessions','total_sessions',30,33,20,0,0,0,'DS:total_sessions:COUNTER:600:0:100000000'),(242,'Current Sessions','current_sessions',35,33,20,0,0,0,'DS:current_sessions:GAUGE:600:0:20000'),(243,'Octets','octets',40,33,20,0,0,0,'DS:octets:COUNTER:600:0:1000000000'),(244,'Index','index',10,34,3,0,0,0,''),(245,'Hostname','hostname',20,34,7,1,0,0,''),(246,'Address','address',30,34,7,1,0,0,''),(247,'Port','port',35,34,7,1,0,0,''),(248,'Real Server','real_server',15,34,8,0,0,1,''),(249,'Response Time','response_time',40,34,20,0,0,0,'DS:response_time:GAUGE:600:0:10000'),(250,'Index','index',10,35,3,0,0,0,''),(251,'Description','description',20,35,7,1,0,0,''),(252,'Number of CPUs','cpu_num',30,35,8,0,0,0,''),(253,'TCP Active','tcp_active',40,35,20,0,0,0,'DS:tcp_active:COUNTER:600:0:10000'),(254,'TCP Passive','tcp_passive',41,35,20,0,0,0,'DS:tcp_passive:COUNTER:600:0:10000'),(255,'TCP Established','tcp_established',42,35,20,0,0,0,'DS:tcp_established:COUNTER:600:0:10000'),(256,'Memory Total','mem_total',50,35,20,0,0,0,'DS:mem_total:GAUGE:600:0:100000000'),(257,'Memory Used','mem_used',51,35,20,0,0,0,'DS:mem_used:GAUGE:600:0:100000000'),(258,'CPU A 1 Sec','cpua_1sec',60,35,20,0,0,0,'DS:cpua_1sec:GAUGE:600:0:1000'),(259,'CPU A 4 Secs','cpua_4secs',61,35,20,0,0,0,'DS:cpua_4secs:GAUGE:600:0:1000'),(260,'CPU A 64 Secs','cpua_64secs',62,35,20,0,0,0,'DS:cpua_64secs:GAUGE:600:0:1000'),(261,'CPU B 1 Sec','cpub_1sec',65,35,20,0,0,0,'DS:cpub_1sec:GAUGE:600:0:1000'),(262,'CPU B 4 Secs','cpub_4secs',66,35,20,0,0,0,'DS:cpub_4secs:GAUGE:600:0:1000'),(263,'CPU B 64 Secs','cpub_64secs',67,35,20,0,0,0,'DS:cpub_64secs:GAUGE:600:0:1000'),(264,'Index','index',10,36,3,0,0,0,''),(265,'Type','sensor_type',30,36,8,1,0,0,''),(266,'Value','sensor_value',40,36,20,0,0,0,'DS:sensor_value:GAUGE:600:0:3000000000'),(267,'Index','index',10,37,3,0,0,0,''),(268,'Description','description',20,37,7,1,0,0,''),(269,'Physical Status','phy',40,37,8,1,0,0,''),(270,'Tx Words','tx_words',40,37,20,0,0,0,'DS:tx_words:COUNTER:600:0:1000000000'),(271,'Rx Words','rx_words',45,37,20,0,0,0,'DS:rx_words:COUNTER:600:0:1000000000'),(272,'Tx Frames','tx_frames',50,37,20,0,0,0,'DS:tx_frames:COUNTER:600:0:100000000'),(273,'Rx Frames','rx_frames',55,37,20,0,0,0,'DS:rx_frames:COUNTER:600:0:100000000'),(274,'Index','index',10,38,3,0,0,0,'1'),(275,'Async Used','cisco_async',10,38,20,0,0,0,'DS:cisco_async:GAUGE:600:0:5000'),(276,'DSX Used','cisco_dsx',20,38,20,0,0,0,'DS:cisco_dsx:GAUGE:600:0:5000'),(277,'Free','cisco_free',30,38,20,0,0,0,'DS:cisco_free:GAUGE:600:0:5000'),(278,'Description','description',20,38,7,2,1,0,''),(279,'System Name','name',40,11,7,1,0,1,''),(280,'Location','location',50,11,7,1,0,1,''),(281,'Contact','contact',60,11,7,1,0,1,''),(282,'System Name','name',50,12,7,1,0,1,''),(283,'Location','location',60,12,7,1,0,1,''),(284,'Contact','contact',70,12,7,1,0,1,''),(285,'System Name','name',40,3,7,1,0,1,''),(286,'Location','location',50,3,7,1,0,1,''),(287,'Contact','contact',60,3,7,1,0,1,''),(288,'System Name','name',40,10,7,1,0,1,''),(289,'Location','location',50,10,7,1,0,1,''),(290,'Contact','contact',60,10,7,1,0,1,''),(291,'System Name','name',40,35,7,1,0,1,''),(292,'Location','location',50,35,7,1,0,1,''),(293,'Contact','contact',60,35,7,1,0,1,''),(294,'Index','index',10,39,3,0,0,0,''),(295,'Description','description',20,39,7,2,1,0,'SNMP Informant Disk Stats'),(296,'lDisk % Read Time','inf_d_read_time',20,39,20,0,0,0,'DS:inf_d_read_time:GAUGE:600:0:100'),(297,'lDisk % Write Time','inf_d_write_time',10,39,20,0,0,0,'DS:inf_d_write_time:GAUGE:600:0:100'),(298,'lDisk Read Rate','inf_d_read_rate',30,39,20,0,0,0,'DS:inf_d_read_rate:GAUGE:600:0:1048576000'),(299,'lDisk Write Rate','inf_d_write_rate',25,39,20,0,0,0,'DS:inf_d_write_rate:GAUGE:600:0:1048576000'),(300,'Index','index',10,40,3,0,0,0,'1'),(301,'Identification','ident',20,40,7,1,0,1,''),(302,'Description','description',30,40,7,2,1,0,''),(303,'Battery Temperature','temperature',10,40,20,0,0,0,'DS:temperature:GAUGE:600:0:200'),(304,'Show in Celcius','show_celcius',40,40,5,2,1,0,'1'),(305,'Minutes Remaining','minutes_remaining',20,40,20,0,0,0,'DS:minutes_remaining:GAUGE:600:0:10000'),(306,'Index','index',10,41,3,0,0,0,''),(307,'Line Type','line_type',20,41,8,0,0,0,''),(308,'Line Index','line_index',30,41,8,0,0,0,''),(309,'Description','description',40,41,7,2,1,0,''),(310,'Voltage','voltage',10,41,20,0,0,0,'DS:voltage:GAUGE:600:0:500'),(311,'Current','current',20,41,20,0,0,0,'DS:current:GAUGE:600:0:100'),(312,'Load','load',30,41,20,0,0,0,'DS:load:GAUGE:600:0:100'),(313,'Charge Remaining','charge_remaining',30,40,20,0,0,0,'DS:charge_remaining:GAUGE:600:0:100'),(314,'IPTables Chain','chainnumber',10,42,3,1,1,0,''),(315,'Default Policy','policy',30,42,7,1,1,0,''),(316,'Number of Packets','ipt_packets',10,42,20,0,0,0,'DS:ipt_packets:COUNTER:600:0:1000000000'),(317,'Number of Bytes','ipt_bytes',20,42,20,0,0,0,'DS:ipt_bytes:COUNTER:600:0:'),(318,'Description','description',20,42,7,2,1,0,''),(319,'Accepted Routers','accepted_routes',40,6,20,0,0,0,'DS:accepted_routes:GAUGE:600:0:900000'),(320,'Advertised Routers','advertised_routes',50,6,20,0,0,0,'DS:advertised_routes:GAUGE:600:0:900000'),(322,'Estimated Bandwidth','bandwidth',40,42,8,2,1,0,'10240000'),(323,'Index','index',10,43,3,0,0,0,''),(324,'Connections','pix_connections',10,43,20,0,0,0,'DS:pix_connections:GAUGE:600:0:1000000'),(325,'Description','description',20,43,7,1,1,0,''),(326,'Index','index',10,44,3,0,0,0,'1'),(327,'Description','description',20,44,7,2,1,0,''),(328,'Cisco Max Inbound NAT Bytes','NatInMax',30,44,8,2,1,0,'1000000000'),(329,'Cisco Max Outbound NAT Bytes','NatOutMax',40,44,8,2,1,0,'1000000000'),(330,'Cisco NAT Other IP Outbound','cisco_nat_other_ip_outbound',10,44,20,0,0,0,'DS:cisco_nat_other_ip_outbound:COUNTER:600:0:'),(331,'Cisco NAT Other IP Inbound','cisco_nat_other_ip_inbound',15,44,20,0,0,0,'DS:cisco_nat_other_ip_inbound:COUNTER:600:0:'),(332,'Cisco NAT ICMP Outbound','cisco_nat_icmp_outbound',20,44,20,0,0,0,'DS:cisco_nat_icmp_outbound:COUNTER:600:0:'),(333,'Cisco NAT ICMP Inbound','cisco_nat_icmp_inbound',25,44,20,0,0,0,'DS:cisco_nat_icmp_inbound:COUNTER:600:0:'),(334,'Cisco NAT UDP Outbound','cisco_nat_udp_outbound',30,44,20,0,0,0,'DS:cisco_nat_udp_outbound:COUNTER:600:0:'),(335,'Cisco NAT UDP Inbound','cisco_nat_udp_inbound',35,44,20,0,0,0,'DS:cisco_nat_udp_inbound:COUNTER:600:0:'),(336,'Cisco NAT TCP Outbound','cisco_nat_tcp_outbound',40,44,20,0,0,0,'DS:cisco_nat_tcp_outbound:COUNTER:600:0:'),(337,'Cisco NAT TCP Inbound','cisco_nat_tcp_inbound',45,44,20,0,0,0,'DS:cisco_nat_tcp_inbound:COUNTER:600:0:'),(338,'Cisco NAT Active Binds','cisco_nat_active_binds',50,44,20,0,0,0,'DS:cisco_nat_active_binds:GAUGE:600:0:100000'),(339,'Index','index',10,45,3,0,0,0,''),(340,'Value','value',10,45,20,0,0,0,'DS:value:GAUGE:600:-100000:100000'),(341,'Description','description',20,45,7,1,1,0,''),(342,'Show in Celcius','show_celcius',31,45,5,2,1,0,'1'),(343,'Show in Celcius','show_in_celcius',30,26,5,2,1,0,'1'),(344,'CPU Usage Threshold','cpu_threshold',90,3,8,2,1,0,'60'),(345,'Index','index',10,46,8,0,0,0,''),(346,'Description','description',20,46,7,2,1,0,''),(347,'CPU Usage','cpu400',10,46,20,0,0,0,'DS:cpu400:GAUGE:600:0:10000'),(348,'CPU Usage Threshold','cpu_threshold',90,11,8,2,1,0,'80'),(350,'Index','index',10,47,3,0,0,0,''),(351,'Description','description',20,47,7,1,1,0,'System Information'),(352,'Dell OpenManage Fan RPM #2','dell_om_fan_2',51,47,20,0,0,0,'DS:dell_om_fan_2:GAUGE:600:0:100000'),(353,'Dell OpenManage Fan RPM #3','dell_om_fan_3',52,47,20,0,0,0,'DS:dell_om_fan_3:GAUGE:600:0:100000'),(354,'Dell OpenManage Fan RPM #4','dell_om_fan_4',53,47,20,0,0,0,'DS:dell_om_fan_4:GAUGE:600:0:100000'),(355,'Dell OpenManage Fan RPM #5','dell_om_fan_5',54,47,20,0,0,0,'DS:dell_om_fan_5:GAUGE:600:0:100000'),(356,'Dell OpenManage Fan RPM #6','dell_om_fan_6',55,47,20,0,0,0,'DS:dell_om_fan_6:GAUGE:600:0:100000'),(357,'Dell OpenManage Fan RPM #7','dell_om_fan_7',56,47,20,0,0,0,'DS:dell_om_fan_7:GAUGE:600:0:100000'),(367,'UPS Type','upstype',50,40,7,1,0,1,''),(358,'UPS Type','upstype',50,41,7,1,0,1,''),(359,'Power','power',50,41,20,0,0,0,'DS:power:GAUGE:600:0:100000'),(360,'Description','description',20,48,7,1,0,0,''),(361,'Index','index',10,48,3,0,0,0,''),(362,'Index','index',10,49,3,0,0,0,''),(363,'Banks','banks',50,48,7,1,0,0,''),(364,'Power Rating Amps)','powerrating',40,49,7,1,0,0,''),(365,'Load (Amps)','load',50,49,20,0,0,0,'DS:load:GAUGE:600:0:100'),(366,'Overload Threshold','threshold',50,49,7,1,0,0,''),(394,'Index','index',5,50,3,0,0,0,''),(368,'Index','index',10,51,3,0,0,0,''),(369,'Health State','health_state',15,51,7,0,0,1,''),(370,'Serial Number','serial',20,51,7,1,0,1,''),(371,'Manuf date','manuf_date',30,51,7,1,0,1,''),(372,'CPU1 Temperature','temperature',35,51,20,0,0,0,'DS:temperature:GAUGE:600:0:100'),(373,'CPU2 Temperature','temperature2',40,51,20,0,0,0,'DS:temperature2:GAUGE:600:0:100'),(374,'Index','index',10,52,3,0,0,0,''),(375,'Oper Status','oper',30,52,8,1,0,0,''),(376,'Tx Frames','tx_frames',40,52,20,0,0,0,'DS:tx_frames:COUNTER:600:0:100000000'),(377,'Rx Frames','rx_frames',50,52,20,0,0,0,'DS:rx_frames:COUNTER:600:0:100000000'),(378,'FC Port','real_index',11,52,7,1,0,1,''),(379,'Admin Status','admin',20,52,8,1,0,0,''),(380,'Index','index',1,53,3,0,0,0,''),(381,'Description','description',10,53,7,1,1,0,''),(382,'Associated','associated',20,53,20,0,0,0,'DS:associated:GAUGE:600:0:2100'),(383,'Index','index',10,54,3,0,0,0,''),(384,'Power Module 1','module1',15,54,7,1,0,1,''),(385,'Power Module 2','module2',20,54,7,1,0,1,''),(386,'Power Consumption','fuelGaugePowerInUse',35,54,20,2,0,0,'DS:fuelGaugePowerInUse:GAUGE:600:0:10000'),(387,'Power Capacity','totalpower',30,54,7,1,0,0,''),(388,'Index','index',5,55,3,0,0,0,''),(389,'Chassis','chassis',10,55,8,1,0,1,''),(390,'Bay','bayindex',15,55,8,1,0,1,''),(391,'Index','index',1,56,3,0,0,0,''),(392,'Number of arrays','nb_arrays',10,56,8,1,0,0,''),(393,'Cpu Threshold','cpu_threshold',40,46,8,2,1,0,'90'),(406,'Index','index',5,57,3,0,0,0,''),(395,'Description','description',10,57,7,1,1,0,'Ldisk 64'),(396,'Current Queue Length','cur_disk_q',20,57,20,0,0,0,'DS:cur_disk_q:GAUGE:600:0:10000'),(397,'Average Queue Length','avg_disk_q',25,57,20,0,0,0,'DS:avg_disk_q:GAUGE:600:0:10000'),(398,'Average Read Queue Length','avg_disk_rdq',30,57,20,0,0,0,'DS:avg_disk_rdq:GAUGE:600:0:10000'),(399,'Average Write Queue Length','avg_disk_wrq',35,57,20,0,0,0,'DS:avg_disk_wrq:GAUGE:600:0:10000'),(400,'Percent Read Time','inf_d_read_time',40,57,20,0,0,0,'DS:inf_d_read_time:GAUGE:600:0:100'),(401,'Percent Write Time','inf_d_write_time',45,57,20,0,0,0,'DS:inf_d_write_time:GAUGE:600:0:100'),(402,'Reads Per Sec','rd_ops',50,57,20,0,0,0,'DS:rd_ops:GAUGE:600:0:10000'),(403,'Writes Per Sec','wr_ops',55,57,20,0,0,0,'DS:wr_ops:GAUGE:600:0:10000'),(404,'Read Bytes Per Sec','inf_d_read_rate',55,57,20,0,0,0,'DS:inf_d_read_rate:GAUGE:600:0:10000'),(405,'Write Bytes Per Sec','inf_d_write_rate',55,57,20,0,0,0,'DS:inf_d_write_rate:GAUGE:600:0:10000'),(407,'Ignore Case','ignore_case',30,15,8,1,1,0,'0'); /*!40000 ALTER TABLE `interface_types_fields` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `interfaces` -- DROP TABLE IF EXISTS `interfaces`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `interfaces` ( `id` int(10) NOT NULL AUTO_INCREMENT, `type` int(10) NOT NULL DEFAULT '1', `interface` char(30) NOT NULL DEFAULT '', `host` int(10) NOT NULL DEFAULT '1', `client` int(10) NOT NULL DEFAULT '1', `sla` int(10) NOT NULL DEFAULT '1', `poll` int(10) NOT NULL DEFAULT '1', `make_sound` tinyint(1) NOT NULL DEFAULT '1', `show_rootmap` tinyint(1) NOT NULL DEFAULT '1', `rrd_mode` tinyint(2) NOT NULL DEFAULT '2', `creation_date` int(10) NOT NULL DEFAULT '0', `modification_date` int(10) NOT NULL DEFAULT '0', `last_poll_date` int(10) NOT NULL DEFAULT '0', `poll_interval` int(5) NOT NULL DEFAULT '0', `check_status` tinyint(1) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), UNIQUE KEY `idint` (`id`), KEY `interface` (`interface`), KEY `host` (`host`), KEY `client` (`client`), KEY `poll` (`poll`), KEY `sla` (`sla`), KEY `interfacehost` (`interface`,`host`), KEY `last_poll_date` (`last_poll_date`), KEY `type` (`type`), KEY `check_status` (`check_status`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `interfaces` -- LOCK TABLES `interfaces` WRITE; /*!40000 ALTER TABLE `interfaces` DISABLE KEYS */; INSERT INTO `interfaces` VALUES (1,1,'Unknown0',1,1,1,1,1,1,1,0,0,0,0,1); /*!40000 ALTER TABLE `interfaces` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `interfaces_values` -- DROP TABLE IF EXISTS `interfaces_values`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `interfaces_values` ( `id` int(10) NOT NULL AUTO_INCREMENT, `interface` int(10) NOT NULL DEFAULT '0', `field` int(10) NOT NULL DEFAULT '0', `value` varchar(3000) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `interface_field` (`interface`,`field`), KEY `interface` (`interface`), KEY `field` (`field`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `interfaces_values` -- LOCK TABLES `interfaces_values` WRITE; /*!40000 ALTER TABLE `interfaces_values` DISABLE KEYS */; INSERT INTO `interfaces_values` VALUES (1,1,1,''); /*!40000 ALTER TABLE `interfaces_values` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `journal` -- DROP TABLE IF EXISTS `journal`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `journal` ( `id` int(10) NOT NULL AUTO_INCREMENT, `date_start` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `date_stop` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `comment` longtext NOT NULL, `subject` varchar(40) NOT NULL DEFAULT '', `active` tinyint(1) NOT NULL DEFAULT '1', `ticket` varchar(20) NOT NULL DEFAULT '', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `id_2` (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `journal` -- LOCK TABLES `journal` WRITE; /*!40000 ALTER TABLE `journal` DISABLE KEYS */; INSERT INTO `journal` VALUES (1,'2002-01-20 19:09:07','0000-00-00 00:00:00','Internally used ID','',0,''),(2,'2002-01-20 19:09:07','0000-00-00 00:00:00','Internally used ID','',0,''); /*!40000 ALTER TABLE `journal` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `logfiles` -- DROP TABLE IF EXISTS `logfiles`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `logfiles` ( `id` int(10) NOT NULL AUTO_INCREMENT, `filename` varchar(60) NOT NULL, `last_poll_date` int(10) NOT NULL DEFAULT '0', `file_offset` int(10) DEFAULT NULL, `description` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `logfiles` -- LOCK TABLES `logfiles` WRITE; /*!40000 ALTER TABLE `logfiles` DISABLE KEYS */; /*!40000 ALTER TABLE `logfiles` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `logfiles_match_groups` -- DROP TABLE IF EXISTS `logfiles_match_groups`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `logfiles_match_groups` ( `id` int(10) NOT NULL AUTO_INCREMENT, `logfile` int(10) NOT NULL, `pos` int(10) NOT NULL DEFAULT '10', `match_item` int(10) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `logfiles_match_groups` -- LOCK TABLES `logfiles_match_groups` WRITE; /*!40000 ALTER TABLE `logfiles_match_groups` DISABLE KEYS */; /*!40000 ALTER TABLE `logfiles_match_groups` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `logfiles_match_items` -- DROP TABLE IF EXISTS `logfiles_match_items`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `logfiles_match_items` ( `id` int(10) NOT NULL AUTO_INCREMENT, `description` varchar(30) NOT NULL, `match_text` varchar(255) NOT NULL, `interface` varchar(20) NOT NULL, `username` varchar(20) NOT NULL, `state` varchar(20) NOT NULL, `info` varchar(20) NOT NULL, `type` int(10) NOT NULL, `host` varchar(20) DEFAULT NULL, `logfile_id` int(10) NOT NULL DEFAULT '0', `pos` int(10) NOT NULL DEFAULT '10', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `logfiles_match_items` -- LOCK TABLES `logfiles_match_items` WRITE; /*!40000 ALTER TABLE `logfiles_match_items` DISABLE KEYS */; /*!40000 ALTER TABLE `logfiles_match_items` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `maps` -- DROP TABLE IF EXISTS `maps`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `maps` ( `id` int(10) NOT NULL AUTO_INCREMENT, `parent` int(10) NOT NULL DEFAULT '0', `name` char(60) NOT NULL DEFAULT '', `color` char(6) NOT NULL DEFAULT '00A348', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `id_2` (`id`), KEY `parent` (`parent`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='Map Hierarchy'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `maps` -- LOCK TABLES `maps` WRITE; /*!40000 ALTER TABLE `maps` DISABLE KEYS */; INSERT INTO `maps` VALUES (1,1,'Root Map','00A348'); /*!40000 ALTER TABLE `maps` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `maps_interfaces` -- DROP TABLE IF EXISTS `maps_interfaces`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `maps_interfaces` ( `id` int(10) NOT NULL AUTO_INCREMENT, `map` int(10) NOT NULL DEFAULT '0', `interface` int(10) NOT NULL DEFAULT '0', `x` int(5) NOT NULL DEFAULT '1', `y` int(5) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `id2` (`id`), KEY `map` (`map`), KEY `interface` (`interface`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='Map to Interface Mapping'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `maps_interfaces` -- LOCK TABLES `maps_interfaces` WRITE; /*!40000 ALTER TABLE `maps_interfaces` DISABLE KEYS */; INSERT INTO `maps_interfaces` VALUES (1,1,1,1,1); /*!40000 ALTER TABLE `maps_interfaces` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `nad_hosts` -- DROP TABLE IF EXISTS `nad_hosts`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `nad_hosts` ( `id` int(10) NOT NULL AUTO_INCREMENT, `snmp_name` char(120) NOT NULL DEFAULT '', `description` varchar(3000) NOT NULL, `snmp_community` char(60) NOT NULL DEFAULT '', `forwarding` tinyint(2) NOT NULL DEFAULT '0', `date_added` int(10) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Network AutoDiscovery Hosts'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `nad_hosts` -- LOCK TABLES `nad_hosts` WRITE; /*!40000 ALTER TABLE `nad_hosts` DISABLE KEYS */; /*!40000 ALTER TABLE `nad_hosts` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `nad_ips` -- DROP TABLE IF EXISTS `nad_ips`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `nad_ips` ( `id` int(10) NOT NULL AUTO_INCREMENT, `host` int(10) NOT NULL DEFAULT '1', `ip` char(20) NOT NULL DEFAULT '', `type` int(4) NOT NULL DEFAULT '0', `network` int(10) NOT NULL DEFAULT '1', `dns` char(120) NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY `host` (`host`,`ip`), KEY `network` (`network`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Network AutoDiscovery IPs'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `nad_ips` -- LOCK TABLES `nad_ips` WRITE; /*!40000 ALTER TABLE `nad_ips` DISABLE KEYS */; /*!40000 ALTER TABLE `nad_ips` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `nad_networks` -- DROP TABLE IF EXISTS `nad_networks`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `nad_networks` ( `id` int(10) NOT NULL AUTO_INCREMENT, `network` char(20) NOT NULL DEFAULT '', `deep` tinyint(2) NOT NULL DEFAULT '1', `oper_status` tinyint(2) NOT NULL DEFAULT '1', `parent` int(10) NOT NULL DEFAULT '1', `seed` int(10) NOT NULL DEFAULT '1', `oper_status_changed` int(10) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `network` (`network`), KEY `parent` (`parent`), KEY `seed` (`seed`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Network AutoDiscovery Networks'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `nad_networks` -- LOCK TABLES `nad_networks` WRITE; /*!40000 ALTER TABLE `nad_networks` DISABLE KEYS */; /*!40000 ALTER TABLE `nad_networks` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `pollers` -- DROP TABLE IF EXISTS `pollers`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `pollers` ( `id` int(10) NOT NULL AUTO_INCREMENT, `name` char(60) NOT NULL DEFAULT '', `description` char(60) NOT NULL DEFAULT '', `command` char(60) NOT NULL DEFAULT '', `parameters` char(100) NOT NULL DEFAULT '', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `id_2` (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `pollers` -- LOCK TABLES `pollers` WRITE; /*!40000 ALTER TABLE `pollers` DISABLE KEYS */; INSERT INTO `pollers` VALUES (1,'no_poller','No Poller','no_poller',''),(2,'input','SNMP Input Rate','snmp_counter','.1.3.6.1.2.1.2.2.1.10.'),(3,'verify_interface_number','Cisco Verify Interface Number','verify_interface_number',''),(5,'cisco_snmp_ping_start','Cisco SNMP Ping Start','cisco_snmp_ping_start',''),(6,'cisco_snmp_ping_wait','Cisco SNMP Ping Wait','cisco_snmp_ping_wait',''),(7,'packetloss','Cisco SNMP Ping Get PL','cisco_snmp_ping_get_pl',''),(8,'rtt','Cisco SNMP Ping Get RTT','cisco_snmp_ping_get_rtt',''),(9,'cisco_snmp_ping_end','Cisco SNMP Ping End','cisco_snmp_ping_end',''),(10,'output','SNMP Output Rate','snmp_counter','.1.3.6.1.2.1.2.2.1.16.'),(11,'outputerrors','SNMP Output Errors','snmp_counter','.1.3.6.1.2.1.2.2.1.20.'),(12,'inputerrors','SNMP Input Errors','snmp_counter','.1.3.6.1.2.1.2.2.1.14.'),(13,'interface_oper_status','SNMP Interface Operational Status','snmp_interface_status_all','8'),(14,'interface_admin_status','SNMP Interface Administrative Status','snmp_interface_status_all','7'),(16,'cpu','Cisco CPU Utilization','snmp_counter','.1.3.6.1.4.1.9.9.109.1.1.1.1.5.1'),(21,'inpackets','SNMP Input Packets','snmp_counter','.1.3.6.1.2.1.2.2.1.11.'),(22,'outpackets','SNMP Output Packets','snmp_counter','.1.3.6.1.2.1.2.2.1.17.'),(23,'tcp_status,tcp_content,conn_delay','TCP Port Check & Delay','tcp_status',''),(24,'mem_used','Cisco Used Memory','snmp_counter','.1.3.6.1.4.1.9.9.48.1.1.1.5.1'),(25,'mem_free','Cisco Free Memory','snmp_counter','.1.3.6.1.4.1.9.9.48.1.1.1.6.1'),(26,'drops','SNMP Drops','snmp_counter','.1.3.6.1.2.1.2.2.1.19.'),(30,'cpu','Cisco 2500 Series CPU Utilization','snmp_counter','.1.3.6.1.4.1.9.2.1.56.0'),(31,'bgpin','BGP Inbound Updates','snmp_counter','.1.3.6.1.2.1.15.3.1.10.'),(32,'bgpout','BGP Outbound Updates','snmp_counter','.1.3.6.1.2.1.15.3.1.11.'),(33,'bgpuptime','BGP Uptime','snmp_counter','.1.3.6.1.2.1.15.3.1.16.'),(35,'storage_used_blocks','Storage Device Used Blocks','snmp_counter','.1.3.6.1.2.1.25.2.3.1.6.'),(36,'storage_block_count','Storage Device Total Blocks','snmp_counter','.1.3.6.1.2.1.25.2.3.1.5.'),(37,'storage_block_size','Storage Device Block Size','snmp_counter','.1.3.6.1.2.1.25.2.3.1.4.'),(38,'bgp_peer_status','BGP Peer Status','bgp_peer_status',''),(40,'hits','CSS VIP Hits','snmp_counter','.1.3.6.1.4.1.2467.1.16.4.1.18.\"\".\"\"'),(41,'output','CSS VIP Traffic Rate','snmp_counter','.1.3.6.1.4.1.2467.1.16.4.1.25.\"\".\"\"'),(42,'cpu_kernel_ticks','CPU Kernel Time','snmp_counter','.1.3.6.1.4.1.2021.11.55.0'),(43,'cpu_idle_ticks','CPU Idle Time','snmp_counter','.1.3.6.1.4.1.2021.11.53.0'),(44,'cpu_wait_ticks','CPU Wait Time','snmp_counter','.1.3.6.1.4.1.2021.11.54.0'),(45,'cpu_system_ticks','CPU System Time','snmp_counter','.1.3.6.1.4.1.2021.11.52.0'),(46,'mem_available','Real Memory Available','snmp_counter','.1.3.6.1.4.1.2021.4.6.0'),(47,'mem_total','Real Memory Total','snmp_counter','.1.3.6.1.4.1.2021.4.5.0'),(48,'swap_available','Swap Memory Available','snmp_counter','.1.3.6.1.4.1.2021.4.4.0'),(49,'swap_total','Swap Memory Total','snmp_counter','.1.3.6.1.4.1.2021.4.3.0'),(50,'load_average_15','Load Average 15 min','snmp_counter','.1.3.6.1.4.1.2021.10.1.3.3'),(51,'load_average_5','Load Average 5 min','snmp_counter','.1.3.6.1.4.1.2021.10.1.3.2'),(52,'load_average_1','Load Average 1 min','snmp_counter','.1.3.6.1.4.1.2021.10.1.3.1'),(53,'cpu_user_ticks','CPU User Time','snmp_counter','.1.3.6.1.4.1.2021.11.50.0'),(54,'cpu_nice_ticks','CPU Nice Time','snmp_counter','.1.3.6.1.4.1.2021.11.51.0'),(55,'bandwidthin','Get Bandwidth IN from DB','db','bandwidthin,to_bytes'),(56,'bandwidthout','Get Bandwidth OUT from DB','db','bandwidthout,to_bytes'),(57,'tcp_conn_number','TCP Connection Numbers','tcp_connection_number',''),(58,'acct_bytes,acct_packets','Cisco Accounting','cisco_accounting',''),(59,'cpu','Host MIB Proc Average Util','snmp_walk_average','.1.3.6.1.2.1.25.3.3.1.2'),(60,'num_procs','Host MIB Number of Processes','snmp_counter','.1.3.6.1.2.1.25.1.6.0'),(61,'num_users','Host MIB Number of Users','snmp_counter','.1.3.6.1.2.1.25.1.5.0'),(62,'tcp_active','TCP MIB Active Opens','snmp_counter','.1.3.6.1.2.1.6.5.0'),(63,'tcp_passive','TCP MIB Passive Opens','snmp_counter','.1.3.6.1.2.1.6.6.0'),(64,'tcp_established','TCP MIB Established Connections','snmp_counter','.1.3.6.1.2.1.6.9.0'),(65,'inputpackets','Cisco MAC Accounting Input Packets','snmp_counter','.1.3.6.1.4.1.9.9.84.1.2.1.1.3..1.'),(66,'outputpackets','Cisco MAC Accounting Output Packets','snmp_counter','.1.3.6.1.4.1.9.9.84.1.2.1.1.3..2.'),(67,'input','Cisco MAC Accounting Input Bytes','snmp_counter','.1.3.6.1.4.1.9.9.84.1.2.1.1.4..1.'),(68,'output','Cisco MAC Accounting Output Bytes','snmp_counter','.1.3.6.1.4.1.9.9.84.1.2.1.1.4..2.'),(69,'packetloss','Smokeping Loss','smokeping','loss'),(70,'rtt','Smokeping RTT','smokeping','median'),(71,'app_status,current_instances','Host MIB Process Verifier','hostmib_apps',''),(72,'cisco_powersupply_status','Cisco Power Supply Status','cisco_envmib_status','5.1.3'),(73,'cisco_temperature_status','Cisco Temperature Status','cisco_envmib_status','3.1.6'),(74,'cisco_voltage_status','Cisco Voltage Status','cisco_envmib_status','2.1.7'),(75,'temperature','Cisco Temperature','snmp_counter','.1.3.6.1.4.1.9.9.13.1.3.1.3.'),(76,'sa_agent_verify','Verify SA Agent Operation','cisco_saagent_verify',''),(77,'forward_jitter','SA Agent Forward Jitter','cisco_saagent_forwardjitter',''),(78,'backward_jitter','SA Agent Backward Jitter','cisco_saagent_backwardjitter',''),(79,'rt_latency','SA Agent Round-Trip Latency','cisco_saagent_rtl',''),(80,'forward_packetloss','SA Agent fw % PacketLoss','cisco_saagent_fwpacketloss',''),(81,'backward_packetloss','SA Agent bw % PacketLoss','cisco_saagent_bwpacketloss',''),(82,'verify_smokeping_number','Verify Smokeping Number','verify_smokeping_number',''),(85,'tcp_content_analisis','TCP Port Response Check','tcp_port_content','tcp_content'),(86,'ping','Reachability Start FPING','reachability_start',''),(87,'wait','Reachability Wait until finished','reachability_wait',''),(88,'rtt','Reachability RTT','reachability_values','rtt'),(89,'packetloss','Reachability PL','reachability_values','pl'),(90,'ping_cleanup','Reachability End','reachability_end',''),(91,'status','Reachability Status','reachability_status',''),(93,'bytes','Linux TC Bytes','snmp_counter','.1.6.'),(94,'packets','Linux TC Packets','snmp_counter','.1.7.'),(95,'verify_tc_number','Linux TC Verfy Interface Number','verify_tc_class_number',''),(100,'tcp_status,tcp_content','TCP Port Status','buffer',''),(101,'app_status','Host MIB Status','buffer',''),(102,'ntp_status','NTP Status','ntp_client',''),(103,'used_memory','Host MIB Process Memory Usage','hostmib_perf','2'),(105,'udp_status,conn_delay','UDP Port Status & Delay','udp_status',''),(106,'udp_status','UDP Port Status','buffer',''),(107,'temperature','Compaq Temperature','snmp_counter','.1.3.6.1.4.1.232.6.2.6.8.1.4..'),(108,'temp_status','Compaq Temperature Status','snmp_status','.1.3.6.1.4.1.232.6.2.6.8.1.6..,2=up'),(109,'fan_status','Compaq Fan Condition','snmp_status','.1.3.6.1.4.1.232.6.2.6.7.1.9..,2=up'),(110,'compaq_disk','Compaq Drive Condition','snmp_status','.1.3.6.1.4.1.232.3.2.5.1.1.6..,2=up'),(111,'tbr','IIS Total Bytes Received','snmp_counter','.1.3.6.1.4.1.311.1.7.3.1.4.0'),(112,'tcgir','IIS Total CGI Requests','snmp_counter','.1.3.6.1.4.1.311.1.7.3.1.35.0'),(113,'tfs','IIS Total Files Sent','snmp_counter','.1.3.6.1.4.1.311.1.7.3.1.5.0'),(114,'tg','IIS Total GETs','snmp_counter','.1.3.6.1.4.1.311.1.7.3.1.18.0'),(115,'tp','IIS Total Posts','snmp_counter','.1.3.6.1.4.1.311.1.7.3.1.19.0'),(116,'pm_serial_free','Livingston Portmaster Free','livingston_serial_port_status','1'),(117,'pm_serial_established','Livingston Portmaster Established','livingston_serial_port_status','3'),(118,'pm_serial_disconnecting','Livingston Portmaster Disconnecting','livingston_serial_port_status','4'),(119,'pm_serial_command','Livingston Portmaster Command','livingston_serial_port_status','5'),(120,'pm_serial_connecting','Livingston Portmaster Connecting','livingston_serial_port_status','2'),(121,'pm_serial_noservice','Livingston Portmaster No Service','livingston_serial_port_status','6'),(122,'tac,tkb,cplo,up,bpr,bw,iw','Apache Status','apache',''),(123,'capacity','a APC Battery Capacity','snmp_counter','.1.3.6.1.4.1.318.1.1.1.2.2.1.0'),(124,'load','a APC Output Load','snmp_counter','.1.3.6.1.4.1.318.1.1.1.4.2.3.0'),(125,'in_voltage','a APC Input Voltage','snmp_counter','.1.3.6.1.4.1.318.1.1.1.3.2.1.0'),(126,'out_voltage','a APC Output Voltage','snmp_counter','.1.3.6.1.4.1.318.1.1.1.4.2.1.0'),(127,'time_remaining','a APC Time Remaining','snmp_counter','.1.3.6.1.4.1.318.1.1.1.2.2.3.0'),(128,'status','a APC Battery Status','snmp_status','.1.3.6.1.4.1.318.1.1.1.2.1.1.0,2=battery normal|1=battery unknown|3=battery low'),(129,'temperature','a APC Temperature','snmp_counter','.1.3.6.1.4.1.318.1.1.1.2.2.2.0'),(130,'output_status','a APC Output Status','snmp_status','.1.3.6.1.4.1.318.1.1.1.4.1.1.0,2=on line|3=on battery'),(131,'records_counter,records_absolute','ODBC Query','odbc_query',''),(132,'sql_status','SQL Query Status','sql_status',''),(133,'admin_state','Alteon RServer Admin','snmp_counter','.1.3.6.1.4.1.1872.2.1.5.2.1.10.'),(134,'oper_state','Alteon RServer Oper','snmp_status','.1.3.6.1.4.1.1872.2.1.9.2.2.1.7.,2=up'),(135,'current_sessions','Alteon RServer Current Sessions','snmp_counter','.1.3.6.1.4.1.1872.2.1.8.2.5.1.2.'),(136,'failures','Alteon RServer Failures','snmp_counter','.1.3.6.1.4.1.1872.2.1.8.2.5.1.4.'),(137,'octets','Alteon RServer Octets','snmp_counter','.1.3.6.1.4.1.1872.2.1.8.2.5.1.7.'),(138,'total_sessions','Alteon RServer Total Sessions','snmp_counter','.1.3.6.1.4.1.1872.2.1.8.2.5.1.3.'),(139,'admin_state','Alteon VServer Admin State','snmp_counter','.1.3.6.1.4.1.1872.2.1.5.5.1.4.'),(140,'current_sessions','Alteon VServer Current Sessions','snmp_counter','.1.3.6.1.4.1.1872.2.1.8.2.7.1.2.'),(141,'total_sessions','Alteon VServer Total Sessions','snmp_counter','.1.3.6.1.4.1.1872.2.1.8.2.7.1.3.'),(142,'octets','Alteon VServer Octets','snmp_counter','.1.3.6.1.4.1.1872.2.1.8.2.7.1.6.'),(143,'admin_state','Alteon RService Admin State','snmp_counter','.1.3.6.1.4.1.1872.2.1.5.2.1.10.'),(144,'oper_state','Alteon RService Oper State','snmp_status','.1.3.6.1.4.1.1872.2.1.9.2.4.1.6.,2=up'),(145,'response_time','Alteon RService Response Time','snmp_counter','.1.3.6.1.4.1.1872.2.1.9.2.4.1.7.'),(146,'cpua_1sec','Alteon CPU A 1Sec','snmp_counter','.1.3.6.1.4.1.1872.2.1.8.16.1.0'),(147,'cpua_4secs','Alteon CPU A 4Secs','snmp_counter','.1.3.6.1.4.1.1872.2.1.8.16.3.0'),(148,'cpua_64secs','Alteon CPU A 64Secs','snmp_counter','.1.3.6.1.4.1.1872.2.1.8.16.5.0'),(149,'cpub_1sec','Alteon CPU B 1Sec','snmp_counter','.1.3.6.1.4.1.1872.2.1.8.1.16.2.0'),(150,'cpub_4secs','Alteon CPU B 4 Secs','snmp_counter','.1.3.6.1.4.1.1872.2.1.8.16.4.0'),(151,'cpub_64secs','Alteon CPU B 64Secs','snmp_counter','.1.3.6.1.4.1.1872.2.1.8.16.6.0'),(152,'mem_total','Alteon Memory Total','snmp_counter','.1.3.6.1.4.1.1872.2.1.8.12.6.0'),(153,'mem_used','Alteon Memory Used','snmp_counter','.1.3.6.1.4.1.1872.2.1.8.12.4.0'),(154,'sensor_value','Brocade Sensor Value','snmp_counter','1.3.6.1.4.1.1588.2.1.1.1.1.22.1.4.'),(155,'oper_status','Brocade Sensor Oper','snmp_status','1.3.6.1.4.1.1588.2.1.1.1.1.22.1.3.,4=ok|3=alert|5=alert'),(156,'tx_words','Brocade FCPort TxWords','snmp_counter','1.3.6.1.4.1.1588.2.1.1.1.6.2.1.11.'),(157,'rx_words','Brocade FCPort RxWords','snmp_counter','1.3.6.1.4.1.1588.2.1.1.1.6.2.1.12.'),(158,'tx_frames','Brocade FCPort TxFrames','snmp_counter','1.3.6.1.4.1.1588.2.1.1.1.6.2.1.13.'),(159,'rx_frames','Brocade FCPort RxFrames','snmp_counter','1.3.6.1.4.1.1588.2.1.1.1.6.2.1.14.'),(160,'admin_state','Brocade Fc Port Admin State','snmp_counter','1.3.6.1.4.1.1588.2.1.1.1.6.2.1.5.'),(161,'oper_status','Brocade fC Ports Oper Status','snmp_status','1.3.6.1.4.1.1588.2.1.1.1.6.2.1.4.,1=up|3=testing'),(162,'phy_state','Brocade FC Port Phy State','brocade_fcport_phystate',''),(163,'cisco_async','Cisco Async Utilisation','cisco_serial_port_status','1'),(164,'cisco_dsx','Cisco DSX Utilisation','cisco_serial_port_status','2'),(165,'cisco_free','Cisco Port Free','cisco_serial_port_status','3'),(166,'inf_d_read_time','Informant Disk Read Time','snmp_counter','.1.3.6.1.4.1.9600.1.1.1.1.2.'),(167,'inf_d_write_time','Informant Disk Write Time','snmp_counter','.1.3.6.1.4.1.9600.1.1.1.1.4.'),(168,'inf_d_read_rate','Informant Disk Read Rate','snmp_counter','.1.3.6.1.4.1.9600.1.1.1.1.15.'),(169,'inf_d_write_rate','Informant Disk Write Rate','snmp_counter','.1.3.6.1.4.1.9600.1.1.1.1.18.'),(170,'status','UPS Battery Status','snmp_status','.1.3.6.1.2.1.33.1.2.1.0,2=battery normal|1=battery unknown|3=battery low|3=battery depleted'),(171,'temperature','UPS Battery Temperature','snmp_counter','.1.3.6.1.2.1.33.1.2.7.0'),(172,'minutes_remaining','UPS Battery Minutes Remaining','snmp_counter','.1.3.6.1.2.1.33.1.2.3.0'),(173,'charge_remaining','UPS Battery Charge Remaining','snmp_counter','.1.3.6.1.2.1.33.1.2.4.0'),(174,'voltage','UPS Lines Voltage','ups_line',''),(175,'current','UPS Lines Current','ups_line',''),(176,'load','UPS Lines Load','ups_line',''),(177,'ipt_packets','IPTables Chain Packets','snmp_counter','.1.3.6.1.4.1.2021.5002.1.4.'),(178,'ipt_bytes','IPTables Chainl Bytes','snmp_counter','.1.3.6.1.4.1.2021.5002.1.5.'),(179,'accepted_routes','BGP Accepted Routes','snmp_counter','.1.3.6.1.4.1.9.9.187.1.2.4.1.1..1.1'),(180,'advertised_routes','BGP Advertised Routes','snmp_counter','.1.3.6.1.4.1.9.9.187.1.2.4.1.6..1.1'),(181,'pix_connections','Pix Connections Poller','snmp_counter','.1.3.6.1.4.1.9.9.147.1.2.2.2.1.5.'),(182,'cisco_nat_other_ip_inbound','Cisco NAT Other IP Inbound','snmp_counter','.1.3.6.1.4.1.9.10.77.1.3.1.1.2.1'),(183,'cisco_nat_icmp_inbound','Cisco NAT ICMP Inbound','snmp_counter','.1.3.6.1.4.1.9.10.77.1.3.1.1.2.2'),(184,'cisco_nat_udp_inbound','Cisco NAT UDP Inbound','snmp_counter','.1.3.6.1.4.1.9.10.77.1.3.1.1.2.3'),(185,'cisco_nat_tcp_inbound','Cisco NAT TCP Inbound','snmp_counter','.1.3.6.1.4.1.9.10.77.1.3.1.1.2.4'),(186,'cisco_nat_other_ip_outbound','Cisco NAT Other IP Outbound','snmp_counter','.1.3.6.1.4.1.9.10.77.1.3.1.1.3.1'),(187,'cisco_nat_icmp_outbound','Cisco NAT ICMP Outbound','snmp_counter','.1.3.6.1.4.1.9.10.77.1.3.1.1.3.2'),(188,'cisco_nat_udp_outbound','Cisco NAT UDP Outbound','snmp_counter','.1.3.6.1.4.1.9.10.77.1.3.1.1.3.3'),(189,'cisco_nat_tcp_outbound','Cisco NAT TCP Outbound','snmp_counter','.1.3.6.1.4.1.9.10.77.1.3.1.1.3.4'),(190,'cisco_nat_active_binds','Cisco NAT Active Binds','snmp_counter','.1.3.6.1.4.1.9.10.77.1.2.1.0'),(191,'value','Sensor Value','snmp_counter','.1.3.6.1.2.1.25.8.1.5.'),(192,'storage_verify','Verify Storage Index','verify_storage_index',''),(193,'cpu400','OS 400 System Load','snmp_counter','.1.3.6.1.4.1.2.6.4.5.1.0'),(194,'dell_om_chassis','Dell OpenManage Chassis','snmp_status','1.3.6.1.4.1.674.10892.1.200.10.1.2.1,1=other|2=unknown|3=ok|4=noncritical|5=critical|6=nonrecoverabl'),(195,'dell_om_temp','Dell OpenManage Ambient Temp','snmp_counter','1.3.6.1.4.1.674.10892.1.700.20.1.6.1.1'),(196,'dell_om_fan_1','Dell OpenManage Fan RPM #1','snmp_counter','1.3.6.1.4.1.674.10892.1.700.12.1.6.1.1'),(197,'dell_om_fan_2','Dell OpenManage Fan RPM #2','snmp_counter','1.3.6.1.4.1.674.10892.1.700.12.1.6.1.2'),(198,'dell_om_fan_3','Dell OpenManage Fan RPM #3','snmp_counter','1.3.6.1.4.1.674.10892.1.700.12.1.6.1.3'),(199,'dell_om_fan_4','Dell OpenManage Fan RPM #4','snmp_counter','1.3.6.1.4.1.674.10892.1.700.12.1.6.1.4'),(200,'dell_om_fan_5','Dell OpenManage Fan RPM #5','snmp_counter','1.3.6.1.4.1.674.10892.1.700.12.1.6.1.5'),(201,'dell_om_fan_6','Dell OpenManage Fan RPM #6','snmp_counter','1.3.6.1.4.1.674.10892.1.700.12.1.6.1.6'),(202,'dell_om_fan_7','Dell OpenManage Fan RPM #7','snmp_counter','1.3.6.1.4.1.674.10892.1.700.12.1.6.1.7'),(203,'power','UPS Lines Power','ups_line',''),(204,'status','PDU Load Status','snmp_status','.1.3.6.1.4.1.318.1.1.12.2.3.1.1.3.,1=load normal|2=load low|3=load near overload|4=load ove'),(205,'load','PDU Banks Load','pdu_banks',''),(206,'ibm_component_health','IBM Component Health Status','snmp_status','1.3.6.1.4.1.2.6.159.1.1.30.3.1.2.,0=up|1=warning|2=down'),(207,'status','IBM Blade Server Health Status','snmp_status_ibm','.1.3.6.1.4.1.2.3.51.2.22.1.5.1.1.5.,1=up|2=warning|3=down'),(208,'temperature','IBM Blade Server CPU1 Temp','snmp_ibm_temperature','.1.3.6.1.4.1.2.3.51.2.22.1.5.3.1.13.'),(209,'status','IBM Blade Power Status','snmp_status_ibm','.1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.3.index>,1=up|2=warning|3=down'),(210,'fuelGaugePowerInUse','IBM Blade Power Gauge','snmp_ibm_power','.1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.10.'),(211,'temperature2','IBM Blade Server CPU2 Temp','snmp_ibm_temperature','.1.3.6.1.4.1.2.3.51.2.22.1.5.3.1.14.'),(212,'status','FC Oper Status','snmp_status','.1.3.6.1.2.1.75.1.2.2.1.2.,1=up|2=offline|4=linkFailure'),(213,'rx_frames','FCPort RxFrames','snmp_counter','.1.3.6.1.2.1.75.1.4.3.1.1.'),(214,'tx_frames','FCPort TxFrames','snmp_counter','.1.3.6.1.2.1.75.1.4.3.1.2.'),(215,'associated','Client Associated','snmp_counter','.1.3.6.1.4.1.9.9.273.1.1.2.1.1.1'),(216,'power_status','Compaq Power Condition','snmp_status','1.3.6.1.4.1.232.6.2.9.3.1.4..,2=up'),(217,'status','IBM Storage Controller status','ibm_ds_storage','controler'),(218,'arraystatus','AS 400 System','snmp_array_null','.1.3.6.1.2.1.25.2.3.1.6'),(219,'cur_disk_q','Inf-64 Disk CurrentDiskQueue','snmp_counter','.1.3.6.1.4.1.9600.1.2.44.1.16.'),(220,'avg_disk_q','Inf-64 Disk AvgDiskQueu','snmp_counter','.1.3.6.1.4.1.9600.1.2.44.1.10.'),(221,'avg_disk_rdq','Inf-64 Disk avg Read DiskQueue','snmp_counter','.1.3.6.1.4.1.9600.1.2.44.1.11.'),(222,'avg_disk_wrq','Inf-64 Disk avg Write DiskQueue','snmp_counter','.1.3.6.1.4.1.9600.1.2.44.1.12.'),(223,'inf_d_read_time','Inf-64 Disk Read Time','snmp_counter','.1.3.6.1.4.1.9600.1.2.44.1.2.'),(224,'inf_d_write_time','Inf-64 Disk Write Time','snmp_counter','.1.3.6.1.4.1.9600.1.2.44.1.4.'),(225,'rd_ops','Inf-64 Disk Read rate','snmp_counter','.1.3.6.1.4.1.9600.1.2.44.1.19.'),(226,'wr_ops','Inf-64 Disk Write rate','snmp_counter','.1.3.6.1.4.1.9600.1.2.44.1.22.'),(227,'inf_d_read_rate','Inf-64 Disk Read Bytes','snmp_counter','.1.3.6.1.4.1.9600.1.2.44.1.18.'),(228,'inf_d_write_rate','Inf-64 Disk Write Bytes','snmp_counter','.1.3.6.1.4.1.9600.1.2.44.1.21.'),(229,'input','SNMP Input Rate HC','snmp_counter','.1.3.6.1.2.1.2.2.1.10.,.1.3.6.1.2.1.31.1.1.1.6.'),(230,'output','SNMP Output Rate HC','snmp_counter','.1.3.6.1.2.1.2.2.1.16.,.1.3.6.1.2.1.31.1.1.1.10.'),(231,'inpackets','SNMP Input Packets HC','snmp_counter','.1.3.6.1.2.1.2.2.1.11.,.1.3.6.1.2.1.31.1.1.1.7.'),(232,'outpackets','SNMP Output Packets HC','snmp_counter','.1.3.6.1.2.1.2.2.1.17.,.1.3.6.1.2.1.31.1.1.1.11.'); /*!40000 ALTER TABLE `pollers` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `pollers_backend` -- DROP TABLE IF EXISTS `pollers_backend`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `pollers_backend` ( `id` int(10) NOT NULL AUTO_INCREMENT, `description` char(60) NOT NULL DEFAULT '', `command` char(60) NOT NULL DEFAULT '', `parameters` char(60) NOT NULL DEFAULT '', `type` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `type` (`type`) ) ENGINE=MyISAM AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `pollers_backend` -- LOCK TABLES `pollers_backend` WRITE; /*!40000 ALTER TABLE `pollers_backend` DISABLE KEYS */; INSERT INTO `pollers_backend` VALUES (1,'No Backend','no_backend','',0),(2,'Unknown Event','event','1',0),(9,'Temporal Buffer','buffer','',0),(10,'RRDTool All DSs','rrd','*',0),(12,'Alarm Verify Operational','alarm','3,,180',1),(14,'Change Interface Number','verify_interface_number','',0),(19,'Alarm TCP Port','alarm','22',1),(20,'Alarm Environmental','alarm','26',1),(24,'Alarm BGP Peer','alarm','6,,180',1),(25,'Application Alarm','alarm','38',1),(27,'Alarm TCP Content','alarm','39',1),(28,'Alarm Reachability','alarm','40',1),(29,'Admin Status Change View','db','show_rootmap,down=2|up=1,0',1),(30,'Multiple Temporal Buffer','multi_buffer','',0),(31,'Alarm NTP','alarm','41,nothing',1),(32,'RRD Individual Value','rrd','',0),(33,'Alarm APC','alarm','60',1),(34,'Alarm SQL Records','alarm','50',1),(35,'Alteon Admin Status View','db','show_rootmap,down=0|up=2,2',1),(36,'Alarm Alteon RServer','alarm','68',1),(37,'Alarm Alteon Service','alarm','69',1),(38,'Alarm Alteon VServer','alarm','70',1),(39,'Brocace FC Admin View','db','show_rootmap,down=2|up=1,0',0),(40,'Alarm Brocade FC Port','alarm','71',1),(41,'Alarm IBM','alarm','75',1),(42,'IBM San Trap','event','77',0),(43,'Alarm OS/400','alarm','78',1),(44,'Alarm IBM Storage Controller','alarm','80',1); /*!40000 ALTER TABLE `pollers_backend` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `pollers_groups` -- DROP TABLE IF EXISTS `pollers_groups`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `pollers_groups` ( `id` int(10) NOT NULL AUTO_INCREMENT, `description` char(60) NOT NULL DEFAULT '', `interface_type` int(10) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `pollers_groups` -- LOCK TABLES `pollers_groups` WRITE; /*!40000 ALTER TABLE `pollers_groups` DISABLE KEYS */; INSERT INTO `pollers_groups` VALUES (1,'No Polling',1),(2,'Cisco Interface',4),(3,'Cisco Router',3),(5,'TCP/IP Port',2),(8,'BGP Neighbor',6),(9,'Storage Device',8),(10,'CSS VIP',9),(11,'Linux/Unix Host',11),(12,'Solaris Host',10),(13,'Windows Host',12),(14,'Cisco Accounting',13),(15,'Smokeping Host',14),(16,'HostMIB Application',15),(17,'Cisco Power Supply',16),(18,'Cisco Tempererature',17),(19,'Cisco Voltage',18),(20,'Cisco SA Agent',19),(21,'Reachability',20),(22,'TC Class',21),(23,'NTP',22),(24,'UDP/IP Port',23),(25,'Compaq Physical Drive',24),(26,'Compaq Fan',25),(27,'Compaq Temperature',26),(28,'IIS Info',27),(29,'Livingston Portmaster',28),(30,'Apache',29),(31,'APC',31),(32,'ODBC',30),(33,'Alteon Real Server',32),(34,'Alteon Virtual Server',33),(35,'Alteon Real Services',34),(36,'Alteon System Info',35),(37,'Brocade Sensors',36),(38,'Brocade FC Ports',37),(39,'Cisco Dialup',38),(40,'Windows Informant Disks',39),(41,'UPS',40),(42,'UPS Lines',41),(43,'IPTable Chain',42),(44,'PIX Connection Stat',43),(45,'Cisco NAT',44),(46,'Sensors',45),(47,'OS/400 Host',46),(48,'Dell Chassis',47),(49,'PDU',48),(50,'PDU Banks',49),(57,'IBM Component Health',50),(51,'IBM Blade Servers',51),(52,'Fibre Channel Interface',52),(53,'Cisco 802.11X Device',53),(54,'IBM Blade Power Module',54),(55,'Compaq Power Supply',55),(56,'IBM Storage Controller',56),(58,'Informant Disks 64',57),(59,'Cisco Interface HC',4),(60,'SNMP Interface',4),(61,'SNMP Interface HC',4); /*!40000 ALTER TABLE `pollers_groups` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `pollers_poller_groups` -- DROP TABLE IF EXISTS `pollers_poller_groups`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `pollers_poller_groups` ( `id` int(10) NOT NULL AUTO_INCREMENT, `poller_group` int(10) NOT NULL DEFAULT '1', `pos` tinyint(4) NOT NULL DEFAULT '1', `poller` int(10) NOT NULL DEFAULT '1', `backend` int(10) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `poller_group` (`poller_group`), KEY `poller` (`poller`), KEY `backend` (`backend`) ) ENGINE=MyISAM AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `pollers_poller_groups` -- LOCK TABLES `pollers_poller_groups` WRITE; /*!40000 ALTER TABLE `pollers_poller_groups` DISABLE KEYS */; INSERT INTO `pollers_poller_groups` VALUES (1,1,1,1,1),(2,2,20,2,9),(3,2,10,3,14),(4,2,15,5,9),(5,2,50,6,1),(6,2,55,7,9),(7,2,60,8,9),(8,2,65,9,1),(9,2,30,10,9),(10,2,40,11,9),(11,2,45,12,9),(12,2,80,1,10),(14,2,16,13,12),(16,3,10,16,9),(20,3,2,20,19),(21,2,25,21,9),(22,2,35,22,9),(23,5,10,23,30),(24,3,20,24,9),(25,3,50,1,10),(26,3,30,25,9),(27,2,46,26,9),(30,8,10,31,32),(31,8,40,32,32),(32,8,50,33,32),(35,9,10,37,9),(36,9,20,36,9),(37,9,30,35,9),(38,9,60,1,10),(39,8,5,38,24),(41,10,10,41,9),(42,10,20,40,9),(43,10,60,1,10),(44,11,10,54,9),(45,11,20,53,9),(46,11,30,43,9),(47,11,40,45,9),(48,11,50,52,9),(49,11,60,51,9),(50,11,70,50,9),(51,11,80,1,10),(52,12,10,45,9),(53,12,20,43,9),(54,12,30,42,9),(55,12,40,44,9),(56,12,50,52,9),(57,12,60,51,9),(58,12,70,50,9),(59,12,80,46,9),(60,12,90,47,9),(61,12,100,48,9),(62,12,110,49,9),(63,12,120,1,10),(64,2,47,55,9),(65,2,48,56,9),(66,5,20,57,9),(67,5,60,1,10),(68,3,40,58,30),(69,13,10,59,9),(70,13,20,60,9),(71,13,30,61,9),(72,13,40,62,9),(73,13,50,64,9),(74,13,60,63,9),(75,13,100,1,10),(76,11,15,60,9),(77,11,25,61,9),(78,11,35,64,9),(79,11,45,62,9),(80,11,55,63,9),(81,3,15,64,9),(82,3,25,62,9),(83,3,35,63,9),(84,14,10,65,9),(85,14,20,67,9),(86,14,30,68,9),(87,14,40,66,9),(88,14,50,1,10),(89,15,30,70,9),(90,15,20,69,9),(91,15,90,1,10),(92,16,10,71,30),(93,17,20,72,20),(94,18,10,73,20),(95,19,20,74,20),(96,18,20,75,9),(97,18,50,1,10),(98,20,10,76,11),(99,20,20,77,9),(100,20,30,81,9),(101,20,40,80,9),(102,20,50,79,9),(103,20,60,78,9),(104,20,90,1,10),(105,15,10,82,14),(106,5,30,85,27),(107,21,1,86,9),(108,21,122,87,1),(109,21,123,88,9),(110,21,124,89,9),(111,21,126,90,1),(112,21,125,91,28),(113,21,127,1,10),(114,22,92,93,9),(115,22,93,94,9),(116,22,91,95,14),(117,22,94,1,10),(122,2,17,14,29),(123,5,15,100,19),(124,16,20,101,25),(125,16,90,1,10),(126,23,50,102,31),(127,16,30,103,9),(129,24,10,105,30),(130,24,20,106,19),(131,24,30,1,10),(132,27,10,108,20),(133,27,20,107,9),(134,27,90,1,10),(135,26,10,109,20),(136,25,10,110,20),(137,28,10,111,9),(138,28,20,112,9),(139,28,30,113,9),(140,28,40,114,9),(141,28,50,115,9),(142,28,90,1,10),(143,29,90,1,10),(144,29,10,116,9),(145,29,20,120,9),(146,29,30,117,9),(147,29,50,119,9),(148,29,60,121,9),(149,29,40,118,9),(150,30,20,1,10),(151,30,10,122,30),(152,31,10,128,20),(153,31,20,123,9),(154,31,31,124,9),(155,31,40,125,9),(156,31,50,126,9),(157,31,60,127,9),(158,31,90,1,10),(159,31,70,129,9),(160,31,15,130,33),(161,32,10,131,30),(162,32,20,132,34),(163,32,90,1,10),(164,33,10,133,35),(165,33,15,134,12),(166,33,20,135,9),(167,33,25,136,9),(168,33,30,137,9),(169,33,35,138,9),(170,33,90,1,10),(171,34,10,139,29),(172,34,20,140,9),(173,34,30,142,9),(174,34,40,141,9),(175,34,90,1,10),(176,35,10,143,29),(177,35,30,144,37),(178,35,20,145,9),(179,35,90,1,10),(180,36,10,146,9),(181,36,11,147,9),(182,36,12,148,9),(183,36,15,149,9),(184,36,16,150,9),(185,36,17,151,9),(186,36,20,62,9),(187,36,21,63,9),(188,36,22,64,9),(189,36,30,153,9),(190,36,35,152,9),(191,36,90,1,10),(192,37,10,155,12),(193,37,20,154,9),(194,37,90,1,10),(195,38,40,156,9),(196,38,45,157,9),(197,38,50,158,9),(198,38,55,159,9),(199,38,90,1,10),(200,38,10,160,39),(201,38,20,161,12),(202,38,30,162,40),(203,39,10,165,9),(204,39,20,164,9),(205,39,30,163,9),(206,39,90,1,10),(207,40,10,168,32),(208,40,20,169,32),(209,40,30,166,32),(210,40,40,167,32),(211,41,10,170,20),(212,41,20,173,32),(213,41,30,172,32),(214,41,40,171,32),(215,42,10,174,32),(216,42,20,175,32),(217,42,30,176,32),(218,43,10,178,32),(219,43,20,177,32),(220,8,20,179,32),(221,8,30,180,32),(222,44,10,181,32),(223,45,50,190,32),(224,45,10,186,32),(225,45,20,187,32),(226,45,30,188,32),(227,45,40,189,32),(228,45,15,182,32),(229,45,25,183,32),(230,45,35,184,32),(231,45,45,185,32),(232,46,20,191,32),(233,9,5,192,14),(234,47,1,193,32),(235,48,20,194,29),(236,48,10,194,12),(237,48,30,195,32),(238,48,40,196,9),(239,48,41,197,9),(240,48,42,198,9),(241,48,43,199,9),(242,48,44,200,9),(243,48,45,201,9),(244,48,46,202,9),(245,48,50,1,10),(246,42,50,203,32),(247,49,10,204,32),(248,50,10,205,32),(249,57,1,206,41),(250,51,1,207,20),(251,51,5,208,9),(252,52,1,212,20),(253,52,5,213,9),(254,52,10,214,9),(255,52,20,1,10),(256,51,10,211,9),(257,51,15,1,10),(258,53,1,215,32),(259,54,1,210,32),(260,54,2,209,41),(261,55,10,216,20),(262,56,1,217,44),(263,47,5,218,43),(264,58,10,219,32),(265,58,20,220,32),(266,58,30,221,32),(267,58,40,222,32),(268,58,50,223,32),(269,58,60,224,32),(270,58,70,225,32),(271,58,80,226,32),(272,58,90,227,32),(273,58,100,228,32),(274,59,10,3,14),(275,59,15,5,9),(276,59,16,13,12),(277,59,17,14,29),(278,59,20,229,9),(279,59,25,231,9),(280,59,30,230,9),(281,59,35,232,9),(282,59,40,11,9),(283,59,45,12,9),(284,59,46,26,9),(285,59,47,55,9),(286,59,48,56,9),(287,59,50,6,1),(288,59,55,7,9),(289,59,60,8,9),(290,59,65,9,1),(291,59,80,1,10),(292,60,10,3,14),(293,60,16,13,12),(294,60,17,14,29),(295,60,20,2,9),(296,60,25,21,9),(297,60,30,10,9),(298,60,35,22,9),(299,60,40,11,9),(300,60,45,12,9),(301,60,46,26,9),(302,60,47,55,9),(303,60,48,56,9),(304,60,80,1,10),(305,61,10,3,14),(306,61,16,13,12),(307,61,17,14,29),(308,61,20,229,9),(309,61,25,231,9),(310,61,30,230,9),(311,61,35,232,9),(312,61,40,11,9),(313,61,45,12,9),(314,61,46,26,9),(315,61,47,55,9),(316,61,48,56,9),(317,61,80,1,10); /*!40000 ALTER TABLE `pollers_poller_groups` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `profiles` -- DROP TABLE IF EXISTS `profiles`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `profiles` ( `id` int(10) NOT NULL AUTO_INCREMENT, `userid` int(10) NOT NULL DEFAULT '1', `profile_option` int(10) DEFAULT '1', `value` int(10) DEFAULT '1', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `id_2` (`id`), KEY `tag` (`profile_option`), KEY `userid` (`userid`) ) ENGINE=MyISAM AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 COMMENT='User Authorization'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `profiles` -- LOCK TABLES `profiles` WRITE; /*!40000 ALTER TABLE `profiles` DISABLE KEYS */; INSERT INTO `profiles` VALUES (1,1,1,1),(2,2,9,12),(3,2,11,300),(4,2,13,30),(5,2,16,36),(6,2,20,46),(7,2,25,50),(8,2,2,8),(9,2,8,6),(10,2,14,32),(11,2,15,34),(12,2,6,20); /*!40000 ALTER TABLE `profiles` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `profiles_options` -- DROP TABLE IF EXISTS `profiles_options`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `profiles_options` ( `id` int(10) NOT NULL AUTO_INCREMENT, `tag` char(30) NOT NULL DEFAULT '', `description` char(60) NOT NULL DEFAULT '', `editable` tinyint(1) NOT NULL DEFAULT '0', `show_in_profile` tinyint(1) NOT NULL DEFAULT '1', `use_default` tinyint(1) NOT NULL DEFAULT '0', `default_value` char(60) NOT NULL DEFAULT '', `type` char(10) NOT NULL DEFAULT '', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `id_2` (`id`), KEY `tag` (`tag`) ) ENGINE=MyISAM AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COMMENT='Authorization Tags'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `profiles_options` -- LOCK TABLES `profiles_options` WRITE; /*!40000 ALTER TABLE `profiles_options` DISABLE KEYS */; INSERT INTO `profiles_options` VALUES (1,'NO_TAG','No Option',1,1,0,'','select'),(2,'ADMIN_ACCESS','Administration Access',0,1,0,'1','select'),(6,'REPORTS_VIEW_ALL_INTERFACES','View All Interfaces',0,1,0,'1','select'),(8,'ADMIN_USERS','User Administration',0,1,0,'1','select'),(9,'MAP_SOUND','Map Sound',1,1,1,'1','select'),(11,'EMAIL','eMail',1,1,1,'','text'),(12,'MAP','Base Map',0,0,0,'1','text'),(13,'EVENTS_SOUND','Events Sound',1,1,1,'1','select'),(14,'ADMIN_SYSTEM','System Administration',0,1,0,'1','select'),(15,'ADMIN_HOSTS','Host Administration',0,1,0,'1','select'),(16,'VIEW_REPORTS','Reports Access',0,0,1,'1','select'),(19,'POPUPS_DISABLED','Disable Popups',0,1,0,'1','select'),(20,'VIEW_STARTPAGE_STATS','View Start Page Stats',1,1,1,'1','select'),(21,'EVENTS_DEFAULT_FILTER','Events Default Filter',1,1,0,'0','text'),(22,'EVENTS_REFRESH','Events Refresh Interval (secs)',1,1,0,'20','text'),(23,'MAP_REFRESH','Map Refresh Interval (secs)',1,1,0,'20','text'),(24,'SMSALIAS','SMS Pager Alias',1,1,0,'','text'),(25,'VIEW_TYPE_DEFAULT','Default View Type',1,1,1,'dhtml','select'),(26,'VIEW_DEFAULT','Default View',1,1,0,'start','select'),(27,'CUSTOMER','Customer Filter',0,1,0,'','text'); /*!40000 ALTER TABLE `profiles_options` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `profiles_values` -- DROP TABLE IF EXISTS `profiles_values`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `profiles_values` ( `id` int(10) NOT NULL AUTO_INCREMENT, `profile_option` int(10) NOT NULL DEFAULT '1', `description` char(30) NOT NULL DEFAULT '', `value` char(250) NOT NULL DEFAULT '', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `profile_option` (`profile_option`) ) ENGINE=MyISAM AUTO_INCREMENT=301 DEFAULT CHARSET=utf8 COMMENT='Profiles Options Values'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `profiles_values` -- LOCK TABLES `profiles_values` WRITE; /*!40000 ALTER TABLE `profiles_values` DISABLE KEYS */; INSERT INTO `profiles_values` VALUES (1,1,'No Value','1'),(5,9,'Disable','0'),(6,8,'Yes','1'),(7,8,'No','0'),(8,2,'Yes','1'),(12,9,'Enable','1'),(20,6,'Yes','1'),(21,6,'No','0'),(30,13,'Yes','1'),(31,13,'No','0'),(32,14,'Yes','1'),(33,14,'No','0'),(34,15,'Yes','1'),(35,15,'No','0'),(36,16,'Yes','1'),(37,16,'No','0'),(43,19,'Yes','1'),(44,19,'No','0'),(46,20,'Yes','1'),(47,20,'No','0'),(48,25,'Normal','normal'),(49,25,'Text Only','text'),(50,25,'DHTML','dhtml'),(52,25,'Normal Big','normal-big'),(53,25,'DHTML Big','dhtml-big'),(55,26,'Start Page','start'),(56,26,'Hosts & Events','hosts-events'),(57,26,'Interfaces & Events','interfaces-events'),(58,26,'Maps & Events','maps-events'),(59,26,'Alarmed Interfaces & Events','alarmed-events'),(60,26,'Alarmed Interfaces','alarmed'),(61,26,'Interfaces','interfaces'),(62,26,'Hosts','hosts'),(63,26,'Maps','maps'),(64,26,'Hosts All Interfaces','hosts-all-int'),(65,26,'Events','events'),(66,26,'Alarmed Hosts & Events','alarmed-hosts-events'),(300,11,'',''); /*!40000 ALTER TABLE `profiles_values` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `satellites` -- DROP TABLE IF EXISTS `satellites`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `satellites` ( `id` int(10) NOT NULL AUTO_INCREMENT, `description` char(40) NOT NULL DEFAULT '', `parent` int(10) NOT NULL DEFAULT '1', `url` char(150) NOT NULL DEFAULT '', `sat_group` int(10) NOT NULL DEFAULT '1', `sat_type` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `parent` (`parent`), KEY `sat_type` (`sat_type`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='Satellites'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `satellites` -- LOCK TABLES `satellites` WRITE; /*!40000 ALTER TABLE `satellites` DISABLE KEYS */; INSERT INTO `satellites` VALUES (1,'Local',1,'',1,1); /*!40000 ALTER TABLE `satellites` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `severity` -- DROP TABLE IF EXISTS `severity`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `severity` ( `id` tinyint(10) NOT NULL AUTO_INCREMENT, `level` tinyint(10) NOT NULL DEFAULT '0', `severity` char(20) NOT NULL DEFAULT '', `bgcolor` char(15) NOT NULL DEFAULT '', `fgcolor` char(15) NOT NULL DEFAULT '', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `nivel` (`level`) ) ENGINE=MyISAM AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `severity` -- LOCK TABLES `severity` WRITE; /*!40000 ALTER TABLE `severity` DISABLE KEYS */; INSERT INTO `severity` VALUES (1,127,'Unknown','000000','FFFFFF'),(2,30,'Warning','00AA00','FFFFFF'),(3,40,'Fault','F51D30','EEEEEE'),(4,50,'Big Fault','DA4725','FFFFFF'),(5,60,'Critical','FF0000','FFFFFF'),(13,10,'Administrative','8D00BA','FFFFFF'),(14,20,'Information','F9FD5F','000000'),(18,35,'Service','0090F0','FFFFFF'); /*!40000 ALTER TABLE `severity` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `slas` -- DROP TABLE IF EXISTS `slas`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `slas` ( `id` int(10) NOT NULL AUTO_INCREMENT, `description` char(60) NOT NULL DEFAULT '', `state` int(10) NOT NULL DEFAULT '3', `info` char(60) NOT NULL DEFAULT '', `event_type` int(10) NOT NULL DEFAULT '12', `threshold` tinyint(3) NOT NULL DEFAULT '100', `interface_type` int(10) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `id_2` (`id`), KEY `state` (`state`), KEY `event_type` (`event_type`) ) ENGINE=MyISAM AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `slas` -- LOCK TABLES `slas` WRITE; /*!40000 ALTER TABLE `slas` DISABLE KEYS */; INSERT INTO `slas` VALUES (1,'No SLA',3,'No SLA',12,100,1),(4,'Customer Satellite Link',3,'Customer Sat Link:',12,75,4),(5,'Main Fiber Link',3,'Main Link:',12,100,4),(6,'Main Satellite Link',3,'Main Sat Link:',12,100,4),(7,'Cisco Router',3,'Router:',12,100,3),(8,'Smokeping Host',3,'Smokeping:',12,100,14),(9,'Storage',3,'Storage',12,100,8),(10,'Linux/Unix CPU',3,'',12,100,11),(11,'Windows CPU',3,'',12,100,12),(12,'APC UPS',3,'APC UPS',12,100,31); /*!40000 ALTER TABLE `slas` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `slas_cond` -- DROP TABLE IF EXISTS `slas_cond`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `slas_cond` ( `id` int(10) NOT NULL AUTO_INCREMENT, `cond` char(250) NOT NULL, `description` char(60) NOT NULL DEFAULT '', `event` char(60) NOT NULL DEFAULT '', `variable_show` char(250) NOT NULL DEFAULT '', `variable_show_info` char(60) NOT NULL DEFAULT '', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `id_2` (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COMMENT='SLA Atomic Conditions'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `slas_cond` -- LOCK TABLES `slas_cond` WRITE; /*!40000 ALTER TABLE `slas_cond` DISABLE KEYS */; INSERT INTO `slas_cond` VALUES (1,'1=2','Unknown','Unknown','',''),(2,'( > 60)','RoundTrip Time > 60ms','RTT > 60','','ms'),(3,'( (( * 100) / ) > 20)','Packet Loss > 20%','PL > 20%','(( * 100) / )','%'),(4,'( < ((*95)/100))','Input Traffic < 95%','IN < 95%','( / 1000)','Kbps'),(5,'AND','AND','','',''),(6,'OR','OR','','',''),(7,'( > 700)','RoundTrip Time > 700ms','RTT > 700','','ms'),(8,'( > 900)','RoundTrip Time > 900ms','RTT > 900','','ms'),(9,'((( * 100) / ) > 50)','Packet Loss > 50%','PL > 50%','(( * 100) / )','%'),(11,'( > ((*90)/100))','Input Traffic > 90%','IN > 90%','( / 1000)','Kbps'),(12,'( < ((*1)/100))','Input Traffic < 1%','IN < 1 %','',''),(13,' ( > ((*90)/100))','Output Traffic > 90%','OUT > 90%','( / 1000 )','kbps'),(14,'( < ((*95)/100))','Output Traffic < 95%','OUT < 95%','( / 1000 )','kbps'),(15,'( ( ( / ( + + 1) )*100) > 20)','Input Error Rate > 20%','IN ERR > 20%','( ( / ( + + 1) )*100)','% = eps'),(16,'( ( ( / ( + + 1) )*100) > 10)','Input Error Rate > 10%','IN ERR > 10%','( ( / ( + + 1) )*100)','% = eps'),(18,'( ( ( / ( + 1) )*100) > 1)','Drops > 1%','Drops > 1%','( ( / ( + 1) )*100)','% = dps'),(19,' ( ( ( / ( + 1) )*100) > 2)','Drops > 2%','Drops > 2%','( ( / ( + 1) )*100)','% = dps'),(20,'((( * 100) / ) > 10)','Packet Loss > 10%','PL > 10%','(( * 100) / )','%'),(21,'( ( ( / ( + + 1) )*100) > 10)','Drops > 10%','Drops > 10%','( ( / ( + + 1) )*100)','%'),(22,' ( < ((*99)/100))','Input Traffic < 99%','IN < 99%',' ( / 1000 )','Kbps'),(23,' ( < ((*99)/100))',' Output Traffic < 99%',' OUT < 99%',' ( / 1000 )','Kbps'),(24,'( > )','High CPU Utilization','Usage > %','','%'),(25,'( > 10)','SP Packet Loss > 10%','Packet Loss > 10%','','%'),(26,'( > ((*)/100))','Used Storage','Used > %','(( * 100)/)','%'),(27,'( > 5 )','Load Average > 5','Load Average > 5','',''),(28,'(((( + + ) * 100 ) / ( + + + )) > )','High CPU Utilization','Usage > %','((( + + ) * 100 ) / ( + + + ))','%'),(29,'( (( * 100) / ( + )) > 80)','Memory Usage > 80%','Memory Usage > 80%','(( * 100) / ( + ))','%'),(30,'( > 90)','CPU Utilization > 90%','CPU > 90%','','%'),(31,'( > )','Too Many Processes','Processes > ','','Processes'),(32,'( > 55)','APC temp > 55','APC temp > 55','','C'),(33,'( < 300000)','APC time < 50 minutes','APC time < 50 minutes','','min'); /*!40000 ALTER TABLE `slas_cond` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `slas_sla_cond` -- DROP TABLE IF EXISTS `slas_sla_cond`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `slas_sla_cond` ( `id` int(10) NOT NULL AUTO_INCREMENT, `pos` tinyint(2) NOT NULL DEFAULT '1', `sla` int(10) NOT NULL DEFAULT '1', `cond` int(10) NOT NULL DEFAULT '1', `show_in_result` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `id_2` (`id`), KEY `sla` (`sla`), KEY `cond` (`cond`) ) ENGINE=MyISAM AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COMMENT='SLA - Condition Relationships'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `slas_sla_cond` -- LOCK TABLES `slas_sla_cond` WRITE; /*!40000 ALTER TABLE `slas_sla_cond` DISABLE KEYS */; INSERT INTO `slas_sla_cond` VALUES (1,1,1,1,0),(9,30,4,4,0),(10,40,4,7,1),(11,50,4,20,1),(12,70,4,6,0),(13,74,4,5,0),(14,10,5,11,1),(15,20,5,2,1),(16,40,5,20,1),(17,50,5,6,0),(18,60,5,6,0),(19,10,6,11,1),(20,30,6,7,1),(21,60,6,6,0),(22,40,6,3,1),(23,50,6,6,0),(33,20,4,14,0),(35,75,4,6,0),(36,15,5,13,1),(37,70,5,6,0),(38,20,6,13,1),(39,70,6,6,0),(40,10,4,16,1),(41,73,4,5,0),(42,45,6,16,1),(43,55,6,6,0),(44,30,5,16,1),(45,45,5,6,0),(47,60,4,18,1),(48,72,4,6,0),(49,10,7,24,1),(50,10,8,25,1),(51,30,8,6,0),(52,20,8,2,1),(53,1,9,26,1),(54,10,10,27,1),(55,20,10,28,1),(56,30,10,6,0),(57,20,7,29,1),(58,30,7,6,0),(59,10,11,30,1),(60,20,11,31,1),(61,30,11,6,0),(62,5,12,32,1),(63,10,12,6,0),(64,1,12,33,1); /*!40000 ALTER TABLE `slas_sla_cond` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `syslog` -- DROP TABLE IF EXISTS `syslog`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `syslog` ( `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `host` varchar(128) DEFAULT NULL, `date_logged` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `message` text, `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `analized` tinyint(2) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `analized` (`analized`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `syslog` -- LOCK TABLES `syslog` WRITE; /*!40000 ALTER TABLE `syslog` DISABLE KEYS */; /*!40000 ALTER TABLE `syslog` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `syslog_types` -- DROP TABLE IF EXISTS `syslog_types`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `syslog_types` ( `id` int(10) NOT NULL AUTO_INCREMENT, `match_text` char(255) NOT NULL DEFAULT '', `interface` char(10) NOT NULL DEFAULT '', `username` char(20) NOT NULL DEFAULT '', `state` char(10) NOT NULL DEFAULT '', `info` char(10) NOT NULL DEFAULT '', `type` int(10) NOT NULL DEFAULT '1', `pos` tinyint(3) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `id_2` (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `syslog_types` -- LOCK TABLES `syslog_types` WRITE; /*!40000 ALTER TABLE `syslog_types` DISABLE KEYS */; INSERT INTO `syslog_types` VALUES (1,'UNKNOWN','0','','','*',1,1),(2,'%SYS-5-CONFIG_I:.+|%SYS-5-CONFIG:','7','5','','3',2,1),(3,'%LINEPROTO-5-UPDOWN:','5','','9','',3,1),(4,'%LINK-3-UPDOWN:','2','','6','',4,1),(5,'%CONTROLLER-5-UPDOWN:','3','','7','2',5,1),(6,'%BGP-5-ADJCHANGE:','2','','3','6',6,1),(7,'%LINK-5-CHANGED:','2','','7','6',7,1),(9,'%RCMD-4-RSHPORTATTEMPT:','5','','','7',9,1),(17,'%CLEAR-5-COUNTERS:','5','7','','10',17,1),(20,'%PIX-2-106006:','7','5','1','3',29,1),(21,'%PIX-2-106007:','7','5','1','3',29,1),(22,'%PIX-2-106001:','8','6','4','2',29,1),(25,'%PIX-3-106010:','7','5','1','3',29,1),(26,'%PIX-3-106014:','7','5','1','3',29,1),(29,'%PIX-3-305006:.+|%PIX-2-106012:.+|%PIX-3-305005:.+|%PIX-3-307001:.+','','','','D',28,1),(30,'%CDP-4-DUPLEX_MISMATCH:','5','10','','11',34,1),(31,'%SEC-6-IPACCESSLOGS:','2','4','3','5',35,1),(32,'%SEC-6-IPACCESSLOGP:.+|%SEC-6-IPACCESSLOGNP:','2','7','3','8',35,1),(33,'%BGP-3-NOTIFICATION: (\\S+ \\S+) neighbor (\\S+) \\S+ (\\S+ \\S+ \\S+) \\S+ \\S+','2','','1','3',36,1),(34,'%SYS-5-RESTART:','','','','D',26,1),(35,'%SYS-5-RELOAD:','','','','D',26,1),(36,'%SEC-6-IPACCESSLOGDP:','2','5','3','9',35,1),(37,'EXCESSCOLL:','1','','','',37,1),(38,'^([^[]+)(?:\\[\\d+\\])?:\\s+(.+)$','1','','','2',44,100),(39,'CRON\\[\\d+\\]: \\((\\S+)\\) CMD (.*)','cron','1','','2',45,1),(40,'^(\\S.*)\\[info\\]\\s*(\\S+)\\s*(\\S.*)','1','','2','3',46,10),(41,'^(\\S.*)\\[error\\]\\s*(\\S+)\\s*(\\S.*)','1','','2','3',48,10),(42,'^(\\S.*)\\[warning\\]\\s*(\\S+)\\s*(\\S.*)','1','','2','3',47,10),(43,'^security\\[failure\\] (\\d*) (.*)','','','1','2',49,10),(44,'%PIX-1-(\\d*): (.*)','1','','','2',67,2),(45,'%PIX-2-(\\d*): (.*)','1','','','2',66,2),(46,'%PIX-3-(\\d*): (.*)','1','','','2',65,2),(47,'%PIX-4-(\\d*): (.*)','1','','','2',64,2),(48,'%PIX-6-(\\d*): (.*)','1','','','2',62,2),(49,'%PIX-5-(\\d*): (.*)','1','','','2',63,2),(50,'%PIX-7-(\\d*): (.*)','1','','','2',61,2),(51,'%PIX-4-106023:','6','4','1','2',29,1),(52,'^UPS: (.*)\\. (.*)$','UPS','','','1',26,1),(53,'WebOS : real server (\\S+) operational','1','','up','',68,1),(54,'WebOS : cannot contact real server (\\S+)','1','','down','',68,1),(55,'WebOS : No services are available for Virtual Server\\d+:(\\S+)','1','','down','',70,1),(56,'WebOS : Services are available for Virtual Server\\d+:(\\S+)','1','','up','',70,1),(57,'WebOS : real service (\\S+) operational','1','','up','',69,1),(58,'WebOS : cannot contact real service (\\S+)','1','','closed','',69,1),(59,'%ISDN-6-CONNECT: Interface (\\S+) is now (\\S+) (.+)$','1','','2','3',72,1),(60,'%ISDN-6-DISCONNECT: Interface (\\S+) (\\S+) (.+)$','1','','2','3',72,1); /*!40000 ALTER TABLE `syslog_types` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `tools` -- DROP TABLE IF EXISTS `tools`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `tools` ( `id` int(10) NOT NULL AUTO_INCREMENT, `description` char(60) NOT NULL DEFAULT '', `name` char(30) NOT NULL DEFAULT '', `file_group` char(30) NOT NULL DEFAULT '', `itype` int(10) NOT NULL DEFAULT '1', `pos` int(3) NOT NULL DEFAULT '1', `allow_set` tinyint(1) NOT NULL DEFAULT '0', `allow_get` tinyint(1) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), KEY `itype` (`itype`,`pos`) ) ENGINE=MyISAM AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `tools` -- LOCK TABLES `tools` WRITE; /*!40000 ALTER TABLE `tools` DISABLE KEYS */; INSERT INTO `tools` VALUES (1,'Nothing','none','none',1,1,0,1),(3,'Description','if_alias','',4,2,1,1),(4,'Change Admin Status','if_admin','',4,3,1,1),(5,'Connections List','tcp_cnx','',2,1,1,1); /*!40000 ALTER TABLE `tools` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `trap_receivers` -- DROP TABLE IF EXISTS `trap_receivers`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `trap_receivers` ( `id` int(10) NOT NULL AUTO_INCREMENT, `position` int(4) NOT NULL DEFAULT '0', `match_oid` char(100) NOT NULL DEFAULT '', `description` char(60) NOT NULL DEFAULT '', `command` char(60) NOT NULL DEFAULT '', `parameters` char(250) NOT NULL DEFAULT '', `backend` int(10) NOT NULL DEFAULT '1', `interface_type` int(10) NOT NULL DEFAULT '1', `stop_if_matches` tinyint(1) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `id_2` (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=10002 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `trap_receivers` -- LOCK TABLES `trap_receivers` WRITE; /*!40000 ALTER TABLE `trap_receivers` DISABLE KEYS */; INSERT INTO `trap_receivers` VALUES (1,99,'.*','Default Trap Receiver','unknown','',2,1,1),(2,10,'.1.3.6.1.6.3.1.1.5.4','Link Up','static','up,interfacenumber,1',12,4,1),(3,10,'.1.3.6.1.6.3.1.1.5.3','Link Down','static','down,interfacenumber,1',12,4,1),(4,10,'enterprises.1123.4.300.0.1','IBM DS Event','static','warning,state,2',12,1,1),(10001,10,'enterprises.9.0.1','blah','static','warning,state,2',2,4,1); /*!40000 ALTER TABLE `trap_receivers` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `traps` -- DROP TABLE IF EXISTS `traps`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `traps` ( `id` int(10) NOT NULL AUTO_INCREMENT, `ip` char(20) NOT NULL DEFAULT '', `trap_oid` char(250) NOT NULL DEFAULT '', `analized` tinyint(1) NOT NULL DEFAULT '0', `date` int(10) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `id_2` (`id`), KEY `analized` (`analized`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `traps` -- LOCK TABLES `traps` WRITE; /*!40000 ALTER TABLE `traps` DISABLE KEYS */; /*!40000 ALTER TABLE `traps` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `traps_varbinds` -- DROP TABLE IF EXISTS `traps_varbinds`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `traps_varbinds` ( `id` int(10) NOT NULL AUTO_INCREMENT, `trapid` int(10) NOT NULL DEFAULT '0', `trap_oid` varchar(250) DEFAULT NULL, `value` varchar(250) NOT NULL DEFAULT '', `oidid` int(10) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `trapid` (`trapid`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Trap Variable Bindings'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `traps_varbinds` -- LOCK TABLES `traps_varbinds` WRITE; /*!40000 ALTER TABLE `traps_varbinds` DISABLE KEYS */; /*!40000 ALTER TABLE `traps_varbinds` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `triggers` -- DROP TABLE IF EXISTS `triggers`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `triggers` ( `id` int(10) NOT NULL AUTO_INCREMENT, `description` char(40) NOT NULL DEFAULT '', `type` char(20) NOT NULL DEFAULT 'alarm', PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='Triggers to be check'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `triggers` -- LOCK TABLES `triggers` WRITE; /*!40000 ALTER TABLE `triggers` DISABLE KEYS */; INSERT INTO `triggers` VALUES (1,'No Trigger','alarm'),(2,'Interface Status Change','alarm'); /*!40000 ALTER TABLE `triggers` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `triggers_rules` -- DROP TABLE IF EXISTS `triggers_rules`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `triggers_rules` ( `id` int(10) NOT NULL AUTO_INCREMENT, `trigger_id` int(10) NOT NULL DEFAULT '1', `pos` int(4) NOT NULL DEFAULT '10', `field` char(40) NOT NULL DEFAULT '', `operator` char(20) NOT NULL DEFAULT '', `value` char(100) NOT NULL DEFAULT '', `action_id` int(10) NOT NULL DEFAULT '1', `action_parameters` char(250) NOT NULL DEFAULT '', `stop` tinyint(1) NOT NULL DEFAULT '1', `and_or` tinyint(1) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), KEY `trigger_id` (`trigger_id`,`pos`) ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='Trigger Rules'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `triggers_rules` -- LOCK TABLES `triggers_rules` WRITE; /*!40000 ALTER TABLE `triggers_rules` DISABLE KEYS */; INSERT INTO `triggers_rules` VALUES (1,1,10,'none','=','',1,'',1,1),(2,2,10,'type','!IN','12,25',2,'from:,subject: ,comment:Default Trigger',0,1); /*!40000 ALTER TABLE `triggers_rules` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `triggers_users` -- DROP TABLE IF EXISTS `triggers_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `triggers_users` ( `id` int(10) NOT NULL AUTO_INCREMENT, `user_id` int(10) NOT NULL DEFAULT '1', `trigger_id` int(10) NOT NULL DEFAULT '1', `active` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `user_id` (`user_id`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='Multiple triggers per user Relationship'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `triggers_users` -- LOCK TABLES `triggers_users` WRITE; /*!40000 ALTER TABLE `triggers_users` DISABLE KEYS */; INSERT INTO `triggers_users` VALUES (1,1,1,0); /*!40000 ALTER TABLE `triggers_users` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `types` -- DROP TABLE IF EXISTS `types`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `types` ( `id` int(10) NOT NULL AUTO_INCREMENT, `description` char(30) NOT NULL DEFAULT '', `severity` int(10) NOT NULL DEFAULT '1', `text` char(250) NOT NULL DEFAULT '', `generate_alarm` tinyint(1) NOT NULL DEFAULT '0', `alarm_up` int(10) NOT NULL DEFAULT '1', `alarm_duration` int(5) NOT NULL DEFAULT '0', `show_default` tinyint(1) NOT NULL DEFAULT '1', `show_host` tinyint(1) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `id_2` (`id`), KEY `severity` (`severity`), KEY `description` (`description`), KEY `generate_alarm` (`generate_alarm`) ) ENGINE=MyISAM AUTO_INCREMENT=10002 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `types` -- LOCK TABLES `types` WRITE; /*!40000 ALTER TABLE `types` DISABLE KEYS */; INSERT INTO `types` VALUES (1,'Unknown',2,' ',0,1,0,1,1),(2,'Configuration',2,': Changed Configuration from ',0,1,0,1,1),(3,'Interface Protocol',3,'Interface Protocol ( )',1,1,0,1,1),(4,'Interface Link',4,'Interface Link ( )',0,1,0,1,1),(5,'Controller Status',4,'Controller ',0,1,0,1,1),(6,'BGP Status',5,'BGP Neighbor ( )',1,1,0,1,1),(7,'Interface Shutdown',4,'Interface ( )',0,4,0,1,1),(8,'Command',2,': ',0,1,0,1,1),(9,'RShell Attempt',14,'RShell attempt from ',0,1,0,1,1),(12,'SLA',14,' ( )',1,1,1800,1,1),(17,'Clear Counters',14,' Cleared Counters of ( )',0,1,0,1,1),(22,'TCP/UDP Service',18,'TCP/UDP Service ( ) ',1,1,0,1,1),(25,'Administrative',13,' ',1,1,1800,1,1),(26,'Environmental',5,' ',1,1,0,1,1),(28,'PIX Event',14,'',0,1,0,1,1),(29,'PIX Port',2,' packet from to ',0,1,0,1,1),(34,'Duplex Mismatch',2,'Duplex Mismatch, is not full duplex and is full duplex',0,1,0,1,1),(35,'ACL',14,'ACL packets from ',0,1,0,1,1),(36,'BGP Notification',14,'Notification ',0,1,0,1,1),(37,'Excess Collitions',2,'Excess Collitions on Interface ',0,1,0,1,1),(38,'Application',5,'Application is ( )',1,1,0,1,1),(39,'TCP Content',18,'Content Response on is ( ) ',1,1,0,1,1),(40,'Reachability',5,'Host is with ',1,1,0,1,1),(41,'NTP',14,' is ',1,1,0,1,1),(42,'Tool Action',5,' changed to by ( )',0,1,0,1,1),(43,'Internal',14,' ',0,1,0,1,0),(44,'Syslog',14,': ',0,1,0,1,1),(45,'Hide this Event',14,' ',0,1,0,0,1),(46,'Win Info',14,': (ID:)',0,1,0,2,1),(47,'Win Warning',2,': (ID:)',0,1,0,1,1),(48,'Win Error',3,': (ID:)',0,1,0,1,1),(49,'Win Security',3,' (ID:)',0,1,0,1,1),(50,'SQL',3,'SQL is ',1,1,0,1,1),(60,'APC Status',5,' is ',1,1,0,1,1),(61,'PIX Debug',13,' (ID:)',0,1,0,2,1),(62,'PIX Info',14,' (ID:)',0,1,0,2,1),(63,'PIX Notif',2,' (ID:)',0,1,0,2,1),(64,'PIX Warn',18,' (ID:)',0,1,0,2,1),(65,'PIX Error',3,' (ID:)',0,1,0,2,1),(66,'PIX Crit',4,' (ID:)',1,1,0,1,1),(67,'PIX Alert',5,' (ID:)',1,1,0,1,1),(68,'Alteon RServer',3,'Real Server is ',1,1,0,1,1),(69,'Alteon Service',3,'Real Service is ',1,1,0,1,1),(70,'Alteon VServer',3,'Virtual Server is ',0,1,0,1,1),(71,'Brocade FC Port',3,' ()',1,1,0,1,1),(72,'ISDN',14,' ',1,1,0,1,1),(73,'To delete',13,' ',0,1,0,2,1),(74,'IBM error',5,' (id:)',1,1,0,1,1),(75,'IBM Warning',127,' is in state',1,1,0,1,1),(76,'Disable polling',13,'Polling for host is disabled (enabling time: )',0,1,0,1,0),(77,'IBM San Trap',5,': ()',1,1,0,1,1),(78,'OS/400 Error',5,'A subsystem is on the OS/400',1,1,0,1,1),(79,'Enable polling',13,'Polling for host is enabled',0,1,0,1,0),(80,'Storage Controller',4,'',1,1,0,1,1); /*!40000 ALTER TABLE `types` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `zones` -- DROP TABLE IF EXISTS `zones`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `zones` ( `id` int(10) NOT NULL AUTO_INCREMENT, `zone` char(60) NOT NULL DEFAULT '', `shortname` char(10) NOT NULL DEFAULT '', `image` char(30) NOT NULL DEFAULT '', `seeds` char(250) NOT NULL DEFAULT '', `max_deep` tinyint(1) NOT NULL DEFAULT '2', `communities` char(250) NOT NULL DEFAULT '', `refresh` int(6) NOT NULL DEFAULT '86400', `admin_status` tinyint(1) NOT NULL DEFAULT '0', `show_zone` tinyint(1) NOT NULL DEFAULT '1', `allow_private` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `id_2` (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `zones` -- LOCK TABLES `zones` WRITE; /*!40000 ALTER TABLE `zones` DISABLE KEYS */; INSERT INTO `zones` VALUES (1,'Unknown','UNK','unknown.png','',1,'',86400,0,1,0),(2,'New Zone','NewZone','unknown.png','',1,'',86400,0,1,1); /*!40000 ALTER TABLE `zones` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2012-05-26 14:50:28 ALTER TABLE interface_types AUTO_INCREMENT = 10001; ALTER TABLE interface_types_fields AUTO_INCREMENT = 10001; ALTER TABLE interface_types_field_types AUTO_INCREMENT = 10001; ALTER TABLE graph_types AUTO_INCREMENT = 10001; ALTER TABLE alarm_states AUTO_INCREMENT = 10001; ALTER TABLE severity AUTO_INCREMENT = 10001; ALTER TABLE syslog_types AUTO_INCREMENT = 10001; ALTER TABLE trap_receivers AUTO_INCREMENT = 10001; ALTER TABLE types AUTO_INCREMENT = 10001; ALTER TABLE slas AUTO_INCREMENT = 10001; ALTER TABLE slas_cond AUTO_INCREMENT = 10001; ALTER TABLE slas_sla_cond AUTO_INCREMENT = 10001; ALTER TABLE filters AUTO_INCREMENT = 10001; ALTER TABLE filters_fields AUTO_INCREMENT = 10001; ALTER TABLE filters_cond AUTO_INCREMENT = 10001; ALTER TABLE pollers AUTO_INCREMENT = 10001; ALTER TABLE pollers_groups AUTO_INCREMENT = 10001; ALTER TABLE pollers_backend AUTO_INCREMENT = 10001; ALTER TABLE pollers_poller_groups AUTO_INCREMENT = 10001; ALTER TABLE autodiscovery AUTO_INCREMENT = 10001; ALTER TABLE hosts_config_types AUTO_INCREMENT = 10001; ALTER TABLE tools AUTO_INCREMENT = 10001; ALTER TABLE profiles_options AUTO_INCREMENT = 10001; ALTER TABLE actions AUTO_INCREMENT = 10001; ALTER TABLE profiles_values AUTO_INCREMENT = 300; jffnms-0.9.3/docs/install/jffnms-0.9.3.pgsql0000644000175000017500000104246711760060424017732 0ustar csmallcsmall-- -- Translated mysqldump file by mdump2pgsql -- /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE acct ( id int4 NOT NULL AUTO_INCREMENT, usern char(15) NOT NULL DEFAULT '', s_name char(30) NOT NULL DEFAULT '', c_name char(30) NOT NULL DEFAULT '', elapsed_time int4 NOT NULL DEFAULT '0', bytes_in int4 DEFAULT '0', bytes_out int4 DEFAULT '0', date datetime NOT NULL DEFAULT NULL, cmd char(250) NOT NULL DEFAULT '', type char(15) NOT NULL DEFAULT '0', analized int2 NOT NULL DEFAULT '0', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE actions ( id int4 NOT NULL AUTO_INCREMENT, description char(40) NOT NULL DEFAULT '', command char(60) NOT NULL DEFAULT 'none', internal_parameters char(120) NOT NULL DEFAULT '', user_parameters char(120) NOT NULL DEFAULT '', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO actions (id, description, command, internal_parameters, user_parameters) VALUES (1,'No Action','none','',''); INSERT INTO actions (id, description, command, internal_parameters, user_parameters) VALUES (2,'Send Mail','email','from:nms,to:,subject:NMS','from:From,subject:Subject,comment:Comment'); INSERT INTO actions (id, description, command, internal_parameters, user_parameters) VALUES (3,'Send SMS via Modem','smsclient','smsname:',''); INSERT INTO actions (id, description, command, internal_parameters, user_parameters) VALUES (4,'Send SMS via Mail','email','short:1,from:nms,to:,subject:NMS','from:From,subject:Subject'); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE alarm_states ( id int4 NOT NULL AUTO_INCREMENT, description char(30) NOT NULL DEFAULT '', activate_alarm int2 NOT NULL DEFAULT '0', sound_in char(30) NOT NULL DEFAULT '', sound_out char(30) NOT NULL DEFAULT '', state int4 NOT NULL DEFAULT '0', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO alarm_states (id, description, activate_alarm, sound_in, sound_out, state) VALUES (1,'down',10,'down.wav','up.wav',1); INSERT INTO alarm_states (id, description, activate_alarm, sound_in, sound_out, state) VALUES (2,'up',100,'','',2); INSERT INTO alarm_states (id, description, activate_alarm, sound_in, sound_out, state) VALUES (3,'alert',60,'boing.wav','',3); INSERT INTO alarm_states (id, description, activate_alarm, sound_in, sound_out, state) VALUES (4,'testing',40,'','',4); INSERT INTO alarm_states (id, description, activate_alarm, sound_in, sound_out, state) VALUES (5,'running',100,'','',2); INSERT INTO alarm_states (id, description, activate_alarm, sound_in, sound_out, state) VALUES (6,'not running',20,'','',1); INSERT INTO alarm_states (id, description, activate_alarm, sound_in, sound_out, state) VALUES (7,'open',100,'','',2); INSERT INTO alarm_states (id, description, activate_alarm, sound_in, sound_out, state) VALUES (8,'closed',15,'','',1); INSERT INTO alarm_states (id, description, activate_alarm, sound_in, sound_out, state) VALUES (9,'error',90,'boing.wav','',3); INSERT INTO alarm_states (id, description, activate_alarm, sound_in, sound_out, state) VALUES (10,'invalid',30,'','',1); INSERT INTO alarm_states (id, description, activate_alarm, sound_in, sound_out, state) VALUES (11,'valid',110,'','',2); INSERT INTO alarm_states (id, description, activate_alarm, sound_in, sound_out, state) VALUES (12,'reachable',100,'','',2); INSERT INTO alarm_states (id, description, activate_alarm, sound_in, sound_out, state) VALUES (13,'unreachable',5,'','',1); INSERT INTO alarm_states (id, description, activate_alarm, sound_in, sound_out, state) VALUES (14,'lowerlayerdown',10,'down.wav','up.wav',1); INSERT INTO alarm_states (id, description, activate_alarm, sound_in, sound_out, state) VALUES (15,'synchronized',100,'','',2); INSERT INTO alarm_states (id, description, activate_alarm, sound_in, sound_out, state) VALUES (16,'unsynchronized',6,'','',1); INSERT INTO alarm_states (id, description, activate_alarm, sound_in, sound_out, state) VALUES (17,'battery normal',100,'','',2); INSERT INTO alarm_states (id, description, activate_alarm, sound_in, sound_out, state) VALUES (18,'battery low',4,'','',1); INSERT INTO alarm_states (id, description, activate_alarm, sound_in, sound_out, state) VALUES (19,'battery unknown',2,'','',1); INSERT INTO alarm_states (id, description, activate_alarm, sound_in, sound_out, state) VALUES (20,'on battery',3,'','',1); INSERT INTO alarm_states (id, description, activate_alarm, sound_in, sound_out, state) VALUES (21,'on line',90,'','',2); INSERT INTO alarm_states (id, description, activate_alarm, sound_in, sound_out, state) VALUES (22,'ok',100,'','',2); INSERT INTO alarm_states (id, description, activate_alarm, sound_in, sound_out, state) VALUES (23,'out of bounds',10,'','',1); INSERT INTO alarm_states (id, description, activate_alarm, sound_in, sound_out, state) VALUES (24,'unavailable',10,'down.wav','up.wav',1); INSERT INTO alarm_states (id, description, activate_alarm, sound_in, sound_out, state) VALUES (25,'available',100,'','',2); INSERT INTO alarm_states (id, description, activate_alarm, sound_in, sound_out, state) VALUES (26,'battery depleted',3,'','',1); INSERT INTO alarm_states (id, description, activate_alarm, sound_in, sound_out, state) VALUES (27,'other',10,'','',1); INSERT INTO alarm_states (id, description, activate_alarm, sound_in, sound_out, state) VALUES (28,'unknown',10,'','',1); INSERT INTO alarm_states (id, description, activate_alarm, sound_in, sound_out, state) VALUES (29,'noncritical',90,'','',1); INSERT INTO alarm_states (id, description, activate_alarm, sound_in, sound_out, state) VALUES (30,'critical',10,'','',1); INSERT INTO alarm_states (id, description, activate_alarm, sound_in, sound_out, state) VALUES (31,'nonrecoverabl',10,'','',1); INSERT INTO alarm_states (id, description, activate_alarm, sound_in, sound_out, state) VALUES (32,'warning',80,'down.wav','up.wav',1); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE alarms ( id int4 NOT NULL AUTO_INCREMENT, date_start datetime NOT NULL DEFAULT NULL, date_stop datetime NOT NULL DEFAULT NULL, interface int4 NOT NULL DEFAULT '0', type int4 NOT NULL DEFAULT '0', active int4 NOT NULL DEFAULT '1', referer_start int4 NOT NULL DEFAULT '0', referer_stop int4 NOT NULL DEFAULT '0', triggered int2 NOT NULL DEFAULT '0', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE auth ( id int4 NOT NULL AUTO_INCREMENT, usern char(60) NOT NULL DEFAULT '', passwd varchar(200) DEFAULT NULL, fullname char(60) NOT NULL DEFAULT '', router int2 NOT NULL DEFAULT '0', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO auth (id, usern, passwd, fullname, router) VALUES (1,'No User','$1$txVdymrd$AO3Qa8js9lVNkyscQ552b1','No User Name',0); INSERT INTO auth (id, usern, passwd, fullname, router) VALUES (2,'admin','adpexzg3FUZAk','Administrator',0); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE autodiscovery ( id int4 NOT NULL AUTO_INCREMENT, description char(40) NOT NULL DEFAULT '0', poller_default int2 NOT NULL DEFAULT '1', permit_add int2 NOT NULL DEFAULT '0', permit_del int2 NOT NULL DEFAULT '0', permit_mod int2 NOT NULL DEFAULT '0', permit_disable int2 NOT NULL DEFAULT '0', skip_loopback int2 NOT NULL DEFAULT '0', check_state int2 NOT NULL DEFAULT '1', check_address int2 NOT NULL DEFAULT '1', alert_del int2 NOT NULL DEFAULT '1', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO autodiscovery (id, description, poller_default, permit_add, permit_del, permit_mod, permit_disable, skip_loopback, check_state, check_address, alert_del) VALUES (1,'No Autodiscovery',1,0,0,0,0,0,1,1,1); INSERT INTO autodiscovery (id, description, poller_default, permit_add, permit_del, permit_mod, permit_disable, skip_loopback, check_state, check_address, alert_del) VALUES (2,'Standard',1,1,0,0,1,1,1,1,1); INSERT INTO autodiscovery (id, description, poller_default, permit_add, permit_del, permit_mod, permit_disable, skip_loopback, check_state, check_address, alert_del) VALUES (3,'Automagic',1,1,1,1,0,1,1,1,1); INSERT INTO autodiscovery (id, description, poller_default, permit_add, permit_del, permit_mod, permit_disable, skip_loopback, check_state, check_address, alert_del) VALUES (4,'Administrative',0,1,1,0,1,1,1,1,1); INSERT INTO autodiscovery (id, description, poller_default, permit_add, permit_del, permit_mod, permit_disable, skip_loopback, check_state, check_address, alert_del) VALUES (5,'Just Inform',0,0,0,0,0,0,1,1,1); INSERT INTO autodiscovery (id, description, poller_default, permit_add, permit_del, permit_mod, permit_disable, skip_loopback, check_state, check_address, alert_del) VALUES (6,'Standard (for Switches)',1,1,0,1,0,1,1,0,1); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE clients ( id int4 NOT NULL AUTO_INCREMENT, username char(60) NOT NULL DEFAULT '', password char(30) NOT NULL DEFAULT '', name char(60) NOT NULL DEFAULT '', shortname char(30) NOT NULL DEFAULT '', enabled int2 NOT NULL DEFAULT '1', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO clients (id, username, password, name, shortname, enabled) VALUES (1,'unkclient','','Unknown Customer','Unknown',1); INSERT INTO clients (id, username, password, name, shortname, enabled) VALUES (2,'','','New Customer','Customer1',1); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE events ( id int4 NOT NULL AUTO_INCREMENT, date datetime NOT NULL DEFAULT NULL, type int4 NOT NULL DEFAULT '0', host int4 NOT NULL DEFAULT '0', interface char(150) NOT NULL, state char(40) NOT NULL DEFAULT '', username char(40) NOT NULL DEFAULT '', info char(150) NOT NULL DEFAULT '', referer int4 NOT NULL DEFAULT '0', ack int4 NOT NULL DEFAULT '0', analized int2 NOT NULL DEFAULT '0', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE events_latest ( id int4 NOT NULL AUTO_INCREMENT, date datetime NOT NULL DEFAULT NULL, type int4 NOT NULL DEFAULT '0', host int4 NOT NULL DEFAULT '0', interface char(40) NOT NULL DEFAULT '', state char(40) NOT NULL DEFAULT '', username char(40) NOT NULL DEFAULT '', info char(150) NOT NULL DEFAULT '', referencia int4 NOT NULL DEFAULT '0', ack int4 NOT NULL DEFAULT '0', analized int2 NOT NULL DEFAULT '0', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE filters ( id int4 NOT NULL AUTO_INCREMENT, description char(40) NOT NULL DEFAULT '', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO filters (id, description) VALUES (1,'All Events'); INSERT INTO filters (id, description) VALUES (4,'Severity Level > Warning'); INSERT INTO filters (id, description) VALUES (5,'Dont Show SLA or Commands'); INSERT INTO filters (id, description) VALUES (8,'Dont Show SLA'); INSERT INTO filters (id, description) VALUES (10,'BGP Events'); INSERT INTO filters (id, description) VALUES (13,'Commands Only'); INSERT INTO filters (id, description) VALUES (17,'Interfaces'); INSERT INTO filters (id, description) VALUES (18,'UnACK Events'); INSERT INTO filters (id, description) VALUES (19,'Windows Events'); INSERT INTO filters (id, description) VALUES (20,'PIX'); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE filters_cond ( id int4 NOT NULL AUTO_INCREMENT, filter_id int4 NOT NULL DEFAULT '1', pos int4 NOT NULL DEFAULT '1', field_id int4 NOT NULL DEFAULT '1', op char(10) NOT NULL DEFAULT '=', value char(60) NOT NULL DEFAULT '', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (1,1,1,1,'=','1'); INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (2,5,1,2,'!=','12'); INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (3,4,1,3,'>','30'); INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (4,5,3,2,'!=','8'); INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (5,5,2,4,'=',''); INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (6,8,1,2,'!=','12'); INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (10,10,1,2,'=','6'); INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (13,13,1,2,'=','8'); INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (20,17,1,11,'>','1'); INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (21,18,1,12,'=','0'); INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (22,19,1,2,'=','46'); INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (23,19,5,5,'=',''); INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (24,19,10,2,'=','47'); INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (25,19,15,5,'=',''); INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (26,19,20,2,'=','48'); INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (27,19,25,5,'=',''); INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (28,19,30,2,'=','49'); INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (29,20,2,5,'=',''); INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (30,20,3,2,'=','63'); INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (31,20,4,5,'=',''); INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (32,20,5,2,'=','62'); INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (33,20,6,5,'=',''); INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (34,20,7,2,'=','65'); INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (35,20,9,2,'=','67'); INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (37,20,10,5,'=',''); INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (38,20,11,2,'=','61'); INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (39,20,12,5,'=',''); INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (40,20,13,2,'=','66'); INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (41,20,1,2,'=','64'); INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (43,20,8,5,'=',''); INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (44,20,14,5,'=',''); INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (45,20,15,2,'=','29'); INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (46,20,16,5,'=',''); INSERT INTO filters_cond (id, filter_id, pos, field_id, op, value) VALUES (47,20,17,2,'=','28'); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE filters_fields ( id int4 NOT NULL AUTO_INCREMENT, description char(40) NOT NULL DEFAULT '', field char(40) NOT NULL DEFAULT '', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO filters_fields (id, description, field) VALUES (1,'ALL',''); INSERT INTO filters_fields (id, description, field) VALUES (2,'Event Type','types.id'); INSERT INTO filters_fields (id, description, field) VALUES (3,'Severity Level','severity.level'); INSERT INTO filters_fields (id, description, field) VALUES (4,'AND','AND'); INSERT INTO filters_fields (id, description, field) VALUES (5,'OR','OR'); INSERT INTO filters_fields (id, description, field) VALUES (6,'Host','hosts.id'); INSERT INTO filters_fields (id, description, field) VALUES (7,'Zone','zones.id'); INSERT INTO filters_fields (id, description, field) VALUES (11,'Interface ID','interfaces.id'); INSERT INTO filters_fields (id, description, field) VALUES (12,'Acknowledge','events.ack'); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE graph_types ( id int4 NOT NULL AUTO_INCREMENT, description char(30) NOT NULL DEFAULT '', type int4 NOT NULL DEFAULT '1', graph1 char(60) NOT NULL DEFAULT '', graph2 char(60) NOT NULL DEFAULT '', sizex1 int4 NOT NULL DEFAULT '0', sizey1 int4 NOT NULL DEFAULT '0', sizex2 int4 NOT NULL DEFAULT '0', sizey2 int4 NOT NULL DEFAULT '0', allow_aggregation int2 NOT NULL DEFAULT '0', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (1,'No Graph Selected',1,'','',0,0,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (3,'Traffic',4,'traffic','',500,150,0,0,1); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (4,'Utilization',4,'traffic_util','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (5,'Packets',4,'packets','error_packets',275,170,250,170,1); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (6,'Error Rate',4,'error_rate','',500,170,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (7,'RTT & Packet Loss',4,'rtt','traffic_pl',275,155,260,140,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (8,'Interface Packet Loss',4,'packetloss','',500,180,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (9,'Cisco CPU Usage',3,'cpu_util','',500,175,0,0,1); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (10,'Cisco Memory',3,'memory','',510,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (11,'Drops',4,'drop_packets','',500,175,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (14,'BGP Updates',6,'bgp_updates','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (15,'Used Storage',8,'storage','',500,150,0,0,1); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (16,'CSS VIP Hits',9,'css_vip_hits','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (17,'CSS VIP Traffic',9,'css_vip_output_only_traffic','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (18,'Solaris Memory Usage',10,'ucd_memory','',500,180,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (19,'Solaris Load Average',10,'ucd_load_average','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (20,'Solaris CPU Usage',10,'ucd_cpu_solaris','',500,175,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (21,'CPU Usage',11,'ucd_cpu_linux','',500,175,0,0,1); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (22,'Load Average',11,'ucd_load_average','',500,150,0,0,1); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (23,'Established Connections',2,'tcp_conn_number','',500,175,0,0,1); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (24,'Connection Delay',2,'tcp_conn_delay','',500,175,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (25,'IP Accounting',3,'acct_bytes','acct_packets',275,170,260,170,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (26,'Processes / Users',12,'hostmib_users_procs','',500,170,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (27,'TCP Connection Status',12,'tcpmib_connections','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (28,'Processor Utilization',12,'cpu_util','',500,175,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (29,'Processes / Users',11,'hostmib_users_procs','',500,170,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (30,'TCP Connection Status',11,'tcpmib_connections','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (31,'TCP Connection Status',3,'tcpmib_connections','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (32,'Accounted Packets',13,'cisco_mac_packets','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (33,'Accounted Bytes',13,'cisco_mac_bytes','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (34,'SP RTT & Loss',14,'rtt','packetloss',270,170,265,170,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (35,'Median RTT',14,'rtt','',500,175,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (36,'Packets Lost',14,'packetloss','',500,175,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (37,'Temperature',17,'temperature','',500,180,0,0,1); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (38,'SA Agent Round-Trip Latency',19,'cisco_saagent_rtl','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (39,'SA Agent Jitter',19,'cisco_saagent_jitter','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (40,'SA Agent % Packet Loss',19,'cisco_saagent_packetloss','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (41,'Host Round Trip Time',20,'rtt','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (42,'Host Packet Loss',20,'packetloss','',500,175,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (43,'TC Class Rate',21,'tc_rate','',500,150,0,0,1); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (44,'Instances/Memory',15,'apps_instances','apps_memory',250,175,280,175,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (45,'Connection Delay',23,'tcp_conn_delay','',500,175,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (46,'Temperature',26,'temperature','',500,175,0,0,1); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (47,'Packets New',4,'packets_new','',610,170,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (48,'Livingston Portmaster Serial',28,'pm_serial','',500,175,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (49,'CGI Requests',27,'iis_tcgir','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (50,'POSTs and GETs',27,'iis_tptg','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (51,'Files Sent',27,'iis_tfs','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (52,'Bytes Received',27,'iis_tbr','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (53,'Hits',29,'apache_tac','',500,175,0,0,1); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (54,'KBytes',29,'apache_tkb','',500,175,0,0,1); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (55,'Apache CPU Load',29,'apache_cplo','',500,175,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (59,'Bytes Per Request',29,'apache_bpr','',500,175,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (60,'Workers',29,'apache_workers','',500,175,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (61,'Load/Capacity',31,'apc_load_capacity','',500,175,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (62,'Voltages',31,'apc_voltages','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (63,'Time Remaining',31,'apc_time_remaining','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (64,'Temperature',31,'temperature','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (65,'Records',30,'sql_records','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (66,'Traffic',32,'alteon_octets','',500,175,0,0,1); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (67,'Session Rate',32,'alteon_sessionrate','',500,175,0,0,1); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (68,'Failures',32,'alteon_failures_sessions','',500,175,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (69,'Current Sessions',32,'alteon_sessions','',500,175,0,0,1); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (70,'Current Sessions',33,'alteon_sessions','',500,175,0,0,1); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (71,'Sessions Rate',33,'alteon_sessionrate','',500,175,0,0,1); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (72,'Octets',33,'alteon_octets','',500,175,0,0,1); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (73,'Response Time',34,'response_time','',500,175,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (74,'Memory',35,'alteon_memory','',500,175,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (75,'CPU Load',35,'alteon_load_average','',500,175,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (76,'TCP Connections',35,'tcpmib_connections','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (77,'Sensor Value',36,'brocade_sensor','',500,175,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (78,'Frames',37,'frames','',500,175,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (79,'Traffic',37,'traffic_words','',500,175,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (80,'Cisco Dialup Usage',38,'cisco_serial','',500,175,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (81,'Time Usage',39,'inf_ldisk_time','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (82,'I/O Rate',39,'inf_ldisk_rate','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (83,'Battery Temperature',40,'temperature','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (84,'Time Remaining',40,'ups_time_remaining','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (85,'UPS Voltage',41,'ups_voltage','',500,150,0,0,1); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (86,'UPS Current',41,'ups_current','',500,150,0,0,1); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (87,'UPS Load',41,'ups_load','',500,150,0,0,1); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (88,'Charge Remaining',40,'ups_charge_remaining','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (89,'IPTables Rate',42,'iptables_rate','',500,150,0,170,1); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (90,'Routes',6,'bgp_routes','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (91,'PIX Connections',43,'pix_connections','',500,175,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (92,'NAT Active Binds',44,'cisco_nat_active','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (93,'NAT Packets',44,'cisco_nat_packets','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (94,'Sensor Value',45,'sensor_value','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (95,'OS/400 CPU Usage',46,'cpu_os400','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (96,'Dell OpenManage Ambient Temp',47,'dell_om_temp','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (97,'Dell OpenManage Fan RPM',47,'dell_om_fan','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (98,'UPS Power',41,'ups_power','',500,150,0,0,1); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (99,'PDU Load',49,'pdu_load','',500,150,0,0,1); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (102,'Time Usage',57,'inf_ldisk_time','',500,175,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (103,'I/O Byte Rate',57,'inf_ldisk_rate','',500,175,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (104,'I/O Ops Rate',57,'inf_ldisk_opsrate','',500,175,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (105,'FC Frames',52,'frames','',500,175,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (106,'IBM Blade CPU Temp',51,'ibm_blade_cpu_temp','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (107,'IBM Blade Power',54,'ibm_blade_power','',500,150,0,0,0); INSERT INTO graph_types (id, description, type, graph1, graph2, sizex1, sizey1, sizex2, sizey2, allow_aggregation) VALUES (101,'Wireless Associated',53,'cisco_80211X_associated','',500,175,0,0,0); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE hosts ( id int4 NOT NULL AUTO_INCREMENT, ip_tacacs char(16) NOT NULL DEFAULT '', ip varchar(39) NOT NULL DEFAULT '', name char(255) NOT NULL, rocommunity char(100) NOT NULL DEFAULT '', rwcommunity char(100) NOT NULL DEFAULT '', zone int4 NOT NULL DEFAULT '0', tftp char(20) NOT NULL DEFAULT '', autodiscovery int4 NOT NULL DEFAULT '1', config_type int4 NOT NULL DEFAULT '1', autodiscovery_default_customer int4 NOT NULL DEFAULT '1', satellite int4 NOT NULL DEFAULT '1', dmii char(10) NOT NULL DEFAULT '1', lat decimal(12,2) NOT NULL DEFAULT '0.00', lon decimal(12,2) NOT NULL DEFAULT '0.00', show_host int2 NOT NULL DEFAULT '1', poll int2 NOT NULL DEFAULT '1', creation_date int4 NOT NULL DEFAULT '0', modification_date int4 NOT NULL DEFAULT '0', last_poll_date int4 NOT NULL DEFAULT '0', last_poll_time int4 NOT NULL DEFAULT '0', poll_interval int4 NOT NULL DEFAULT '300', dmii_up int2 NOT NULL DEFAULT '1', sysobjectid varchar(255) DEFAULT NULL, PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO hosts (id, ip_tacacs, ip, name, rocommunity, rwcommunity, zone, tftp, autodiscovery, config_type, autodiscovery_default_customer, satellite, dmii, lat, lon, show_host, poll, creation_date, modification_date, last_poll_date, last_poll_time, poll_interval, dmii_up, sysobjectid) VALUES (1,'','','Unknown','','',1,'',1,1,1,1,'1','0.00','0.00',1,1,0,0,1232673711,0,300,1,NULL); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE hosts_config ( id int4 NOT NULL AUTO_INCREMENT, date datetime NOT NULL DEFAULT NULL, host int4 NOT NULL DEFAULT '0', config text NOT NULL, PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO hosts_config (id, date, host, config) VALUES (1,NULL,1,'No Config'); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE hosts_config_types ( id int4 NOT NULL AUTO_INCREMENT, description char(60) NOT NULL DEFAULT '', command char(30) NOT NULL DEFAULT '', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO hosts_config_types (id, description, command) VALUES (1,'No Configuration Transfer','none'); INSERT INTO hosts_config_types (id, description, command) VALUES (2,'Cisco IOS, Newer than 12.0 (CONFIG-COPY-MIB)','cisco_cc'); INSERT INTO hosts_config_types (id, description, command) VALUES (3,'Cisco IOS, Older than 12.0 (SYS-MIB)','cisco_sys'); INSERT INTO hosts_config_types (id, description, command) VALUES (4,'Cisco CatOS, Catalyst Switches (STACK-MIB)','cisco_catos'); INSERT INTO hosts_config_types (id, description, command) VALUES (5,'Alteon WebOS Switches (DANGEROUS)','alteon_webos'); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE interface_types ( id int4 NOT NULL AUTO_INCREMENT, description varchar(40) NOT NULL DEFAULT '', autodiscovery_validate int2 NOT NULL DEFAULT '0', autodiscovery_enabled int2 NOT NULL DEFAULT '0', autodiscovery_function varchar(40) NOT NULL DEFAULT '', autodiscovery_parameters varchar(200) NOT NULL DEFAULT '', autodiscovery_default_poller int4 NOT NULL DEFAULT '1', have_graph int2 NOT NULL DEFAULT '0', rrd_structure_rra text NOT NULL, rrd_structure_res varchar(20) NOT NULL DEFAULT '', rrd_structure_step int4 NOT NULL DEFAULT '300', graph_default int4 NOT NULL DEFAULT '1', break_by_card int2 NOT NULL DEFAULT '0', update_handler varchar(30) NOT NULL DEFAULT 'none', allow_manual_add int2 NOT NULL DEFAULT '0', sla_default int4 NOT NULL DEFAULT '1', have_tools int2 NOT NULL DEFAULT '0', snmp_oid varchar(255) NOT NULL DEFAULT '.', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (1,'No Interface Type',0,0,'none','',1,0,'','',300,1,0,'none',0,1,0,'.'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (2,'TCP Ports',0,1,'tcp_ports','-sT -p1-500,600-1024',5,1,'RRA:LAST:0.5:1:','103680',300,23,0,'tcp_ports',1,1,1,''); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (3,'Cisco System Info',1,1,'host_information','cisco,9.1,9.5',3,1,'RRA:AVERAGE:0.5:1:','103680',300,9,0,'none',0,7,0,'ent.9'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (4,'Physical Interfaces',1,1,'snmp_interfaces','',61,1,'RRA:AVERAGE:0.5:1:','103680',300,3,1,'none',0,1,1,'.'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (6,'BGP Neighbors',1,1,'bgp_peers','',8,1,'RRA:AVERAGE:0.5:1:','103680',300,90,0,'none',0,1,0,'.'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (8,'Storage',1,1,'storage','',9,1,'RRA:AVERAGE:0.5:1:','103680',300,15,0,'none',0,9,0,'.'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (9,'CSS VIPs',0,1,'css_vips','',10,1,'RRA:AVERAGE:0.5:1:','103680',300,17,0,'none',0,1,0,'ent.9'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (10,'Solaris System Info',1,1,'host_information','solaris,sparc,sun,11.2.3.10,8072.3.2.3',12,1,'RRA:AVERAGE:0.5:1:','103680',300,20,0,'none',0,1,0,'.'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (11,'Linux/Unix System Info',1,1,'host_information','2021.250.10,linux,2021.250.255,freebsd,netSnmp,8072',11,1,'RRA:AVERAGE:0.5:1:','103680',300,21,0,'none',0,10,0,'.'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (12,'Windows System Info',1,1,'host_information','enterprises.311',13,1,'RRA:AVERAGE:0.5:1:','103680',300,28,0,'none',0,11,0,'.'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (13,'Cisco MAC Accounting',1,1,'cisco_accounting','',14,1,'RRA:AVERAGE:0.5:1:','103680',300,33,0,'none',0,1,0,'.'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (14,'Smokeping Host',1,1,'smokeping','/var/lib/smokeping',15,1,'RRA:AVERAGE:0.5:1:','103680',300,34,0,'none',0,8,0,''); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (15,'Applications',1,0,'hostmib_apps','',16,1,'RRA:AVERAGE:0.5:1:','103680',300,44,0,'none',0,1,0,'.'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (16,'Cisco Power Supply',1,1,'cisco_envmib','PowerSupply,5.1.2,5.1.3',17,0,'','103680',300,1,1,'none',0,1,0,'ent.9'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (17,'Cisco Temperature',1,1,'cisco_envmib','Temperature,3.1.2,3.1.6',18,1,'RRA:AVERAGE:0.5:1:','103680',300,37,1,'none',0,1,0,'ent.9'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (18,'Cisco Voltage',1,1,'cisco_envmib','Voltage,2.1.2,2.1.7',19,0,'','103680',300,1,1,'none',0,1,0,'ent.9'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (19,'Cisco SA Agent',1,1,'cisco_saagent','',20,1,'RRA:AVERAGE:0.5:1:','103680',300,39,0,'none',0,1,0,'ent.9'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (20,'Reachable',1,1,'reachability','',21,1,'RRA:AVERAGE:0.5:1:','103680',300,41,0,'none',0,1,0,''); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (21,'Linux Traffic Control',1,1,'linux_tc','.1.3.6.1.4.1.2021.5001',22,1,'RRA:AVERAGE:0.5:1:','103680',300,43,1,'none',0,1,0,'.'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (22,'NTP',0,1,'ntp_client','',23,0,'RRA:AVERAGE:0.5:1:','103680',300,1,0,'none',0,1,0,''); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (23,'UDP Ports',0,0,'tcp_ports','-sU -p1-500,600-1024 --host_timeout 15000',24,1,'RRA:AVERAGE:0.5:1:','103680',300,45,0,'tcp_ports',1,1,0,''); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (24,'Compaq Physical Drives',0,1,'cpqmib','phydrv',25,0,'RRA:AVERAGE:0.5:1:','103680',300,1,0,'none',0,1,0,'.'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (25,'Compaq Fans',0,1,'cpqmib','fans',26,0,'RRA:AVERAGE:0.5:1:','103680',300,1,0,'none',0,1,0,'.'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (26,'Compaq Temperature',0,1,'cpqmib','temperature',27,1,'RRA:AVERAGE:0.5:1:','103680',300,46,0,'none',0,1,0,'.'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (27,'IIS Webserver Information',0,1,'iis_info','',28,1,'RRA:AVERAGE:0.5:1:','103680',300,50,0,'none',0,1,0,'.'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (28,'Livingston Serial Port',0,1,'livingston_serial_port','',29,1,'RRA:AVERAGE:0.5:1:','103680',300,48,0,'none',0,1,0,'.'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (29,'Apache',0,1,'apache','',30,1,'RRA:AVERAGE:0.5:1:','103680',300,53,0,'none',1,1,0,''); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (30,'SQL Query',0,1,'none','',32,1,'RRA:AVERAGE:0.5:1:','103680',300,65,0,'none',1,1,0,''); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (31,'APC',1,1,'apc','enterprises.318',31,1,'RRA:AVERAGE:0.5:1:','103680',300,61,0,'none',0,1,0,'.'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (32,'Alteon Real Server',1,1,'alteon_realservers','',33,1,'RRA:AVERAGE:0.5:1:','103680',300,66,0,'none',0,1,0,'ent.1872'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (33,'Alteon Virtual Server',0,1,'alteon_virtualservers','',34,1,'RRA:AVERAGE:0.5:1:','103680',300,70,0,'none',0,1,0,'ent.1872'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (34,'Alteon Real Services',0,1,'alteon_realservices','',35,1,'RRA:AVERAGE:0.5:1:','103680',300,73,0,'none',0,1,0,'ent.1872'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (35,'Alteon System Info',1,1,'host_information','enterprises.1872',36,1,'RRA:AVERAGE:0.5:1:','103680',300,75,0,'none',0,1,0,'ent.1872'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (36,'Brocade Sensors',0,0,'brocade_sensors','',37,1,'RRA:AVERAGE:0.5:1:','103680',300,77,0,'none',0,1,0,'ent.1588'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (37,'Brocade FC Ports',0,0,'brocade_fcports','',38,1,'RRA:AVERAGE:0.5:1:','103680',300,78,0,'none',0,1,0,'ent.1588'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (38,'Cisco Dialup Usage',1,1,'cisco_serial_port','',39,1,'RRA:AVERAGE:0.5:1:','103680',300,80,0,'none',0,1,0,'ent.9'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (39,'Windows Logical Disks',1,1,'informant_ldisks','',40,1,'RRA:AVERAGE:0.5:1:','103680',300,82,0,'none',0,1,0,'.'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (40,'UPS',1,1,'ups','',41,1,'RRA:AVERAGE:0.5:1:','103680',300,84,0,'none',0,1,0,'.'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (41,'UPS Lines',0,1,'ups_lines','',42,1,'RRA:AVERAGE:0.5:1:','103680',300,85,0,'none',0,1,0,'.'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (42,'IPTables Chains',1,1,'linux_iptables','.1.3.6.1.4.1.2021.5002',43,1,'RRA:AVERAGE:0.5:1:','103680',300,89,1,'none',0,1,0,'.'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (43,'Cisco PIX',1,1,'pix_connections','',44,1,'RRA:AVERAGE:0.5:1:','103680',300,91,0,'none',0,1,0,'ent.9'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (44,'Cisco NAT',0,1,'simple','.1.3.6.1.4.1.9.10.77.1.2.1.0,NAT',45,1,'RRA:AVERAGE:0.5:1:','103680',300,93,0,'none',0,1,0,'ent.9'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (45,'Sensors',1,1,'sensors','',46,1,'RRA:AVERAGE:0.5:1:','103680',300,94,1,'none',0,1,0,'.'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (46,'OS/400 System Info',1,1,'simple','.1.3.6.1.4.1.2.6.4.5.1.0,OS400',47,1,'RRA:AVERAGE:0.5:1:','103680',300,95,0,'none',0,1,0,'.'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (47,'Dell Chassis',1,1,'simple','.1.3.6.1.4.1.674.10892.1.200.10.1.2.1,Chassis status',48,0,'RRA:AVERAGE:0.5:1:','103680',300,1,0,'none',0,1,0,'.'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (48,'PDU',1,1,'pdu','',49,0,'RRA:AVERAGE:0.5:1:','103680',300,1,0,'none',0,1,0,'.'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (49,'PDU Banks',0,1,'pdu_banks','',50,1,'RRA:AVERAGE:0.5:1:','103680',300,99,0,'none',0,1,0,'.'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (50,'IBM Component Health',1,0,'ibm_ComponentHealth','',57,0,'RRA:AVERAGE:0.5:1:','103680',300,1,0,'none',0,1,0,'.'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (51,'IBM Blade server',1,0,'ibm_blade_servers','',51,1,'RRA:AVERAGE:0.5:1:','103680',300,106,0,'none',0,1,0,'.'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (52,'Generic FC Ports',1,0,'fc_ports','',52,1,'RRA:AVERAGE:0.5:1:','103680',300,105,0,'none',0,1,0,'.'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (53,'Cisco Wireless Device',1,0,'simple','.1.3.6.1.4.1.9.9.273.1.1.2.1.1.1,Cisco AP',53,1,'RRA:AVERAGE:0.5:1\r\n:','103680',300,101,0,'none',0,1,0,'ent.9'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (54,'IBM Blade Power',1,0,'ibm_blade_power','',54,1,'RRA:AVERAGE:0.5:1:','103680',300,107,0,'none',0,1,0,'.'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (55,'Compaq Power Supply',1,0,'cpqmib','powersupply',55,0,'RRA:AVERAGE:0.5:1:','103680',300,1,0,'none',0,1,0,'.'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (56,'IBM Storage Controller',0,0,'ibm_ds_storage','storagesubsystem',56,0,'RRA:AVERAGE:0.5:1:','103680',300,1,0,'none',0,1,0,'.'); INSERT INTO interface_types (id, description, autodiscovery_validate, autodiscovery_enabled, autodiscovery_function, autodiscovery_parameters, autodiscovery_default_poller, have_graph, rrd_structure_rra, rrd_structure_res, rrd_structure_step, graph_default, break_by_card, update_handler, allow_manual_add, sla_default, have_tools, snmp_oid) VALUES (57,'Informant Disks 64',1,1,'informant_adv_ldisks','',58,1,'RRA:AVERAGE:0.5:1:','103680',300,102,0,'none',0,1,0,'.'); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE interface_types_field_types ( id int4 NOT NULL AUTO_INCREMENT, description char(30) NOT NULL DEFAULT '', handler char(30) NOT NULL DEFAULT '', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO interface_types_field_types (id, description, handler) VALUES (1,'Unknown','none'); INSERT INTO interface_types_field_types (id, description, handler) VALUES (3,'Index','text'); INSERT INTO interface_types_field_types (id, description, handler) VALUES (5,'Boolean','bool'); INSERT INTO interface_types_field_types (id, description, handler) VALUES (7,'Description','text'); INSERT INTO interface_types_field_types (id, description, handler) VALUES (8,'Other','text'); INSERT INTO interface_types_field_types (id, description, handler) VALUES (20,'RRDTool DS','rrd_ds'); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE interface_types_fields ( id int4 NOT NULL AUTO_INCREMENT, description char(40) NOT NULL DEFAULT '', name char(40) NOT NULL DEFAULT '', pos int4 NOT NULL DEFAULT '10', itype int4 NOT NULL DEFAULT '1', ftype int4 NOT NULL DEFAULT '1', showable int2 NOT NULL DEFAULT '1', overwritable int2 NOT NULL DEFAULT '1', tracked int2 NOT NULL DEFAULT '0', default_value char(250) NOT NULL DEFAULT '', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (1,'Unknown','unknown',10,1,1,0,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (3,'SNMP IFIndex','interfacenumber',60,4,3,1,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (4,'Description','description',10,4,7,1,1,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (5,'IP Address','address',30,4,7,1,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (6,'Input Bandwidth','bandwidthin',50,4,8,1,1,0,'1'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (7,'Port Number','port',10,2,3,1,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (9,'Check Content','check_content',30,2,5,2,1,0,'0'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (10,'Port Description','description',20,2,7,1,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (11,'Input Bytes','input',10,4,20,0,0,0,'DS:input:COUNTER:600:0:'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (12,'Established Connections','tcp_conn_number',10,2,20,0,0,0,'DS:tcp_conn_number:GAUGE:600:0:10000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (13,'Check Content URL','check_url',40,2,8,2,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (14,'Output Bytes','output',20,4,20,0,0,0,'DS:output:COUNTER:600:0:'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (15,'Input Packets','inpackets',70,4,20,0,0,0,'DS:inpackets:COUNTER:600:0:'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (16,'Flip In Out in Graphs','flipinout',70,4,5,2,1,0,'0'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (20,'Connection Delay','conn_delay',20,2,20,0,0,0,'DS:conn_delay:GAUGE:600:0:100000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (21,'Output Bandwidth','bandwidthout',51,4,8,2,1,0,'1'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (22,'Peer Address','peer',36,4,8,1,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (23,'Input Errors','inputerrors',30,4,20,0,0,0,'DS:inputerrors:COUNTER:600:0:'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (24,'Output Errors','outputerrors',40,4,20,0,0,0,'DS:outputerrors:COUNTER:600:0:'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (25,'Round Trip Time','rtt',50,4,20,0,0,0,'DS:rtt:GAUGE:600:0:10000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (26,'PacketLoss','packetloss',60,4,20,0,0,0,'DS:packetloss:GAUGE:600:0:1000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (27,'Output Packets','outpackets',80,4,20,0,0,0,'DS:outpackets:COUNTER:600:0:'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (28,'Drops','drops',90,4,20,0,0,0,'DS:drops:COUNTER:600:0:'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (29,'Not Used','aux4',100,4,20,0,0,0,'DS:aux4:COUNTER:600:0:'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (30,'Saved Input Bandwidth','bandwidthin',110,4,20,0,0,0,'DS:bandwidthin:GAUGE:600:0:'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (31,'Saved Output Bandwidth','bandwidthout',120,4,20,0,0,0,'DS:bandwidthout:GAUGE:600:0:'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (32,'Index','index',10,12,3,0,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (33,'Description','description',20,12,7,1,0,1,'System Information'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (34,'Number of Processors','cpu_num',30,12,8,1,1,0,'1'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (35,'Index','index',10,11,3,0,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (36,'Description','description',20,11,7,1,0,1,'System Information'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (37,'Number of CPUs','cpu_num',30,11,8,1,1,0,'1'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (43,'CPU','cpu',10,3,20,0,0,0,'DS:cpu:GAUGE:600:0:100'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (44,'Mem Used','mem_used',20,3,20,0,0,0,'DS:mem_used:GAUGE:600:0:100000000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (45,'Mem Free','mem_free',30,3,20,0,0,0,'DS:mem_free:GAUGE:600:0:100000000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (46,'Acct Packets','acct_packets',40,3,20,0,0,0,'DS:acct_packets:ABSOLUTE:600:0:100000000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (47,'Acct Bytes','acct_bytes',50,3,20,0,0,0,'DS:acct_bytes:GAUGE:600:0:100000000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (48,'Tcp Active','tcp_active',60,3,20,0,0,0,'DS:tcp_active:COUNTER:600:0:10000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (49,'Tcp Passive','tcp_passive',70,3,20,0,0,0,'DS:tcp_passive:COUNTER:600:0:1000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (50,'Tcp Established','tcp_established',80,3,20,0,0,0,'DS:tcp_established:COUNTER:600:0:1000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (51,'Bgpin','bgpin',10,6,20,0,0,0,'DS:bgpin:COUNTER:600:0:10000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (52,'Bgpout','bgpout',20,6,20,0,0,0,'DS:bgpout:COUNTER:600:0:10000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (53,'Bgpuptime','bgpuptime',30,6,20,0,0,0,'DS:bgpuptime:GAUGE:600:0:10000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (56,'Storage Block Size','storage_block_size',10,8,20,0,0,0,'DS:storage_block_size:GAUGE:600:0:'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (57,'Storage Block Count','storage_block_count',20,8,20,0,0,0,'DS:storage_block_count:GAUGE:600:0:'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (58,'Storage Used Blocks','storage_used_blocks',30,8,20,0,0,0,'DS:storage_used_blocks:GAUGE:600:0:'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (59,'Output','output',10,9,20,0,0,0,'DS:output:COUNTER:600:0:'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (60,'Hits','hits',20,9,20,0,0,0,'DS:hits:COUNTER:600:0:'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (61,'Cpu User Ticks','cpu_user_ticks',10,10,20,0,0,0,'DS:cpu_user_ticks:COUNTER:600:0:86400'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (62,'Cpu Idle Ticks','cpu_idle_ticks',20,10,20,0,0,0,'DS:cpu_idle_ticks:COUNTER:600:0:86400'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (63,'Cpu Wait Ticks','cpu_wait_ticks',30,10,20,0,0,0,'DS:cpu_wait_ticks:COUNTER:600:0:86400'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (64,'Cpu Kernel Ticks','cpu_kernel_ticks',40,10,20,0,0,0,'DS:cpu_kernel_ticks:COUNTER:600:0:86400'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (65,'Swap Total','swap_total',50,10,20,0,0,0,'DS:swap_total:GAUGE:600:0:10000000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (66,'Swap Available','swap_available',60,10,20,0,0,0,'DS:swap_available:GAUGE:600:0:10000000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (67,'Mem Total','mem_total',70,10,20,0,0,0,'DS:mem_total:GAUGE:600:0:10000000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (68,'Mem Available','mem_available',80,10,20,0,0,0,'DS:mem_available:GAUGE:600:0:10000000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (69,'Load Average 1','load_average_1',90,10,20,0,0,0,'DS:load_average_1:GAUGE:600:0:1000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (70,'Load Average 5','load_average_5',100,10,20,0,0,0,'DS:load_average_5:GAUGE:600:0:1000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (71,'Load Average 15','load_average_15',110,10,20,0,0,0,'DS:load_average_15:GAUGE:600:0:1000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (72,'Cpu User Ticks','cpu_user_ticks',10,11,20,0,0,0,'DS:cpu_user_ticks:COUNTER:600:0:86400'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (73,'Cpu Idle Ticks','cpu_idle_ticks',20,11,20,0,0,0,'DS:cpu_idle_ticks:COUNTER:600:0:86400'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (74,'Cpu Nice Ticks','cpu_nice_ticks',30,11,20,0,0,0,'DS:cpu_nice_ticks:COUNTER:600:0:86400'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (75,'Cpu System Ticks','cpu_system_ticks',40,11,20,0,0,0,'DS:cpu_system_ticks:COUNTER:600:0:86400'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (76,'Load Average 1','load_average_1',50,11,20,0,0,0,'DS:load_average_1:GAUGE:600:0:1000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (77,'Load Average 5','load_average_5',60,11,20,0,0,0,'DS:load_average_5:GAUGE:600:0:1000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (78,'Load Average 15','load_average_15',70,11,20,0,0,0,'DS:load_average_15:GAUGE:600:0:1000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (79,'Num Users','num_users',80,11,20,0,0,0,'DS:num_users:GAUGE:600:0:100000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (80,'Num Procs','num_procs',90,11,20,0,0,0,'DS:num_procs:GAUGE:600:0:10000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (81,'Tcp Active','tcp_active',100,11,20,0,0,0,'DS:tcp_active:COUNTER:600:0:10000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (82,'Tcp Passive','tcp_passive',110,11,20,0,0,0,'DS:tcp_passive:COUNTER:600:0:1000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (83,'Tcp Established','tcp_established',120,11,20,0,0,0,'DS:tcp_established:COUNTER:600:0:1000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (84,'CPU','cpu',10,12,20,0,0,0,'DS:cpu:GAUGE:600:0:100'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (85,'Num Users','num_users',20,12,20,0,0,0,'DS:num_users:GAUGE:600:0:100000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (86,'Num Procs','num_procs',30,12,20,0,0,0,'DS:num_procs:GAUGE:600:0:10000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (87,'Tcp Active','tcp_active',40,12,20,0,0,0,'DS:tcp_active:COUNTER:600:0:10000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (88,'Tcp Passive','tcp_passive',50,12,20,0,0,0,'DS:tcp_passive:COUNTER:600:0:1000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (89,'Tcp Established','tcp_established',60,12,20,0,0,0,'DS:tcp_established:COUNTER:600:0:1000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (90,'Input','input',10,13,20,0,0,0,'DS:input:COUNTER:600:0:10000000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (91,'Output','output',20,13,20,0,0,0,'DS:output:COUNTER:600:0:10000000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (92,'Inputpackets','inputpackets',30,13,20,0,0,0,'DS:inputpackets:COUNTER:600:0:10000000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (93,'Outputpackets','outputpackets',40,13,20,0,0,0,'DS:outputpackets:COUNTER:600:0:10000000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (94,'RTT','rtt',10,14,20,0,0,0,'DS:rtt:GAUGE:600:0:10000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (95,'Packetloss','packetloss',20,14,20,0,0,0,'DS:packetloss:GAUGE:600:0:1000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (98,'Temperature','temperature',10,17,20,0,0,0,'DS:temperature:GAUGE:600:0:100'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (100,'Forward Jitter','forward_jitter',10,19,20,0,0,0,'DS:forward_jitter:GAUGE:600:0:100'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (101,'Backward Jitter','backward_jitter',20,19,20,0,0,0,'DS:backward_jitter:GAUGE:600:0:100'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (102,'Rt Latency','rt_latency',30,19,20,0,0,0,'DS:rt_latency:GAUGE:600:0:100'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (103,'Forward Packetloss','forward_packetloss',40,19,20,0,0,0,'DS:forward_packetloss:GAUGE:600:0:100'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (104,'Backward Packetloss','backward_packetloss',50,19,20,0,0,0,'DS:backward_packetloss:GAUGE:600:0:100'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (105,'RTT','rtt',10,20,20,0,0,0,'DS:rtt:GAUGE:600:0:10000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (106,'Packetloss','packetloss',20,20,20,0,0,0,'DS:packetloss:GAUGE:600:0:1000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (107,'Bytes','bytes',10,21,20,0,0,0,'DS:bytes:COUNTER:600:0:'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (108,'Packets','packets',20,21,20,0,0,0,'DS:packets:COUNTER:600:0:'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (109,'Disk Type','storage_type',10,8,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (110,'Size (Bytes)','size',20,8,7,1,1,1,'0'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (111,'Description','description',30,8,7,1,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (112,'Index','index',40,8,3,0,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (113,'Index','index',10,10,3,1,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (114,'Description','description',20,10,7,1,0,1,'System Information'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (115,'Number of Processors','cpu_num',30,10,8,1,1,0,'1'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (116,'Index','index',10,14,3,1,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (117,'Description','description',20,14,7,1,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (118,'Index','index',10,20,3,0,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (119,'Description','description',20,20,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (120,'Rate','rate',20,21,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (121,'Ceil','ceil',30,21,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (122,'Index','index',50,21,3,1,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (123,'Description','description',40,21,7,2,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (124,'Index','index',10,9,3,1,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (125,'Owner','owner',20,9,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (126,'VIP Address','address',30,9,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (127,'Bandwidth','bandwidth',40,9,8,1,1,0,'1'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (128,'Description','description',20,18,7,1,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (129,'Description','description',20,17,7,1,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (130,'Description','description',20,16,7,1,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (131,'Index','index',30,18,3,1,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (132,'Index','index',30,17,3,1,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (133,'Index','index',10,16,3,1,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (134,'Number of Processors','cpu_num',30,3,8,1,1,0,'1'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (135,'Index','index',10,3,3,1,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (136,'Description','description',20,3,7,1,0,1,'System Information'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (137,'Index','index',10,19,3,1,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (138,'Description','description',20,19,7,1,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (139,'Description','description',20,13,7,1,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (140,'Index','index',35,13,3,1,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (141,'MAC Address','mac',30,13,8,0,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (142,'Interface Index','ifindex',40,13,8,2,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (143,'IP Address','address',25,13,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (144,'Flip Graph In/Out','flipinout',45,13,5,2,1,0,'0'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (145,'Local IP','local',30,6,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (146,'Remote IP','remote',40,6,3,1,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (147,'Autonomous System','asn',20,6,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (149,'Description','description',50,6,7,2,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (150,'Process Name','process_name',10,15,3,2,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (151,'Description','description',20,15,7,1,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (153,'Instances at Discovery','instances',30,15,8,1,1,0,'1'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (154,'Pings to Send','pings',80,4,8,2,1,0,'50'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (155,'Pings to Send','pings',30,20,8,2,1,0,'50'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (156,'PL Threshold %','threshold',40,20,8,2,1,0,'70'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (157,'Interval (ms)','interval',50,20,8,2,1,0,'300'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (158,'Check Content RegExp','check_regexp',50,2,8,2,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (159,'Current Instances','current_instances',10,15,20,0,0,0,'DS:current_instances:GAUGE:600:0:99999'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (160,'Index','index',10,22,3,0,0,0,'1'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (161,'Fixed Admin Status','fixed_admin_status',99,4,5,2,1,0,'0'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (162,'Usage Threshold %','usage_threshold',40,8,8,2,1,0,'80'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (164,'Used Memory','used_memory',20,15,20,0,0,0,'DS:used_memory:GAUGE:600:0:9999999'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (165,'IP Mask','mask',32,4,8,2,1,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (167,'Show in Celcius','show_celcius',40,17,5,2,1,0,'1'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (168,'Port Number','port',10,23,3,1,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (169,'Port Description','description',20,23,7,1,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (170,'Connection Delay','conn_delay',10,23,20,0,0,0,'DS:conn_delay:GAUGE:600:0:100000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (171,'Controller','controller',10,24,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (172,'Drive','drvindex',11,24,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (173,'Drive Model','model',15,24,8,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (174,'Index','index',5,24,3,0,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (175,'Index','index',5,25,3,0,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (176,'Chassis','chassis',10,25,8,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (177,'Fan','fanindex',11,25,8,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (178,'Location','location',20,25,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (179,'Index','index',5,26,3,0,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (180,'Chassis','chassis',10,26,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (181,'Sensor','tempindex',11,26,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (182,'Location','location',2,26,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (183,'Temperature','temperature',80,26,20,0,0,0,'DS:temperature:GAUGE:600:0:1000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (184,'Index','index',10,27,3,0,0,0,'1'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (185,'Total Bytes Received','tbr',10,27,20,0,0,0,'DS:tbr:COUNTER:600:0:999999999'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (186,'Total CGI Requests','tcgir',20,27,20,0,0,0,'DS:tcgir:COUNTER:600:0:999999999'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (187,'Total Files Sent','tfs',30,27,20,0,0,0,'DS:tfs:COUNTER:600:0:999999999'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (188,'Total Gets','tg',40,27,20,0,0,0,'DS:tg:COUNTER:600:0:999999999'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (189,'Total Posts','tp',50,27,20,0,0,0,'DS:tp:COUNTER:600:0:999999999'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (190,'Serial Lines Free','pm_serial_free',10,28,20,1,0,0,'DS:pm_serial_free:GAUGE:600:0:5000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (191,'Serial Lines Connecting','pm_serial_connecting',20,28,20,1,0,0,'DS:pm_serial_connecting:GAUGE:600:0:5000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (192,'Serial Lines Established','pm_serial_established',30,28,20,1,0,0,'DS:pm_serial_established:GAUGE:600:0:5000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (193,'Serial Lines Disconnecting','pm_serial_disconnecting',40,28,20,1,0,0,'DS:pm_serial_disconnecting:GAUGE:600:0:5000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (194,'Serial Lines Command','pm_serial_command',50,28,20,1,0,0,'DS:pm_serial_command:GAUGE:600:0:5000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (195,'Serial Lines NoService','pm_serial_noservice',60,28,20,1,0,0,'DS:pm_serial_noservice:GAUGE:600:0:5000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (196,'Index','index',10,28,3,0,0,0,'1'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (197,'Process Threshold','proc_threshold',40,12,8,2,1,0,'100'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (199,'Description','description',20,29,7,2,1,0,'Apache Stats'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (200,'Total Accesses','tac',30,29,20,0,0,0,'DS:tac:COUNTER:600:0:100000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (201,'IP:Port','ip_port',10,29,3,1,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (202,'Total KBytes','tkb',20,29,20,0,0,0,'DS:tkb:COUNTER:600:0:10000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (203,'CPU Load','cplo',60,29,20,0,0,0,'DS:cplo:GAUGE:600:0:1000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (204,'Uptime','up',10,29,20,0,0,0,'DS:up:GAUGE:600:0:99999999999999'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (205,'Bytes Per Request','bpr',40,29,20,0,0,0,'DS:bpr:GAUGE:600:0:10000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (208,'Busy Workers','bw',90,29,20,0,0,0,'DS:bw:GAUGE:600:0:1000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (209,'Idle Workers','iw',50,29,20,0,0,0,'DS:iw:GAUGE:600:0:1000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (210,'Index','index',10,31,3,0,0,0,'1'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (211,'Description','description',20,31,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (212,'Battery Capacity','capacity',10,31,20,0,0,0,'DS:capacity:GAUGE:600:0:100'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (213,'Output Load','load',20,31,20,0,0,0,'DS:load:GAUGE:600:0:100'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (214,'Input Voltage','in_voltage',31,31,20,0,0,0,'DS:in_voltage:GAUGE:600:0:400'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (215,'Output Voltage','out_voltage',40,31,20,0,0,0,'DS:out_voltage:GAUGE:600:0:400'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (216,'Time Remaining','time_remaining',50,31,20,0,0,0,'DS:time_remaining:GAUGE:600:0:9999999999'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (217,'Temperature','temperature',60,31,20,0,0,0,'DS:temperature:GAUGE:600:0:200'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (218,'Show Temp in Celcius','show_celcius',31,31,5,2,1,0,'1'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (220,'Index','index',10,30,3,1,1,0,'1'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (221,'Description','description',20,30,7,1,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (222,'DSN','dsn',30,30,8,2,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (223,'Username','username',40,30,8,2,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (224,'Password','password',50,30,8,2,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (225,'Max Records','max_records',60,30,8,2,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (226,'Min Records','min_records',70,30,8,2,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (227,'Counter Records','records_counter',10,30,20,0,0,0,'DS:records_counter:COUNTER:600:0:9999999999'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (228,'Query','query',55,30,8,2,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (229,'Absolute Records','records_absolute',20,30,20,0,0,0,'DS:records_absolute:GAUGE:600:0:9999999999'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (230,'Is Absolute?','absolute',80,30,5,1,1,0,'0'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (231,'Percentile','percentile',55,4,8,2,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (232,'Index','index',10,32,3,0,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (233,'Hostname','hostname',20,32,7,1,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (234,'Max Connections','max_connections',30,32,8,2,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (235,'Total Sessions','total_sessions',50,32,20,0,0,0,'DS:total_sessions:COUNTER:600:0:100000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (236,'Current Sessions','current_sessions',55,32,20,0,0,0,'DS:current_sessions:GAUGE:600:0:'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (237,'Failures','failures',60,32,20,0,0,0,'DS:failures:COUNTER:600:0:10000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (238,'Octets','octets',65,32,20,0,0,0,'DS:octets:COUNTER:600:0:1000000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (239,'Index','index',10,33,3,0,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (240,'Hostname','hostname',20,33,7,1,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (241,'Total Sessions','total_sessions',30,33,20,0,0,0,'DS:total_sessions:COUNTER:600:0:100000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (242,'Current Sessions','current_sessions',35,33,20,0,0,0,'DS:current_sessions:GAUGE:600:0:20000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (243,'Octets','octets',40,33,20,0,0,0,'DS:octets:COUNTER:600:0:1000000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (244,'Index','index',10,34,3,0,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (245,'Hostname','hostname',20,34,7,1,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (246,'Address','address',30,34,7,1,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (247,'Port','port',35,34,7,1,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (248,'Real Server','real_server',15,34,8,0,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (249,'Response Time','response_time',40,34,20,0,0,0,'DS:response_time:GAUGE:600:0:10000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (250,'Index','index',10,35,3,0,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (251,'Description','description',20,35,7,1,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (252,'Number of CPUs','cpu_num',30,35,8,0,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (253,'TCP Active','tcp_active',40,35,20,0,0,0,'DS:tcp_active:COUNTER:600:0:10000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (254,'TCP Passive','tcp_passive',41,35,20,0,0,0,'DS:tcp_passive:COUNTER:600:0:10000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (255,'TCP Established','tcp_established',42,35,20,0,0,0,'DS:tcp_established:COUNTER:600:0:10000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (256,'Memory Total','mem_total',50,35,20,0,0,0,'DS:mem_total:GAUGE:600:0:100000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (257,'Memory Used','mem_used',51,35,20,0,0,0,'DS:mem_used:GAUGE:600:0:100000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (258,'CPU A 1 Sec','cpua_1sec',60,35,20,0,0,0,'DS:cpua_1sec:GAUGE:600:0:1000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (259,'CPU A 4 Secs','cpua_4secs',61,35,20,0,0,0,'DS:cpua_4secs:GAUGE:600:0:1000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (260,'CPU A 64 Secs','cpua_64secs',62,35,20,0,0,0,'DS:cpua_64secs:GAUGE:600:0:1000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (261,'CPU B 1 Sec','cpub_1sec',65,35,20,0,0,0,'DS:cpub_1sec:GAUGE:600:0:1000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (262,'CPU B 4 Secs','cpub_4secs',66,35,20,0,0,0,'DS:cpub_4secs:GAUGE:600:0:1000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (263,'CPU B 64 Secs','cpub_64secs',67,35,20,0,0,0,'DS:cpub_64secs:GAUGE:600:0:1000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (264,'Index','index',10,36,3,0,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (265,'Type','sensor_type',30,36,8,1,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (266,'Value','sensor_value',40,36,20,0,0,0,'DS:sensor_value:GAUGE:600:0:3000000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (267,'Index','index',10,37,3,0,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (268,'Description','description',20,37,7,1,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (269,'Physical Status','phy',40,37,8,1,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (270,'Tx Words','tx_words',40,37,20,0,0,0,'DS:tx_words:COUNTER:600:0:1000000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (271,'Rx Words','rx_words',45,37,20,0,0,0,'DS:rx_words:COUNTER:600:0:1000000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (272,'Tx Frames','tx_frames',50,37,20,0,0,0,'DS:tx_frames:COUNTER:600:0:100000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (273,'Rx Frames','rx_frames',55,37,20,0,0,0,'DS:rx_frames:COUNTER:600:0:100000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (274,'Index','index',10,38,3,0,0,0,'1'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (275,'Async Used','cisco_async',10,38,20,0,0,0,'DS:cisco_async:GAUGE:600:0:5000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (276,'DSX Used','cisco_dsx',20,38,20,0,0,0,'DS:cisco_dsx:GAUGE:600:0:5000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (277,'Free','cisco_free',30,38,20,0,0,0,'DS:cisco_free:GAUGE:600:0:5000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (278,'Description','description',20,38,7,2,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (279,'System Name','name',40,11,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (280,'Location','location',50,11,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (281,'Contact','contact',60,11,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (282,'System Name','name',50,12,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (283,'Location','location',60,12,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (284,'Contact','contact',70,12,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (285,'System Name','name',40,3,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (286,'Location','location',50,3,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (287,'Contact','contact',60,3,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (288,'System Name','name',40,10,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (289,'Location','location',50,10,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (290,'Contact','contact',60,10,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (291,'System Name','name',40,35,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (292,'Location','location',50,35,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (293,'Contact','contact',60,35,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (294,'Index','index',10,39,3,0,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (295,'Description','description',20,39,7,2,1,0,'SNMP Informant Disk Stats'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (296,'lDisk % Read Time','inf_d_read_time',20,39,20,0,0,0,'DS:inf_d_read_time:GAUGE:600:0:100'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (297,'lDisk % Write Time','inf_d_write_time',10,39,20,0,0,0,'DS:inf_d_write_time:GAUGE:600:0:100'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (298,'lDisk Read Rate','inf_d_read_rate',30,39,20,0,0,0,'DS:inf_d_read_rate:GAUGE:600:0:1048576000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (299,'lDisk Write Rate','inf_d_write_rate',25,39,20,0,0,0,'DS:inf_d_write_rate:GAUGE:600:0:1048576000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (300,'Index','index',10,40,3,0,0,0,'1'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (301,'Identification','ident',20,40,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (302,'Description','description',30,40,7,2,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (303,'Battery Temperature','temperature',10,40,20,0,0,0,'DS:temperature:GAUGE:600:0:200'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (304,'Show in Celcius','show_celcius',40,40,5,2,1,0,'1'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (305,'Minutes Remaining','minutes_remaining',20,40,20,0,0,0,'DS:minutes_remaining:GAUGE:600:0:10000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (306,'Index','index',10,41,3,0,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (307,'Line Type','line_type',20,41,8,0,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (308,'Line Index','line_index',30,41,8,0,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (309,'Description','description',40,41,7,2,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (310,'Voltage','voltage',10,41,20,0,0,0,'DS:voltage:GAUGE:600:0:500'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (311,'Current','current',20,41,20,0,0,0,'DS:current:GAUGE:600:0:100'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (312,'Load','load',30,41,20,0,0,0,'DS:load:GAUGE:600:0:100'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (313,'Charge Remaining','charge_remaining',30,40,20,0,0,0,'DS:charge_remaining:GAUGE:600:0:100'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (314,'IPTables Chain','chainnumber',10,42,3,1,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (315,'Default Policy','policy',30,42,7,1,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (316,'Number of Packets','ipt_packets',10,42,20,0,0,0,'DS:ipt_packets:COUNTER:600:0:1000000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (317,'Number of Bytes','ipt_bytes',20,42,20,0,0,0,'DS:ipt_bytes:COUNTER:600:0:'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (318,'Description','description',20,42,7,2,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (319,'Accepted Routers','accepted_routes',40,6,20,0,0,0,'DS:accepted_routes:GAUGE:600:0:900000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (320,'Advertised Routers','advertised_routes',50,6,20,0,0,0,'DS:advertised_routes:GAUGE:600:0:900000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (322,'Estimated Bandwidth','bandwidth',40,42,8,2,1,0,'10240000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (323,'Index','index',10,43,3,0,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (324,'Connections','pix_connections',10,43,20,0,0,0,'DS:pix_connections:GAUGE:600:0:1000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (325,'Description','description',20,43,7,1,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (326,'Index','index',10,44,3,0,0,0,'1'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (327,'Description','description',20,44,7,2,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (328,'Cisco Max Inbound NAT Bytes','NatInMax',30,44,8,2,1,0,'1000000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (329,'Cisco Max Outbound NAT Bytes','NatOutMax',40,44,8,2,1,0,'1000000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (330,'Cisco NAT Other IP Outbound','cisco_nat_other_ip_outbound',10,44,20,0,0,0,'DS:cisco_nat_other_ip_outbound:COUNTER:600:0:'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (331,'Cisco NAT Other IP Inbound','cisco_nat_other_ip_inbound',15,44,20,0,0,0,'DS:cisco_nat_other_ip_inbound:COUNTER:600:0:'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (332,'Cisco NAT ICMP Outbound','cisco_nat_icmp_outbound',20,44,20,0,0,0,'DS:cisco_nat_icmp_outbound:COUNTER:600:0:'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (333,'Cisco NAT ICMP Inbound','cisco_nat_icmp_inbound',25,44,20,0,0,0,'DS:cisco_nat_icmp_inbound:COUNTER:600:0:'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (334,'Cisco NAT UDP Outbound','cisco_nat_udp_outbound',30,44,20,0,0,0,'DS:cisco_nat_udp_outbound:COUNTER:600:0:'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (335,'Cisco NAT UDP Inbound','cisco_nat_udp_inbound',35,44,20,0,0,0,'DS:cisco_nat_udp_inbound:COUNTER:600:0:'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (336,'Cisco NAT TCP Outbound','cisco_nat_tcp_outbound',40,44,20,0,0,0,'DS:cisco_nat_tcp_outbound:COUNTER:600:0:'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (337,'Cisco NAT TCP Inbound','cisco_nat_tcp_inbound',45,44,20,0,0,0,'DS:cisco_nat_tcp_inbound:COUNTER:600:0:'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (338,'Cisco NAT Active Binds','cisco_nat_active_binds',50,44,20,0,0,0,'DS:cisco_nat_active_binds:GAUGE:600:0:100000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (339,'Index','index',10,45,3,0,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (340,'Value','value',10,45,20,0,0,0,'DS:value:GAUGE:600:-100000:100000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (341,'Description','description',20,45,7,1,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (342,'Show in Celcius','show_celcius',31,45,5,2,1,0,'1'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (343,'Show in Celcius','show_in_celcius',30,26,5,2,1,0,'1'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (344,'CPU Usage Threshold','cpu_threshold',90,3,8,2,1,0,'60'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (345,'Index','index',10,46,8,0,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (346,'Description','description',20,46,7,2,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (347,'CPU Usage','cpu400',10,46,20,0,0,0,'DS:cpu400:GAUGE:600:0:10000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (348,'CPU Usage Threshold','cpu_threshold',90,11,8,2,1,0,'80'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (350,'Index','index',10,47,3,0,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (351,'Description','description',20,47,7,1,1,0,'System Information'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (352,'Dell OpenManage Fan RPM #2','dell_om_fan_2',51,47,20,0,0,0,'DS:dell_om_fan_2:GAUGE:600:0:100000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (353,'Dell OpenManage Fan RPM #3','dell_om_fan_3',52,47,20,0,0,0,'DS:dell_om_fan_3:GAUGE:600:0:100000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (354,'Dell OpenManage Fan RPM #4','dell_om_fan_4',53,47,20,0,0,0,'DS:dell_om_fan_4:GAUGE:600:0:100000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (355,'Dell OpenManage Fan RPM #5','dell_om_fan_5',54,47,20,0,0,0,'DS:dell_om_fan_5:GAUGE:600:0:100000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (356,'Dell OpenManage Fan RPM #6','dell_om_fan_6',55,47,20,0,0,0,'DS:dell_om_fan_6:GAUGE:600:0:100000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (357,'Dell OpenManage Fan RPM #7','dell_om_fan_7',56,47,20,0,0,0,'DS:dell_om_fan_7:GAUGE:600:0:100000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (367,'UPS Type','upstype',50,40,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (358,'UPS Type','upstype',50,41,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (359,'Power','power',50,41,20,0,0,0,'DS:power:GAUGE:600:0:100000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (360,'Description','description',20,48,7,1,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (361,'Index','index',10,48,3,0,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (362,'Index','index',10,49,3,0,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (363,'Banks','banks',50,48,7,1,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (364,'Power Rating Amps)','powerrating',40,49,7,1,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (365,'Load (Amps)','load',50,49,20,0,0,0,'DS:load:GAUGE:600:0:100'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (366,'Overload Threshold','threshold',50,49,7,1,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (394,'Index','index',5,50,3,0,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (368,'Index','index',10,51,3,0,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (369,'Health State','health_state',15,51,7,0,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (370,'Serial Number','serial',20,51,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (371,'Manuf date','manuf_date',30,51,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (372,'CPU1 Temperature','temperature',35,51,20,0,0,0,'DS:temperature:GAUGE:600:0:100'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (373,'CPU2 Temperature','temperature2',40,51,20,0,0,0,'DS:temperature2:GAUGE:600:0:100'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (374,'Index','index',10,52,3,0,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (375,'Oper Status','oper',30,52,8,1,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (376,'Tx Frames','tx_frames',40,52,20,0,0,0,'DS:tx_frames:COUNTER:600:0:100000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (377,'Rx Frames','rx_frames',50,52,20,0,0,0,'DS:rx_frames:COUNTER:600:0:100000000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (378,'FC Port','real_index',11,52,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (379,'Admin Status','admin',20,52,8,1,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (380,'Index','index',1,53,3,0,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (381,'Description','description',10,53,7,1,1,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (382,'Associated','associated',20,53,20,0,0,0,'DS:associated:GAUGE:600:0:2100'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (383,'Index','index',10,54,3,0,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (384,'Power Module 1','module1',15,54,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (385,'Power Module 2','module2',20,54,7,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (386,'Power Consumption','fuelGaugePowerInUse',35,54,20,2,0,0,'DS:fuelGaugePowerInUse:GAUGE:600:0:10000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (387,'Power Capacity','totalpower',30,54,7,1,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (388,'Index','index',5,55,3,0,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (389,'Chassis','chassis',10,55,8,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (390,'Bay','bayindex',15,55,8,1,0,1,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (391,'Index','index',1,56,3,0,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (392,'Number of arrays','nb_arrays',10,56,8,1,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (393,'Cpu Threshold','cpu_threshold',40,46,8,2,1,0,'90'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (406,'Index','index',5,57,3,0,0,0,''); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (395,'Description','description',10,57,7,1,1,0,'Ldisk 64'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (396,'Current Queue Length','cur_disk_q',20,57,20,0,0,0,'DS:cur_disk_q:GAUGE:600:0:10000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (397,'Average Queue Length','avg_disk_q',25,57,20,0,0,0,'DS:avg_disk_q:GAUGE:600:0:10000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (398,'Average Read Queue Length','avg_disk_rdq',30,57,20,0,0,0,'DS:avg_disk_rdq:GAUGE:600:0:10000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (399,'Average Write Queue Length','avg_disk_wrq',35,57,20,0,0,0,'DS:avg_disk_wrq:GAUGE:600:0:10000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (400,'Percent Read Time','inf_d_read_time',40,57,20,0,0,0,'DS:inf_d_read_time:GAUGE:600:0:100'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (401,'Percent Write Time','inf_d_write_time',45,57,20,0,0,0,'DS:inf_d_write_time:GAUGE:600:0:100'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (402,'Reads Per Sec','rd_ops',50,57,20,0,0,0,'DS:rd_ops:GAUGE:600:0:10000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (403,'Writes Per Sec','wr_ops',55,57,20,0,0,0,'DS:wr_ops:GAUGE:600:0:10000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (404,'Read Bytes Per Sec','inf_d_read_rate',55,57,20,0,0,0,'DS:inf_d_read_rate:GAUGE:600:0:10000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (405,'Write Bytes Per Sec','inf_d_write_rate',55,57,20,0,0,0,'DS:inf_d_write_rate:GAUGE:600:0:10000'); INSERT INTO interface_types_fields (id, description, name, pos, itype, ftype, showable, overwritable, tracked, default_value) VALUES (407,'Ignore Case','ignore_case',30,15,8,1,1,0,'0'); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE interfaces ( id int4 NOT NULL AUTO_INCREMENT, type int4 NOT NULL DEFAULT '1', interface char(30) NOT NULL DEFAULT '', host int4 NOT NULL DEFAULT '1', client int4 NOT NULL DEFAULT '1', sla int4 NOT NULL DEFAULT '1', poll int4 NOT NULL DEFAULT '1', make_sound int2 NOT NULL DEFAULT '1', show_rootmap int2 NOT NULL DEFAULT '1', rrd_mode int2 NOT NULL DEFAULT '2', creation_date int4 NOT NULL DEFAULT '0', modification_date int4 NOT NULL DEFAULT '0', last_poll_date int4 NOT NULL DEFAULT '0', poll_interval int4 NOT NULL DEFAULT '0', check_status int2 NOT NULL DEFAULT '1', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO interfaces (id, type, interface, host, client, sla, poll, make_sound, show_rootmap, rrd_mode, creation_date, modification_date, last_poll_date, poll_interval, check_status) VALUES (1,1,'Unknown0',1,1,1,1,1,1,1,0,0,0,0,1); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE interfaces_values ( id int4 NOT NULL AUTO_INCREMENT, interface int4 NOT NULL DEFAULT '0', field int4 NOT NULL DEFAULT '0', value varchar(3000) NOT NULL, PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO interfaces_values (id, interface, field, value) VALUES (1,1,1,''); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE journal ( id int4 NOT NULL AUTO_INCREMENT, date_start datetime NOT NULL DEFAULT NULL, date_stop datetime NOT NULL DEFAULT NULL, comment text NOT NULL, subject varchar(40) NOT NULL DEFAULT '', active int2 NOT NULL DEFAULT '1', ticket varchar(20) NOT NULL DEFAULT '', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO journal (id, date_start, date_stop, comment, subject, active, ticket) VALUES (1,'2002-01-20 19:09:07',NULL,'Internally used ID','',0,''); INSERT INTO journal (id, date_start, date_stop, comment, subject, active, ticket) VALUES (2,'2002-01-20 19:09:07',NULL,'Internally used ID','',0,''); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE logfiles ( id int4 NOT NULL AUTO_INCREMENT, filename varchar(60) NOT NULL, last_poll_date int4 NOT NULL DEFAULT '0', file_offset int4 DEFAULT NULL, description varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE logfiles_match_groups ( id int4 NOT NULL AUTO_INCREMENT, logfile int4 NOT NULL, pos int4 NOT NULL DEFAULT '10', match_item int4 NOT NULL, PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE logfiles_match_items ( id int4 NOT NULL AUTO_INCREMENT, description varchar(30) NOT NULL, match_text varchar(255) NOT NULL, interface varchar(20) NOT NULL, username varchar(20) NOT NULL, state varchar(20) NOT NULL, info varchar(20) NOT NULL, type int4 NOT NULL, host varchar(20) DEFAULT NULL, logfile_id int4 NOT NULL DEFAULT '0', pos int4 NOT NULL DEFAULT '10', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE maps ( id int4 NOT NULL AUTO_INCREMENT, parent int4 NOT NULL DEFAULT '0', name char(60) NOT NULL DEFAULT '', color char(6) NOT NULL DEFAULT '00A348', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO maps (id, parent, name, color) VALUES (1,1,'Root Map','00A348'); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE maps_interfaces ( id int4 NOT NULL AUTO_INCREMENT, map int4 NOT NULL DEFAULT '0', interface int4 NOT NULL DEFAULT '0', x int4 NOT NULL DEFAULT '1', y int4 NOT NULL DEFAULT '1', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO maps_interfaces (id, map, interface, x, y) VALUES (1,1,1,1,1); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE nad_hosts ( id int4 NOT NULL AUTO_INCREMENT, snmp_name char(120) NOT NULL DEFAULT '', description varchar(3000) NOT NULL, snmp_community char(60) NOT NULL DEFAULT '', forwarding int2 NOT NULL DEFAULT '0', date_added int4 NOT NULL DEFAULT '0', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE nad_ips ( id int4 NOT NULL AUTO_INCREMENT, host int4 NOT NULL DEFAULT '1', ip char(20) NOT NULL DEFAULT '', type int4 NOT NULL DEFAULT '0', network int4 NOT NULL DEFAULT '1', dns char(120) NOT NULL DEFAULT '', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE nad_networks ( id int4 NOT NULL AUTO_INCREMENT, network char(20) NOT NULL DEFAULT '', deep int2 NOT NULL DEFAULT '1', oper_status int2 NOT NULL DEFAULT '1', parent int4 NOT NULL DEFAULT '1', seed int4 NOT NULL DEFAULT '1', oper_status_changed int4 NOT NULL DEFAULT '0', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE pollers ( id int4 NOT NULL AUTO_INCREMENT, name char(60) NOT NULL DEFAULT '', description char(60) NOT NULL DEFAULT '', command char(60) NOT NULL DEFAULT '', parameters char(100) NOT NULL DEFAULT '', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO pollers (id, name, description, command, parameters) VALUES (1,'no_poller','No Poller','no_poller',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (2,'input','SNMP Input Rate','snmp_counter','.1.3.6.1.2.1.2.2.1.10.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (3,'verify_interface_number','Cisco Verify Interface Number','verify_interface_number',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (5,'cisco_snmp_ping_start','Cisco SNMP Ping Start','cisco_snmp_ping_start',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (6,'cisco_snmp_ping_wait','Cisco SNMP Ping Wait','cisco_snmp_ping_wait',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (7,'packetloss','Cisco SNMP Ping Get PL','cisco_snmp_ping_get_pl',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (8,'rtt','Cisco SNMP Ping Get RTT','cisco_snmp_ping_get_rtt',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (9,'cisco_snmp_ping_end','Cisco SNMP Ping End','cisco_snmp_ping_end',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (10,'output','SNMP Output Rate','snmp_counter','.1.3.6.1.2.1.2.2.1.16.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (11,'outputerrors','SNMP Output Errors','snmp_counter','.1.3.6.1.2.1.2.2.1.20.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (12,'inputerrors','SNMP Input Errors','snmp_counter','.1.3.6.1.2.1.2.2.1.14.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (13,'interface_oper_status','SNMP Interface Operational Status','snmp_interface_status_all','8'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (14,'interface_admin_status','SNMP Interface Administrative Status','snmp_interface_status_all','7'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (16,'cpu','Cisco CPU Utilization','snmp_counter','.1.3.6.1.4.1.9.9.109.1.1.1.1.5.1'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (21,'inpackets','SNMP Input Packets','snmp_counter','.1.3.6.1.2.1.2.2.1.11.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (22,'outpackets','SNMP Output Packets','snmp_counter','.1.3.6.1.2.1.2.2.1.17.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (23,'tcp_status,tcp_content,conn_delay','TCP Port Check & Delay','tcp_status',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (24,'mem_used','Cisco Used Memory','snmp_counter','.1.3.6.1.4.1.9.9.48.1.1.1.5.1'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (25,'mem_free','Cisco Free Memory','snmp_counter','.1.3.6.1.4.1.9.9.48.1.1.1.6.1'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (26,'drops','SNMP Drops','snmp_counter','.1.3.6.1.2.1.2.2.1.19.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (30,'cpu','Cisco 2500 Series CPU Utilization','snmp_counter','.1.3.6.1.4.1.9.2.1.56.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (31,'bgpin','BGP Inbound Updates','snmp_counter','.1.3.6.1.2.1.15.3.1.10.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (32,'bgpout','BGP Outbound Updates','snmp_counter','.1.3.6.1.2.1.15.3.1.11.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (33,'bgpuptime','BGP Uptime','snmp_counter','.1.3.6.1.2.1.15.3.1.16.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (35,'storage_used_blocks','Storage Device Used Blocks','snmp_counter','.1.3.6.1.2.1.25.2.3.1.6.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (36,'storage_block_count','Storage Device Total Blocks','snmp_counter','.1.3.6.1.2.1.25.2.3.1.5.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (37,'storage_block_size','Storage Device Block Size','snmp_counter','.1.3.6.1.2.1.25.2.3.1.4.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (38,'bgp_peer_status','BGP Peer Status','bgp_peer_status',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (40,'hits','CSS VIP Hits','snmp_counter','.1.3.6.1.4.1.2467.1.16.4.1.18.\"\".\"\"'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (41,'output','CSS VIP Traffic Rate','snmp_counter','.1.3.6.1.4.1.2467.1.16.4.1.25.\"\".\"\"'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (42,'cpu_kernel_ticks','CPU Kernel Time','snmp_counter','.1.3.6.1.4.1.2021.11.55.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (43,'cpu_idle_ticks','CPU Idle Time','snmp_counter','.1.3.6.1.4.1.2021.11.53.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (44,'cpu_wait_ticks','CPU Wait Time','snmp_counter','.1.3.6.1.4.1.2021.11.54.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (45,'cpu_system_ticks','CPU System Time','snmp_counter','.1.3.6.1.4.1.2021.11.52.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (46,'mem_available','Real Memory Available','snmp_counter','.1.3.6.1.4.1.2021.4.6.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (47,'mem_total','Real Memory Total','snmp_counter','.1.3.6.1.4.1.2021.4.5.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (48,'swap_available','Swap Memory Available','snmp_counter','.1.3.6.1.4.1.2021.4.4.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (49,'swap_total','Swap Memory Total','snmp_counter','.1.3.6.1.4.1.2021.4.3.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (50,'load_average_15','Load Average 15 min','snmp_counter','.1.3.6.1.4.1.2021.10.1.3.3'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (51,'load_average_5','Load Average 5 min','snmp_counter','.1.3.6.1.4.1.2021.10.1.3.2'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (52,'load_average_1','Load Average 1 min','snmp_counter','.1.3.6.1.4.1.2021.10.1.3.1'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (53,'cpu_user_ticks','CPU User Time','snmp_counter','.1.3.6.1.4.1.2021.11.50.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (54,'cpu_nice_ticks','CPU Nice Time','snmp_counter','.1.3.6.1.4.1.2021.11.51.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (55,'bandwidthin','Get Bandwidth IN from DB','db','bandwidthin,to_bytes'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (56,'bandwidthout','Get Bandwidth OUT from DB','db','bandwidthout,to_bytes'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (57,'tcp_conn_number','TCP Connection Numbers','tcp_connection_number',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (58,'acct_bytes,acct_packets','Cisco Accounting','cisco_accounting',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (59,'cpu','Host MIB Proc Average Util','snmp_walk_average','.1.3.6.1.2.1.25.3.3.1.2'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (60,'num_procs','Host MIB Number of Processes','snmp_counter','.1.3.6.1.2.1.25.1.6.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (61,'num_users','Host MIB Number of Users','snmp_counter','.1.3.6.1.2.1.25.1.5.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (62,'tcp_active','TCP MIB Active Opens','snmp_counter','.1.3.6.1.2.1.6.5.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (63,'tcp_passive','TCP MIB Passive Opens','snmp_counter','.1.3.6.1.2.1.6.6.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (64,'tcp_established','TCP MIB Established Connections','snmp_counter','.1.3.6.1.2.1.6.9.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (65,'inputpackets','Cisco MAC Accounting Input Packets','snmp_counter','.1.3.6.1.4.1.9.9.84.1.2.1.1.3..1.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (66,'outputpackets','Cisco MAC Accounting Output Packets','snmp_counter','.1.3.6.1.4.1.9.9.84.1.2.1.1.3..2.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (67,'input','Cisco MAC Accounting Input Bytes','snmp_counter','.1.3.6.1.4.1.9.9.84.1.2.1.1.4..1.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (68,'output','Cisco MAC Accounting Output Bytes','snmp_counter','.1.3.6.1.4.1.9.9.84.1.2.1.1.4..2.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (69,'packetloss','Smokeping Loss','smokeping','loss'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (70,'rtt','Smokeping RTT','smokeping','median'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (71,'app_status,current_instances','Host MIB Process Verifier','hostmib_apps',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (72,'cisco_powersupply_status','Cisco Power Supply Status','cisco_envmib_status','5.1.3'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (73,'cisco_temperature_status','Cisco Temperature Status','cisco_envmib_status','3.1.6'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (74,'cisco_voltage_status','Cisco Voltage Status','cisco_envmib_status','2.1.7'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (75,'temperature','Cisco Temperature','snmp_counter','.1.3.6.1.4.1.9.9.13.1.3.1.3.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (76,'sa_agent_verify','Verify SA Agent Operation','cisco_saagent_verify',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (77,'forward_jitter','SA Agent Forward Jitter','cisco_saagent_forwardjitter',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (78,'backward_jitter','SA Agent Backward Jitter','cisco_saagent_backwardjitter',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (79,'rt_latency','SA Agent Round-Trip Latency','cisco_saagent_rtl',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (80,'forward_packetloss','SA Agent fw % PacketLoss','cisco_saagent_fwpacketloss',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (81,'backward_packetloss','SA Agent bw % PacketLoss','cisco_saagent_bwpacketloss',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (82,'verify_smokeping_number','Verify Smokeping Number','verify_smokeping_number',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (85,'tcp_content_analisis','TCP Port Response Check','tcp_port_content','tcp_content'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (86,'ping','Reachability Start FPING','reachability_start',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (87,'wait','Reachability Wait until finished','reachability_wait',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (88,'rtt','Reachability RTT','reachability_values','rtt'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (89,'packetloss','Reachability PL','reachability_values','pl'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (90,'ping_cleanup','Reachability End','reachability_end',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (91,'status','Reachability Status','reachability_status',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (93,'bytes','Linux TC Bytes','snmp_counter','.1.6.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (94,'packets','Linux TC Packets','snmp_counter','.1.7.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (95,'verify_tc_number','Linux TC Verfy Interface Number','verify_tc_class_number',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (100,'tcp_status,tcp_content','TCP Port Status','buffer',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (101,'app_status','Host MIB Status','buffer',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (102,'ntp_status','NTP Status','ntp_client',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (103,'used_memory','Host MIB Process Memory Usage','hostmib_perf','2'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (105,'udp_status,conn_delay','UDP Port Status & Delay','udp_status',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (106,'udp_status','UDP Port Status','buffer',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (107,'temperature','Compaq Temperature','snmp_counter','.1.3.6.1.4.1.232.6.2.6.8.1.4..'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (108,'temp_status','Compaq Temperature Status','snmp_status','.1.3.6.1.4.1.232.6.2.6.8.1.6..,2=up'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (109,'fan_status','Compaq Fan Condition','snmp_status','.1.3.6.1.4.1.232.6.2.6.7.1.9..,2=up'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (110,'compaq_disk','Compaq Drive Condition','snmp_status','.1.3.6.1.4.1.232.3.2.5.1.1.6..,2=up'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (111,'tbr','IIS Total Bytes Received','snmp_counter','.1.3.6.1.4.1.311.1.7.3.1.4.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (112,'tcgir','IIS Total CGI Requests','snmp_counter','.1.3.6.1.4.1.311.1.7.3.1.35.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (113,'tfs','IIS Total Files Sent','snmp_counter','.1.3.6.1.4.1.311.1.7.3.1.5.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (114,'tg','IIS Total GETs','snmp_counter','.1.3.6.1.4.1.311.1.7.3.1.18.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (115,'tp','IIS Total Posts','snmp_counter','.1.3.6.1.4.1.311.1.7.3.1.19.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (116,'pm_serial_free','Livingston Portmaster Free','livingston_serial_port_status','1'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (117,'pm_serial_established','Livingston Portmaster Established','livingston_serial_port_status','3'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (118,'pm_serial_disconnecting','Livingston Portmaster Disconnecting','livingston_serial_port_status','4'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (119,'pm_serial_command','Livingston Portmaster Command','livingston_serial_port_status','5'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (120,'pm_serial_connecting','Livingston Portmaster Connecting','livingston_serial_port_status','2'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (121,'pm_serial_noservice','Livingston Portmaster No Service','livingston_serial_port_status','6'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (122,'tac,tkb,cplo,up,bpr,bw,iw','Apache Status','apache',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (123,'capacity','a APC Battery Capacity','snmp_counter','.1.3.6.1.4.1.318.1.1.1.2.2.1.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (124,'load','a APC Output Load','snmp_counter','.1.3.6.1.4.1.318.1.1.1.4.2.3.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (125,'in_voltage','a APC Input Voltage','snmp_counter','.1.3.6.1.4.1.318.1.1.1.3.2.1.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (126,'out_voltage','a APC Output Voltage','snmp_counter','.1.3.6.1.4.1.318.1.1.1.4.2.1.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (127,'time_remaining','a APC Time Remaining','snmp_counter','.1.3.6.1.4.1.318.1.1.1.2.2.3.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (128,'status','a APC Battery Status','snmp_status','.1.3.6.1.4.1.318.1.1.1.2.1.1.0,2=battery normal|1=battery unknown|3=battery low'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (129,'temperature','a APC Temperature','snmp_counter','.1.3.6.1.4.1.318.1.1.1.2.2.2.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (130,'output_status','a APC Output Status','snmp_status','.1.3.6.1.4.1.318.1.1.1.4.1.1.0,2=on line|3=on battery'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (131,'records_counter,records_absolute','ODBC Query','odbc_query',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (132,'sql_status','SQL Query Status','sql_status',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (133,'admin_state','Alteon RServer Admin','snmp_counter','.1.3.6.1.4.1.1872.2.1.5.2.1.10.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (134,'oper_state','Alteon RServer Oper','snmp_status','.1.3.6.1.4.1.1872.2.1.9.2.2.1.7.,2=up'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (135,'current_sessions','Alteon RServer Current Sessions','snmp_counter','.1.3.6.1.4.1.1872.2.1.8.2.5.1.2.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (136,'failures','Alteon RServer Failures','snmp_counter','.1.3.6.1.4.1.1872.2.1.8.2.5.1.4.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (137,'octets','Alteon RServer Octets','snmp_counter','.1.3.6.1.4.1.1872.2.1.8.2.5.1.7.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (138,'total_sessions','Alteon RServer Total Sessions','snmp_counter','.1.3.6.1.4.1.1872.2.1.8.2.5.1.3.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (139,'admin_state','Alteon VServer Admin State','snmp_counter','.1.3.6.1.4.1.1872.2.1.5.5.1.4.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (140,'current_sessions','Alteon VServer Current Sessions','snmp_counter','.1.3.6.1.4.1.1872.2.1.8.2.7.1.2.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (141,'total_sessions','Alteon VServer Total Sessions','snmp_counter','.1.3.6.1.4.1.1872.2.1.8.2.7.1.3.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (142,'octets','Alteon VServer Octets','snmp_counter','.1.3.6.1.4.1.1872.2.1.8.2.7.1.6.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (143,'admin_state','Alteon RService Admin State','snmp_counter','.1.3.6.1.4.1.1872.2.1.5.2.1.10.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (144,'oper_state','Alteon RService Oper State','snmp_status','.1.3.6.1.4.1.1872.2.1.9.2.4.1.6.,2=up'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (145,'response_time','Alteon RService Response Time','snmp_counter','.1.3.6.1.4.1.1872.2.1.9.2.4.1.7.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (146,'cpua_1sec','Alteon CPU A 1Sec','snmp_counter','.1.3.6.1.4.1.1872.2.1.8.16.1.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (147,'cpua_4secs','Alteon CPU A 4Secs','snmp_counter','.1.3.6.1.4.1.1872.2.1.8.16.3.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (148,'cpua_64secs','Alteon CPU A 64Secs','snmp_counter','.1.3.6.1.4.1.1872.2.1.8.16.5.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (149,'cpub_1sec','Alteon CPU B 1Sec','snmp_counter','.1.3.6.1.4.1.1872.2.1.8.1.16.2.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (150,'cpub_4secs','Alteon CPU B 4 Secs','snmp_counter','.1.3.6.1.4.1.1872.2.1.8.16.4.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (151,'cpub_64secs','Alteon CPU B 64Secs','snmp_counter','.1.3.6.1.4.1.1872.2.1.8.16.6.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (152,'mem_total','Alteon Memory Total','snmp_counter','.1.3.6.1.4.1.1872.2.1.8.12.6.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (153,'mem_used','Alteon Memory Used','snmp_counter','.1.3.6.1.4.1.1872.2.1.8.12.4.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (154,'sensor_value','Brocade Sensor Value','snmp_counter','1.3.6.1.4.1.1588.2.1.1.1.1.22.1.4.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (155,'oper_status','Brocade Sensor Oper','snmp_status','1.3.6.1.4.1.1588.2.1.1.1.1.22.1.3.,4=ok|3=alert|5=alert'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (156,'tx_words','Brocade FCPort TxWords','snmp_counter','1.3.6.1.4.1.1588.2.1.1.1.6.2.1.11.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (157,'rx_words','Brocade FCPort RxWords','snmp_counter','1.3.6.1.4.1.1588.2.1.1.1.6.2.1.12.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (158,'tx_frames','Brocade FCPort TxFrames','snmp_counter','1.3.6.1.4.1.1588.2.1.1.1.6.2.1.13.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (159,'rx_frames','Brocade FCPort RxFrames','snmp_counter','1.3.6.1.4.1.1588.2.1.1.1.6.2.1.14.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (160,'admin_state','Brocade Fc Port Admin State','snmp_counter','1.3.6.1.4.1.1588.2.1.1.1.6.2.1.5.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (161,'oper_status','Brocade fC Ports Oper Status','snmp_status','1.3.6.1.4.1.1588.2.1.1.1.6.2.1.4.,1=up|3=testing'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (162,'phy_state','Brocade FC Port Phy State','brocade_fcport_phystate',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (163,'cisco_async','Cisco Async Utilisation','cisco_serial_port_status','1'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (164,'cisco_dsx','Cisco DSX Utilisation','cisco_serial_port_status','2'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (165,'cisco_free','Cisco Port Free','cisco_serial_port_status','3'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (166,'inf_d_read_time','Informant Disk Read Time','snmp_counter','.1.3.6.1.4.1.9600.1.1.1.1.2.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (167,'inf_d_write_time','Informant Disk Write Time','snmp_counter','.1.3.6.1.4.1.9600.1.1.1.1.4.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (168,'inf_d_read_rate','Informant Disk Read Rate','snmp_counter','.1.3.6.1.4.1.9600.1.1.1.1.15.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (169,'inf_d_write_rate','Informant Disk Write Rate','snmp_counter','.1.3.6.1.4.1.9600.1.1.1.1.18.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (170,'status','UPS Battery Status','snmp_status','.1.3.6.1.2.1.33.1.2.1.0,2=battery normal|1=battery unknown|3=battery low|3=battery depleted'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (171,'temperature','UPS Battery Temperature','snmp_counter','.1.3.6.1.2.1.33.1.2.7.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (172,'minutes_remaining','UPS Battery Minutes Remaining','snmp_counter','.1.3.6.1.2.1.33.1.2.3.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (173,'charge_remaining','UPS Battery Charge Remaining','snmp_counter','.1.3.6.1.2.1.33.1.2.4.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (174,'voltage','UPS Lines Voltage','ups_line',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (175,'current','UPS Lines Current','ups_line',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (176,'load','UPS Lines Load','ups_line',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (177,'ipt_packets','IPTables Chain Packets','snmp_counter','.1.3.6.1.4.1.2021.5002.1.4.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (178,'ipt_bytes','IPTables Chainl Bytes','snmp_counter','.1.3.6.1.4.1.2021.5002.1.5.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (179,'accepted_routes','BGP Accepted Routes','snmp_counter','.1.3.6.1.4.1.9.9.187.1.2.4.1.1..1.1'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (180,'advertised_routes','BGP Advertised Routes','snmp_counter','.1.3.6.1.4.1.9.9.187.1.2.4.1.6..1.1'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (181,'pix_connections','Pix Connections Poller','snmp_counter','.1.3.6.1.4.1.9.9.147.1.2.2.2.1.5.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (182,'cisco_nat_other_ip_inbound','Cisco NAT Other IP Inbound','snmp_counter','.1.3.6.1.4.1.9.10.77.1.3.1.1.2.1'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (183,'cisco_nat_icmp_inbound','Cisco NAT ICMP Inbound','snmp_counter','.1.3.6.1.4.1.9.10.77.1.3.1.1.2.2'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (184,'cisco_nat_udp_inbound','Cisco NAT UDP Inbound','snmp_counter','.1.3.6.1.4.1.9.10.77.1.3.1.1.2.3'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (185,'cisco_nat_tcp_inbound','Cisco NAT TCP Inbound','snmp_counter','.1.3.6.1.4.1.9.10.77.1.3.1.1.2.4'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (186,'cisco_nat_other_ip_outbound','Cisco NAT Other IP Outbound','snmp_counter','.1.3.6.1.4.1.9.10.77.1.3.1.1.3.1'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (187,'cisco_nat_icmp_outbound','Cisco NAT ICMP Outbound','snmp_counter','.1.3.6.1.4.1.9.10.77.1.3.1.1.3.2'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (188,'cisco_nat_udp_outbound','Cisco NAT UDP Outbound','snmp_counter','.1.3.6.1.4.1.9.10.77.1.3.1.1.3.3'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (189,'cisco_nat_tcp_outbound','Cisco NAT TCP Outbound','snmp_counter','.1.3.6.1.4.1.9.10.77.1.3.1.1.3.4'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (190,'cisco_nat_active_binds','Cisco NAT Active Binds','snmp_counter','.1.3.6.1.4.1.9.10.77.1.2.1.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (191,'value','Sensor Value','snmp_counter','.1.3.6.1.2.1.25.8.1.5.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (192,'storage_verify','Verify Storage Index','verify_storage_index',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (193,'cpu400','OS 400 System Load','snmp_counter','.1.3.6.1.4.1.2.6.4.5.1.0'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (194,'dell_om_chassis','Dell OpenManage Chassis','snmp_status','1.3.6.1.4.1.674.10892.1.200.10.1.2.1,1=other|2=unknown|3=ok|4=noncritical|5=critical|6=nonrecoverabl'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (195,'dell_om_temp','Dell OpenManage Ambient Temp','snmp_counter','1.3.6.1.4.1.674.10892.1.700.20.1.6.1.1'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (196,'dell_om_fan_1','Dell OpenManage Fan RPM #1','snmp_counter','1.3.6.1.4.1.674.10892.1.700.12.1.6.1.1'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (197,'dell_om_fan_2','Dell OpenManage Fan RPM #2','snmp_counter','1.3.6.1.4.1.674.10892.1.700.12.1.6.1.2'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (198,'dell_om_fan_3','Dell OpenManage Fan RPM #3','snmp_counter','1.3.6.1.4.1.674.10892.1.700.12.1.6.1.3'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (199,'dell_om_fan_4','Dell OpenManage Fan RPM #4','snmp_counter','1.3.6.1.4.1.674.10892.1.700.12.1.6.1.4'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (200,'dell_om_fan_5','Dell OpenManage Fan RPM #5','snmp_counter','1.3.6.1.4.1.674.10892.1.700.12.1.6.1.5'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (201,'dell_om_fan_6','Dell OpenManage Fan RPM #6','snmp_counter','1.3.6.1.4.1.674.10892.1.700.12.1.6.1.6'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (202,'dell_om_fan_7','Dell OpenManage Fan RPM #7','snmp_counter','1.3.6.1.4.1.674.10892.1.700.12.1.6.1.7'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (203,'power','UPS Lines Power','ups_line',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (204,'status','PDU Load Status','snmp_status','.1.3.6.1.4.1.318.1.1.12.2.3.1.1.3.,1=load normal|2=load low|3=load near overload|4=load ove'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (205,'load','PDU Banks Load','pdu_banks',''); INSERT INTO pollers (id, name, description, command, parameters) VALUES (206,'ibm_component_health','IBM Component Health Status','snmp_status','1.3.6.1.4.1.2.6.159.1.1.30.3.1.2.,0=up|1=warning|2=down'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (207,'status','IBM Blade Server Health Status','snmp_status_ibm','.1.3.6.1.4.1.2.3.51.2.22.1.5.1.1.5.,1=up|2=warning|3=down'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (208,'temperature','IBM Blade Server CPU1 Temp','snmp_ibm_temperature','.1.3.6.1.4.1.2.3.51.2.22.1.5.3.1.13.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (209,'status','IBM Blade Power Status','snmp_status_ibm','.1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.3.index>,1=up|2=warning|3=down'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (210,'fuelGaugePowerInUse','IBM Blade Power Gauge','snmp_ibm_power','.1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.10.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (211,'temperature2','IBM Blade Server CPU2 Temp','snmp_ibm_temperature','.1.3.6.1.4.1.2.3.51.2.22.1.5.3.1.14.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (212,'status','FC Oper Status','snmp_status','.1.3.6.1.2.1.75.1.2.2.1.2.,1=up|2=offline|4=linkFailure'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (213,'rx_frames','FCPort RxFrames','snmp_counter','.1.3.6.1.2.1.75.1.4.3.1.1.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (214,'tx_frames','FCPort TxFrames','snmp_counter','.1.3.6.1.2.1.75.1.4.3.1.2.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (215,'associated','Client Associated','snmp_counter','.1.3.6.1.4.1.9.9.273.1.1.2.1.1.1'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (216,'power_status','Compaq Power Condition','snmp_status','1.3.6.1.4.1.232.6.2.9.3.1.4..,2=up'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (217,'status','IBM Storage Controller status','ibm_ds_storage','controler'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (218,'arraystatus','AS 400 System','snmp_array_null','.1.3.6.1.2.1.25.2.3.1.6'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (219,'cur_disk_q','Inf-64 Disk CurrentDiskQueue','snmp_counter','.1.3.6.1.4.1.9600.1.2.44.1.16.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (220,'avg_disk_q','Inf-64 Disk AvgDiskQueu','snmp_counter','.1.3.6.1.4.1.9600.1.2.44.1.10.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (221,'avg_disk_rdq','Inf-64 Disk avg Read DiskQueue','snmp_counter','.1.3.6.1.4.1.9600.1.2.44.1.11.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (222,'avg_disk_wrq','Inf-64 Disk avg Write DiskQueue','snmp_counter','.1.3.6.1.4.1.9600.1.2.44.1.12.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (223,'inf_d_read_time','Inf-64 Disk Read Time','snmp_counter','.1.3.6.1.4.1.9600.1.2.44.1.2.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (224,'inf_d_write_time','Inf-64 Disk Write Time','snmp_counter','.1.3.6.1.4.1.9600.1.2.44.1.4.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (225,'rd_ops','Inf-64 Disk Read rate','snmp_counter','.1.3.6.1.4.1.9600.1.2.44.1.19.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (226,'wr_ops','Inf-64 Disk Write rate','snmp_counter','.1.3.6.1.4.1.9600.1.2.44.1.22.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (227,'inf_d_read_rate','Inf-64 Disk Read Bytes','snmp_counter','.1.3.6.1.4.1.9600.1.2.44.1.18.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (228,'inf_d_write_rate','Inf-64 Disk Write Bytes','snmp_counter','.1.3.6.1.4.1.9600.1.2.44.1.21.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (229,'input','SNMP Input Rate HC','snmp_counter','.1.3.6.1.2.1.2.2.1.10.,.1.3.6.1.2.1.31.1.1.1.6.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (230,'output','SNMP Output Rate HC','snmp_counter','.1.3.6.1.2.1.2.2.1.16.,.1.3.6.1.2.1.31.1.1.1.10.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (231,'inpackets','SNMP Input Packets HC','snmp_counter','.1.3.6.1.2.1.2.2.1.11.,.1.3.6.1.2.1.31.1.1.1.7.'); INSERT INTO pollers (id, name, description, command, parameters) VALUES (232,'outpackets','SNMP Output Packets HC','snmp_counter','.1.3.6.1.2.1.2.2.1.17.,.1.3.6.1.2.1.31.1.1.1.11.'); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE pollers_backend ( id int4 NOT NULL AUTO_INCREMENT, description char(60) NOT NULL DEFAULT '', command char(60) NOT NULL DEFAULT '', parameters char(60) NOT NULL DEFAULT '', type int2 NOT NULL DEFAULT '0', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO pollers_backend (id, description, command, parameters, type) VALUES (1,'No Backend','no_backend','',0); INSERT INTO pollers_backend (id, description, command, parameters, type) VALUES (2,'Unknown Event','event','1',0); INSERT INTO pollers_backend (id, description, command, parameters, type) VALUES (9,'Temporal Buffer','buffer','',0); INSERT INTO pollers_backend (id, description, command, parameters, type) VALUES (10,'RRDTool All DSs','rrd','*',0); INSERT INTO pollers_backend (id, description, command, parameters, type) VALUES (12,'Alarm Verify Operational','alarm','3,,180',1); INSERT INTO pollers_backend (id, description, command, parameters, type) VALUES (14,'Change Interface Number','verify_interface_number','',0); INSERT INTO pollers_backend (id, description, command, parameters, type) VALUES (19,'Alarm TCP Port','alarm','22',1); INSERT INTO pollers_backend (id, description, command, parameters, type) VALUES (20,'Alarm Environmental','alarm','26',1); INSERT INTO pollers_backend (id, description, command, parameters, type) VALUES (24,'Alarm BGP Peer','alarm','6,,180',1); INSERT INTO pollers_backend (id, description, command, parameters, type) VALUES (25,'Application Alarm','alarm','38',1); INSERT INTO pollers_backend (id, description, command, parameters, type) VALUES (27,'Alarm TCP Content','alarm','39',1); INSERT INTO pollers_backend (id, description, command, parameters, type) VALUES (28,'Alarm Reachability','alarm','40',1); INSERT INTO pollers_backend (id, description, command, parameters, type) VALUES (29,'Admin Status Change View','db','show_rootmap,down=2|up=1,0',1); INSERT INTO pollers_backend (id, description, command, parameters, type) VALUES (30,'Multiple Temporal Buffer','multi_buffer','',0); INSERT INTO pollers_backend (id, description, command, parameters, type) VALUES (31,'Alarm NTP','alarm','41,nothing',1); INSERT INTO pollers_backend (id, description, command, parameters, type) VALUES (32,'RRD Individual Value','rrd','',0); INSERT INTO pollers_backend (id, description, command, parameters, type) VALUES (33,'Alarm APC','alarm','60',1); INSERT INTO pollers_backend (id, description, command, parameters, type) VALUES (34,'Alarm SQL Records','alarm','50',1); INSERT INTO pollers_backend (id, description, command, parameters, type) VALUES (35,'Alteon Admin Status View','db','show_rootmap,down=0|up=2,2',1); INSERT INTO pollers_backend (id, description, command, parameters, type) VALUES (36,'Alarm Alteon RServer','alarm','68',1); INSERT INTO pollers_backend (id, description, command, parameters, type) VALUES (37,'Alarm Alteon Service','alarm','69',1); INSERT INTO pollers_backend (id, description, command, parameters, type) VALUES (38,'Alarm Alteon VServer','alarm','70',1); INSERT INTO pollers_backend (id, description, command, parameters, type) VALUES (39,'Brocace FC Admin View','db','show_rootmap,down=2|up=1,0',0); INSERT INTO pollers_backend (id, description, command, parameters, type) VALUES (40,'Alarm Brocade FC Port','alarm','71',1); INSERT INTO pollers_backend (id, description, command, parameters, type) VALUES (41,'Alarm IBM','alarm','75',1); INSERT INTO pollers_backend (id, description, command, parameters, type) VALUES (42,'IBM San Trap','event','77',0); INSERT INTO pollers_backend (id, description, command, parameters, type) VALUES (43,'Alarm OS/400','alarm','78',1); INSERT INTO pollers_backend (id, description, command, parameters, type) VALUES (44,'Alarm IBM Storage Controller','alarm','80',1); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE pollers_groups ( id int4 NOT NULL AUTO_INCREMENT, description char(60) NOT NULL DEFAULT '', interface_type int4 NOT NULL DEFAULT '1', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO pollers_groups (id, description, interface_type) VALUES (1,'No Polling',1); INSERT INTO pollers_groups (id, description, interface_type) VALUES (2,'Cisco Interface',4); INSERT INTO pollers_groups (id, description, interface_type) VALUES (3,'Cisco Router',3); INSERT INTO pollers_groups (id, description, interface_type) VALUES (5,'TCP/IP Port',2); INSERT INTO pollers_groups (id, description, interface_type) VALUES (8,'BGP Neighbor',6); INSERT INTO pollers_groups (id, description, interface_type) VALUES (9,'Storage Device',8); INSERT INTO pollers_groups (id, description, interface_type) VALUES (10,'CSS VIP',9); INSERT INTO pollers_groups (id, description, interface_type) VALUES (11,'Linux/Unix Host',11); INSERT INTO pollers_groups (id, description, interface_type) VALUES (12,'Solaris Host',10); INSERT INTO pollers_groups (id, description, interface_type) VALUES (13,'Windows Host',12); INSERT INTO pollers_groups (id, description, interface_type) VALUES (14,'Cisco Accounting',13); INSERT INTO pollers_groups (id, description, interface_type) VALUES (15,'Smokeping Host',14); INSERT INTO pollers_groups (id, description, interface_type) VALUES (16,'HostMIB Application',15); INSERT INTO pollers_groups (id, description, interface_type) VALUES (17,'Cisco Power Supply',16); INSERT INTO pollers_groups (id, description, interface_type) VALUES (18,'Cisco Tempererature',17); INSERT INTO pollers_groups (id, description, interface_type) VALUES (19,'Cisco Voltage',18); INSERT INTO pollers_groups (id, description, interface_type) VALUES (20,'Cisco SA Agent',19); INSERT INTO pollers_groups (id, description, interface_type) VALUES (21,'Reachability',20); INSERT INTO pollers_groups (id, description, interface_type) VALUES (22,'TC Class',21); INSERT INTO pollers_groups (id, description, interface_type) VALUES (23,'NTP',22); INSERT INTO pollers_groups (id, description, interface_type) VALUES (24,'UDP/IP Port',23); INSERT INTO pollers_groups (id, description, interface_type) VALUES (25,'Compaq Physical Drive',24); INSERT INTO pollers_groups (id, description, interface_type) VALUES (26,'Compaq Fan',25); INSERT INTO pollers_groups (id, description, interface_type) VALUES (27,'Compaq Temperature',26); INSERT INTO pollers_groups (id, description, interface_type) VALUES (28,'IIS Info',27); INSERT INTO pollers_groups (id, description, interface_type) VALUES (29,'Livingston Portmaster',28); INSERT INTO pollers_groups (id, description, interface_type) VALUES (30,'Apache',29); INSERT INTO pollers_groups (id, description, interface_type) VALUES (31,'APC',31); INSERT INTO pollers_groups (id, description, interface_type) VALUES (32,'ODBC',30); INSERT INTO pollers_groups (id, description, interface_type) VALUES (33,'Alteon Real Server',32); INSERT INTO pollers_groups (id, description, interface_type) VALUES (34,'Alteon Virtual Server',33); INSERT INTO pollers_groups (id, description, interface_type) VALUES (35,'Alteon Real Services',34); INSERT INTO pollers_groups (id, description, interface_type) VALUES (36,'Alteon System Info',35); INSERT INTO pollers_groups (id, description, interface_type) VALUES (37,'Brocade Sensors',36); INSERT INTO pollers_groups (id, description, interface_type) VALUES (38,'Brocade FC Ports',37); INSERT INTO pollers_groups (id, description, interface_type) VALUES (39,'Cisco Dialup',38); INSERT INTO pollers_groups (id, description, interface_type) VALUES (40,'Windows Informant Disks',39); INSERT INTO pollers_groups (id, description, interface_type) VALUES (41,'UPS',40); INSERT INTO pollers_groups (id, description, interface_type) VALUES (42,'UPS Lines',41); INSERT INTO pollers_groups (id, description, interface_type) VALUES (43,'IPTable Chain',42); INSERT INTO pollers_groups (id, description, interface_type) VALUES (44,'PIX Connection Stat',43); INSERT INTO pollers_groups (id, description, interface_type) VALUES (45,'Cisco NAT',44); INSERT INTO pollers_groups (id, description, interface_type) VALUES (46,'Sensors',45); INSERT INTO pollers_groups (id, description, interface_type) VALUES (47,'OS/400 Host',46); INSERT INTO pollers_groups (id, description, interface_type) VALUES (48,'Dell Chassis',47); INSERT INTO pollers_groups (id, description, interface_type) VALUES (49,'PDU',48); INSERT INTO pollers_groups (id, description, interface_type) VALUES (50,'PDU Banks',49); INSERT INTO pollers_groups (id, description, interface_type) VALUES (57,'IBM Component Health',50); INSERT INTO pollers_groups (id, description, interface_type) VALUES (51,'IBM Blade Servers',51); INSERT INTO pollers_groups (id, description, interface_type) VALUES (52,'Fibre Channel Interface',52); INSERT INTO pollers_groups (id, description, interface_type) VALUES (53,'Cisco 802.11X Device',53); INSERT INTO pollers_groups (id, description, interface_type) VALUES (54,'IBM Blade Power Module',54); INSERT INTO pollers_groups (id, description, interface_type) VALUES (55,'Compaq Power Supply',55); INSERT INTO pollers_groups (id, description, interface_type) VALUES (56,'IBM Storage Controller',56); INSERT INTO pollers_groups (id, description, interface_type) VALUES (58,'Informant Disks 64',57); INSERT INTO pollers_groups (id, description, interface_type) VALUES (59,'Cisco Interface HC',4); INSERT INTO pollers_groups (id, description, interface_type) VALUES (60,'SNMP Interface',4); INSERT INTO pollers_groups (id, description, interface_type) VALUES (61,'SNMP Interface HC',4); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE pollers_poller_groups ( id int4 NOT NULL AUTO_INCREMENT, poller_group int4 NOT NULL DEFAULT '1', pos int2 NOT NULL DEFAULT '1', poller int4 NOT NULL DEFAULT '1', backend int4 NOT NULL DEFAULT '1', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (1,1,1,1,1); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (2,2,20,2,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (3,2,10,3,14); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (4,2,15,5,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (5,2,50,6,1); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (6,2,55,7,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (7,2,60,8,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (8,2,65,9,1); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (9,2,30,10,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (10,2,40,11,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (11,2,45,12,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (12,2,80,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (14,2,16,13,12); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (16,3,10,16,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (20,3,2,20,19); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (21,2,25,21,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (22,2,35,22,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (23,5,10,23,30); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (24,3,20,24,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (25,3,50,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (26,3,30,25,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (27,2,46,26,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (30,8,10,31,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (31,8,40,32,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (32,8,50,33,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (35,9,10,37,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (36,9,20,36,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (37,9,30,35,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (38,9,60,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (39,8,5,38,24); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (41,10,10,41,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (42,10,20,40,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (43,10,60,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (44,11,10,54,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (45,11,20,53,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (46,11,30,43,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (47,11,40,45,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (48,11,50,52,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (49,11,60,51,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (50,11,70,50,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (51,11,80,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (52,12,10,45,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (53,12,20,43,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (54,12,30,42,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (55,12,40,44,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (56,12,50,52,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (57,12,60,51,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (58,12,70,50,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (59,12,80,46,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (60,12,90,47,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (61,12,100,48,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (62,12,110,49,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (63,12,120,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (64,2,47,55,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (65,2,48,56,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (66,5,20,57,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (67,5,60,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (68,3,40,58,30); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (69,13,10,59,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (70,13,20,60,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (71,13,30,61,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (72,13,40,62,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (73,13,50,64,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (74,13,60,63,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (75,13,100,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (76,11,15,60,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (77,11,25,61,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (78,11,35,64,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (79,11,45,62,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (80,11,55,63,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (81,3,15,64,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (82,3,25,62,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (83,3,35,63,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (84,14,10,65,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (85,14,20,67,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (86,14,30,68,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (87,14,40,66,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (88,14,50,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (89,15,30,70,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (90,15,20,69,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (91,15,90,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (92,16,10,71,30); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (93,17,20,72,20); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (94,18,10,73,20); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (95,19,20,74,20); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (96,18,20,75,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (97,18,50,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (98,20,10,76,11); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (99,20,20,77,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (100,20,30,81,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (101,20,40,80,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (102,20,50,79,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (103,20,60,78,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (104,20,90,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (105,15,10,82,14); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (106,5,30,85,27); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (107,21,1,86,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (108,21,122,87,1); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (109,21,123,88,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (110,21,124,89,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (111,21,126,90,1); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (112,21,125,91,28); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (113,21,127,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (114,22,92,93,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (115,22,93,94,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (116,22,91,95,14); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (117,22,94,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (122,2,17,14,29); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (123,5,15,100,19); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (124,16,20,101,25); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (125,16,90,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (126,23,50,102,31); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (127,16,30,103,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (129,24,10,105,30); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (130,24,20,106,19); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (131,24,30,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (132,27,10,108,20); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (133,27,20,107,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (134,27,90,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (135,26,10,109,20); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (136,25,10,110,20); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (137,28,10,111,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (138,28,20,112,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (139,28,30,113,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (140,28,40,114,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (141,28,50,115,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (142,28,90,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (143,29,90,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (144,29,10,116,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (145,29,20,120,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (146,29,30,117,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (147,29,50,119,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (148,29,60,121,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (149,29,40,118,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (150,30,20,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (151,30,10,122,30); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (152,31,10,128,20); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (153,31,20,123,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (154,31,31,124,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (155,31,40,125,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (156,31,50,126,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (157,31,60,127,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (158,31,90,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (159,31,70,129,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (160,31,15,130,33); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (161,32,10,131,30); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (162,32,20,132,34); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (163,32,90,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (164,33,10,133,35); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (165,33,15,134,12); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (166,33,20,135,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (167,33,25,136,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (168,33,30,137,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (169,33,35,138,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (170,33,90,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (171,34,10,139,29); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (172,34,20,140,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (173,34,30,142,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (174,34,40,141,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (175,34,90,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (176,35,10,143,29); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (177,35,30,144,37); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (178,35,20,145,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (179,35,90,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (180,36,10,146,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (181,36,11,147,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (182,36,12,148,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (183,36,15,149,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (184,36,16,150,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (185,36,17,151,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (186,36,20,62,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (187,36,21,63,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (188,36,22,64,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (189,36,30,153,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (190,36,35,152,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (191,36,90,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (192,37,10,155,12); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (193,37,20,154,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (194,37,90,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (195,38,40,156,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (196,38,45,157,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (197,38,50,158,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (198,38,55,159,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (199,38,90,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (200,38,10,160,39); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (201,38,20,161,12); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (202,38,30,162,40); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (203,39,10,165,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (204,39,20,164,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (205,39,30,163,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (206,39,90,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (207,40,10,168,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (208,40,20,169,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (209,40,30,166,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (210,40,40,167,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (211,41,10,170,20); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (212,41,20,173,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (213,41,30,172,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (214,41,40,171,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (215,42,10,174,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (216,42,20,175,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (217,42,30,176,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (218,43,10,178,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (219,43,20,177,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (220,8,20,179,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (221,8,30,180,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (222,44,10,181,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (223,45,50,190,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (224,45,10,186,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (225,45,20,187,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (226,45,30,188,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (227,45,40,189,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (228,45,15,182,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (229,45,25,183,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (230,45,35,184,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (231,45,45,185,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (232,46,20,191,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (233,9,5,192,14); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (234,47,1,193,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (235,48,20,194,29); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (236,48,10,194,12); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (237,48,30,195,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (238,48,40,196,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (239,48,41,197,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (240,48,42,198,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (241,48,43,199,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (242,48,44,200,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (243,48,45,201,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (244,48,46,202,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (245,48,50,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (246,42,50,203,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (247,49,10,204,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (248,50,10,205,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (249,57,1,206,41); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (250,51,1,207,20); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (251,51,5,208,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (252,52,1,212,20); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (253,52,5,213,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (254,52,10,214,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (255,52,20,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (256,51,10,211,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (257,51,15,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (258,53,1,215,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (259,54,1,210,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (260,54,2,209,41); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (261,55,10,216,20); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (262,56,1,217,44); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (263,47,5,218,43); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (264,58,10,219,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (265,58,20,220,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (266,58,30,221,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (267,58,40,222,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (268,58,50,223,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (269,58,60,224,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (270,58,70,225,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (271,58,80,226,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (272,58,90,227,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (273,58,100,228,32); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (274,59,10,3,14); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (275,59,15,5,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (276,59,16,13,12); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (277,59,17,14,29); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (278,59,20,229,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (279,59,25,231,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (280,59,30,230,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (281,59,35,232,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (282,59,40,11,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (283,59,45,12,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (284,59,46,26,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (285,59,47,55,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (286,59,48,56,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (287,59,50,6,1); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (288,59,55,7,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (289,59,60,8,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (290,59,65,9,1); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (291,59,80,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (292,60,10,3,14); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (293,60,16,13,12); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (294,60,17,14,29); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (295,60,20,2,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (296,60,25,21,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (297,60,30,10,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (298,60,35,22,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (299,60,40,11,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (300,60,45,12,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (301,60,46,26,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (302,60,47,55,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (303,60,48,56,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (304,60,80,1,10); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (305,61,10,3,14); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (306,61,16,13,12); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (307,61,17,14,29); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (308,61,20,229,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (309,61,25,231,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (310,61,30,230,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (311,61,35,232,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (312,61,40,11,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (313,61,45,12,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (314,61,46,26,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (315,61,47,55,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (316,61,48,56,9); INSERT INTO pollers_poller_groups (id, poller_group, pos, poller, backend) VALUES (317,61,80,1,10); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE profiles ( id int4 NOT NULL AUTO_INCREMENT, userid int4 NOT NULL DEFAULT '1', profile_option int4 DEFAULT '1', value int4 DEFAULT '1', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO profiles (id, userid, profile_option, value) VALUES (1,1,1,1); INSERT INTO profiles (id, userid, profile_option, value) VALUES (2,2,9,12); INSERT INTO profiles (id, userid, profile_option, value) VALUES (3,2,11,300); INSERT INTO profiles (id, userid, profile_option, value) VALUES (4,2,13,30); INSERT INTO profiles (id, userid, profile_option, value) VALUES (5,2,16,36); INSERT INTO profiles (id, userid, profile_option, value) VALUES (6,2,20,46); INSERT INTO profiles (id, userid, profile_option, value) VALUES (7,2,25,50); INSERT INTO profiles (id, userid, profile_option, value) VALUES (8,2,2,8); INSERT INTO profiles (id, userid, profile_option, value) VALUES (9,2,8,6); INSERT INTO profiles (id, userid, profile_option, value) VALUES (10,2,14,32); INSERT INTO profiles (id, userid, profile_option, value) VALUES (11,2,15,34); INSERT INTO profiles (id, userid, profile_option, value) VALUES (12,2,6,20); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE profiles_options ( id int4 NOT NULL AUTO_INCREMENT, tag char(30) NOT NULL DEFAULT '', description char(60) NOT NULL DEFAULT '', editable int2 NOT NULL DEFAULT '0', show_in_profile int2 NOT NULL DEFAULT '1', use_default int2 NOT NULL DEFAULT '0', default_value char(60) NOT NULL DEFAULT '', type char(10) NOT NULL DEFAULT '', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO profiles_options (id, tag, description, editable, show_in_profile, use_default, default_value, type) VALUES (1,'NO_TAG','No Option',1,1,0,'','select'); INSERT INTO profiles_options (id, tag, description, editable, show_in_profile, use_default, default_value, type) VALUES (2,'ADMIN_ACCESS','Administration Access',0,1,0,'1','select'); INSERT INTO profiles_options (id, tag, description, editable, show_in_profile, use_default, default_value, type) VALUES (6,'REPORTS_VIEW_ALL_INTERFACES','View All Interfaces',0,1,0,'1','select'); INSERT INTO profiles_options (id, tag, description, editable, show_in_profile, use_default, default_value, type) VALUES (8,'ADMIN_USERS','User Administration',0,1,0,'1','select'); INSERT INTO profiles_options (id, tag, description, editable, show_in_profile, use_default, default_value, type) VALUES (9,'MAP_SOUND','Map Sound',1,1,1,'1','select'); INSERT INTO profiles_options (id, tag, description, editable, show_in_profile, use_default, default_value, type) VALUES (11,'EMAIL','eMail',1,1,1,'','text'); INSERT INTO profiles_options (id, tag, description, editable, show_in_profile, use_default, default_value, type) VALUES (12,'MAP','Base Map',0,0,0,'1','text'); INSERT INTO profiles_options (id, tag, description, editable, show_in_profile, use_default, default_value, type) VALUES (13,'EVENTS_SOUND','Events Sound',1,1,1,'1','select'); INSERT INTO profiles_options (id, tag, description, editable, show_in_profile, use_default, default_value, type) VALUES (14,'ADMIN_SYSTEM','System Administration',0,1,0,'1','select'); INSERT INTO profiles_options (id, tag, description, editable, show_in_profile, use_default, default_value, type) VALUES (15,'ADMIN_HOSTS','Host Administration',0,1,0,'1','select'); INSERT INTO profiles_options (id, tag, description, editable, show_in_profile, use_default, default_value, type) VALUES (16,'VIEW_REPORTS','Reports Access',0,0,1,'1','select'); INSERT INTO profiles_options (id, tag, description, editable, show_in_profile, use_default, default_value, type) VALUES (19,'POPUPS_DISABLED','Disable Popups',0,1,0,'1','select'); INSERT INTO profiles_options (id, tag, description, editable, show_in_profile, use_default, default_value, type) VALUES (20,'VIEW_STARTPAGE_STATS','View Start Page Stats',1,1,1,'1','select'); INSERT INTO profiles_options (id, tag, description, editable, show_in_profile, use_default, default_value, type) VALUES (21,'EVENTS_DEFAULT_FILTER','Events Default Filter',1,1,0,'0','text'); INSERT INTO profiles_options (id, tag, description, editable, show_in_profile, use_default, default_value, type) VALUES (22,'EVENTS_REFRESH','Events Refresh Interval (secs)',1,1,0,'20','text'); INSERT INTO profiles_options (id, tag, description, editable, show_in_profile, use_default, default_value, type) VALUES (23,'MAP_REFRESH','Map Refresh Interval (secs)',1,1,0,'20','text'); INSERT INTO profiles_options (id, tag, description, editable, show_in_profile, use_default, default_value, type) VALUES (24,'SMSALIAS','SMS Pager Alias',1,1,0,'','text'); INSERT INTO profiles_options (id, tag, description, editable, show_in_profile, use_default, default_value, type) VALUES (25,'VIEW_TYPE_DEFAULT','Default View Type',1,1,1,'dhtml','select'); INSERT INTO profiles_options (id, tag, description, editable, show_in_profile, use_default, default_value, type) VALUES (26,'VIEW_DEFAULT','Default View',1,1,0,'start','select'); INSERT INTO profiles_options (id, tag, description, editable, show_in_profile, use_default, default_value, type) VALUES (27,'CUSTOMER','Customer Filter',0,1,0,'','text'); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE profiles_values ( id int4 NOT NULL AUTO_INCREMENT, profile_option int4 NOT NULL DEFAULT '1', description char(30) NOT NULL DEFAULT '', value char(250) NOT NULL DEFAULT '', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO profiles_values (id, profile_option, description, value) VALUES (1,1,'No Value','1'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (5,9,'Disable','0'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (6,8,'Yes','1'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (7,8,'No','0'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (8,2,'Yes','1'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (12,9,'Enable','1'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (20,6,'Yes','1'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (21,6,'No','0'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (30,13,'Yes','1'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (31,13,'No','0'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (32,14,'Yes','1'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (33,14,'No','0'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (34,15,'Yes','1'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (35,15,'No','0'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (36,16,'Yes','1'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (37,16,'No','0'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (43,19,'Yes','1'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (44,19,'No','0'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (46,20,'Yes','1'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (47,20,'No','0'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (48,25,'Normal','normal'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (49,25,'Text Only','text'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (50,25,'DHTML','dhtml'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (52,25,'Normal Big','normal-big'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (53,25,'DHTML Big','dhtml-big'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (55,26,'Start Page','start'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (56,26,'Hosts & Events','hosts-events'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (57,26,'Interfaces & Events','interfaces-events'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (58,26,'Maps & Events','maps-events'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (59,26,'Alarmed Interfaces & Events','alarmed-events'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (60,26,'Alarmed Interfaces','alarmed'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (61,26,'Interfaces','interfaces'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (62,26,'Hosts','hosts'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (63,26,'Maps','maps'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (64,26,'Hosts All Interfaces','hosts-all-int'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (65,26,'Events','events'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (66,26,'Alarmed Hosts & Events','alarmed-hosts-events'); INSERT INTO profiles_values (id, profile_option, description, value) VALUES (300,11,'',''); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE satellites ( id int4 NOT NULL AUTO_INCREMENT, description char(40) NOT NULL DEFAULT '', parent int4 NOT NULL DEFAULT '1', url char(150) NOT NULL DEFAULT '', sat_group int4 NOT NULL DEFAULT '1', sat_type int2 NOT NULL DEFAULT '0', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO satellites (id, description, parent, url, sat_group, sat_type) VALUES (1,'Local',1,'',1,1); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE severity ( id int2 NOT NULL AUTO_INCREMENT, level int2 NOT NULL DEFAULT '0', severity char(20) NOT NULL DEFAULT '', bgcolor char(15) NOT NULL DEFAULT '', fgcolor char(15) NOT NULL DEFAULT '', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO severity (id, level, severity, bgcolor, fgcolor) VALUES (1,127,'Unknown','000000','FFFFFF'); INSERT INTO severity (id, level, severity, bgcolor, fgcolor) VALUES (2,30,'Warning','00AA00','FFFFFF'); INSERT INTO severity (id, level, severity, bgcolor, fgcolor) VALUES (3,40,'Fault','F51D30','EEEEEE'); INSERT INTO severity (id, level, severity, bgcolor, fgcolor) VALUES (4,50,'Big Fault','DA4725','FFFFFF'); INSERT INTO severity (id, level, severity, bgcolor, fgcolor) VALUES (5,60,'Critical','FF0000','FFFFFF'); INSERT INTO severity (id, level, severity, bgcolor, fgcolor) VALUES (13,10,'Administrative','8D00BA','FFFFFF'); INSERT INTO severity (id, level, severity, bgcolor, fgcolor) VALUES (14,20,'Information','F9FD5F','000000'); INSERT INTO severity (id, level, severity, bgcolor, fgcolor) VALUES (18,35,'Service','0090F0','FFFFFF'); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE slas ( id int4 NOT NULL AUTO_INCREMENT, description char(60) NOT NULL DEFAULT '', state int4 NOT NULL DEFAULT '3', info char(60) NOT NULL DEFAULT '', event_type int4 NOT NULL DEFAULT '12', threshold int2 NOT NULL DEFAULT '100', interface_type int4 NOT NULL DEFAULT '1', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO slas (id, description, state, info, event_type, threshold, interface_type) VALUES (1,'No SLA',3,'No SLA',12,100,1); INSERT INTO slas (id, description, state, info, event_type, threshold, interface_type) VALUES (4,'Customer Satellite Link',3,'Customer Sat Link:',12,75,4); INSERT INTO slas (id, description, state, info, event_type, threshold, interface_type) VALUES (5,'Main Fiber Link',3,'Main Link:',12,100,4); INSERT INTO slas (id, description, state, info, event_type, threshold, interface_type) VALUES (6,'Main Satellite Link',3,'Main Sat Link:',12,100,4); INSERT INTO slas (id, description, state, info, event_type, threshold, interface_type) VALUES (7,'Cisco Router',3,'Router:',12,100,3); INSERT INTO slas (id, description, state, info, event_type, threshold, interface_type) VALUES (8,'Smokeping Host',3,'Smokeping:',12,100,14); INSERT INTO slas (id, description, state, info, event_type, threshold, interface_type) VALUES (9,'Storage',3,'Storage',12,100,8); INSERT INTO slas (id, description, state, info, event_type, threshold, interface_type) VALUES (10,'Linux/Unix CPU',3,'',12,100,11); INSERT INTO slas (id, description, state, info, event_type, threshold, interface_type) VALUES (11,'Windows CPU',3,'',12,100,12); INSERT INTO slas (id, description, state, info, event_type, threshold, interface_type) VALUES (12,'APC UPS',3,'APC UPS',12,100,31); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE slas_cond ( id int4 NOT NULL AUTO_INCREMENT, cond char(250) NOT NULL, description char(60) NOT NULL DEFAULT '', event char(60) NOT NULL DEFAULT '', variable_show char(250) NOT NULL DEFAULT '', variable_show_info char(60) NOT NULL DEFAULT '', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO slas_cond (id, cond, description, event, variable_show, variable_show_info) VALUES (1,'1=2','Unknown','Unknown','',''); INSERT INTO slas_cond (id, cond, description, event, variable_show, variable_show_info) VALUES (2,'( > 60)','RoundTrip Time > 60ms','RTT > 60','','ms'); INSERT INTO slas_cond (id, cond, description, event, variable_show, variable_show_info) VALUES (3,'( (( * 100) / ) > 20)','Packet Loss > 20%','PL > 20%','(( * 100) / )','%'); INSERT INTO slas_cond (id, cond, description, event, variable_show, variable_show_info) VALUES (4,'( < ((*95)/100))','Input Traffic < 95%','IN < 95%','( / 1000)','Kbps'); INSERT INTO slas_cond (id, cond, description, event, variable_show, variable_show_info) VALUES (5,'AND','AND','','',''); INSERT INTO slas_cond (id, cond, description, event, variable_show, variable_show_info) VALUES (6,'OR','OR','','',''); INSERT INTO slas_cond (id, cond, description, event, variable_show, variable_show_info) VALUES (7,'( > 700)','RoundTrip Time > 700ms','RTT > 700','','ms'); INSERT INTO slas_cond (id, cond, description, event, variable_show, variable_show_info) VALUES (8,'( > 900)','RoundTrip Time > 900ms','RTT > 900','','ms'); INSERT INTO slas_cond (id, cond, description, event, variable_show, variable_show_info) VALUES (9,'((( * 100) / ) > 50)','Packet Loss > 50%','PL > 50%','(( * 100) / )','%'); INSERT INTO slas_cond (id, cond, description, event, variable_show, variable_show_info) VALUES (11,'( > ((*90)/100))','Input Traffic > 90%','IN > 90%','( / 1000)','Kbps'); INSERT INTO slas_cond (id, cond, description, event, variable_show, variable_show_info) VALUES (12,'( < ((*1)/100))','Input Traffic < 1%','IN < 1 %','',''); INSERT INTO slas_cond (id, cond, description, event, variable_show, variable_show_info) VALUES (13,' ( > ((*90)/100))','Output Traffic > 90%','OUT > 90%','( / 1000 )','kbps'); INSERT INTO slas_cond (id, cond, description, event, variable_show, variable_show_info) VALUES (14,'( < ((*95)/100))','Output Traffic < 95%','OUT < 95%','( / 1000 )','kbps'); INSERT INTO slas_cond (id, cond, description, event, variable_show, variable_show_info) VALUES (15,'( ( ( / ( + + 1) )*100) > 20)','Input Error Rate > 20%','IN ERR > 20%','( ( / ( + + 1) )*100)','% = eps'); INSERT INTO slas_cond (id, cond, description, event, variable_show, variable_show_info) VALUES (16,'( ( ( / ( + + 1) )*100) > 10)','Input Error Rate > 10%','IN ERR > 10%','( ( / ( + + 1) )*100)','% = eps'); INSERT INTO slas_cond (id, cond, description, event, variable_show, variable_show_info) VALUES (18,'( ( ( / ( + 1) )*100) > 1)','Drops > 1%','Drops > 1%','( ( / ( + 1) )*100)','% = dps'); INSERT INTO slas_cond (id, cond, description, event, variable_show, variable_show_info) VALUES (19,' ( ( ( / ( + 1) )*100) > 2)','Drops > 2%','Drops > 2%','( ( / ( + 1) )*100)','% = dps'); INSERT INTO slas_cond (id, cond, description, event, variable_show, variable_show_info) VALUES (20,'((( * 100) / ) > 10)','Packet Loss > 10%','PL > 10%','(( * 100) / )','%'); INSERT INTO slas_cond (id, cond, description, event, variable_show, variable_show_info) VALUES (21,'( ( ( / ( + + 1) )*100) > 10)','Drops > 10%','Drops > 10%','( ( / ( + + 1) )*100)','%'); INSERT INTO slas_cond (id, cond, description, event, variable_show, variable_show_info) VALUES (22,' ( < ((*99)/100))','Input Traffic < 99%','IN < 99%',' ( / 1000 )','Kbps'); INSERT INTO slas_cond (id, cond, description, event, variable_show, variable_show_info) VALUES (23,' ( < ((*99)/100))',' Output Traffic < 99%',' OUT < 99%',' ( / 1000 )','Kbps'); INSERT INTO slas_cond (id, cond, description, event, variable_show, variable_show_info) VALUES (24,'( > )','High CPU Utilization','Usage > %','','%'); INSERT INTO slas_cond (id, cond, description, event, variable_show, variable_show_info) VALUES (25,'( > 10)','SP Packet Loss > 10%','Packet Loss > 10%','','%'); INSERT INTO slas_cond (id, cond, description, event, variable_show, variable_show_info) VALUES (26,'( > ((*)/100))','Used Storage','Used > %','(( * 100)/)','%'); INSERT INTO slas_cond (id, cond, description, event, variable_show, variable_show_info) VALUES (27,'( > 5 )','Load Average > 5','Load Average > 5','',''); INSERT INTO slas_cond (id, cond, description, event, variable_show, variable_show_info) VALUES (28,'(((( + + ) * 100 ) / ( + + + )) > )','High CPU Utilization','Usage > %','((( + + ) * 100 ) / ( + + + ))','%'); INSERT INTO slas_cond (id, cond, description, event, variable_show, variable_show_info) VALUES (29,'( (( * 100) / ( + )) > 80)','Memory Usage > 80%','Memory Usage > 80%','(( * 100) / ( + ))','%'); INSERT INTO slas_cond (id, cond, description, event, variable_show, variable_show_info) VALUES (30,'( > 90)','CPU Utilization > 90%','CPU > 90%','','%'); INSERT INTO slas_cond (id, cond, description, event, variable_show, variable_show_info) VALUES (31,'( > )','Too Many Processes','Processes > ','','Processes'); INSERT INTO slas_cond (id, cond, description, event, variable_show, variable_show_info) VALUES (32,'( > 55)','APC temp > 55','APC temp > 55','','C'); INSERT INTO slas_cond (id, cond, description, event, variable_show, variable_show_info) VALUES (33,'( < 300000)','APC time < 50 minutes','APC time < 50 minutes','','min'); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE slas_sla_cond ( id int4 NOT NULL AUTO_INCREMENT, pos int2 NOT NULL DEFAULT '1', sla int4 NOT NULL DEFAULT '1', cond int4 NOT NULL DEFAULT '1', show_in_result int2 NOT NULL DEFAULT '0', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (1,1,1,1,0); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (9,30,4,4,0); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (10,40,4,7,1); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (11,50,4,20,1); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (12,70,4,6,0); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (13,74,4,5,0); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (14,10,5,11,1); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (15,20,5,2,1); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (16,40,5,20,1); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (17,50,5,6,0); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (18,60,5,6,0); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (19,10,6,11,1); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (20,30,6,7,1); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (21,60,6,6,0); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (22,40,6,3,1); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (23,50,6,6,0); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (33,20,4,14,0); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (35,75,4,6,0); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (36,15,5,13,1); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (37,70,5,6,0); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (38,20,6,13,1); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (39,70,6,6,0); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (40,10,4,16,1); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (41,73,4,5,0); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (42,45,6,16,1); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (43,55,6,6,0); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (44,30,5,16,1); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (45,45,5,6,0); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (47,60,4,18,1); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (48,72,4,6,0); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (49,10,7,24,1); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (50,10,8,25,1); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (51,30,8,6,0); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (52,20,8,2,1); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (53,1,9,26,1); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (54,10,10,27,1); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (55,20,10,28,1); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (56,30,10,6,0); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (57,20,7,29,1); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (58,30,7,6,0); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (59,10,11,30,1); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (60,20,11,31,1); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (61,30,11,6,0); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (62,5,12,32,1); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (63,10,12,6,0); INSERT INTO slas_sla_cond (id, pos, sla, cond, show_in_result) VALUES (64,1,12,33,1); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE syslog ( date datetime NOT NULL DEFAULT NULL, host varchar(128) DEFAULT NULL, date_logged datetime NOT NULL DEFAULT NULL, message text, id int4 NOT NULL AUTO_INCREMENT, analized int2 NOT NULL DEFAULT '0', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE syslog_types ( id int4 NOT NULL AUTO_INCREMENT, match_text char(255) NOT NULL DEFAULT '', interface char(10) NOT NULL DEFAULT '', username char(20) NOT NULL DEFAULT '', state char(10) NOT NULL DEFAULT '', info char(10) NOT NULL DEFAULT '', type int4 NOT NULL DEFAULT '1', pos int2 NOT NULL DEFAULT '1', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (1,'UNKNOWN','0','','','*',1,1); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (2,'%SYS-5-CONFIG_I:.+|%SYS-5-CONFIG:','7','5','','3',2,1); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (3,'%LINEPROTO-5-UPDOWN:','5','','9','',3,1); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (4,'%LINK-3-UPDOWN:','2','','6','',4,1); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (5,'%CONTROLLER-5-UPDOWN:','3','','7','2',5,1); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (6,'%BGP-5-ADJCHANGE:','2','','3','6',6,1); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (7,'%LINK-5-CHANGED:','2','','7','6',7,1); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (9,'%RCMD-4-RSHPORTATTEMPT:','5','','','7',9,1); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (17,'%CLEAR-5-COUNTERS:','5','7','','10',17,1); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (20,'%PIX-2-106006:','7','5','1','3',29,1); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (21,'%PIX-2-106007:','7','5','1','3',29,1); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (22,'%PIX-2-106001:','8','6','4','2',29,1); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (25,'%PIX-3-106010:','7','5','1','3',29,1); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (26,'%PIX-3-106014:','7','5','1','3',29,1); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (29,'%PIX-3-305006:.+|%PIX-2-106012:.+|%PIX-3-305005:.+|%PIX-3-307001:.+','','','','D',28,1); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (30,'%CDP-4-DUPLEX_MISMATCH:','5','10','','11',34,1); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (31,'%SEC-6-IPACCESSLOGS:','2','4','3','5',35,1); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (32,'%SEC-6-IPACCESSLOGP:.+|%SEC-6-IPACCESSLOGNP:','2','7','3','8',35,1); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (33,'%BGP-3-NOTIFICATION: (\\S+ \\S+) neighbor (\\S+) \\S+ (\\S+ \\S+ \\S+) \\S+ \\S+','2','','1','3',36,1); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (34,'%SYS-5-RESTART:','','','','D',26,1); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (35,'%SYS-5-RELOAD:','','','','D',26,1); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (36,'%SEC-6-IPACCESSLOGDP:','2','5','3','9',35,1); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (37,'EXCESSCOLL:','1','','','',37,1); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (38,'^([^[]+)(?:\\[\\d+\\])?:\\s+(.+)$','1','','','2',44,100); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (39,'CRON\\[\\d+\\]: \\((\\S+)\\) CMD (.*)','cron','1','','2',45,1); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (40,'^(\\S.*)\\[info\\]\\s*(\\S+)\\s*(\\S.*)','1','','2','3',46,10); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (41,'^(\\S.*)\\[error\\]\\s*(\\S+)\\s*(\\S.*)','1','','2','3',48,10); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (42,'^(\\S.*)\\[warning\\]\\s*(\\S+)\\s*(\\S.*)','1','','2','3',47,10); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (43,'^security\\[failure\\] (\\d*) (.*)','','','1','2',49,10); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (44,'%PIX-1-(\\d*): (.*)','1','','','2',67,2); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (45,'%PIX-2-(\\d*): (.*)','1','','','2',66,2); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (46,'%PIX-3-(\\d*): (.*)','1','','','2',65,2); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (47,'%PIX-4-(\\d*): (.*)','1','','','2',64,2); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (48,'%PIX-6-(\\d*): (.*)','1','','','2',62,2); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (49,'%PIX-5-(\\d*): (.*)','1','','','2',63,2); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (50,'%PIX-7-(\\d*): (.*)','1','','','2',61,2); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (51,'%PIX-4-106023:','6','4','1','2',29,1); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (52,'^UPS: (.*)\\. (.*)$','UPS','','','1',26,1); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (53,'WebOS : real server (\\S+) operational','1','','up','',68,1); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (54,'WebOS : cannot contact real server (\\S+)','1','','down','',68,1); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (55,'WebOS : No services are available for Virtual Server\\d+:(\\S+)','1','','down','',70,1); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (56,'WebOS : Services are available for Virtual Server\\d+:(\\S+)','1','','up','',70,1); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (57,'WebOS : real service (\\S+) operational','1','','up','',69,1); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (58,'WebOS : cannot contact real service (\\S+)','1','','closed','',69,1); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (59,'%ISDN-6-CONNECT: Interface (\\S+) is now (\\S+) (.+)$','1','','2','3',72,1); INSERT INTO syslog_types (id, match_text, interface, username, state, info, type, pos) VALUES (60,'%ISDN-6-DISCONNECT: Interface (\\S+) (\\S+) (.+)$','1','','2','3',72,1); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE tools ( id int4 NOT NULL AUTO_INCREMENT, description char(60) NOT NULL DEFAULT '', name char(30) NOT NULL DEFAULT '', file_group char(30) NOT NULL DEFAULT '', itype int4 NOT NULL DEFAULT '1', pos int4 NOT NULL DEFAULT '1', allow_set int2 NOT NULL DEFAULT '0', allow_get int2 NOT NULL DEFAULT '1', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO tools (id, description, name, file_group, itype, pos, allow_set, allow_get) VALUES (1,'Nothing','none','none',1,1,0,1); INSERT INTO tools (id, description, name, file_group, itype, pos, allow_set, allow_get) VALUES (3,'Description','if_alias','',4,2,1,1); INSERT INTO tools (id, description, name, file_group, itype, pos, allow_set, allow_get) VALUES (4,'Change Admin Status','if_admin','',4,3,1,1); INSERT INTO tools (id, description, name, file_group, itype, pos, allow_set, allow_get) VALUES (5,'Connections List','tcp_cnx','',2,1,1,1); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE trap_receivers ( id int4 NOT NULL AUTO_INCREMENT, position int4 NOT NULL DEFAULT '0', match_oid char(100) NOT NULL DEFAULT '', description char(60) NOT NULL DEFAULT '', command char(60) NOT NULL DEFAULT '', parameters char(250) NOT NULL DEFAULT '', backend int4 NOT NULL DEFAULT '1', interface_type int4 NOT NULL DEFAULT '1', stop_if_matches int2 NOT NULL DEFAULT '1', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO trap_receivers (id, position, match_oid, description, command, parameters, backend, interface_type, stop_if_matches) VALUES (1,99,'.*','Default Trap Receiver','unknown','',2,1,1); INSERT INTO trap_receivers (id, position, match_oid, description, command, parameters, backend, interface_type, stop_if_matches) VALUES (2,10,'.1.3.6.1.6.3.1.1.5.4','Link Up','static','up,interfacenumber,1',12,4,1); INSERT INTO trap_receivers (id, position, match_oid, description, command, parameters, backend, interface_type, stop_if_matches) VALUES (3,10,'.1.3.6.1.6.3.1.1.5.3','Link Down','static','down,interfacenumber,1',12,4,1); INSERT INTO trap_receivers (id, position, match_oid, description, command, parameters, backend, interface_type, stop_if_matches) VALUES (4,10,'enterprises.1123.4.300.0.1','IBM DS Event','static','warning,state,2',12,1,1); INSERT INTO trap_receivers (id, position, match_oid, description, command, parameters, backend, interface_type, stop_if_matches) VALUES (10001,10,'enterprises.9.0.1','blah','static','warning,state,2',2,4,1); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE traps ( id int4 NOT NULL AUTO_INCREMENT, ip char(20) NOT NULL DEFAULT '', trap_oid char(250) NOT NULL DEFAULT '', analized int2 NOT NULL DEFAULT '0', date int4 NOT NULL DEFAULT '0', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE traps_varbinds ( id int4 NOT NULL AUTO_INCREMENT, trapid int4 NOT NULL DEFAULT '0', trap_oid varchar(250) DEFAULT NULL, value varchar(250) NOT NULL DEFAULT '', oidid int4 NOT NULL DEFAULT '0', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE triggers ( id int4 NOT NULL AUTO_INCREMENT, description char(40) NOT NULL DEFAULT '', type char(20) NOT NULL DEFAULT 'alarm', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO triggers (id, description, type) VALUES (1,'No Trigger','alarm'); INSERT INTO triggers (id, description, type) VALUES (2,'Interface Status Change','alarm'); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE triggers_rules ( id int4 NOT NULL AUTO_INCREMENT, trigger_id int4 NOT NULL DEFAULT '1', pos int4 NOT NULL DEFAULT '10', field char(40) NOT NULL DEFAULT '', operator char(20) NOT NULL DEFAULT '', value char(100) NOT NULL DEFAULT '', action_id int4 NOT NULL DEFAULT '1', action_parameters char(250) NOT NULL DEFAULT '', stop int2 NOT NULL DEFAULT '1', and_or int2 NOT NULL DEFAULT '1', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO triggers_rules (id, trigger_id, pos, field, operator, value, action_id, action_parameters, stop, and_or) VALUES (1,1,10,'none','=','',1,'',1,1); INSERT INTO triggers_rules (id, trigger_id, pos, field, operator, value, action_id, action_parameters, stop, and_or) VALUES (2,2,10,'type','!IN','12,25',2,'from:,subject: ,comment:Default Trigger',0,1); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE triggers_users ( id int4 NOT NULL AUTO_INCREMENT, user_id int4 NOT NULL DEFAULT '1', trigger_id int4 NOT NULL DEFAULT '1', active int2 NOT NULL DEFAULT '0', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO triggers_users (id, user_id, trigger_id, active) VALUES (1,1,1,0); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE types ( id int4 NOT NULL AUTO_INCREMENT, description char(30) NOT NULL DEFAULT '', severity int4 NOT NULL DEFAULT '1', text char(250) NOT NULL DEFAULT '', generate_alarm int2 NOT NULL DEFAULT '0', alarm_up int4 NOT NULL DEFAULT '1', alarm_duration int4 NOT NULL DEFAULT '0', show_default int2 NOT NULL DEFAULT '1', show_host int2 NOT NULL DEFAULT '1', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (1,'Unknown',2,' ',0,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (2,'Configuration',2,': Changed Configuration from ',0,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (3,'Interface Protocol',3,'Interface Protocol ( )',1,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (4,'Interface Link',4,'Interface Link ( )',0,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (5,'Controller Status',4,'Controller ',0,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (6,'BGP Status',5,'BGP Neighbor ( )',1,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (7,'Interface Shutdown',4,'Interface ( )',0,4,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (8,'Command',2,': ',0,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (9,'RShell Attempt',14,'RShell attempt from ',0,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (12,'SLA',14,' ( )',1,1,1800,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (17,'Clear Counters',14,' Cleared Counters of ( )',0,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (22,'TCP/UDP Service',18,'TCP/UDP Service ( ) ',1,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (25,'Administrative',13,' ',1,1,1800,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (26,'Environmental',5,' ',1,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (28,'PIX Event',14,'',0,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (29,'PIX Port',2,' packet from to ',0,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (34,'Duplex Mismatch',2,'Duplex Mismatch, is not full duplex and is full duplex',0,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (35,'ACL',14,'ACL packets from ',0,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (36,'BGP Notification',14,'Notification ',0,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (37,'Excess Collitions',2,'Excess Collitions on Interface ',0,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (38,'Application',5,'Application is ( )',1,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (39,'TCP Content',18,'Content Response on is ( ) ',1,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (40,'Reachability',5,'Host is with ',1,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (41,'NTP',14,' is ',1,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (42,'Tool Action',5,' changed to by ( )',0,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (43,'Internal',14,' ',0,1,0,1,0); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (44,'Syslog',14,': ',0,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (45,'Hide this Event',14,' ',0,1,0,0,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (46,'Win Info',14,': (ID:)',0,1,0,2,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (47,'Win Warning',2,': (ID:)',0,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (48,'Win Error',3,': (ID:)',0,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (49,'Win Security',3,' (ID:)',0,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (50,'SQL',3,'SQL is ',1,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (60,'APC Status',5,' is ',1,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (61,'PIX Debug',13,' (ID:)',0,1,0,2,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (62,'PIX Info',14,' (ID:)',0,1,0,2,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (63,'PIX Notif',2,' (ID:)',0,1,0,2,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (64,'PIX Warn',18,' (ID:)',0,1,0,2,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (65,'PIX Error',3,' (ID:)',0,1,0,2,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (66,'PIX Crit',4,' (ID:)',1,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (67,'PIX Alert',5,' (ID:)',1,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (68,'Alteon RServer',3,'Real Server is ',1,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (69,'Alteon Service',3,'Real Service is ',1,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (70,'Alteon VServer',3,'Virtual Server is ',0,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (71,'Brocade FC Port',3,' ()',1,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (72,'ISDN',14,' ',1,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (73,'To delete',13,' ',0,1,0,2,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (74,'IBM error',5,' (id:)',1,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (75,'IBM Warning',127,' is in state',1,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (76,'Disable polling',13,'Polling for host is disabled (enabling time: )',0,1,0,1,0); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (77,'IBM San Trap',5,': ()',1,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (78,'OS/400 Error',5,'A subsystem is on the OS/400',1,1,0,1,1); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (79,'Enable polling',13,'Polling for host is enabled',0,1,0,1,0); INSERT INTO types (id, description, severity, text, generate_alarm, alarm_up, alarm_duration, show_default, show_host) VALUES (80,'Storage Controller',4,'',1,1,0,1,1); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE zones ( id int4 NOT NULL AUTO_INCREMENT, zone char(60) NOT NULL DEFAULT '', shortname char(10) NOT NULL DEFAULT '', image char(30) NOT NULL DEFAULT '', seeds char(250) NOT NULL DEFAULT '', max_deep int2 NOT NULL DEFAULT '2', communities char(250) NOT NULL DEFAULT '', refresh int4 NOT NULL DEFAULT '86400', admin_status int2 NOT NULL DEFAULT '0', show_zone int2 NOT NULL DEFAULT '1', allow_private int2 NOT NULL DEFAULT '0', PRIMARY KEY (id) ); /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO zones (id, zone, shortname, image, seeds, max_deep, communities, refresh, admin_status, show_zone, allow_private) VALUES (1,'Unknown','UNK','unknown.png','',1,'',86400,0,1,0); INSERT INTO zones (id, zone, shortname, image, seeds, max_deep, communities, refresh, admin_status, show_zone, allow_private) VALUES (2,'New Zone','NewZone','unknown.png','',1,'',86400,0,1,1); SELECT SETVAL('interface_types_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from interface_types)); SELECT SETVAL('interface_types_fields_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from interface_types_fields)); SELECT SETVAL('interface_types_field_types_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from interface_types_field_types)); SELECT SETVAL('graph_types_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from graph_types)); SELECT SETVAL('alarm_states_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from alarm_states)); SELECT SETVAL('severity_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from severity)); SELECT SETVAL('syslog_types_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from syslog_types)); SELECT SETVAL('trap_receivers_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from trap_receivers)); SELECT SETVAL('types_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from types)); SELECT SETVAL('slas_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from slas)); SELECT SETVAL('slas_cond_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from slas_cond)); SELECT SETVAL('slas_sla_cond_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from slas_sla_cond)); SELECT SETVAL('filters_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from filters)); SELECT SETVAL('filters_fields_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from filters_fields)); SELECT SETVAL('filters_cond_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from filters_cond)); SELECT SETVAL('pollers_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from pollers)); SELECT SETVAL('pollers_groups_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from pollers_groups)); SELECT SETVAL('pollers_backend_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from pollers_backend)); SELECT SETVAL('pollers_poller_groups_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from pollers_poller_groups)); SELECT SETVAL('autodiscovery_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from autodiscovery)); SELECT SETVAL('hosts_config_types_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from hosts_config_types)); SELECT SETVAL('tools_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from tools)); SELECT SETVAL('profiles_options_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from profiles_options)); SELECT SETVAL('actions_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from actions)); SELECT SETVAL('profiles_values_id_seq',(select case when max(id)>299 then max(id) else 299 end from profiles_values)); jffnms-0.9.3/docs/cisco-example0000644000175000017500000000231211377440254015727 0ustar csmallcsmall#be carefull with this aaa new-model aaa authentication login default group tacacs+ local enable aaa authentication enable default group tacacs+ enable aaa authorization exec default group tacacs+ aaa accounting suppress null-username aaa accounting update newinfo aaa accounting exec default start-stop group tacacs+ aaa accounting commands 0 default stop-only group tacacs+ aaa accounting commands 1 default stop-only group tacacs+ aaa accounting commands 15 default stop-only group tacacs+ ! logging trap debugging no logging console logging facility local6 logging source-interface Loopback0 # or the correct one. (optional) logging ! access-list 99 permit (acl optional) ! tacacs-server host tacacs-server key ip tacacs source-interface Loopback0 # or the correct one. (optional) ! snmp-server community public RO 99 (acl optional) snmp-server community private RW 99 #we only want jffnms acl99 accessing this (acl optional) snmp-server trap-source Loopback0 #or de correct one (optional) snmp-server enable traps snmp authentication linkdown linkup coldstart warmstart # for traps (optional) snmp-server host traps public # for traps (optional) jffnms-0.9.3/docs/unix/0002755000175000017500000000000011736004250014231 5ustar csmallcsmalljffnms-0.9.3/docs/unix/syslog-ng-example0000644000175000017500000000223111377440254017534 0ustar csmallcsmall# ---------------------------------------------------------- # # Before this can work you have to do mkfifo /tmp/mysql.pipe # # ---------------------------------------------------------- # # ---------------------------------------------------------- # # This is an example source, you may want to use your own # # ---------------------------------------------------------- # source src { unix-stream("/dev/log"); internal(); pipe("/proc/kmsg"); udp(ip(0.0.0.0) port(514)); }; # ---------------------------------------------------------- # # These are the lines you have to add to your syslog-ng.conf # # ---------------------------------------------------------- # destination jffnms_processing { program ("mysql -u jffnms -pjffnms jffnms < /tmp/mysql.pipe"); }; destination d_jffnms { pipe ("/tmp/mysql.pipe" template("INSERT INTO syslog (date, date_logged, host, message) VALUES ('$YEAR-$MONTH-$DAY $HOUR:$MIN:$SEC', NOW\(\), '$FULLHOST', '$MSG');\n") template-escape(yes)); }; # This is optional filter f_jffnms { facility(local6); }; log { source (src); filter (f_jffnms); destination (d_jffnms); }; jffnms-0.9.3/docs/unix/crontab0000644000175000017500000000207311734305452015612 0ustar csmallcsmall#Paths JFFNMS=/opt/jffnms/engine PHP=/usr/bin/php # Consolidator */1 * * * * cd $JFFNMS && $PHP -q consolidate.php >/dev/null 2>&1 # SLAs */30 * * * * cd $JFFNMS && $PHP -q rrd_analizer.php >/dev/null 2>&1 # TFTP Configuration 02 4 * * * cd $JFFNMS && $PHP -q tftp_get_host_config.php >/dev/null 2>&1 # Cleanup system 02 5 * * * cd $JFFNMS && $PHP -q cleanup_raw_tables.php >/dev/null 2>&1 20 * * * * cd $JFFNMS && sh tmpwatch.sh $JFFNMS >/dev/null 2>&1 # *** Pollers # Only uncomment one of the following. The -o flag will make it run only # once then exit. It is better to use the first one */5 * * * * cd $JFFNMS && $PHP -q poller.php >/dev/null 2>&1 # run 20 children #*/5 * * * * cd $JFFNMS && $PHP -q poller.php -c 0,20 >/dev/null 2>&1 #*/5 * * * * cd $JFFNMS && $PHP -q poller.php -o >/dev/null 2>&1 # Interface Autodiscovery */30 * * * * cd $JFFNMS && $PHP -q autodiscovery_interfaces.php > /dev/null 2>&1 # Network Autodiscovery #*/30 * * * * cd $JFFNMS && $PHP -q autodiscovery_network.php master $THREADS > /dev/null 2>&1 jffnms-0.9.3/docs/unix/msyslog-example0000644000175000017500000001025611377440254017315 0ustar csmallcsmallInstructions for Msyslog ------------------------ By Christian Zimmerman Project homepage: http://sourceforge.net/projects/msyslog/ JFFNMS version of msyslog: http://jffnms.sourceforge.net/ Step 1 Untar: ------------------------ #gunzip msyslog-v1.08a-jffnms-3.tar.gz #tar xvf msyslog-v1.08a-jffnms-3.tar then change directories: #cd msyslog-v1.xxx Step 2 Configure ------------------------------------ #./configure ************************************************* for /usr/local installs, or for /usr (i.e. Solaris, BSDs) # ./configure -prefix=/usr or the following for / installs (i.e. Linux) # ./configure -prefix=/usr ************************************************ Now compile and install #make #make install Step3 Configuring Msyslog =============================== I want to explain one thing first before we continue. The original docs for msyslog fail to explain the reasoning behind configuring conf files while running command line switches. Also when it installs, the syslogd dameon is the same name as the one that installs with Redhat by default, so make sure that you know which one is which or rename the one that Redhat installs to something else that way you don't get confused. Moving on.... I come from a windows background where usually you would only need to configure a particular config file and let the program run in those parameters but this isn't necessarily the case with msyslog. First things first, the /etc/syslog.conf file is configured in regards to output and when you run the syslogd from commandline with the -i switches you are configuring what the syslogd dameon is going to accept. Remember that if doesn't accept, it can't log it, if doesn't log it, you can't put in the database what doesn't exist! /ETC/SYSLOG.CONF -------------------------------------- If you want to log to a mysql database you need to edit the /etc/syslog.conf file. Just add the following line to the bottom of the file substituting the correct parameters like username and password, and so on... # Log to server localhost through MySQL *.* %mysql -s localhost -u user -p password -d Database_name -t DBtable_name For JFFNMS its: -ujffnms -p jffnms -d jffnms -t syslog If you are only going to record Syslog Messages from routers, then just put local6.* and configure the logging facility as local6 SYSLOGD Commandline --------------------------------------- -i udp = Listen for incoming syslog messages via udp (default's to port 514) -i tcp = Listen for incoming syslog messages via tcp -i linux = used to log linux kernel messages -i unix = unix system logging, reads the log messages from a socket EX: #/path/to/syslogd -i linux -i unix -i tcp -i udp The above are the commonly ones used. There are a couple other switches, if you need or want to use them then read the man pages. Now that we have configured the syslog.conf file to log to a database and we know what commandline switches to use to start the syslogd service, we need to stop the syslog service that Redhat installs by default. Step 4 Stopping the default Syslog service -------------------------------------------------- The default syslogd service is probably already running by default. We need to stop these services so that we can start the msyslog service that we just installed. To see if its all ready running do this: #netstat -putan | grep syslogd This should list something if syslogd is currently running. If it running it should have what it is called a PID then a slash service_name :( Ex 8018/syslogd ). o kill this service issue the command: #kill 8018 Then you will need to run the netstat command again to make sure it is really not running. Once confirmed that syslogd is stopped you'll need to start msyslog from the commandline like this: #syslogd -i linux -i udp -i tcp Once you issue this command issue the netstat command and look to see that it is running. If so then you should be finished. You should start seeing entry's in syslog table for database JFFNMS assuming you set it up this way. In the msyslog documentation its explained how to use a Redhat-Style init.d script to start/stop the service. (ie, just modify your current sysklogd script to remove the kernel logger) jffnms-0.9.3/docs/unix/syslog.conf0000644000175000017500000000170711377440254016434 0ustar csmallcsmall# Log all kernel messages to the console. # Logging much else clutters up the screen. #kern.* /dev/console #*.debug /var/log/debug #*.debug /var/log/messages # Log anything (except mail) of level info or higher. # Don't log private authentication messages! *.info;mail.none;authpriv.none;cron.none;local6.none /var/log/messages # The authpriv file has restricted access. authpriv.* /var/log/secure # Log all the mail messages in one place. mail.* /var/log/maillog # Log cron stuff cron.* /var/log/cron # Everybody gets emergency messages, plus log them on another # machine. *.emerg * # Save mail and news errors of level err and higher in a # special file. uucp,news.crit /var/log/spooler local3.* /var/log/dhcpd.log # Save boot messages also to boot.log local7.* /var/log/boot.log local6.* /var/log/cisco.log local6.* %mysql -s localhost -u jffnms -p jffnms -d jffnms -t syslog jffnms-0.9.3/docs/unix/php.ini.example0000644000175000017500000006730011377440254017170 0ustar csmallcsmall;THIS IS ONLY AN EXAMPLE OF MY CONFIGURATION ;Please change Register_Globals = On ;AND RESTART APACHE [PHP] ;;;;;;;;;;; ; WARNING ; ;;;;;;;;;;; ; This is the default settings file for new PHP installations. ; By default, PHP installs itself with a configuration suitable for ; development purposes, and *NOT* for production purposes. ; For several security-oriented considerations that should be taken ; before going online with your site, please consult php.ini-recommended ; and http://php.net/manual/en/security.php. ;;;;;;;;;;;;;;;;;;; ; About this file ; ;;;;;;;;;;;;;;;;;;; ; This file controls many aspects of PHP's behavior. In order for PHP to ; read it, it must be named 'php.ini'. PHP looks for it in the current ; working directory, in the path designated by the environment variable ; PHPRC, and in the path that was defined in compile time (in that order). ; Under Windows, the compile-time path is the Windows directory. The ; path in which the php.ini file is looked for can be overridden using ; the -c argument in command line mode. ; ; The syntax of the file is extremely simple. Whitespace and Lines ; beginning with a semicolon are silently ignored (as you probably guessed). ; Section headers (e.g. [Foo]) are also silently ignored, even though ; they might mean something in the future. ; ; Directives are specified using the following syntax: ; directive = value ; Directive names are *case sensitive* - foo=bar is different from FOO=bar. ; ; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one ; of the INI constants (On, Off, True, False, Yes, No and None) or an expression ; (e.g. E_ALL & ~E_NOTICE), or a quoted string ("foo"). ; ; Expressions in the INI file are limited to bitwise operators and parentheses: ; | bitwise OR ; & bitwise AND ; ~ bitwise NOT ; ! boolean NOT ; ; Boolean flags can be turned on using the values 1, On, True or Yes. ; They can be turned off using the values 0, Off, False or No. ; ; An empty string can be denoted by simply not writing anything after the equal ; sign, or by using the None keyword: ; ; foo = ; sets foo to an empty string ; foo = none ; sets foo to an empty string ; foo = "none" ; sets foo to the string 'none' ; ; If you use constants in your value, and these constants belong to a ; dynamically loaded extension (either a PHP extension or a Zend extension), ; you may only use these constants *after* the line that loads the extension. ; ; All the values in the php.ini-dist file correspond to the builtin ; defaults (that is, if no php.ini is used, or if you delete these lines, ; the builtin defaults will be identical). ;;;;;;;;;;;;;;;;;;;; ; Language Options ; ;;;;;;;;;;;;;;;;;;;; ; Enable the PHP scripting language engine under Apache. engine = On ; Allow the tags are recognized. short_open_tag = On ; Allow ASP-style <% %> tags. asp_tags = Off ; The number of significant digits displayed in floating point numbers. precision = 14 ; Enforce year 2000 compliance (will cause problems with non-compliant browsers) y2k_compliance = Off ; Output buffering allows you to send header lines (including cookies) even ; after you send body content, at the price of slowing PHP's output layer a ; bit. You can enable output buffering during runtime by calling the output ; buffering functions. You can also enable output buffering for all files by ; setting this directive to On. If you wish to limit the size of the buffer ; to a certain size - you can use a maximum number of bytes instead of 'On', as ; a value for this directive (e.g., output_buffering=4096). output_buffering = Off ; You can redirect all of the output of your scripts to a function. For ; example, if you set output_handler to "ob_gzhandler", output will be ; transparently compressed for browsers that support gzip or deflate encoding. ; Setting an output handler automatically turns on output buffering. output_handler = ; Transparent output compression using the zlib library ; Valid values for this option are 'off', 'on', or a specific buffer size ; to be used for compression (default is 4KB) zlib.output_compression = Off ; Implicit flush tells PHP to tell the output layer to flush itself ; automatically after every output block. This is equivalent to calling the ; PHP function flush() after each and every call to print() or echo() and each ; and every HTML block. Turning this option on has serious performance ; implications and is generally recommended for debugging purposes only. implicit_flush = Off ; Whether to enable the ability to force arguments to be passed by reference ; at function call time. This method is deprecated and is likely to be ; unsupported in future versions of PHP/Zend. The encouraged method of ; specifying which arguments should be passed by reference is in the function ; declaration. You're encouraged to try and turn this option Off and make ; sure your scripts work properly with it in order to ensure they will work ; with future versions of the language (you will receive a warning each time ; you use this feature, and the argument will be passed by value instead of by ; reference). allow_call_time_pass_reference = On ; ; Safe Mode ; safe_mode = Off ; By default, Safe Mode does a UID compare check when ; opening files. If you want to relax this to a GID compare, ; then turn on safe_mode_gid. safe_mode_gid = Off ; When safe_mode is on, UID/GID checks are bypassed when ; including files from this directory and its subdirectories. ; (directory must also be in include_path or full path must ; be used when including) safe_mode_include_dir = ; When safe_mode is on, only executables located in the safe_mode_exec_dir ; will be allowed to be executed via the exec family of functions. safe_mode_exec_dir = ; open_basedir, if set, limits all file operations to the defined directory ; and below. This directive makes most sense if used in a per-directory ; or per-virtualhost web server configuration file. ; ;open_basedir = ; Setting certain environment variables may be a potential security breach. ; This directive contains a comma-delimited list of prefixes. In Safe Mode, ; the user may only alter environment variables whose names begin with the ; prefixes supplied here. By default, users will only be able to set ; environment variables that begin with PHP_ (e.g. PHP_FOO=BAR). ; ; Note: If this directive is empty, PHP will let the user modify ANY ; environment variable! safe_mode_allowed_env_vars = PHP_ ; This directive contains a comma-delimited list of environment variables that ; the end user won't be able to change using putenv(). These variables will be ; protected even if safe_mode_allowed_env_vars is set to allow to change them. safe_mode_protected_env_vars = LD_LIBRARY_PATH ; This directive allows you to disable certain functions for security reasons. ; It receives a comma-delimited list of function names. This directive is ; *NOT* affected by whether Safe Mode is turned On or Off. disable_functions = ; Colors for Syntax Highlighting mode. Anything that's acceptable in ; would work. highlight.string = #CC0000 highlight.comment = #FF9900 highlight.keyword = #006600 highlight.bg = #FFFFFF highlight.default = #0000CC highlight.html = #000000 ; ; Misc ; ; Decides whether PHP may expose the fact that it is installed on the server ; (e.g. by adding its signature to the Web server header). It is no security ; threat in any way, but it makes it possible to determine whether you use PHP ; on your server or not. expose_php = On ;;;;;;;;;;;;;;;;;;; ; Resource Limits ; ;;;;;;;;;;;;;;;;;;; max_execution_time = 9999999999999 ; Maximum execution time of each script, in seconds memory_limit = 8M ; Maximum amount of memory a script may consume (8MB) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Error handling and logging ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; error_reporting is a bit-field. Or each number up to get desired error ; reporting level ; E_ALL - All errors and warnings ; E_ERROR - fatal run-time errors ; E_WARNING - run-time warnings (non-fatal errors) ; E_PARSE - compile-time parse errors ; E_NOTICE - run-time notices (these are warnings which often result ; from a bug in your code, but it's possible that it was ; intentional (e.g., using an uninitialized variable and ; relying on the fact it's automatically initialized to an ; empty string) ; E_CORE_ERROR - fatal errors that occur during PHP's initial startup ; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's ; initial startup ; E_COMPILE_ERROR - fatal compile-time errors ; E_COMPILE_WARNING - compile-time warnings (non-fatal errors) ; E_USER_ERROR - user-generated error message ; E_USER_WARNING - user-generated warning message ; E_USER_NOTICE - user-generated notice message ; ; Examples: ; ; - Show all errors, except for notices ; ;error_reporting = E_ALL & ~E_NOTICE ; ; - Show only errors ; ;error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR ; ; - Show all errors except for notices ; error_reporting = E_ALL & ~E_NOTICE ; Print out errors (as a part of the output). For production web sites, ; you're strongly encouraged to turn this feature off, and use error logging ; instead (see below). Keeping display_errors enabled on a production web site ; may reveal security information to end users, such as file paths on your Web ; server, your database schema or other information. display_errors = On ; Even when display_errors is on, errors that occur during PHP's startup ; sequence are not displayed. It's strongly recommended to keep ; display_startup_errors off, except for when debugging. display_startup_errors = Off ; Log errors into a log file (server-specific log, stderr, or error_log (below)) ; As stated above, you're strongly advised to use error logging in place of ; error displaying on production web sites. log_errors = Off ; Store the last error/warning message in $php_errormsg (boolean). track_errors = Off ; Disable the inclusion of HTML tags in error messages. ;html_errors = Off ; String to output before an error message. ;error_prepend_string = "" ; String to output after an error message. ;error_append_string = "" ; Log errors to specified file. ;error_log = filename ; Log errors to syslog (Event Log on NT, not valid in Windows 95). ;error_log = syslog ; Warn if the + operator is used with strings. warn_plus_overloading = Off ;;;;;;;;;;;;;;;;; ; Data Handling ; ;;;;;;;;;;;;;;;;; ; ; Note - track_vars is ALWAYS enabled as of PHP 4.0.3 ; The separator used in PHP generated URLs to separate arguments. ; Default is "&". ;arg_separator.output = "&" ; List of separator(s) used by PHP to parse input URLs into variables. ; Default is "&". ; NOTE: Every character in this directive is considered as separator! ;arg_separator.input = ";&" ; This directive describes the order in which PHP registers GET, POST, Cookie, ; Environment and Built-in variables (G, P, C, E & S respectively, often ; referred to as EGPCS or GPC). Registration is done from left to right, newer ; values override older values. variables_order = "EGPCS" ; Whether or not to register the EGPCS variables as global variables. You may ; want to turn this off if you don't want to clutter your scripts' global scope ; with user data. This makes most sense when coupled with track_vars - in which ; case you can access all of the GPC variables through the $HTTP_*_VARS[], ; variables. ; ; You should do your best to write your scripts so that they do not require ; register_globals to be on; Using form variables as globals can easily lead ; to possible security problems, if the code is not very well thought of. register_globals = On ; This directive tells PHP whether to declare the argv&argc variables (that ; would contain the GET information). If you don't use these variables, you ; should turn it off for increased performance. register_argc_argv = On ; Maximum size of POST data that PHP will accept. post_max_size = 8M ; This directive is deprecated. Use variables_order instead. gpc_order = "GPC" ; Magic quotes ; ; Magic quotes for incoming GET/POST/Cookie data. magic_quotes_gpc = Off ; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc. magic_quotes_runtime = Off ; Use Sybase-style magic quotes (escape ' with '' instead of \'). magic_quotes_sybase = Off ; Automatically add files before or after any PHP document. auto_prepend_file = auto_append_file = ; As of 4.0b4, PHP always outputs a character encoding by default in ; the Content-type: header. To disable sending of the charset, simply ; set it to be empty. ; ; PHP's built-in default is text/html default_mimetype = "text/html" ;default_charset = "iso-8859-1" always_populate_raw_post_data = on; ;;;;;;;;;;;;;;;;;;;;;;;;; ; Paths and Directories ; ;;;;;;;;;;;;;;;;;;;;;;;;; ; UNIX: "/path1:/path2" include_path = ".:/php/includes;/var/www/html/admintools" ; ; Windows: "\path1;\path2" ;include_path = ".;c:\php\includes" ; The root of the PHP pages, used only if nonempty. ; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root ; if you are running php as a CGI under any web server (other than IIS) ; see documentation for security issues. The alternate is to use the ; cgi.force_redirect configuration below doc_root = ; The directory under which PHP opens the script using /~usernamem used only ; if nonempty. user_dir = ; Directory in which the loadable extensions (modules) reside. extension_dir = /usr/lib/php4 ; Whether or not to enable the dl() function. The dl() function does NOT work ; properly in multithreaded servers, such as IIS or Zeus, and is automatically ; disabled on them. enable_dl = On ; cgi.force_redirect is necessary to provide security running PHP as a CGI under ; most web servers. Left undefined, PHP turns this on by default. You can ; turn it off here AT YOUR OWN RISK ; **You CAN safely turn this off for IIS, in fact, you MUST.** ; cgi.force_redirect = 1 ; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape ; (iPlanet) web servers, you MAY need to set an environment variable name that PHP ; will look for to know it is OK to continue execution. Setting this variable MAY ; cause security issues, KNOW WHAT YOU ARE DOING FIRST. ; cgi.redirect_status_env = ; ;;;;;;;;;;;;;;;; ; File Uploads ; ;;;;;;;;;;;;;;;; ; Whether to allow HTTP file uploads. file_uploads = On ; Temporary directory for HTTP uploaded files (will use system default if not ; specified). upload_tmp_dir = /tmp ; Maximum allowed size for uploaded files. upload_max_filesize = 100000 ;;;;;;;;;;;;;;;;;; ; Fopen wrappers ; ;;;;;;;;;;;;;;;;;; ; Whether to allow the treatment of URLs (like http:// or ftp://) as files. allow_url_fopen = On ; Define the anonymous ftp password (your email address) ;from="john@doe.com" ;;;;;;;;;;;;;;;;;;;;;; ; Dynamic Extensions ; ;;;;;;;;;;;;;;;;;;;;;; ; ; If you wish to have an extension loaded automatically, use the following ; syntax: ; ; extension=modulename.extension ; ; For example, on Windows: ; ; extension=msql.dll ; ; ... or under UNIX: ; ; extension=msql.so ; ; Note that it should be the name of the module only; no directory information ; needs to go here. Specify the location of the extension with the ; extension_dir directive above. ;Windows Extensions ;Note that MySQL and ODBC support is now built in, so no dll is needed for it. ; ;extension=php_bz2.dll ;extension=php_ctype.dll ;extension=php_cpdf.dll ;extension=php_curl.dll ;extension=php_cybercash.dll ;extension=php_db.dll ;extension=php_dba.dll ;extension=php_dbase.dll ;extension=php_dbg.dll ;extension=php_dbx.dll ;extension=php_domxml.dll ;extension=php_dotnet.dll ;extension=php_exif.dll ;extension=php_fbsql.dll ;extension=php_fdf.dll ;extension=php_filepro.dll ;extension=php_gd.dll ;extension=php_gettext.dll ;extension=php_hyperwave.dll ;extension=php_iconv.dll ;extension=php_ifx.dll ;extension=php_iisfunc.dll ;extension=php_imap.dll ;extension=php_ingres.dll ;extension=php_interbase.dll ;extension=php_java.dll ;extension=php_ldap.dll ;extension=php_mbstring.dll ;extension=php_mcrypt.dll ;extension=php_mhash.dll ;extension=php_ming.dll ;extension=php_mssql.dll ;extension=php_mysql.dll extension=mysql.so ;extension=soap.so ;extension=dbg.so ;extension=php_oci8.dll ;extension=php_odbc.dll ;extension=php_openssl.dll ;extension=php_oracle.dll ;extension=php_pdf.dll extension=pgsql.so ;extension=php_printer.dll ;extension=php_sablot.dll ;extension=php_shmop.dll extension=snmp.so ;extension=php_sockets.dll ;extension=php_sybase_ct.dll ;extension=php_xslt.dll ;extension=php_yaz.dll ;extension=php_zlib.dll ;;;;;;;;;;;;;;;;;;; ; Module Settings ; ;;;;;;;;;;;;;;;;;;; [Syslog] ; Whether or not to define the various syslog variables (e.g. $LOG_PID, ; $LOG_CRON, etc.). Turning it off is a good idea performance-wise. In ; runtime, you can define these variables by calling define_syslog_variables(). define_syslog_variables = Off [mail function] ; For Win32 only. SMTP = 10.1.0.101 ; For Win32 only. sendmail_from = ip@tiba.com ; For Unix only. You may supply arguments as well (default: 'sendmail -t -i'). ;sendmail_path = [Logging] ; These configuration directives are used by the example logging mechanism. ; See examples/README.logging for more explanation. ;logging.method = db ;logging.directory = /path/to/log/directory [Java] ;java.class.path = .\php_java.jar ;java.home = c:\jdk ;java.library = c:\jdk\jre\bin\hotspot\jvm.dll ;java.library.path = .\ [SQL] sql.safe_mode = Off [ODBC] ;odbc.default_db = Not yet implemented ;odbc.default_user = Not yet implemented ;odbc.default_pw = Not yet implemented ; Allow or prevent persistent links. odbc.allow_persistent = On ; Check that a connection is still valid before reuse. odbc.check_persistent = On ; Maximum number of persistent links. -1 means no limit. odbc.max_persistent = -1 ; Maximum number of links (persistent + non-persistent). -1 means no limit. odbc.max_links = -1 ; Handling of LONG fields. Returns number of bytes to variables. 0 means ; passthru. odbc.defaultlrl = 4096 ; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char. ; See the documentation on odbc_binmode and odbc_longreadlen for an explanation ; of uodbc.defaultlrl and uodbc.defaultbinmode odbc.defaultbinmode = 1 [MySQL] ; Allow or prevent persistent links. mysql.allow_persistent = On ; Maximum number of persistent links. -1 means no limit. mysql.max_persistent = -1 ; Maximum number of links (persistent + non-persistent). -1 means no limit. mysql.max_links = -1 ; Default port number for mysql_connect(). If unset, mysql_connect() will use ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the ; compile-time value defined MYSQL_PORT (in that order). Win32 will only look ' at MYSQL_PORT. mysql.default_port = ; Default socket name for local MySQL connects. If empty, uses the built-in ; MySQL defaults. mysql.default_socket = ; Default host for mysql_connect() (doesn't apply in safe mode). mysql.default_host = ; Default user for mysql_connect() (doesn't apply in safe mode). mysql.default_user = ; Default password for mysql_connect() (doesn't apply in safe mode). ; Note that this is generally a *bad* idea to store passwords in this file. ; *Any* user with PHP access can run 'echo cfg_get_var("mysql.default_password") ; and reveal this password! And of course, any users with read access to this ; file will be able to reveal the password as well. mysql.default_password = [mSQL] ; Allow or prevent persistent links. msql.allow_persistent = On ; Maximum number of persistent links. -1 means no limit. msql.max_persistent = -1 ; Maximum number of links (persistent+non persistent). -1 means no limit. msql.max_links = -1 [PostgresSQL] ; Allow or prevent persistent links. pgsql.allow_persistent = On ; Maximum number of persistent links. -1 means no limit. pgsql.max_persistent = -1 ; Maximum number of links (persistent+non persistent). -1 means no limit. pgsql.max_links = -1 [Sybase] ; Allow or prevent persistent links. sybase.allow_persistent = On ; Maximum number of persistent links. -1 means no limit. sybase.max_persistent = -1 ; Maximum number of links (persistent + non-persistent). -1 means no limit. sybase.max_links = -1 ;sybase.interface_file = "/usr/sybase/interfaces" ; Minimum error severity to display. sybase.min_error_severity = 10 ; Minimum message severity to display. sybase.min_message_severity = 10 ; Compatability mode with old versions of PHP 3.0. ; If on, this will cause PHP to automatically assign types to results according ; to their Sybase type, instead of treating them all as strings. This ; compatability mode will probably not stay around forever, so try applying ; whatever necessary changes to your code, and turn it off. sybase.compatability_mode = Off [Sybase-CT] ; Allow or prevent persistent links. sybct.allow_persistent = On ; Maximum number of persistent links. -1 means no limit. sybct.max_persistent = -1 ; Maximum number of links (persistent + non-persistent). -1 means no limit. sybct.max_links = -1 ; Minimum server message severity to display. sybct.min_server_severity = 10 ; Minimum client message severity to display. sybct.min_client_severity = 10 [bcmath] ; Number of decimal digits for all bcmath functions. bcmath.scale = 0 [browscap] ;browscap = extra/browscap.ini [Informix] ; Default host for ifx_connect() (doesn't apply in safe mode). ifx.default_host = ; Default user for ifx_connect() (doesn't apply in safe mode). ifx.default_user = ; Default password for ifx_connect() (doesn't apply in safe mode). ifx.default_password = ; Allow or prevent persistent links. ifx.allow_persistent = On ; Maximum number of persistent links. -1 means no limit. ifx.max_persistent = -1 ; Maximum number of links (persistent + non-persistent). -1 means no limit. ifx.max_links = -1 ; If on, select statements return the contents of a text blob instead of its id. ifx.textasvarchar = 0 ; If on, select statements return the contents of a byte blob instead of its id. ifx.byteasvarchar = 0 ; Trailing blanks are stripped from fixed-length char columns. May help the ; life of Informix SE users. ifx.charasvarchar = 0 ; If on, the contents of text and byte blobs are dumped to a file instead of ; keeping them in memory. ifx.blobinfile = 0 ; NULL's are returned as empty strings, unless this is set to 1. In that case, ; NULL's are returned as string 'NULL'. ifx.nullformat = 0 [Session] ; Handler used to store/retrieve data. session.save_handler = files ; Argument passed to save_handler. In the case of files, this is the path ; where data files are stored. Note: Windows users have to change this ; variable in order to use PHP's session functions. session.save_path = /tmp ; Whether to use cookies. session.use_cookies = 0 ; Name of the session (used as cookie name). session.name = PHPSESSID ; Initialize session on request startup. session.auto_start = 1 ; Lifetime in seconds of cookie or, if 0, until browser is restarted. session.cookie_lifetime = 0 ; The path for which the cookie is valid. session.cookie_path = / ; The domain for which the cookie is valid. session.cookie_domain = ; Handler used to serialize data. php is the standard serializer of PHP. session.serialize_handler = php ; Percentual probability that the 'garbage collection' process is started ; on every session initialization. session.gc_probability = 1 ; After this number of seconds, stored data will be seen as 'garbage' and ; cleaned up by the garbage collection process. session.gc_maxlifetime = 1440 ; Check HTTP Referer to invalidate externally stored URLs containing ids. session.referer_check = ; How many bytes to read from the file. session.entropy_length = 0 ; Specified here to create the session id. session.entropy_file = ;session.entropy_length = 16 ;session.entropy_file = /dev/urandom ; Set to {nocache,private,public} to determine HTTP caching aspects. session.cache_limiter = nocache ; Document expires after n minutes. session.cache_expire = 180 ; use transient sid support if enabled by compiling with --enable-trans-sid. session.use_trans_sid = 0 url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry" [MSSQL] ; Allow or prevent persistent links. mssql.allow_persistent = On ; Maximum number of persistent links. -1 means no limit. mssql.max_persistent = -1 ; Maximum number of links (persistent+non persistent). -1 means no limit. mssql.max_links = -1 ; Minimum error severity to display. mssql.min_error_severity = 10 ; Minimum message severity to display. mssql.min_message_severity = 10 ; Compatability mode with old versions of PHP 3.0. mssql.compatability_mode = Off ; Valid range 0 - 2147483647. Default = 4096. ;mssql.textlimit = 4096 ; Valid range 0 - 2147483647. Default = 4096. ;mssql.textsize = 4096 ; Limits the number of records in each batch. 0 = all records in one batch. ;mssql.batchsize = 0 [Assertion] ; Assert(expr); active by default. ;assert.active = On ; Issue a PHP warning for each failed assertion. ;assert.warning = On ; Don't bail out by default. ;assert.bail = Off ; User-function to be called if an assertion fails. ;assert.callback = 0 ; Eval the expression with current error_reporting(). Set to true if you want ; error_reporting(0) around the eval(). ;assert.quiet_eval = 0 [Ingres II] ; Allow or prevent persistent links. ingres.allow_persistent = On ; Maximum number of persistent links. -1 means no limit. ingres.max_persistent = -1 ; Maximum number of links, including persistents. -1 means no limit. ingres.max_links = -1 ; Default database (format: [node_id::]dbname[/srv_class]). ingres.default_database = ; Default user. ingres.default_user = ; Default password. ingres.default_password = [Verisign Payflow Pro] ; Default Payflow Pro server. pfpro.defaulthost = "test-payflow.verisign.com" ; Default port to connect to. pfpro.defaultport = 443 ; Default timeout in seconds. pfpro.defaulttimeout = 30 ; Default proxy IP address (if required). ;pfpro.proxyaddress = ; Default proxy port. ;pfpro.proxyport = ; Default proxy logon. ;pfpro.proxylogon = ; Default proxy password. ;pfpro.proxypassword = [Sockets] ; Use the system read() function instead of the php_read() wrapper. sockets.use_system_read = On [com] ; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs ;com.typelib_file = ; allow Distributed-COM calls ;com.allow_dcom = true ; autoregister constants of a components typlib on com_load() ;com.autoregister_typelib = true ; register constants casesensitive ;com.autoregister_casesensitive = false ; show warnings on duplicate constat registrations ;com.autoregister_verbose = true [debugger] debugger.enabled = true deubgger.JIT_host = clienthost debugger.JIT_port = 7869 [Printer] ;printer.default_printer = "" [mbstring] ;mbstring.internal_encoding = EUC-JP ;mbstring.http_input = auto ;mbstring.http_output = SJIS ;mbstring.detect_order = auto ;mbstring.substitute_character = none; [FrontBase] ;fbsql.allow_persistant = On ;fbsql.autocommit = On ;fbsql.default_database = ;fbsql.default_database_password = ;fbsql.default_host = ;fbsql.default_password = ;fbsql.default_user = "_SYSTEM" ;fbsql.generate_warnings = Off ;fbsql.max_connections = 128 ;fbsql.max_links = 128 ;fbsql.max_persistent = -1 ;fbsql.max_results = 128 ;fbsql.mbatchSize = 1000 ; Local Variables: ; tab-width: 4 ; End: ; [debugger] ; debugger.enabled = true ; debugger.JIT_host = clienthost ; debugger.JIT_port = 7869 ; [Debugger] ; debugger.enabled = true ; debugger.profiler_enabled=true ; debugger.JIT_enabled = true ; debugger.JIT_host = 10.1.0.105 ; debugger.JIT_port = 7869 ; debugger.JIT_level = 4 ; debugger.fail_silently = false ; debugger.ignore_nops = false ; debugger.timeout_seconds= 300 ; debugger.enable_session_cookie= true ; debugger.session_nocache= on jffnms-0.9.3/docs/unix/snmp.conf0000644000175000017500000000002511377440254016061 0ustar csmallcsmallprintNumericOids yes jffnms-0.9.3/docs/unix/tac_plus.cfg0000644000175000017500000000117411377440254016536 0ustar csmallcsmall# for automatic enable on routers user = javier { service = exec { priv-lvl = 15 } } user = DEFAULT { service = exec { default attribute = permit priv-lvl = 1 } } default authentication = db mysql://jffnms:jffnms@localhost/jffnms/auth?usern&passwd accounting file = /var/log/tac_acc.log db_accounting = "mysql://jffnms:jffnms@localhost/jffnms/acct" host = 192.168.10.99 { key = secret type = cisco prompt = " This is private property. Criminal Law prohibits unauthorized use. All violators will be prosecuted. UNAUTHORIZED USERS LOG OFF IMMEDIATELY! Welcome to This Router Username: " } jffnms-0.9.3/docs/unix/tftp0000644000175000017500000000075111377440254015143 0ustar csmallcsmall# default: off # description: The tftp server serves files using the trivial file transfer \ # protocol. The tftp protocol is often used to boot diskless \ # workstations, download configuration files to network-aware printers, \ # and to start the installation process for some operating systems. # this is for XINETD service tftp { socket_type = dgram protocol = udp wait = yes user = root server = /usr/sbin/in.tftpd server_args = -s /opt/jffnms/tftpd disable = no } jffnms-0.9.3/docs/unix/snmptrapd.conf0000644000175000017500000000006711377440254017122 0ustar csmallcsmalltraphandle default /opt/jffnms/engine/trap_receiver.sh jffnms-0.9.3/docs/upgrade/0000755000175000017500000000000011760060424014675 5ustar csmallcsmalljffnms-0.9.3/docs/upgrade/jffnms-0.9.2-to-0.9.3.pgsql0000644000175000017500000000672211760060424020770 0ustar csmallcsmallUPDATE interface_types SET autodiscovery_default_poller=61 WHERE id=4; UPDATE pollers SET parameters='.1.3.6.1.2.1.2.2.1.10.,.1.3.6.1.2.1.31.1.1.1.6.' WHERE id=229; UPDATE pollers SET parameters='.1.3.6.1.2.1.2.2.1.16.,.1.3.6.1.2.1.31.1.1.1.10.' WHERE id=230; UPDATE pollers SET parameters='.1.3.6.1.2.1.2.2.1.11.,.1.3.6.1.2.1.31.1.1.1.7.' WHERE id=231; UPDATE pollers SET parameters='.1.3.6.1.2.1.2.2.1.17.,.1.3.6.1.2.1.31.1.1.1.11.' WHERE id=232; SELECT SETVAL('interface_types_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from interface_types)); SELECT SETVAL('interface_types_fields_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from interface_types_fields)); SELECT SETVAL('interface_types_field_types_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from interface_types_field_types)); SELECT SETVAL('graph_types_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from graph_types)); SELECT SETVAL('alarm_states_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from alarm_states)); SELECT SETVAL('severity_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from severity)); SELECT SETVAL('syslog_types_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from syslog_types)); SELECT SETVAL('trap_receivers_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from trap_receivers)); SELECT SETVAL('types_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from types)); SELECT SETVAL('slas_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from slas)); SELECT SETVAL('slas_cond_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from slas_cond)); SELECT SETVAL('slas_sla_cond_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from slas_sla_cond)); SELECT SETVAL('filters_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from filters)); SELECT SETVAL('filters_fields_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from filters_fields)); SELECT SETVAL('filters_cond_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from filters_cond)); SELECT SETVAL('pollers_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from pollers)); SELECT SETVAL('pollers_groups_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from pollers_groups)); SELECT SETVAL('pollers_backend_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from pollers_backend)); SELECT SETVAL('pollers_poller_groups_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from pollers_poller_groups)); SELECT SETVAL('autodiscovery_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from autodiscovery)); SELECT SETVAL('hosts_config_types_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from hosts_config_types)); SELECT SETVAL('tools_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from tools)); SELECT SETVAL('profiles_options_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from profiles_options)); SELECT SETVAL('actions_id_seq',(select case when max(id)>10000 then max(id) else 10000 end from actions)); SELECT SETVAL('profiles_values_id_seq',(select case when max(id)>299 then max(id) else 299 end from profiles_values)); jffnms-0.9.3/docs/upgrade/jffnms-0.9.2-to-0.9.3.mysql0000644000175000017500000000344011760060424021001 0ustar csmallcsmallUPDATE interface_types SET autodiscovery_default_poller=61 WHERE id=4; UPDATE pollers SET parameters='.1.3.6.1.2.1.2.2.1.10.,.1.3.6.1.2.1.31.1.1.1.6.' WHERE id=229; UPDATE pollers SET parameters='.1.3.6.1.2.1.2.2.1.16.,.1.3.6.1.2.1.31.1.1.1.10.' WHERE id=230; UPDATE pollers SET parameters='.1.3.6.1.2.1.2.2.1.11.,.1.3.6.1.2.1.31.1.1.1.7.' WHERE id=231; UPDATE pollers SET parameters='.1.3.6.1.2.1.2.2.1.17.,.1.3.6.1.2.1.31.1.1.1.11.' WHERE id=232; ALTER TABLE interface_types AUTO_INCREMENT = 10001; ALTER TABLE interface_types_fields AUTO_INCREMENT = 10001; ALTER TABLE interface_types_field_types AUTO_INCREMENT = 10001; ALTER TABLE graph_types AUTO_INCREMENT = 10001; ALTER TABLE alarm_states AUTO_INCREMENT = 10001; ALTER TABLE severity AUTO_INCREMENT = 10001; ALTER TABLE syslog_types AUTO_INCREMENT = 10001; ALTER TABLE trap_receivers AUTO_INCREMENT = 10001; ALTER TABLE types AUTO_INCREMENT = 10001; ALTER TABLE slas AUTO_INCREMENT = 10001; ALTER TABLE slas_cond AUTO_INCREMENT = 10001; ALTER TABLE slas_sla_cond AUTO_INCREMENT = 10001; ALTER TABLE filters AUTO_INCREMENT = 10001; ALTER TABLE filters_fields AUTO_INCREMENT = 10001; ALTER TABLE filters_cond AUTO_INCREMENT = 10001; ALTER TABLE pollers AUTO_INCREMENT = 10001; ALTER TABLE pollers_groups AUTO_INCREMENT = 10001; ALTER TABLE pollers_backend AUTO_INCREMENT = 10001; ALTER TABLE pollers_poller_groups AUTO_INCREMENT = 10001; ALTER TABLE autodiscovery AUTO_INCREMENT = 10001; ALTER TABLE hosts_config_types AUTO_INCREMENT = 10001; ALTER TABLE tools AUTO_INCREMENT = 10001; ALTER TABLE profiles_options AUTO_INCREMENT = 10001; ALTER TABLE actions AUTO_INCREMENT = 10001; ALTER TABLE profiles_values AUTO_INCREMENT = 300; jffnms-0.9.3/docs/upgrade/jffnms-0.9.2-to-0.9.3.patch0000644000175000017500000075775311760060424020762 0ustar csmallcsmalldiff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/BUGS jffnms-0.9.3/BUGS --- ../jffnms-0.9.2/BUGS 2012-03-04 13:43:13.000000000 +1100 +++ jffnms-0.9.3/BUGS 1970-01-01 10:00:00.000000000 +1000 @@ -1,18 +0,0 @@ -If your find a bug please report it at sourceforge.net - -1. Mailing-List: - - jffnms-users@lists.sourceforge.net - - Archives: - http://marc.theaimsgroup.com/?l=jffnms-users - or - http://lists.sourceforge.net/lists/listinfo/jffnms-users - or - http://www.mail-archive.com/jffnms-users@lists.sourceforge.net/ - -2. Forums : - http://sourceforge.net/forum/?group_id=46041 - -3. Bugs: - http://sourceforge.net/tracker/?atid=444844&group_id=46041&func=browse diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/Changelog jffnms-0.9.3/Changelog --- ../jffnms-0.9.2/Changelog 2012-03-04 13:43:13.000000000 +1100 +++ jffnms-0.9.3/Changelog 1970-01-01 10:00:00.000000000 +1000 @@ -1,1854 +0,0 @@ -JFFNMS 0.9.2 -============ - * really save config file - * engines run with unset repeat values - * Fixed profile update so it works - * Interface selector can select multiple interfaces again - * config save fixes to reduce warnings - * Changed all php short tags to full ones - * Check for existance of some snmp functions that are not in windows - * Update to pass syntax for PHP version 5.4 - - -JFFNMS 0.9.1 -============ - * SNMP trap receiver table can be edited with poller_backends - * poller backend select fixed - * Consolidater default repeat value set - * check for array to silence error message when array not set - * Config page saves config file and renames it - * Interface selector has some height - -JFFNMS 0.9.0 -============ - * Fixed error in syslog consolidator which fails for postgresql - * All webpage input passes through Sanitizer - * register_globals no longer needs to be turned on, so turn it off! - * rrdtool v1.0 support dropped - * lots of cleanup - * poller rewritten with parent/child code - * autodiscovery the same as poller - * Removed php rrd module support - * Interface auto-discovery will check sysobjid before trying discovery - * IPv6 reachability support - * Separated interface selector code - * SNMP interfaces can have High Speed and optinally no Cisco proxy ping - -JFFNMS 0.8.5 -============ - * Fixed traffic graph - * Commented out logfile checking - * postgresql schema uses mysqldump compat mode - * Adjusted build script to make cleaner tar files - * Change logfile column name offset to file_offset for pgsql - * Cleaned up some more code so STRICT complains less - -JFFNMS 0.8.4 Released 2009-10-05 -================================ - * tcp_status poller only returns ascii data - * Config script redirects to https url if called that way - * Added security patches as per Debian security patch 20_security - * Above Closes SF:1725069 - * blentz patch for Dell OpenManage Fans and Tempeature added SF:1633506 - * Removed non-free font and change code to handle no font present - * Started on logfile reading - * UPS poller now can work with Mitsubishi Diamondlink devices - * APC PDU support - this and above patch from falz - * Added support for IBM Blades, IBM Servers, IBM DS4XXX controllers, - generic Fibre Channel - All from David Lima - * Informant-Advanced logical disk support added - From Sebastian van Dijk - * Network UPS Tool support added - * import_custom.php fixed for multiple fields in same table - * Host MIB Apps can be case-insensitive checking - -JFFNMS 0.8.3 Released 2006-09-16 -================================ -When other people are involved is noted if not it was me: Javier Szyszlican. - -* New Features: - - - Support for RRDTool 1.2.x - - Escapes : in COMMENT statements (Reported by: Aaron Daubman ) - - Uses LucidaTypewriter font so the graphs are about the same as with RRDTool 1.0.x - - - Storage device interface type now tracks index changes (like when adding a USB drive) or restarting the Agent - - - OS/400 Interface type with CPU Utilization graph - By: David LIMA - - - Per-Host CPU Threshold for Cisco and Linux/Unix hosts - By: David LIMA - - - Initial Dell OpenManager Interface type (only general alarm for now) - By: Ben Lentz and David LIMA - -* Bug Fixes: - - - Apache Discovery now has a 10 seconds timeout. - by: Craig Small - - - Install guide includes cron.allow and new tmpwatch and pcntl dependencies - Reported by: Joel Harrison - - - New Installation guide for Windows - By: Fabricio Castro - - - Host name field now is bigger - Reported by: Emmanuel Doguet - - - crontab example now has only one Autodiscovery enabled (old one) - Reported by: Cody Holland - - - Changed some tables to avoid MySQL 5.x keywords ('condition') - Fixed by: Craig Small - - - NAD now works in PostgreSQL - - - Cisco CC TFTP copy now works even with the MIBs loaded - Fixed by: Nick Korosi - - - NTP Client GPS support - - - TCP Port Status now supports hosts with a different SNMP port - Reported by: Tim Nelson - - - tmpwatch.sh script should work in most Unices now - Fixed by: Aaron Daubman - - - RRDTool will not use the Pipe system when the command line is bigger than 1000 characters - Fixed by: Aaron Daubman - - - Added PortChannel link type to NAD - - - SNMP Traps Backend GUI now works - Fixed by: Craig Small - - - Timezone removed from PostgreSQL Date results - Reported by: MOYA Yves - - - Changed state field in alarm_states to int (10) - Reported by: frederic Vay - - - HostMIB interfaces on Windows paths with Non-Printable characters were not correctly handled - - - Fixed RRDTool grapher to skip empty array items causing problems with some RRDTool versions - By: Sebastien Namche - - - Added blocked_devices to storage discovery to avoid problems on MacOSX with /dev and /.vol - - -JFFNMS 0.8.2 Released 2005-05-09 -================================ - -*New Features: - - - Host MIB hrSensor support, tested under net-snmp with lm_sensors patch. - It can graph Temperature, Voltages and Fan's RPM. - Requested by: Michael Fuereder - - - New SNMP Trap handler. It uses plugins (receivers) to parse the traps and send them to backends. - It provides a more flexible system for SNMP Trap processing. - By: Erno Rigo - - - SystemMIB Name, Contact and Location added to the Windows, Linux, Solaris, Cisco and Alteon System informantion interface types. - This information is also tracked via AD so you will be notified of any change. - Sponsored by: John Wagrowski of Moraine Valley Community College - - - UPS MIB support, this should enable support for the Riello UPS or any other that implements the UPSMIB. - Sponsored by: Novikmec Jozef of Zentiva - - - Linux IPTables Chain support. This Interface type will graph the IPTables build-in chains bytes and packets. - By: Hans Peter Dittler - - - Cisco BGP Neighbor Routes graphing. This will only work with Cisco IOS version 12.0(26)S or later. - Request and info from: Fabiano Rodrigo Boscatto and Jade JDeane@sungardfutures |d|o|t| com - - - Cisco PIX support, Number of connections graph included. - By: Mario Spendier - - - Windows SNMP Informant Logical Disk Interface Type, offer Windows Disk Usage stats. - by: David Lima - - - Cisco NAT support, Active Binds and Input/Output packets graph by protocol (UDP, TCP, ICMP, Others). - By: Karl S |d|o|t| Hagen - - - Support for PHP snmp2_* functions. - By: Karl S |d|o|t| Hagen - - - The host_information discovery script now tries to discovery how many CPUs the host has. - - - Added Alarmed Hosts & Events to the Default View profile option values. - - - Added PIX Event and PIX Port to the PIX filter - - - Added Cisco ISDN Syslog Events - Requested by: Roberto Veiga - - - Included the "simple" discovery script, takes a Test OID and an interface name as parameter and returns an interface - if the OID is available. - - - Compaq Temperature Graph can be displayed in Fahrenheit now - Requested by: Chad Markley - -*Fixes: - - - Start Page alarms now exclude the hidden interfaces, so now the number matches what is seen in the interfaces screen. - Reported by: Chris Hammond - - - Rechability interface information is correctly tracked now if the Host IP changes. - Reported by: Travis Johnson - - - The cpu_util no longer users the number of cpus to scale the graph, since the only ones using this are the Cisco System Info, - and the Windows System info, which we do an average of the CPU usage of all the CPUs, so the MAX is still 100%. - Reported by: David Lima - - - The jffnms-snmp system (for tc and iptables) now uses the pass_persist call in snmpd.conf please re check your configuration. - Reported by: Hans Peter Dittler - - - SNMPv2 GET now handles multi-line strings correctly. - Reported by: Manoj Khabe - - - is_process_running() function now works fine on BSDs, changed "ps -eo args" to "ps axo args". - Fixed by: Chris Cappuccio - - - Disabled ordering in edit mode. - - - Triggers Users filter by user when used by a User Admin. - - - Trigger analizer now again honors the default "from" field from the trigger definition, if the trigger action parameter is not set. - - - PIX Syslog messages should match better now, removed the ^ in the regexps - Reported by: GuruLeeNyc - - - Its now possible to ack a lot of events with one click. - Reported by: GuruLeeNyc - - - Alteon Polling and Syslog Fixes - By: Craig Small - - - Poller2 and NAD now work with PostgreSQL. - - - Zone and Map trigger fields work again. - Reported by: Karl S |d|o|t| Hagen - - - Windows Security events work better now. - Reported By: Brian Hoban Fixed by: LIMA David - -JFFNMS 0.8.1 Released 2005-03-07 -================================ - -*New Features: - - - New View: Alarmed Hosts & Events. It will only show the alarmed hosts screen and the events frame. - - - Windows Syslog Install Guide - by: Ruud Hop - - - Added 2 - 24 hours Poller Interval options. - Requested by: Jade - - - Added Link to the Aggregated graph, useful to show only that. - - - Added Host Name to the State Reports screen. - Requested by: Mario Spendier - -*Fixes: - - - The events_latest_max config option is back, this was causing slowdowns in the events screen. - Reported by: Travis Johnson - - - Syslog matching of messages that contain the work "Unknown" now works again. - Reported by: David Lima - - - New Poller now polls the host in order to avoid gaps in the graphs when using a low number of threads, - starts threads in groups of 5 so it can start working earlier and there were some speedups in the - next-host-to-poll finder. - Reported by: Travis Johnson - - - User deletion works again. - Reported by: Thomas Mangin - - - Logged in Customers can use the calendar page now. - Reported by: ChakraPani - - - Physical interfaces now show the correct bandwidth instead of 128k, - it was caused by a parsing error in the snmp response. - Reported by: Balu - - - Matching of Client for Events Triggers now works. - Fixed by: Hans Peter Dittler - - - Logging file name fixed when using logger() from a web page. Now we use $_SERVER["SCRIPT_NAME"]. - Reported by: Eugene Turovsky & Min Qiu - - - Removed Totals section from the Aggregated Traffic graph, because its giving real values. - Reported by: Eugene Turovsky - - - Remove the SNMPv2c option if we're running on a Windows Host, because there is no support for SNMPv2 on it. - - - Events and Map refresh intervals from the User Profile work again. - Reported by: Renegade - - - Titles with \r\n were causing problems in the RRD Graphs. - Reported by: Chris Zimmerman - - - Using lots of interfaces in the DHTML maps were generating a long scroll, - now they go to a new row at the end of the visible screen. - Reported by: Jason Humes - - - SNMPv2 SETs were not returning a bool value and causing problems with CISCO Ping-MIB. - Reported by: Jose Amengual & Javier Reyes - - - Cisco SYSMIB config transfer had a very, very long timeout. Now it waits around 4 to 8 seconds. - Reported by: Johan - - - Fixed Cisco SAA Agent poller to work correctly with the new SNMP API. - Reported by: Jose Amengual & Javier Reyes - - -JFFNMS 0.8.0 Released 2005-02-15 -================================ - -*New Features: - - .API: - ----- - - - New Launcher thread manager, its a generic way to handle item processing to child process, - while keeping the load down. It will launch a fixed number of threads and send them work. - Requested by: Travis Johnson - - - New Poller using the new launcher. (poller2.php) - Its simpler than the old poller (which is kept for some features like DMII and Satellite that are - not implemented here). This is still experimental and only works in Unix. - - - Network Autodiscovery. - Allows you to add 1 or more seed networks and snmp communities to a zone, and when the daemon runs, - it will discover the devices in that network and in attached networks. This is very useful to add - a lot of hosts easily. Experimental Too. - - - Support for SNMPv2 and SNMPv3, Including 64 bits counters. - For SNMPv1 and SNMPv3 we are using the integrated PHP functions and for SNMPv2 we are calling the - net-snmp executables (snmpget, snmpwalk and snmpset) that is a little slow, but it works. - When using SNMPv2 or v3, the 64 bit OIDs will be used automatically for input and output, - bytes and packet coutners. - Requested by: A lot of people - - - New Backend Configuration Format, uses one defaults file (conf/jffnms.conf.defaults) and - one user-config file (conf/jffnms.conf) for easier automated upgrades. - JFFNMS should automatically upgrade from the old config system (conf/config.ini) to the new format. - Requested by: Craig Small - - - APC UPS Monitoring: Autodiscovery, Status Alerts, Load, Capacity, Voltage (in/out), Time Remaining and Temperature Graphs. - Requested by: Travis Johnson and Novikmec Jozef - - - Nth Percentile graphing support. (Like 95th percentile graphing). - This is configured per-interfaces and allows you to specify the Nth percentil you want. - A New line will be shown in the traffic graph. - Requested by: Richard Sears and Paul Matuszewski - - - Alteon AD3 monitoring - Monitors system, real and virtual servers and real services, Graphs for bytes, session rate and current value, - Alarms when servers or services go down, Fixes problem with physical ports all having the same name. - By: Craig Small - - - Brocade Fibre Switch monitoring - Monitors temperature and fan sensors, Graphs temperature or fan speed, Monitors FC ports, - Graphs traffic by bits or frames. - By: Craig Small - - - Cisco AS 5300 - Count the number of Async or DSX1 lines used by an access switch removing the D channel. - Should work with all Cisco Routers with an E1/T1 connection to a Telco. - By: Thomas Mangin - - - New SQL Query Interface Type. - It uses ODBC to query any database and graph the number of rows returned by the specified query. - Also includes Min/Max limit alerting. - Requested by: Daniel Afonso - - - New Interfaces Autodiscovery using the new launcher, replaced the old autodiscovery under the same name, all features re-implemented. - - - Managed RRDtool: one RRDtool process is called by each poller and we use the open connection to multiple operations, - reducing the fork load. Only works on Unix. - - - New Host fields: Creation, Modification, Last Poll Date and Last Poll duration Time, useful for debugging. - - - Cisco PIX syslog events matching and filtering. - By: David Lima - - .GUI: - ----- - - - Complete GUI redesign using HTML 4.01 and CSS, known as DHTML. - - If you want to modify how JFFNMS looks you can use your own CSS file, check the 'Custom CSS' Setup option. - - Too many changes to describe them all, you have to see them for yourself. - - - New Logo - - - Interface Selector: we now use a popup system to show the selected group interfaces, making it possible - to select some interfaces from more than one group at the same time. Its also hiddable. - And when in Customer or Map Filtered mode, you can still select by host. - - Requested by: Craig Small , Jason Humes , and others |d|o|t| - - - Faster Tools system, now will need to ask for a specific or specifics values, no more load-all-on-start. - Requested by: TIBA Staff - - - New Standard Administration Features: - - Add without insert - - Discard Save - - Export to ASCII Table - - Filter by Field - - Sort by Field - - - New Administration Menu - Now its vertical on the right side of the screen, and its hiddable. - - - View Type (DHTML, text, etc) saved in a Session Cookie. - So it will keep your selection until you change it or you logout, and it will get back to your default. - Requested By: falz - - - Option to hide a complete Zone from the interfaces view. - Requested by: Chris Hammond - - - Events ACK, now its easier, just click on the blinking red dot. - - - View Performance: - - CSV Export of the Input/Output value on Physical interfaces, including Nth percentile calculation. - - Allows hidding of the options box so you will get more space. - - - Better Events RSS output, now its RSS 2.0, tests with Mozilla Live Bookmarks - Used as: http://yourserver/jffnms/events.php?view_type=rss&user=admin&pass=admin - - .DOC: - ----- - - - New UNIX Install Instructions using a 'jffnms' user, that way we don't need the system crontab anymore. - -*Fixed Bugs: - - - Interface Map sort order fixed, using SORT_NUMERIC for the interface field now. - Reported by: Kelly Hamlin - - - Events Interface Filter, now matches *INTERFACE instead of *INTERFACE* - Reported by: Durga Prasad - - - Reachablity interface now works when using a host with : in the IP (useful for snmp agents on different ports). - Reported By: Manoj Khabe - - - IF-MIB discovery now works when the host IP is a DNS name. - Reported by: David Lima - - - Setup screen works correctly under SSL now. - - - Windows Event Log Syslog events fixes. - By: David Lima - - - Fixed NTP poller bug when you have a Stratum 0 device connected locally. - Reported By: Karl S |d|o|t| Hagen - - - Cisco SEC-6-IPACCESSLOGDP syslog rule fixed. - By: Craig Small - - - Maps order fixed. Now its by Map Name, not ID. - Reported by: Kelly Hamlin - - - Better Linux Syslog matching. - With help from: Craig Small - - - Removed Consolidate Events->Alarms item limit. - - - Syslog message matching fixes: now its case-insensitive and has better handling of old/simple match strings, and - has better handling of not-matching hosts. - - - NTP discovery and poller do not output errors now. - - - Removed support for old UCD-SNMP 4.x - - - Old experimental poller removed. - - - Apache Poller now works with Apache 1.3.x - - - Fixed CatOS interface naming - Reported by: falz - - - IOS Configuration now skips the ntp clock-period line. - By: Craig Small - - - RRDtool Number of DS - - -JFFNMS 0.7.9 Released 2004-09-21 -================================ - -*New Features: - - - Support for PHP5 - I've been testing on PHP 5.0.1 and everything I tried works. - *** Please report any warnings or errors you may get *** - - - Support for CatOS, Cisco Catalyst Switch. - Now you will see the correct interface names and descriptions. - Idea/Sample Code by: Perry Lewis - - - Apache /server-status? Monitoring. - You need to enable mod_status.so with permission to access from the JFFNMS server. - Will autodiscover the server on port 80, and allow for manual add for other ports. - Graphs for: Hits (with aggregation), Bytes transfered (with aggregation), - Bytes per Request, CPU Load and Uptime, Busy/Idle Workers. - By: Robert St Denis - - - IIS (Internet Information Server) Monitoring. - Graphs for: Bytes Received, CGI Requests, Files Sents, number of GETs and POSTs. - By: Robert St Denis - - - Compaq Insight Manager Monitoring. - Will allow you to monitor fan, temperature and disks on Compaq/HP servers. - By: Craig Small - - - Livingston Portmaster Serial Port Monitoring. - Allows you to see the general status of the ports in a graph. - By: Thomas Mangin - - - Windows EventLog Messages parsing and filter. You have to use NTSyslog. - By: David Lima - - - Windows CPU and Running Processes SLA - New 'Process Threshold' field for SLA - By: David Lima - - - Support for changing the envelope-sender in Triggers/Action emails. - New 'From' option in the trigger configuration. - Requeted/Idea by: ML - - - New Aggregation (Average) Graphs for: Cisco CPU Utilization, Linux CPU Usage and Load Avearge. - By: Robert St Denis - - - New Packets and Errors Graphs, still in development. - - - New Temperature Aggregation Graph. - By: Craig Small - - - New Manual Discovery Without PorScan (without using nmap). - Requested by: Robert St Denis - - - Interface Selector now allows to select all interfaces in the group with one click. - And also, when using the Performance Screen, to show only the Date/Graph options - before showing any graph. - Requested by: Robert St Denis - - - Added HELP link from the setup.php screen to the JFFNMS Documentation. - Documentation By: Craig Small - - - Added 'active alarm' and its start date to the alarmed interfaces infobox. - Requested by: Chris Landegent - - - Customer Selector in the Interfaces Viewer (Map Selector). - Requested by: Travis Johnson - - - Performance Viewer now allows to show only the Aggregate Graphs, - and to select all the graph types with one click. - Requested by: Robert St Denis - - - New Trigger Filter to Match by Interface name using 'Contains'. - Requested by: Chris Landegent - -*Fixed Bugs: - - - Fixed Host Screen, now it does not have filters, and when you execute an action, - it will show only the affected host. It also has a new Select Box for selecting the actions. - Reported by: Jason Humes - - - Speed in Physical Interfaces will now be correctly set for interfaces without IPs. - - - Peer IP will now be correctly shown in the RTT Graph. - Reported by: Jason Humes - - - Bandwidth information in traffic graph is now shown even if the BW is not in range - - - Temperature Graph will now work, the RRDTool DS name was bad. - Reported by: Chris Epler - - - Graph Titles are now better centered in Debian PHP/GD systems. - Reported by: Karel P Kerezman - - - RRDTool Fetch Fixes that show up on sparc are now fixed. - By: Craig Small - - - RRDTool Fetch Fixes when using RRDTool > 1.0.47 fixed (timestamp parsing problem) - Reported by: Jeff Vaneek - - - Windows Upgrade documentation now includes .exe files copying. - Reported by: BJ - - - Allow values of '0' in multi_buffer (!empty("0") is not equal to ("0"!=="")) - - - BGP Peers now use the Remote Neighbor IP as the Index field. - - - HostMIB Applications now use the process name as the Index field, no need for hashes now. - - - Traffic Aggregation Graph now includes Totals. - By: Robert St Denis - - - Linux/Unix Net-SNMP CPU Usage graph now does averaging on devices with more than 1 CPU. - By: Robert St Denis - - - When evaluating if we are going to store a new TFTP dowloaded config, don't escape the ' - - - Better SNMP Trap RegExp - By: Nistor Lubomir - - - Interface values are now trimmed, to avoid problems. - - - Performance Viewer was not filtering by Customer when the User had a Fixed Customer. - Reported by: Johan - - - Performance Viewer nows has a JavaScript refresh stopper (like the events screen). - - - Show Hour Control now adds the current hour:minute if not in the list. - - - Users List is now sorted by Username. - Reported by: Johan - - - Allow for interfaces with '0' as the value. (!empty("0") is not equal to ("0"!=="")) - Reported By: Craig Small - - - RootMap is now shown in the Maps screen for easy background changing. - Reported by: Kelly Hamlin - - -JFFNMS 0.7.8 Released 2004-06-21 -================================ - -*New Features: - - - Host Information discovery (Windows, Unix, etc) now gathers the SysDescr, - usually it contains the Kernel and Host name, as this field is tracked, you will now when - host changes kernels, or host name. - Requested by: Gregory Leggett - - - New general interface option to disable Status Polling completly. - This way all graph information will be polled, but status will not, not even syslog messages - for that interface. The interface upper-right corner will be gray. - Requested by: Tony Nelson & Others. - - - Application interfaces now include the Memory used by the Application, with graph. - Requested by: Doug Toombs - - - New Calendar for Reports. We're now using 'The Coolest DHTML Calendar' - from http://dynarch.com/mishoo/calendar.epl , Behavior is better now. - - - Profile Option to disable DHTML informational boxes. - Requested by: Travis Johnson - - - Profile option to restric interface viewing by customer, much like the Base Map option. - Requested by: Travis Johnson - - - New Trigger field to match by Map. - Requested by: Alexandru Thomae - - - New Trigger Field to match by Customer. - Requested by: Travis Johnson - - - UDP Port Monitoring, much like the TCP, but we use NMAP for testing, because it gives better results. - Based on design by: Yery Tannus - - - New Option to show the temperature in Farenheit - Requested by: Travis Johnson - - - Added Mask to the Physical Interfaces options. - - - New AD Policy option to don't alert if an interface is not in host (deletion). - - - New Poller for easier handling Status MIB variables. - by: Craig Small - - - Add 'nolog' to the autodiscovery_interfaces to avoid creation of events, useful for debugging. - -*Fixed Bugs: - - - Marked Disabled interfaces now don't count in the Status of a host in the Hosts Screen. - Requested by: Chris Tuska - - - Easier event ACK'd now works as it should have been in 0.7.7 - Reported by: Thomas Mangin - - - Syslog Consolidator works again with the * and D variables. - Reported by: Mario Spendier - - - Session locking bug, now JFFNMS GUI should feel a lot faster. - - - Event Filter fixes. - Reported by: Chris Landegent - - - TCP Connections tool fixes. - Reported by: Thomas Mangin - - - NTP fixes. - Reported by: Thomas Mangin - - - Popups & MiniSLA deprecated. No one used them. - - - Interfaces are now sorted using Natural Sort, this will make finding an interface by name easier. - - - Better Filter behavior on the Hosts Screen. - - - AD Output now includes the Interface Name. - - - SNMP Counter function now removes the ( and ) characters from output. - - - DOC: Windows Install, added creation of c:\tmp folder - - -JFFNMS 0.7.7 Released 2004-04-05 -================================ - -*New Features: - - - New Login Screen, a new DHTML login screen, is selectable from the setup. - You can also add a logo to the page. This new method uses sessions/cookies to store a session id, - and internall is faster because we don't have to auth in every page request, which made some IDS ring. - An event is created when a user tries to login successfully or not. - - Old method (HTTP AUTH) is still there, and will continue to be supported. - - - New Tools Framework. - This system allows changes to be made to interfaces on the host. - Examples provided for Changing the Interface description and Admin Status on Routers and - to list or finish TCP connections on agents that support that feature (Cisco's TCP MIB). - - A new event (Tool Action) is generated everytime something is changed using this tools. - - - New Profile option to select which "View" Page do you want to see when you login. - - - New ToolBox Interface Alarms widget. This allows access to more pages related to the selected interface. - Like Tools, Edit, Events and Performance. This is shown when you pass over an interface in the HTML or DHTML view types. - - - New Event Type "internal" for JFFNMS related events. Also added a new option to hide the Host Name in the events viewer. - This event is used by the new Login Screen. - - - 'Or' Type matching for Triggers. - Requested by: Alexandru Thomae - - - Poller, Autodiscovery, and Satellite Distribution now verifies that no other process with the same name are running. - To avoid duplicate processes. This works only on Linux. - - - New Poller Helper, checks DMII and Alarmed interfaces, this allow faster UPs and faster poll of imporant interfaces. - Requested by: David Lima. - - - Alarm Backend now supports to set the time-span between down and up events, - and the value to assume (or not) when no result is given by the poller. - Also, better (human readable) return values are given. - - - RRD Backend again supports update on one DS by call. - This is to make simplier poller groups when only one value is graphed. - And also to check if performance is better than doing all the DS at the end. - - - New poller option to poll just the DMII interaces on a host. - Requested by: David Lima. - - - snmp_interfaces_status_all now checks if the host has more than 30 interfaces before doing the walk, - if it does not, then uses normal snmp_get's - - - When ACK'ing summarized events ('Message Repeated N times'), all events are now ACKd rather than just one. - Requested by: Thomas Mangin - - - Interfaces Alarm Screen now autodetects the screen width at start, so no more 'Big Screen' View types. - - - New folder ('engine/shared') to store shared code (ie. that may be required for pollers and for tools), - and a new function to call them jffnms_shared(). - - - Satellite now works with HTTPS, new https_post_message function, that uses the CURL extension. - by: Chris Landegent - - - Allow interfaces to be checked only every X minutes (N > 5), useful when used with the TCP Content Checking. - Requested by: Chris Landegent - - - Anonymous customer logins. Just define a customer with no password. - Example URL: http://youserver/jffnms/?user=customer_username&pass=&logout=1 - Requested by: Chris Tuska - - - Direct Graph download. Useful for embedding them on a site, examples: - - Get the traffic graph from one interface: - http://youserver/jffnms/view_performance.php?interace_id=332&want_graph=traffic - - - Get the Aggregation Traffic graph of a whole host: - http://youserver/jffnms/view_performance.php?host=6&want_graph=aggr&graph_type=traffic - - - Use with the Anonymous logins - http://youserver/jffnms/view_performance.php?user=customer1&pass=&logout=1&interace_id=332&want_graph=traffic - - - Syslog Consolidator has a Position parameter now, to handle the order on which the syslog RegExps are tried. - - - New Syslog Event Type to match normal linux syslog messages. - - - DOC: Added Another Example on using Syslog-NG - - - GUI: ACK'd events show differently on the Event Viewer - Requested by: Thomas Mangin - - - Storage Threshold can be configured per interface now. - Requested by: Thomas Mangin - - - Cleanup Raw tables now supports deletion of N days old Router Configs, N is controlled via setup. - Requested by: Chris Tuska - -*Fixed Bugs: - - - DOC: Fixed the documentation about the PHP trap_receiver. - - - Alarm table now allows bigger alarm_state ids. - - - Syslog Consolidator now checks for Literals. - - - Events Screen now does escaping of HTML meta-chars. - - - Removal of un-matched < > variables in events. - - - Tacacs Consolidator now checks the Normal IP too, rather than only the Tacacs IP of the host when matching. - Requested by: Thomas Mangin - - - Severity Level Filter now works again. - Reported by: David Lima - - - NTP Discovery now verifies if the Host has and IP address. - - - NTP Poller Now checks for timeouts. - - - Exp_poller now works correctly with this version. - - - Removed old snmp_interfaces_status - - - Old 'Event Tools' depreacated. It was an old code that nobody used. - - - Old perl trap_receiver depreacated. - - - GUI: Event Screen code cleanup, uses more CSS and the resulting file is smaller. - - - GUI: Better Interface Selector in the Triggers screen. - - - GUI: Better Recursive URL cleaner. - - - Manual Add is now show event if the host does not have any interface of that type. - - - We now only distribute the SQL Diffs of the past to the current version, not older files. - - - Coding Style changes and Call By Reference bugs fixed. - - -JFFNMS 0.7.6 Released 2004-02-22 -================================ - -*New Features: - - - TCP Port Content (port response or URL content) can be checked against a Regular Expression to validate it. - Requested by: Richard Sears - - - Manual Add of TCP Ports, now its possible to add any port number you want manually, - or to set up the same port a more than one time with different testing Regular Expressions. - - - CPU Usage and Load Average SLA for Linux Hosts. - - - CPU and Memory Usage SLA for Cisco Routers. - - - Graphing of the number of Application Instances. - - - NTP syncronization testing, it reports when a NTP server is syncronized or not to another peer. (it requires the ntpq program) - - - GUI: Added New "only when filtering" option to Event Types, to better manage its showing. - Requested by: David Lima - - - GUI: New DHTML View Type for Interfaces and Hosts, it doesn't use png's anymore for the boxes, its all CSS and JavaScript, - Tested with Mozilla/Firebird/Firefox on Linux and Windows, and with Internet Explorer 5.0 and 6.0 - - - GUI: New option to disable refresh on the Interfaces/Hosts Screens. - Requested by: Lucas Iglesias - - - GUI: New option to diable the refresh of the Events Screen more easily. - Click on the 'round arrows' icon to stop the refreshing, and click on the 'page refresh' to enable it again. - - - GUI: Faster event Acknowlodge, without selecting a Journal. - Requested by: Aaron Aubman - - - New Physical Interface option to avoid the automatic Admin Status modifications. - When you mark "Fixed Admin Status" the show type of the interface (Show, Mark Disable, Don't show) will no be modified by the poller. - The Default is not checked, so the poller will automatically modify the Admin Status/View Type of the interface. - - - New trap_receiver coded in PHP, now you can use the trap functions with postgresql, because it uses the JFFNMS DB abstraction. - by: Aaron Aubman - - - New Way to use Satellites "Local Master", this means the Satellite will poll the values, store them locally AND send it to the master too. - Requested by: Juan Rojas - - - Added Interface Type to the list of Trigger Rules Fields, to match by the interface type. - Requested by: Ray Hatch - - - API: Its now possible to poll more than one interface on the same host via the command line (ie for testing) - - - API: Added option to use HTTP/1.0 or HTTP/1.1 in HTTP queries - - - API: The jffnms-snmp system (plugin's for net-snmp) now caches its response for one minute to ease the load on the server. - - - API: Its now possible to setup Default SLAs per interface type - - - GUI: Double Clicking on a Graph Type on the Performance Screen, will show it without needing to click on the 'View' Button. - - - GUI: Its now possible to select a Default View type in the User profile (ie Normal, Text, etc). - - - GUI: New button in the top frame to reload the current selected view - Requested by: Thomas Mangin - - - DOC: msyslog & SLA configuration example documentation - by: Chirstian Zimmerman - -*Fixed Bugs: - - - Dates in graphs are checked to be sure they are valid. - - - BGP Verify Number poller removed, its no longer needed. - - - When adding a new interface from Manual Discovery, the interfaces screen now its correctly positioned. - Reported by: Ray Hatch - - - Autodiscovery and RRD Analyzer now check the "poll" option in the interface and the host they are working on. - - - Last Poll Date is now handled as an added poller/backend because it shares the same structure. (its now injected from poller_plan) - - - Cosmetic Changes to Config Transfer Types, and Autodiscovery Policy - Requested by: Thomas Mangin - - - Performance Graph Title was badly calculated. - Reported by: Pierre-Damien Gatouillat - - - Autodiscovery now checks if the host is localy managed or satellite, this way AD only runs over the hosts this Satellite manages. - - - Changed some Satellite Calling functions to make correct use of the 'params' field. - - - Interface Type RRA Structure now included in the default field values. - - - Fixed handling of & and | in the Satellite Query content. - - - Customer Username can now be 60 characters long - Requested by: Thomas Mangin - - -JFFNMS 0.7.5 Released 2003-12-16 -================================ - -*New Features: - - - Per Interface-Type Fields: - - Until now every interface had the same fields, for some interface types this was ok, but others required more or different fields, - so this new feature allows different fields per interface type. - ie: Linux TC now has Rate and Ceil fields, and its not using the BW in/out fields, TCP Ports don't have IP address or BW, etc. - - This was one of the big "barriers" in the internal design of JFFNMS, so I'm glad I finally made it configurable/modular. - - - DB: 3 new tables: interface_types_fields, interface_types_field_types, and interface_values - - GUI: Manual Discovery has a new layout and includes all the specific interface fields. - - GUI: View Interfaces shows all the 'description' fields and has a better text layout - - API: interfaces_update updates every interface value not just the interfaces table. - - API: Events Text now can include any interface type specific fields - - API: Poller Parameters can include any interface type specific fields - - - AD Tracked Fields are set from the Interface Type Fields. - - SLA: now you can use SLA expressions with the name of each interface type specific field - - - Changed all discovery, poller and backend scripts to use the new and specific fields, ie: - - - ALL: changed 'descr' fields to 'description' - - Physical: Pings to Send configurable per interface - - BGP: Separated field for Local IP , Remote IP and ASN values. - - Applications: Number of Instanses stored in DB. - - Linux TC: Specific Ceil and Rate fields. - - Storage: Specific Size Field (it was bandwidth before) - - TCP: Check content option now allows for a specific URL to be included - - Reachability: Now you can configure the fping parameters per interface - - Verify Interface Number Backend now uses specific Index Field. - - RRD Backend gets the RRD Structure from the Interface Type Fields. - - Important Notes: - ---------------- - - * If you have "custom" interface types, please read the UPGRADE file carefully - - * By default we not 'track' the network interface's description via autodiscovery, so if you don't want to loose - your custom interface descriptions, please disable the field tracking via the Polling & Discovery=>Interface Types Screen. - - - All AD changes to an interface are summarized on one event. - - - Cleanup old Events and Alarms integrated to cleanup_raw_tables. - - the number of days is configurable via setup.php (Defaults to 7 Days of Raw Events, and 60 Days of Normal Events/Alarms) - - We try to repair the tables using a REPAIR/OPTIMIZE or VACUUM command at the end. This is to avoid index problems. - - - Per Host 'Polling Enabled' Option to disallow polling of all host interfaces more easily. - Requested by: Richard Sears - - - Host View option now acts over the View option of its interfaces, so if the Host is in Don't show or Mark Disabled, it will look as - all its interfaces where in the same state. - Reqiested by: Richard Sears - - - Experimental Poller (for networks with a lot of hosts) - A new polling system that keeps a number of pollers running, and distributed the polling load by interface to them. - This allow us to poll a lot of hosts without the problems of lauching one poller for each host. This is still experimental, don't use - it yet for production enviorments. It Requires the SHMOP and PCNTL PHP Modules to work. - By: Anders Karlsson - - - RRD_Analyzer: SLA is now a seprated analyzer, this mimics all other plugin scripts, SLA still the only one implemented. - - - When a Network Interface (IFMIB) has AdminStatus 'down', it will be set to 'Mark Disabled' automatically, - also when the interface is back in AdminStatus 'up', it will be set to 'Show'. - Requested by: Richard Sears - - - GUI: Interface Viewer (Status Map) now includes a link to the interface editor - - - GUI: Graph legends now include the Site Name. - - - GUI: Alarmed Interfaces view now includes the Host Name of the interfaces in a new line - Requested by: Chris Landegent - - - GUI: When inside a Host in the Interface Viewer, clicking on the "card" (gray) box will show all the graph for that interface type - - - GUI: Added the Current and Last Polled Date to the Performance Viewer - Requested by: Smith Chen - - - API: Added fetch_ds() method to the interfaces class, to allow an RRDTool Fetch remotely. - - - API: Temporal Buffer Backend supports calling the same variable more than once, until it has a value. - - - API: Poller Plan now allows to filter by type - - - API: Interfaces_Add can use an array as parameter to define more than the host_id of the new record, but only interface table fields - - - UTILS: Added Debug option to jffnms-snmp, to check the output tree. - -*Fixes: - - - Linux TC regexp fix to allow leaf and prio options - By: Craig Small - - - Better Autodiscovery Output with specific interface type fields. - - - Better Handling of subinterfaces (VLAN, FrameRelay, etc) - - - Removed some 'extract()' calls in graph's that were not needed. - - - Added more colors to the TC Aggregation Graph. - - - Added more descriptive names to 'View' options in Administration - - - Windows CPU Polling now doing a walk of the CPUs tree to get the avarage usage of all processors - Report and Fix Concept by: Chen from Taiwan - - - Zone filter now works again. - - - Don't Discover the Reachability Interface if the fping executable is not set-uid. - - - Fix fping response when the IP is in the local subnet and its unreachable (read the last line) - Reported by: Ben Lentz - - - Cisco MAC Accounting Interfaces now include a unique indentifier. - - - BGP4 MIB implementation fixes, the index is now better calculated to be unique, so no AD problems occur. - - - Alarm Editor is back (under Internal Configuration=>Reports) - Requested by: Rob Laidlaw - - - Fixes SMS Client action message creation to include the interface data, and to trim the message to 140 chars. - Reported/Fixed by: Ben Lentz & Yuri Krichevsky - - - Maps List is now in a Select box, because if you have a lot of maps, or long names, you loose the View Types section. - - - API:DB some internal modifications, query doesn't die on failure, it tries 5 times, then it returns, but it doesn't die. - - - API:Satellite - - WDDX Fixes - - Import/Export (distribution) now also updates records on changes, not just deletes and inserts a new one - - - Setup: don't allow " ' & | # = / characters in the fields (SF BUG 841139) - Requested by: Mark Burdick - - - Cisco CPU Poller now uses the 5 Minutes CPU utilization, rather than the 1 min OID (SF BUG 841140) - Requested by: Mark Burdick - - -JFFNMS 0.7.4 Released 2003-10-13 -================================ - -*New Features: - - - Reachability Interface Type - Using fping (http://www.fping.com) we can now monitor hosts via ICMP (ping) and graph the RTT and PL from - the JFFNMS server. It also issues events when the PL is over a treshold. This plugin will not work on Windows. - Requested by: a lot of people. - - - Linux Traffic Control (tc) Support - Using our own net-snmp extension (pass-type) installed on the Shaper Box you can see each Class Bandwith Usage, - including aggregation to view all usages on the same graph. Tested only with HBT. - Scripts and example configuration in docs/utils/jffnms-snmp/ . - - - Configurable Interface Field Tracking. - Now is possible to track other interface fields rather than the name, for example the description. - Added BGP Description Tracking. - Requested by: Richard Sears - - - TCP Content Checking. - The TCP Poller now also check for a valid response in HTTP/HTTPS/FTP/FTPS ports using fopen(). - Until we get Per Interface Type Fields, configuration is done via the description field. - ie: http|/jffnms/admin/adm/test.php - ie: ftp://testuser:testpass@|/test.txt - ie: https|/jffnms/admin/adm/test.php - - 'http' tells the poller to use the HTTP protocol and whats after the | specifies a page rather than the default (/). - - Requested by: Richard Sears - - - Added the SNMP Auth Failed Trap. - - - Added Acknowlodge Field to Express Filter. - Requested by: Craig Small - - - Added Creation, Modification and Last Poll Time Stamps to the Interfaces table. - All this information is useful when looking for something wrong. - - - Trigger rule to match the ongoing duration of active alarms (includes new consolidator process). - By: Anders Karlsson - - - News Section included in the Start Page. - - - Support Client Only in Satellites (just incoming queries). - - - Added Example on how to use Satellites, in docs/utils/satellite-client.php - - - Better support for Juniper Routers (Based on M20): Consolidate Interface List and LowerLayerDown Support. - Requested by: Richard Sears - -*Fixes: - - - Added BASE64 Encoding to API:rrd_grapher() and BASE64 Decoding to GUI:performance_graph() - - - When No Zone Image is configured the Events screen doesn't try to show it. - - - When no interfaces were alarmed the 'Alarmed Interfaces' View showed all interfaces, now its fixed. - Reported by: Kevin R. Armstrong - - - RRDTool Graph now returns the real result of the command. - Reported by: Anders Karlsson - - - Fixes to poller_plan_next to replace all poller parameters - - - Problem with changing Fullname or Router Access to User, now its not needed to re-enter the password - - - Support WDDX over TCP in Satellites. - - - RRD Files are now (back again) deleted when the interface is deleted. - - - Now we check if allow_url_fopen is set to On in setup. - - - Changed JFFNMS URL to http://www.jffnms.org - - - Fixed Input Error Rate Graph and SLA calculations (Total Input Packets = Input Packets + Input Errors) - - - API:DB added db_free function - By: Anders Karlsson - - - Make sure most public API functions return some value (breaks satellize otherwise). - - - More separation between API and GUI code. - - - Discovery_none script now doesn't return an error, just an empty list, to use when a new interface type does not have a discovery system. - Requested by: Craig Small - - - New Database entries on system tables start with id 10000 from now on, so we can add more things without interfering with - user-created internal configurations, like new Interface Types - - -JFFNMS 0.7.3 Released 2003-08-02 -================================ - -*New Features: - - - Host Config Downloader Rewrite: - Modular, More Secure and Better Error Reporting (via log, event and alarm) - by: Javier Szyszlican Ideas from: Michael Samuel - - - GUI: Performance Viewer: Added 'Last 2 Days' to Time Span Options, Multiple Graph Selector, Graph Scale Legend included in IMG ALT - Requested by: Juan Rojas (TIBA) by: Javier Szyszlican - - - SMS via Mail Action: Modified Email Action for shorter messages. - Requested by: Michael Orth by: Javier Szyszlican - - - SMS via Modem Action: send SMS via modem with SMSClient (http://www.smsclient.org/) - by: Craig Small - - - GUI: Interface Viewer Reworked and Modularized: - - View Interfaces, View Hosts and View Maps use the the same engine (but different sources), - this also means that you can now view Hosts and Maps in Text Mode also. - - 'Performance View' is nicer now, and it can also use dynmap. - - 'Text View' now shows all the links and it has a better layout - - - Temp Files Cleanup Script for Unix - by: Kovacs Andrei - - - Get Interfaces (Manual Discovery): Show Interfaces not found in Host but found in the DB. - - - Support for Cisco Catalyst Config Download - Thanks to and Requested by: Paul Stewart by: Javier Szyszlican - - - Logging is disbled by default, and the files now don't have the date in their name. - - - New Engine Temp Folder, to store Engine (poller, autodiscovery, etc.) Temporary Files. - - - TCP Port Discovery now uses the New Engine Temp Folder. - - - API: Graph handling was put in the engine, and a wrapper function (performance_graph in GUI) was created. - Now graphs are stored in the Engine Temp folder, read, deleted, and returned as a variable to the GUI, which - stores it in Temp Graph Folder and allows the browser to see it. - - - GUI: Some Graphs now show the 'In / Out Flipped' Legend, to let the user know the graph Input and Output are inverted. - Requested by: Juan Rojas (TIBA) by: Javier Szyszlican - - - SNMPTraps: the traps consolidator now supports placing literal data in the SNMP Trap Rules screen (like 'down' in the State field) - Also some rewrite of the code, and handling of Up's and Down's in numeric mode - - - GUI: Behavior Change, if the Events Frame does not exists (ie. Hosts, Maps, Interfaces WITHOUT Events) don't display a new window. - Requested by: Rob Laidlaw - -*Fixed Bugs: - - - Fixed TCP Port Discovery to only return Open TCP Ports, because Validate in AD is unchecked for feature reasons. - Reported by: Daryl G. Jurbala by: Javier Szyszlican - - - Changed Cisco EnvMIB Discovery (Voltage, PowerSupply, Temperature) to check for status, and - to give a more generic Interface Name - Reported by: Daryl G. Jurbala by: Javier Szyszlican - - - Fixed Customer Login when JFFNMS is installed in the Document Root (relative path /) - Reported by: Brian Watters - - - Fixed Storage Interface Type to return the Device Type String from hard-coded values if the MIB doesn't include them (return OIDs is set). - - - Fixed Host Information Interface Type to convert 'enterprises' to its OID when comparing (return OIDs is set). - - - Smokeping Internal Number Tracking Fixes - by: Craig Small - - - Don't send the Alarm's 'Date Stop' Field on a Down Alarm in Email Action - - - PgSQL 7.3 fix in UnAck Filter (changed '' for 0) - - - PgSQL 7.3 fix in insert_alarm, don't include zero-lenght string for referer_stop - - - PgSQL fixes (changed " for ') in interface_filter and cleanup_raw_tables - - - Fixed TCP Number of Connections Poller for use with NET-SNMP (not absolute OIDs in the returned array key) - - - Physical Interfaces Discovery now puts the correct Name for Cisco VLAN Interfaces (IOS 12.2.16b) - Reported by: Lucas Iglesias (TIBA) by: Javier Szyszlican - - - Autodiscovery now informs the New Interface Name when the AD Policy dont allow the name to be changed - - - Fixed Physical Interfaces Status Pollers and Discovery to not depend on the MIBs values - - - Packets Graph does not use the Flip Graph option anymore. - - - Fixed interface_shortname_and_card() to manage a new case when the interface[pos] is not numeric for Cisco ENVMIB - - - snmp_get now tries 2 times to get the requested data. - - - GUI: Administration Menu Internal Code and Organization reworked. - - - GUI: First,Prev,Next,3Next Options Menu now is fixed size, the options don't change places. - Requested by: Alejandro Alvarez (TIBA) - - - Fixed crypt() usage in Authentication - Reported by: Michael Samuel - - - Internal Messages Framework Deprecated. - - - Disabled the TIBA TT plugin. You have to write your own TT plugins. - - - Fixed more NET-SNMP returned values handling - - - Fixed most of the functions that use the DB from the GUI, only 2 left. Added more API Classes, and fixed others. - - - Cleanup of unused GUI functions (due to the migration to API Classes) - - - Check if the DB module is loaded before testing the connection for setup in db_test. - - - DOCS: Fixes and additions to the Windows Install Procedure, also start of the Windows Upgrade Procedure. - By: James Swart - - - Zone Image (flag) is not longer Required, now is optional. - - -JFFNMS 0.7.2 Released 2003-05-27 -================================ - -*New Features: - - Cisco Temperature (with graph), Voltage and Power Supply Monitoring. - By: Anders Karlsson - - - Internal: Support for more alarm_states, now pollers and events can return any state value - Already Implemented for tcp poller (up,down) and Applications (running, not running) - Requested: Anders Karlsson - - - Internal: the Alarm Backend can get extra info from the poller with | as the separator - to include it as the info of a new event. - - - Cisco SA Agent (Service Assurance) (Round Trip Latency, Jitter and Packet Loss) - By: Anders Karlsson - - - The TCP Poller now tries to read 1 second of data from the open socket to report it in the events. - - - New Autodiscovery Policy to allow adding of interfaces without checking if they have an IP Address (for Switches) - - - NetSNMP Agents added to UCD-SNMP System Interface Type - - - Physical Interface Status is now gathered with a new poller which stores all the table and then processes it. - By: Anders Karlsson - - - Added in-development tools, an mib parser and an sql update generator (internal) - - - Added InfoBox explaining the alarms in the Hosts View. - - - Hosts now can be hidden or marked disabled like interfaces (to hide old routers) - - - Added Refresh link to the menu interfaces list. - - - New Mailing List Archives at: http://marc.theaimsgroup.com/?l=jffnms-users - - - Added Storage Aggregation (All Selected Storage Interfaces in the same graph) - - - Storage SLA alerts when the Used Space is more than 80%, its autoselected on every new Storage Interface. - By: Dan Ratzlaff - - - Satellites understands SOAP, you can talk SOAP with the satellite.php to call any method of any class. - - -*Fixed Bugs: - - - State Report didn't show correctly the duration of alarms which lasted more than 24hs. - Reported: Kevin R. Armstrong - - - Missing Check in hosmib_apps poller caused error when the host had no snmp daemon. - Reported: Larry Burton - - - Dont show RTT/PL in state report on interfaces which don't have them. - - - Some bugfixes to allow use of net-snmp v5. - - - Modified autodiscovery_interfaces for better output and now it uses alarm_lookup to see if somethins is up or down - - - Modified the tcp_ports discovery to answer open or closed, because discovery now understands them via alarm_lookup - - - Poller Position is now included in the command line parameters when forking poller.php - Reported: Nigel A. Taylor - - - Changed Interface Types Order, for manual Discovery - - - Performance Graphs now works in paths with dots. - Reported: Peter Burgstaller - - - Autodiscovery now let you set any interface field from the discovery script's (like slas, clients, etc) - - - Autodiscovery can now be called with a second command line parameter to only discover one interface type (for debugging) - - - New Autodiscovery Policy options to check if the state is UP, and if the IP Address is valid. (both checked for all except the new policy for switches) - - - The Cisco Ping Pollers where using the old buffer, changed to the new one. - Reported: Oliver Kuhn - - - Coding Style Fixes to get SOAP working, mostly undeclared variables and constant array keys - By: Anders Karlsson - - - State Report now shows only the customer, map, type, host or interfaces selected. - Reported: Kevin R. Armstrong - - - Added Zone Image (flag) to the Hosts View. - - - Added Images of More Coutries Flags in the Full Install. - - - Modified view_interfaces card detecting code to handle ie. Tunnel0, Tunnel1 and eth0, eth1 as the same card - - - Modified 'Mark On Map' tool to show only the host of the interface in selected. - - - The syslog consolidator now checks for the host name and ip (for syslog-ng) - by: Craig Small - - - More Flexible and Clean auth.php - by: Michael Samuel - - - Customers are now allowed to see their State Report. - - - Fix possible overwriting of unavailability array. - - - Physical Interfaces Discovery and the Tacacs Consolidator didnt handle the ' character in a good way. - Reported by: Brian Watters - - - Off-by-one RRD DS Position error fixed and now we use interface_name as the file name. - By: Craig Small - - - snmp_walk now makes 2 tries to get the requested data. - - - Changed INSTALL to allow PHP CLI work correctly from crontab (Current Working Directory Problems) - - - rrd_analizer took the 0's as a value to calculate the averge causing bad readings. - Reported by: Dan Ratzlaff - - - Some Fixes to clean some alerts when viewing JFFNMS using SSL - Requested by: TIBA Staff - - - Quick/Bad Fix for the init - exim hash collition. - Reported by: Craig Small - - -JFFNMS 0.7.1 Released 2003-04-02 -================================ - -*New Features: - - - HostMIB Running Software Polling and Discovery - By: Anders Karlsson - - - Events RDF Feed availble from http:///jffnms/events.php?view_type=rdf - By: Craig Small - - - Raw tables cleanup script - By: Andrei Kovacs - - - Added Latitude/Longitude fields to Host table (for future GIS Maps) - Requested: Anders Karlsson - - - Added Filter to show only UnAck'd Events - Requested: Walter Brock - - - Added 'Default Event Filter' Profile Option - - - Added 'Events & Maps Refresh Intervals' Profile Options - Requested: Daniel Farinella - - - Documentation on how to use syslog-ng with JFFNMS. - By: Craig Small - -*Fixed Bugs: - - - strpos() haystack, needle inversion in syslog parser. - Fixed: Craig Small - - - Bad Loop in Somekping Poller - Fixed: Craig Small - - - Satellite Field is now a text label when listing in the Hosts Screen - - - Changed order of Hosts from Zone, Name to Name, Zone - Requested: Lucas Iglesias - - - Reworked interface_status its lot faster now. - Requested: Anders Karlsson - - - Added interface_count and hosts_count for speed ups. - - - Graphviz doesn't show the unknown host anymore. - - - Removed Link to old Message System from the control.php, also disabled refresh becasue it was not needed. - - - trap_reciever.pl does not mix the order of the OIDs now. Also changed the DB to reflect the real OID order. - - - Fixed trap_reciever.pl RegExp to match multi-word values in OIDs - - - Setup.php on Windows Escaped \ as \\, causing problems with RRDTool, now it replaces \\ with / - Reported: BEV - - - Added ScrollBar and Set the height of the color_select.php row to be sure of their size. - Reported: Jack Snir - - - Fixed Repeated 'control name' in select_color(), it was causing problems in IE. - Reported. Jack Snir - - - Period Can't be 0 in get_availability, changed to 1 if zero, to avoid division by zero warnings. - Reported: Andrei Kovacs - - - State Report now sets the default TO time to the actual time rather than at 00:00 today. - Reported: Andrei Kovacs - - - Customers are now allowed to see the Graph Type Chooser, until we get more flexible on what can a logged in customer do. - Requested: Alexandra Alvarado - - -JFFNMS 0.7.0 - Released 2003-03-10 -================================== - -*New Features: - - - New Syslog Message Processing System (support for RegExps and compatible with older definition) - by: Craig Small and Javier Szyszlican - - - New SNMP Traps Processing System - by: Craig Small - - - Tacacs+ Consolidator now Supports REJECT messages (minor changes also). - - - Reworked State Report - - Internal changes to use new rrdtool functions - - Time filter - - CSV Export - - - New API for some rrdtool functions to get dynamic structure changes, - this includes cleanups in all graphs and every function that uses rrdtool. - Now every DS goes on a different file like interface-999-0.rrd this is handled by the rrd_mode field - - - The Interface Map Views has been broken in pieces for the cleaness of the code. - This also helps to add a new Map View type. (htdocs/views/*) - - - New Interface Map View on SubMaps (dynmap) allows you to change the position of - the interfaces in the map and to establish connections between them. - - - Bulk Interface Add Feature in Manual "Get Interfaces" Option, it allows you to add a lot of interfaces with only a few clicks, - without using autodiscovery. - - - Designated Main Interface(s) (DMII) : You can select an interface or map of interfaces which will be the Main ones for that host, this means: - if the DMII are all down, the polling of that host other interfaces will stop, - except for the DMII (to detect the UP again), this solves a domino or 'stacking' problem when some hosts are unreachable. - Also, a new event is generated when the Polling Fails because of DMII being down. - Requested: Larry Burton - - - Added Packets Aggregation (useful to see how much packets per second your router is handling) - - - New Interface Type for Windows Hosts (Servers), Number of Users, Number of Processes, Processor Utlization, and TCP Connections Graphs - Requested: Rob Laidlaw Information: Musfa Baig Coding: Javier Szyszlican URL: http://snmpboy.msft.net/ - - - New Interface Type: Cisco MAC Accounting, Polling and Graphing (ip accounting mac input, ip accounting mac output) - This allows one graph per MAC Address giving you accounting per machine in an Ethernet Segment. Experimental, Autodiscovery Disabled. - - - Modified Linux Host Type: New Graphs and Pollers for Number of Users, Number of Processes, and TCP Connections Graph - Also Changed its name to UCD-SNMP Host, because we support FreeBSD (Need Testing) or other ucd-snmp implementations - with this Interface Type - - - Modified Cisco Host: New Graphs and Pollers for TCP Connections Graph, and Accounting - - - TCP Port Delay and Number of connections graph (aggregation too) (modified interface type) - Requested: Karlheinz Hagen - - - Smokeping Integration (RTT & PL), Discovery, SLAs, Graphs - by: Craig Small - - - Cisco IP Accouting Polling and Graphing (ip accounting output-packets) - - - If no interfaces found in Manual Discovery Show the "No Interfaces Found" Message - - - Cisco CPU SLA, SLA set to match at > 80% - Requested: Brian Watters - - - Cisco Syslog Message: ACL Match - Requested: Alexandra Alvarado - - - Cisco Syslog Message: CDP Duplex Mismatch - Requested: Alexandra Alvarado - - - Cisco Syslog BGP Notification Message - - - Added Profile option to not show the stats on the start page. - - - Added Shortcuts to go bettween View Performance, Interface Administration and State Reports - - - New FrameWork for Distributed Processing (Satellites) - Each Satellite is an jffnms in a different machine, this allows Distributed Polling for now - in the future this will allow to do syslog,trap,discovery an other in a distributed fashion. - Experimental, Needs Testing, Allows Load Balancing. - - - Added Label at the Setup to know which config file are you using - - - Added Option to Event Filter so now you can filter by Extra Info too (LIKE), useful for seaching in tacacs logs. - Requested: TIBA Staff - - - Added Options to Event Filter to NOT get a field when it matches. - - - Added the RRDTool Step value to the Interface Type options. - This is used when creating a new rrd file. - - - Added a Favicon icon and some HTML meta tags. - - - Setup.php now checks for Register_Globals to be set to On - - - Added RRDTool Dump & Restore functions to API - -*Fixed bugs: - - - Wrong Query date compare in interfaces_status (typo from postgres changes) - Reported: Stanislav Gaydukov Fixed: Javier Szyszlican - - - RRDTool Fetch Speedups (it was using too much memory) - Reported: Juan Rojas Fixed: Javier Szyszlican - - - Verify length of info field in insert_event - Reported: Alejandro Alvarez Fixed: Javier Szyszlican - - - Better handling of LIMIT on a pgsql query - Reported: Alejandro Alvarez Fixed: Javier Szyszlican - - - Field type of interfaces.host was tinyint, now changed to int. (it was a typo) - Reported: Kevin R. Armstrong Fixed: Kevin R. Armstrong - - - The Maps Interfaces GUI type changer didn't work right on Mozilla - Reported: Javier Szyszlican Fixed: Javier Szyszlican - - - The Path of the TFTP windows .bat file was wrong. - Reported: Gregory A. Leggett Jr.Fixed: Gregory A. Leggett Jr. - - - If no tcp ports were found on a host, the Manual discovery showed garbage - Reported: Javier Szyszlican Fixed: Javier Szyszlican - - - Sounds where not working on the view_interfaces.php (Main Map). - Reported: Javier Szyszlican Fixed: Javier Szyszlican - - - Off by 1 error didn't show events if only one is found. - Reported: Javier Szyszlican Fixed: Javier Szyszlican - - - Events View All Option didnt show all the events. - Reported: Juan Rojas Fixed: Javier Szyszlican - - - SQL LIMIT and OFFSET doesnt accept numbers with decimals, now rounded. - Reported: Javier Szyszlican Fixed: Javier Szyszlican - - - State Report showed dates in Seconds, now in Hours:Minutes:Seconds - Reported: Javier Szyszlican Fixed: Javier Szyszlican - - - State Report did wrong math in Total Values - Reported: Javier Szyszlican Fixed: Javier Szyszlican - - - Java Map was deprecated. - - - Availability Report was deprecated in favor of the State Report. - - - Fixed SLA Processor (rrd_analizer) to take care of one line SLA's - Reported: Brian Watters Fixed: Javier Szyszlican - - - Fixed Event Filter to Allow Search of Unknown Events - - - Disable refresh when you go back in the Events Screen - - - Behavior Change: when an interface/host is not reachable (non response) is taken like a down response. - This affects the report generation also... please test this and give me feedback so we could know which is best. - - - Added Verification of SNMP community to a few pollers - - - Fixed Typo in menu_interfaces - - - Fixed Typo in db_copy_table() - - - Changed Most Event Filter Fields to the LIKE expression rather than equal (=) - - - Added Default Customer to the Get Interfaces Option - - - New Include File Loader, fixed for multiple installtions - - -JFFNMS 0.6.9-2 - Released 2002-09-21 -==================================== - -*Fixed bugs: - - - Modified some SQL querys to make them compatible PostgreSQL - Postgres support now works. - - - Fixed a typo in trap_receiver.php (the name) - - - Make RRDTool functions check for the .rrd file. - - - Converted some GUI selects to the new API. - - - Fixed a function name change in filters. - - -JFFNMS 0.6.9 - Released 2002-09-07 -================================== - -*New Features: - - -Triggers Framework: - Parse New Events or Alarms with a condition, - and triggers an Action. - - -Actions Framework (email for now) - - -Host Default Customer - Assigns a default customer to an autodiscovered interface. - - -Host TFTP Config Get Type included in DB. - - -TFTP Get Hosts Changed its name. (please update crontabs) - - -TFTP Config Upload Tool (external utility) - - -Use Interface Bandwidth parameter for number of CPU's on CPU Information. - - -SLAs: more verbose debug. - - -SLAs: Updated Rules. - - -Maps: Mark Disabled now affects Maps also. - - -GUI: Events: Summary of Identical Events. - - -GUI: New Interfaces Views (supports bigger graphs) - - -New To Do List. - -*Fixed bugs: - - -Documentation fixes. - - -Changed field 'tipo' (spanish) from events table to 'type'. - - -Reorganization of some API Classes. - - -FreeBSD (PHP 4.2.2) $_SERVER variable Changes. - Reported: Nicolas Huret Fixed: Javier Szyszlican - - -Autodiscovery: Verify more before Modification. - - -Consolidate sub-programs name change. - - -API Alarms: Fixed Filters. - - -API Events: Variable resolution now is internal, not in GUI. - - -API RRDTool: verify if .rrd exists before tune. - - -Ticket: Some changes. - - -GUI: Interfaces '1 record only' fixes. - - -GUI: Standard Admin Fixes. - - -GUI: Updated some selects to objects. - - -GUI: changed RRDTool Graph grid color. - - -Alarm Viewer is gone, it didnt work. - - - -JFFNMS 0.6.8 - Released 2002-07-27 -================================== - -*New Features: - - -Windows 2000/XP Support. - JFFNMS works correctly on Windows, all functions work - except TCP Port Autodiscovery (I need a windows nmap). - Install Guide Included. - - -New Graph Types Framework - Converted all graphs to the new format. - - -New Interface Types (by Robert Bogdon): - Cisco CSS VIPs - Linux Processor Usage - Linux Load Average - Solaris Memory Utilization - Solaris Processor Usage - Solaris Load Average - - Includes Autodiscovery, Graphs and Poller Groups. - - -Better Host Information Identification - Based on Robert Bogdon code. - - -Added Drops () variable to SLA's - - -Better SLA presentation, more flexible and useful output. - Requested by: TIBA Staff - - -New MiniSLA's, SLA verifications every 5 minutes (optional) - Requested by: TIBA Staff - - -New Journaling Framework, better handling of comments and - Reporting/Editing. - - -New Trouble Ticket Integration Framework, send Journals to your TT System. - Example included. - - -Interface Selector, you can now select by Interface Type and - the View all button is back is Wizard Mode. - - -*Fixed bugs: - -Documentation fixes. - - -PHP Time Limit Handling implemented. - Reported: Micheal Orth Fixed: Javier Szyszlican - - -Quotes Handling in Tacacs and TFTP - Reported: Alberto Passariello Fixed: Javier Szyszlican - - -Changed snmp_interfaces to numerical OIDs. - - -Take care of HexStrings and Quotes on Windows Agents - - -Changed Default Speed of Snmp Interfaces to 128k because 0 makes no graphs. - - -Changed $argv[] to _$SERVER[argv][] in engines. - Requested by: Someone running FreeBSD with PHP 4.2.1 - - -Fixed a typo in poller.php str_replace. - Fixed by: Robert Bogdon - - -When creating a new Host, now the filter is to the seleced zone, not Uknown. - - -Fixed some Setup Autoconfiguration options - - -Move MiniSLA's and Messages to popups.php and popups/ directory - - -New Graph Type Selection (performance) Algorithm - - -Moved all RRD Related functions to api.rrdtool.inc.php - - -Changed Host_Interfaces (aka Get Interfaces in Host Configuration) to only - show the interfaces types with records. - - -Don't Show MultiEdit in Interfaces Administration when only one record is shown. - - -JFFNMS 0.6.7 - Released 2002-06-29 -================================== - -*Fixed bugs: - -When changing password the Router Access was disabled. - Reported: Mariano Schuler Fixed: Javier Szyszlican - - -Handling of shutdown events, leaves interface down. - Reported: Lucas Iglesias Fixed: Javier Szyszlican - - -Storage discovery broken in UCD-SNMP 2.4.4 - - -TCP Port Poller timeout, too short, increased to 8 seconds. - - -Some Orders are inverted. - - -API: better filter management in interfaces object. (status & list) - -API: Auth now on jffnms object. - -API: new delete_from_all method on map_interfaces object. - - -Change Clock color to white in Events. - -*New Features: - -New Interface in Rootmap status, you can mark the interface as disabled (grey). - -Add to Map option in Interfaces Editor. - -New Interface Selector (Wizard and Classic mode) (faster) - -Autoconfigurable Setup.php (Robert Bogdon) - -Use the OLD-CISCO-SYS-MIB for configuration retrival (optional) (requested by: Mike Hide) - -Wait 3 seconds before spawning new a process in autodiscovery_interfaces.php and poller.php (requested by: Robert Bogdon) - -New Poller: BGP Peer Interface Number (track when new bgp peer are added). - -New Views: Host All Interfaces (not only the ones with show in rootmap), Alarmed interfaces & events. - -OLDER RELEASES -============== - -Please check http://sourceforge.net/tracker/?atid=444844&group_id=46041&func=browse - diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/conf/config.php jffnms-0.9.3/conf/config.php --- ../jffnms-0.9.2/conf/config.php 2012-03-04 13:43:11.000000000 +1100 +++ jffnms-0.9.3/conf/config.php 2012-05-26 14:50:17.000000000 +1000 @@ -1,7 +1,7 @@ Javier Szyszlican - * Copyright (C) 2011 Craig Small + * Copyright (C) 2012 Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ #error_reporting(E_ALL | E_STRICT); @@ -10,7 +10,7 @@ snmp_set_output_format(SNMP_OID_OUTPUT_NUMERIC); if (function_exists('snmp_set_quick_print')) snmp_set_quick_print(1); -define('JFFNMS_VERSION', '0.9.1'); +define('JFFNMS_VERSION', '0.9.3'); class JffnmsConfig { @@ -52,7 +52,8 @@ { if ($key == 'logging_file') continue; - if (!array_key_exists('type', $this->default_configs[$key])) + if (!array_key_exists($key, $this->default_configs) || + !array_key_exists('type', $this->default_configs[$key])) $config_type='plain'; else $config_type = $this->default_configs[$key]['type']; @@ -64,7 +65,8 @@ case 'phpconf': break; # this lot dont get saved default: - if (!array_key_exists('default', $this->default_configs[$key]) || + if (!array_key_exists($key, $this->default_configs) || + !array_key_exists('default', $this->default_configs[$key]) || $value != $this->default_configs[$key]['default']) $new_config .= "$key = $value\n"; } diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/docs/unix/crontab jffnms-0.9.3/docs/unix/crontab --- ../jffnms-0.9.2/docs/unix/crontab 2010-11-09 21:20:49.000000000 +1100 +++ jffnms-0.9.3/docs/unix/crontab 2012-03-27 20:40:58.000000000 +1100 @@ -16,10 +16,14 @@ 20 * * * * cd $JFFNMS && sh tmpwatch.sh $JFFNMS >/dev/null 2>&1 -# Normal poller - run once (like old poller) -*/5 * * * * cd $JFFNMS && $PHP -q poller.php -o >/dev/null 2>&1 -# Poller that stays in loop, like poller2 + +# *** Pollers +# Only uncomment one of the following. The -o flag will make it run only +# once then exit. It is better to use the first one */5 * * * * cd $JFFNMS && $PHP -q poller.php >/dev/null 2>&1 +# run 20 children +#*/5 * * * * cd $JFFNMS && $PHP -q poller.php -c 0,20 >/dev/null 2>&1 +#*/5 * * * * cd $JFFNMS && $PHP -q poller.php -o >/dev/null 2>&1 # Interface Autodiscovery */30 * * * * cd $JFFNMS && $PHP -q autodiscovery_interfaces.php > /dev/null 2>&1 diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/autodiscovery_interfaces.php jffnms-0.9.3/engine/autodiscovery_interfaces.php --- ../jffnms-0.9.2/engine/autodiscovery_interfaces.php 2012-02-14 23:10:39.000000000 +1100 +++ jffnms-0.9.3/engine/autodiscovery_interfaces.php 2012-04-18 09:00:13.000000000 +1000 @@ -48,6 +48,7 @@ case 'F': $opt_force=TRUE; $num_params-= 1; + break; case 'type': case 't': $num_params-= 2; @@ -141,6 +142,7 @@ function iad_get_hosts($host_id,$itype_id) { + global $opt_force; if ($host_id === FALSE) $hostid_match = '> 1'; else @@ -150,8 +152,9 @@ id, ip, rocommunity, autodiscovery_default_customer, autodiscovery, sysobjectid FROM hosts WHERE - hosts.id $hostid_match - AND hosts.poll = 1 AND hosts.autodiscovery > 1"; + hosts.id $hostid_match"; + if (!$opt_force) + $query_hosts .= " AND hosts.poll = 1 AND hosts.autodiscovery > 1"; $result_hosts = db_query($query_hosts) or die ('Query failed - iad_get_hosts() '.db_error()); @@ -175,27 +178,26 @@ function iad_read_children(&$Parent) { - $repeats = 10; + $read_timeout = max(time() + ENGINE_HEARTBEAT/$Parent->max_children,2); - while ($repeats--) { - $read_retval = $Parent->read_children(); - if ($read_retval === FALSE) + while (time() < $read_timeout) { + if ($Parent->read_children('iad_read_callback') == FALSE) return; - if ($read_retval === TRUE) - continue; - // otherwise its something we parse - list($child_id, $child_data) = $read_retval; - switch($child_data['cmd']) - { - case 'DONE': - $item_id = $Parent->child_done_job($child_id); - break; - case 'NOTDONE': - $Parent->child_notdone_job($child_id); - break; - } - } // while repeats -} //iad_read_children() + } +} + +function iad_read_callback(&$Parent, $child_id, $child_data) +{ + switch($child_data['cmd']) + { + case 'DONE': + $item_id = $Parent->child_done_job($child_id); + break; + case 'NOTDONE': + $Parent->child_notdone_job($child_id); + break; + } +} //iad_read_callback() ?> diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/common_child.inc.php jffnms-0.9.3/engine/common_child.inc.php --- ../jffnms-0.9.2/engine/common_child.inc.php 2011-04-15 09:46:32.000000000 +1000 +++ jffnms-0.9.3/engine/common_child.inc.php 2012-03-09 22:56:51.000000000 +1100 @@ -40,9 +40,19 @@ die("Cannot write message to parent.\n"); fflush($this->stdout); } + public function debug($item) + { + $debug_msg = explode("\n", print_r($item, TRUE)); + $this->send_array("DEBUG",array('msg'=>$debug_msg)); + } + + public function logger($msg) + { + $this->send_array('LOGGER', array('msg'=>addslashes(rtrim($msg)))); + } public function send_error($msg) { - $this->send_array('ERROR', array('msg'=>$msg)); + $this->send_array('ERROR', array('msg'=>rtrim($msg))); } public function check_heartbeat($old_time) { @@ -76,4 +86,12 @@ return TRUE; } // require_file } // class JffmnsEngineChild + +function child_debug($item) +{ + global $Child; + $Child->debug($item); +} + + ?> diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/common_parent.inc.php jffnms-0.9.3/engine/common_parent.inc.php --- ../jffnms-0.9.2/engine/common_parent.inc.php 2011-05-23 10:23:31.000000000 +1000 +++ jffnms-0.9.3/engine/common_parent.inc.php 2012-03-21 11:59:17.000000000 +1100 @@ -11,6 +11,7 @@ define ('ENGINE_MAX_POLL_TIME', 180); define ('ENGINE_DIE_TIME', 5); define ('ENGINE_MAX_CHILDREN', 5); +define ('ENGINE_SELECT_USEC', 2000); //PHP RECOMMENDATION is 200,000 require_once('../conf/config.php'); $Config = new JffnmsConfig(); @@ -61,12 +62,12 @@ { $new_wait = count($this->waiting_items); if ($this->waiting_count != $new_wait) { - logger("Waiting count adjusted to $new_wait (was ".$this->waiting_count.")\n"); + logger("PAR: Waiting count adjusted to $new_wait (was ".$this->waiting_count.")\n"); $this->waiting_count = $new_wait; } $new_poll = count($this->polling_items); if ($this->polling_count != $new_poll) { - logger("polling count adjusted to $new_poll (was ".$this->polling_count.")\n"); + logger("PAR: Polling count adjusted to $new_poll (was ".$this->polling_count.")\n"); $this->polling_count = $new_poll; } } @@ -79,7 +80,7 @@ return; } if (!array_key_exists($item_id, $this->polling_items)) { - logger("item_set_done(): Item $item_id does not exist in poller items.\n"); + logger("PAR: ** ERROR ** item_set_done(): Item $item_id does not exist in poller items.\n"); $this->items_recount(); return; } @@ -94,13 +95,17 @@ return; } if (!array_key_exists($item_id, $this->polling_items)) { - logger("item_set_waiting(): Item $item_id does not exist in poller items.\n"); + logger("PAR: ** ERROR ** item_set_waiting(): Item $item_id does not exist in poller items.\n"); $this->items_recount(); return; } - $this->waiting_items[$item_id] = $this->polling_items[$item_id]; + if ($this->polling_items[$item_id]['tries'] > ENGINE_MAX_TRIES) { + logger("PAR: Cannot process item $item_id after ".ENGINE_MAX_TRIES." attempts.\n"); + } else { + $this->waiting_items[$item_id] = $this->polling_items[$item_id]; + $this->waiting_count++; + } unset($this->polling_items[$item_id]); - $this->waiting_count++; $this->polling_count--; } // item_set_waiting @@ -111,7 +116,7 @@ return; } if (!array_key_exists($item_id, $this->waiting_items)) { - logger("item_set_polling(): Item $item_id does not exist in waiting items.\n"); + logger("PAR: ** ERROR ** item_set_polling(): Item $item_id does not exist in waiting items.\n"); $this->items_recount(); return; } @@ -163,13 +168,22 @@ $new_child = $this->start_child(); if ($new_child === FALSE) return $children_started; - $this->child_procs[] = $new_child; + $this->child_procs[$this->get_child_id()] = $new_child; $children_count++; $children_started++; } return $children_started; } // children_start() + public function get_child_id() + { + $id=0; + while(TRUE) { + if (!array_key_exists($id, $this->child_procs)) + return $id; + $id++; + } + } public function stop_all_children($reason) { foreach ($this->child_procs as $child_id => $child) @@ -179,10 +193,10 @@ public function stop_child($child_id, $reason) { if (!array_key_exists($child_id, $this->child_procs)) { - logger("** FATAL ** Child ID $child_id stopped but doesn't exist.\n"); + logger("PAR: ** FATAL ** Child ID $child_id stopped but doesn't exist.\n"); die(); } - logger("Child #$child_id (PID:".$this->child_procs[$child_id]['pid'].") stopped: $reason.\n"); + logger("CH$child_id (".$this->child_procs[$child_id]['pid']."): stopped: $reason.\n"); $this->item_set_waiting($this->child_procs[$child_id]['item_id']); $this->child_procs[$child_id]['item_id']=FALSE; $this->child_procs[$child_id]['state']='DEAD'; @@ -199,7 +213,7 @@ // Check that the child process actually exists $child_stat = proc_get_status($child['resource']); if ($child_stat === FALSE ) { - logger("Child $child_id has no status - removing.\n"); + logger("CH:$child_id no status - removing.\n"); $this->item_set_waiting($child['item_id']); unset($this->child_procs[$child_id]); $child_count--; @@ -207,7 +221,7 @@ } if ($child_stat['running'] === FALSE) { if ($child['state'] != 'DEAD') - logger("Child $child_id is no longer running - removing.\n"); + logger("CH:$child_id No longer running - removing.\n"); $this->item_set_waiting($child['item_id']); proc_close($child['resource']); unset($this->child_procs[$child_id]); @@ -238,7 +252,7 @@ break; case 'DEAD': if ($child['killtime'] + ENGINE_DIE_TIME < $now) { - logger("Child #$child_id (PID:$child[pid]) took too long to die.\n"); + logger("CH:$child_id ($child[pid]): took too long to die.\n"); proc_close($child['resource']); unset($this->child_procs[$child_id]); $child_count--; @@ -249,7 +263,7 @@ } // foreach children } - public function read_children() + public function read_children($callback_function) { $read_fds = array(); $write_fds = NULL; @@ -262,59 +276,83 @@ if (sizeof($read_fds) == 0) return FALSE; + $child_had_data = FALSE; if ( ($nr = stream_select($read_fds, $write_fds, $except_fds, 0)) !== FALSE) { if ($nr == 0) return FALSE; foreach($this->child_procs AS $child_id => &$child_proc) { if ( in_array($child_proc['output'], $read_fds)) { - if ( ($raw_data = fgets($child_proc['output'])) !== FALSE) { - $child_proc['lastseen'] = $now; - $child_data = @unserialize($raw_data); - //print_r($child_data); - if (!is_array($child_data)) { - // If unserialise fails, it needs to be logged - logger("CHILD #$child_id ".preg_replace('/^\d\d\:\d\d\:\d\d /','',$raw_data)); - return TRUE; - } - if (!array_key_exists('cmd', $child_data)) - { - logger('Child #'.$child_id.' sent data with no cmd.'); - return TRUE; - } - switch($child_data['cmd']) + if ( ($raw_data = fgets($child_proc['output'])) === FALSE) + continue; + $child_proc['lastseen'] = $now; + $child_data = @unserialize($raw_data); + //print_r($child_data); + if (!is_array($child_data)) { + // If unserialise fails, it needs to be logged + logger("CH$child_id : RAW:".preg_replace('/^\d\d\:\d\d\:\d\d /','',$raw_data)); + $child_had_data = TRUE; + continue; + } + if (!array_key_exists('cmd', $child_data)) + { + logger("CH#$child_id: ERROR sent data with no cmd."); + $child_had_data = TRUE; + continue; + } + switch($child_data['cmd']) + { + case 'HEARTBEAT': + $child_had_data = TRUE; + break; + case 'START': + if ($child_proc['state'] != 'STARTING') { - case 'HEARTBEAT': - break; - case 'START': - if ($child_proc['state'] != 'STARTING') - { - logger('Child #'.$child_id.' sending START after starting.'); + logger("CH$child_id ($child_proc[pid]): sending START after starting.\n"); + } else { + if (array_key_exists('pid', $child_data)) { + $child_proc['pid'] = $child_data['pid']; + $child_proc['state'] = 'IDLE'; + logger("CH:$child_id ($child_proc[pid]): START and idle.\n"); } else { - if (array_key_exists('pid', $child_data)) - { - $child_proc['pid'] = $child_data['pid']; - $child_proc['state'] = 'IDLE'; - logger("START Child started with PID $child_proc[pid] and idle.\n"); - } else { - logger('START Child #'.$child_id.' sent START with no PID.'); - } + logger("CH:$child_id (unknown): ERROR: child started and did not return PID.\n"); } - break; - case 'ERROR': - if (array_key_exists('msg', $child_data)) - logger("Child #$child_id (PID:$child_proc[pid]) got error \"$child_data[msg]\"\n"); - else - logger("Child #$child_id (PID:$child_proc[pid]) got error \"unknown error\"\n"); - break; - default: - return array($child_id, $child_data); - break; - }// case - } - } + } + $child_had_data = TRUE; + break; + case 'DEBUG': + if (array_key_exists('msg', $child_data)) { + logger("CH:$child_id ($child_proc[pid]): DEBUG\n"); + foreach ($child_data['msg'] as $line) + logger(" $line\n"); + } else + logger("CH:$child_id ($child_proc[pid]): got DEBUG with no message\n"); + $child_had_data = TRUE; + break; + + case 'LOGGER': + if (array_key_exists('msg', $child_data)) { + $msg = stripslashes($child_data['msg']); + logger("CH:$child_id ($child_proc[pid]): $msg\n"); + } else + logger("CH:$child_id ($child_proc[pid]): logger called with no msg.\n"); + $child_had_data = TRUE; + break; + case 'ERROR': + if (array_key_exists('msg', $child_data)) + logger("CH$child_id ($child_proc[pid]): ERROR: \"$child_data[msg]\"\n"); + else + logger("CH$child_id ($child_proc[pid]): got error \"unknown error\"\n"); + $child_had_data = TRUE; + break; + default: + call_user_func_array($callback_function,array(&$this, $child_id, $child_data)); + $child_had_data = TRUE; + break; + }// case + }//child output inarry }//foreach - } // valid select - return TRUE; + }//nr not false + return $child_had_data; } // read_children() /* @@ -341,7 +379,7 @@ $item['tries']++; $item['poll_time'] = time(); $this->item_set_polling($item_id); - logger("WORK Child $child_id was idle, working on item $item_id Try $item[tries]\n"); + logger("PAR: Child $child_id was idle, working on item $item_id Try $item[tries]\n"); $this->send_to_child($child_id, 'POLL',$item); break; }// foreach child @@ -355,7 +393,7 @@ { $child_count = array('starting'=>0, 'idle'=>0, 'busy'=>0,'dead'=>0, 'other'=>0, 'total'=>0 ); - logger('STATUS Items Waiting/Polling=Total: '. + logger('PAR: Items Waiting/Polling=Total: '. $this->waiting_count.'/'.$this->polling_count."\n"); foreach($this->child_procs as $child) { @@ -368,7 +406,7 @@ default: $child_count['other']++; break; } } - logger('STATUS Childn Min/Max Idl/Bsy/Srt/Ded/Otr=Tot: '. + logger('PAR: Childn Min/Max Idl/Bsy/Srt/Ded/Otr=Tot: '. $this->min_children.'/'. $this->max_children.' '. "$child_count[idle]/$child_count[busy]/$child_count[starting]/$child_count[dead]/$child_count[other]=$child_count[total]\n"); @@ -391,14 +429,15 @@ public function child_notdone_job($child_id) { if (array_key_exists($child_id, $this->child_procs)) { - logger("Child #$child_id failed to process item $item_id.\n"); - $item_id = $this->child_procs[$child_id]['item_id']; + $child = $this->child_procs[$child_id]; + $item_id = $child['item_id']; + logger("CH:$child_id (): ** ERROR ** failed to process item $item_id.\n"); $this->item_set_waiting($item_id); $this->child_procs[$child_id]['state'] = 'IDLE'; $this->child_procs[$child_id]['item_id'] = FALSE; return $item_id; } - logger("** ERROR ** child_notdone_job(): Child ID $child_id not found.\n"); + logger("CH: $child_id(): ** ERROR ** child_notdone_job(): Child ID $child_id not found.\n"); return FALSE; } // child_notdone_job() @@ -430,7 +469,7 @@ $msg = serialize($args)."\n"; $msglen = strlen($msg); if ( fwrite($this->child_procs[$child_id]['input'], $msg, $msglen) != $msglen) - logger("Error sending message to child #$child_id.\n"); + logger("CH:$child_id(): ** ERROR ** Parent unable to send message to child.\n"); fflush($this->child_procs[$child_id]['input']); } } //class diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/configs/alteon_webos.inc.php jffnms-0.9.3/engine/configs/alteon_webos.inc.php --- ../jffnms-0.9.2/engine/configs/alteon_webos.inc.php 2010-05-27 19:51:40.000000000 +1000 +++ jffnms-0.9.3/engine/configs/alteon_webos.inc.php 2012-03-06 07:19:23.000000000 +1100 @@ -5,11 +5,11 @@ */ // agGeneral .1.3.6.1.4.1.1872.2.1.2.1 -define(agTftpServer, '.1.3.6.1.4.1.1872.2.1.2.1.18.0'); -define(agTftpCfgFileName, '.1.3.6.1.4.1.1872.2.1.2.1.19.0'); -define(agTftpAction, '.1.3.6.1.4.1.1872.2.1.2.1.21.0'); -define(cfg-get, '3'); -define(agTftpLastActionStatus, '.1.3.6.1.4.1.1872.2.1.2.1.22.0'); +define('agTftpServer', '.1.3.6.1.4.1.1872.2.1.2.1.18.0'); +define('agTftpCfgFileName', '.1.3.6.1.4.1.1872.2.1.2.1.19.0'); +define('agTftpAction', '.1.3.6.1.4.1.1872.2.1.2.1.21.0'); +define('cfg-get', '3'); +define('agTftpLastActionStatus', '.1.3.6.1.4.1.1872.2.1.2.1.22.0'); function config_alteon_webos_get($ip, $community, $server, $filename) { diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/discovery/host_information.inc.php jffnms-0.9.3/engine/discovery/host_information.inc.php --- ../jffnms-0.9.2/engine/discovery/host_information.inc.php 2012-02-14 23:10:39.000000000 +1100 +++ jffnms-0.9.3/engine/discovery/host_information.inc.php 2012-04-05 18:48:39.000000000 +1000 @@ -35,7 +35,7 @@ // If it was, get all the other information and return an interface if ($found==true) { - $description = snmp_get ($ip, $rocommunity, $sysDescr_oid); + $description = str_replace("\n",' ',snmp_get ($ip, $rocommunity, $sysDescr_oid)); $name = snmp_get ($ip, $rocommunity, $sysName_oid); $contact = snmp_get ($ip, $rocommunity, $sysContact_oid); $location = snmp_get ($ip, $rocommunity, $sysLocation_oid); diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/discovery/snmp_interfaces.inc.php jffnms-0.9.3/engine/discovery/snmp_interfaces.inc.php --- ../jffnms-0.9.2/engine/discovery/snmp_interfaces.inc.php 2010-11-16 22:39:50.000000000 +1100 +++ jffnms-0.9.3/engine/discovery/snmp_interfaces.inc.php 2012-04-09 10:44:26.000000000 +1000 @@ -97,7 +97,7 @@ $int = $regs[1]; if (!empty($interface_names[$int])) // if it is already loaded in list { - $oid_id = $interface_names[$int]; + $old_id = $interface_names[$int]; $aux2 = $snmp_interfaces[$old_id]; $aux2['address'] = $new_interface['address']; $aux2['peer'] = $new_interface['peer']; diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/discovery/tcp_ports.inc.php jffnms-0.9.3/engine/discovery/tcp_ports.inc.php --- ../jffnms-0.9.2/engine/discovery/tcp_ports.inc.php 2011-02-21 11:55:19.000000000 +1100 +++ jffnms-0.9.3/engine/discovery/tcp_ports.inc.php 2012-04-18 09:23:59.000000000 +1000 @@ -36,12 +36,12 @@ foreach($nmap_ports as $nmap_port) { $port_data = explode('/', $nmap_port); - if (preg_match('%^(\d+)/open/[a-z]+/([^/]+)/%', $nmap_port, $port_data)) + if ($port_data[1] == 'open') { - $port_num = $port_data[1]; + $port_num = trim($port_data[0]); $ports[$port_num] = array( 'interface' => 'Port '.$port_num, - 'description' => $port_data[2], + 'description' => $port_data[4], 'admin' => 'open', 'oper' => 'open' ); diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/iad_child.php jffnms-0.9.3/engine/iad_child.php --- ../jffnms-0.9.2/engine/iad_child.php 2012-02-14 23:10:39.000000000 +1100 +++ jffnms-0.9.3/engine/iad_child.php 2012-04-06 22:10:59.000000000 +1000 @@ -60,11 +60,13 @@ function child_discover_interfaces($params) { + global $Config, $Child; $iad_time = time_msec(); $Interfaces = new JffnmsInterfaces(); $InterfaceTypesFields = new JffnmsInterface_types_fields(); + $Events = new JffnmsEvents(); - $autodiscovery = iad_get_autodiscovery($params['autodiscovery_id']); + $ad_policy = iad_get_autodiscovery($params['autodiscovery_id']); $interface_types = iad_get_interface_types($params['itype']); if ($interface_types === FALSE) return FALSE; @@ -104,33 +106,39 @@ array('itype'=>$itype['id'],'exclude_types'=>20)); if (is_array($ad_interfaces) && count($ad_interfaces) > 0) { - $unique_interfaces = array_unique(array_merge(array_merge(array_keys($ad_interfaces), array_keys($db_interfaces)))); + $unique_interfaces = array_unique(array_merge(array_keys($ad_interfaces), array_keys($db_interfaces))); + asort($unique_interfaces); + reset($unique_interfaces); foreach($unique_interfaces as $key) { if ($key < 0) continue; $processed = FALSE; + if (isset($db_interfaces[$key])) + ksort($db_interfaces[$key]); + if (isset($ad_interfaces[$key])) + ksort($ad_interfaces[$key]); + discovery_logger($params['host_id'], $itype['id'], $key, 'DB : '.(isset($db_interfaces[$key])?iad_show_interface($fields,$db_interfaces[$key]):'Not Found')); discovery_logger($params['host_id'], $itype['id'], $key, 'HOST: '.(isset($ad_interfaces[$key])?iad_show_interface($fields,$ad_interfaces[$key]):'Not Found')); // Not in DB but in Host = add new - if (!isset($db[$key]) && isset($host[$key])) + if (!isset($db_interfaces[$key]) && isset($ad_interfaces[$key])) { - if (iad_permit_new($host[$key], $host_info)) - { + if (iad_permit_new($ad_interfaces[$key], $ad_policy,$itype)) { $text = ''; - discovery_logger($host_info['id'], $it['id'], $key, + discovery_logger($params['host_id'], $itype['id'], $key, 'RES : New Interface Found'); //if the AD policy permits adding an interface. - if ($host_info['permit_add']==1) + if ($ad_policy['permit_add']==1) { //if the AD policy says use default poller - if ($host_info['poller_default']==1) - ad_set_default ($host[$key]['poll'],$it['autodiscovery_default_poller']); //use the interface type default poller for this new interface - ad_set_default ($host[$key]['client'],$host_info['autodiscovery_default_customer']); - ad_set_default ($host[$key]['sla'],$it['sla_default']); + if ($ad_policy['poller_default']==1) + ad_set_default ($ad_interfaces[$key]['poll'],$itype['autodiscovery_default_poller']); //use the interface type default poller for this new interface + ad_set_default ($ad_interfaces[$key]['client'],$params['autodiscovery_default_customer']); + ad_set_default ($ad_interfaces[$key]['sla'],$itype['sla_default']); //Find the Index Field foreach ($fields as $fdata) if ($fdata['ftype']==3) @@ -139,28 +147,105 @@ break; } //add the index field as data to use when adding a record - $host[$key][$index_field]=$key; + $ad_interfaces[$key][$index_field]=$key; //delete the status fields, because they will not be found in the db - unset ($host[$key]['admin']); - unset ($host[$key]['oper']); + unset ($ad_interfaces[$key]['admin']); + unset ($ad_interfaces[$key]['oper']); - $interface_id = adm_interfaces_add(array('host'=>$host_info['id'],'type'=>$it['id'])); //add new record - adm_interfaces_update($interface_id,$host[$key]); //update it with the data + $interface_id = $Interfaces->add(array('host'=>$params['host_id'],'type'=>$itype['id'])); //add new record + $Interfaces->update($interface_id,$ad_interfaces[$key]); //update it with the data $text = '- Added'; } // permit add - if ($log_events==true) - insert_event ($now_date, $event_type_id, $host_info['id'], $host[$key]['interface'], //add informative event + $Events->add(date("Y-m-d H:i:s",time()), $Config->get('jffnms_administrative_type'), $params['host_id'], $ad_interfaces[$key]['interface'], //add informative event 'alert','autodiscovery',trim('Found '.$text),0); $processed = 1; - } // if allow add - } + } // if allow add + continue; + } // In Host not DB - } //foreach unique int id - } - } //foreach itype + if (!isset($ad_interfaces[$key]) && isset($db_interfaces[$key])) { + if ($itype['autodiscovery_validate']==1 && $db_interfaces[$key]['poll'] > 1) { + discovery_logger($params['host_id'], $itype['id'], $key, + 'RES : Not Found in Host'); + $test=''; + if ($ad_policy['permit_del']==1 && $ad_policy['permit_disable']==0) { + $Interfaces->del($db_interfaces[$key]['id']); + $text = '- Deleted'; + } + if ($ad_policy['permit_del']==0 && $ad_policy['permit_disable']==1) { + $Interfaces->update($db_interfaces[$key]['id'], + array('poll'=>1, 'show_rootmap'=>2)); + $text = '- Disabled'; + } + + if ($ad_policy['alert_del']==1) + $Events->add(date("Y-m-d H:i:s",time()), $Config->get('jffnms_administrative_type'), $params['host_id'], $db_interfaces[$key]['interface'], //add informative event + 'alert', 'autodiscovery', trim('Not Found in Host '.$text),0); + } + continue; + } + + // Found in both and polling enabled + if (isset($ad_interfaces[$key]) && isset($db_interfaces[$key])) { + if ($itype['autodiscovery_validate']==1) { + $fields_to_modify = array(); + $track_fields = array(); + + $track_fields['interface']='Interface Name'; + foreach ($fields as $fdata) + if ($fdata['tracked']==1) + $track_fields[$fdata['name']] = $fdata['description']; + + foreach ($track_fields as $track_field=>$track_field_descr) { + if (!empty($ad_interfaces[$key][$track_field]) && + (strncmp($ad_interfaces[$key][$track_field], $db_interfaces[$key][$track_field], 30) != 0)) { + discovery_logger($params['host_id'], $itype['id'], $key, + "RES : $track_field_descr changed from ". + $db_interfaces[$key][$track_field].' to '. + $ad_interfaces[$key][$track_field]); + $fields_to_modify[$track_field]=$ad_interfaces[$key][$track_field]; + } // fields not equal + if (count($fields_to_modify) > 0) { + $changed_fields = array(); + foreach ($fields_to_modify as $field_name=>$field_value) + $changed_fields[] = $track_fields[$field_name].' to '.$field_value.' was '.$db_interfaces[$key][$field_name]; + $changed_fields = join(' and ',$changed_fields); + + if ($ad_policy['permit_mod']==1) { + $Interfaces->update($db_interfaces[$key]['id'], + $fields_to_modify); + if (array_key_exists('interface', $fields_to_modify)) + $interface_name = $ad_interfaces[$key]['interface']; + else + $interface_name = $db_interfaces[$key]['interface']; + $event_comment = '- Changed '.$changed_fields; + } else { + $interface_name = $db_interfaces[$key]['interface']; + $event_comment = '- NOT Changed '.$changed_fields; + } + $Events->add(date("Y-m-d H:i:s",time()), $Config->get('jffnms_administrative_type'), $params['host_id'], $interface_name, + 'alert', 'autodiscovery', trim('detected modification '.$event_comment),0); + } + } + } + + // Check for interfaces with no client assigned + if ($db_interfaces[$key]['client'] <= 1) { + discovery_logger($params['host_id'], $itype['id'], $key, + 'RES : No Customer Selected'); + $Events->add(date("Y-m-d H:i:s",time()), $Config->get('jffnms_administrative_type'), $params['host_id'], $db_interfaces[$key]['interface'], + 'alert', 'autodiscovery', 'Incomplete interface setup (Customer not selected)', 0); + continue; + } + } + discovery_logger($params['host_id'], $itype['id'], $key, + 'RES : Nothing done.'); + } // foreach unique interfaces + } //ad_interfaces > 0 + } //interface types $iad_time = round(time_msec_diff($iad_time)); - logger('H '.str_pad($params['host_id'],3,' ',STR_PAD_LEFT)." : Autodiscovery took ".$iad_time." msec.\n"); + $Child->logger('H '.str_pad($params['host_id'],3,' ',STR_PAD_LEFT)." : Autodiscovery took ".$iad_time." msec.\n"); return TRUE; } @@ -220,7 +305,10 @@ function discovery_logger($host, $itype, $intid, $result) { - logger( 'H '.str_pad($host,3,' ',STR_PAD_LEFT).' : '. + global $Child; + + $Child->logger( + 'H '.str_pad($host,3,' ',STR_PAD_LEFT).' : '. 'IT '.str_pad($itype,3,' ',STR_PAD_LEFT).' : '. ($intid?'I '.str_pad($intid,4,' ',STR_PAD_LEFT).' : ':''). "$result.\n"); @@ -239,23 +327,30 @@ } // Not in database but found in host - is it really supposed to be there? -function iad_permit_new(&$host_data, &$host_info) +function iad_permit_new(&$host_data, &$ad_policy, &$itype) { - if ($itype['autodiscovery_validate'] == 1) - return FALSE; + if ($itype['autodiscovery_validate'] == 0) + return TRUE; - if ($host_info['skip_loopback'] == 1 && ( - preg_match('/(loopback.*|null.*|lo\d*)$/i', $host_data['interface']) || - (array_key_exists('address', $host_data) && $host_data['address'] == '127.0.0.1'))) - return FALSE; + # If we skip looback and have a loopback address - dont add it + if ( // Possibly check for loopback + $ad_policy['skip_loopback'] == 1 && + ( + ( preg_match('/(loopback.*|null.*|lo\d*)$/i', $host_data['interface']) != 0) || + ( array_key_exists('address', $host_data) && $host_data['address'] == '127.0.0.1') + )) { + return FALSE; // Skip loopback and loopback detected + } - if ($host_info['check_address'] == 1 && ( - !array_key_exists('address', $host_data || - $host_data['address'] == '' || - $host_data['address'] == '0.0.0.0'))) - return FALSE; + # Valid address? + if ( $ad_policy['check_address'] == 1 && + (array_key_exists('address', $host_data) == TRUE) && + ($host_data['address'] == '' || $host_data['address'] == '0.0.0.0') + ) + return FALSE; // Found address and its invalid - if ($host_info['check_state'] == 1 && + $Alarms = new JffnmsAlarms(); + if ($ad_policy['check_state'] == 1 && $Alarms->lookup($host_data['oper']) != ALARM_UP) return FALSE; @@ -268,6 +363,7 @@ $sysObjectId = snmp_get($host_ip, $rocommunity, $oid); if ($sysObjectId === FALSE) return NULL; + $sysObjectId = str_replace('SNMPv2-SMI::enterprises','ent', $sysObjectId); db_update('hosts', $host_id, array('sysobjectid' => $sysObjectId)); return $sysObjectId; } diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/poller_child.php jffnms-0.9.3/engine/poller_child.php --- ../jffnms-0.9.2/engine/poller_child.php 2011-04-15 09:43:47.000000000 +1000 +++ jffnms-0.9.3/engine/poller_child.php 2012-03-28 23:26:18.000000000 +1100 @@ -57,7 +57,7 @@ function child_poll_interface($params) { - global $Config, $Child; + global $Config, $Child, $poller_buffer; $host_id = $params['host_id']; if (!is_numeric($host_id)) { @@ -78,6 +78,7 @@ // Poller Group 1 is no polling so return immediately if ($poller_group == 1) return TRUE; + $check_status = $params['check_status']; $poller_group_query = 'SELECT pollers.name AS poller_name, pollers.command AS poller_command, pollers.parameters AS poller_parameters, @@ -90,6 +91,7 @@ pollers_poller_groups.poller_group = '.$poller_group.' AND pollers_poller_groups.poller = pollers.id AND pollers_poller_groups.backend = pollers_backend.id + '.($check_status==0?' AND pollers_backend.type != 1':'').' ORDER BY pollers_poller_groups.pos'; //fwrite(STDERR, $poller_query); @@ -98,6 +100,7 @@ return FALSE; } $jffnms_real_path = $Config->get('jffnms_real_path'); + $poller_buffer=array(); while ($poller_row = db_fetch_array($poller_group_result)) { $poller_command = $poller_row['poller_command']; $backend_command = $poller_row['backend_command']; @@ -108,15 +111,23 @@ if ( $Child->require_file($backend_filename, 'backend_'.$backend_command) === FALSE) continue; + # Calls poller, poller returns NULL if there is an error + # An errors means don't waste time running backend $poller_data = child_poller_data($interface_id, $poller_row, $params); $time_poller_query = time_msec(); $poller_result = call_user_func_array('poller_'.$poller_command, array($poller_data)); $time_poller_query = time_msec_diff($time_poller_query); - $time_backend_query = time_msec(); - $backend_result = call_user_func_array('backend_'.$backend_command, - array($poller_data, $poller_result)); - $time_backend_query = time_msec_diff($time_backend_query); + if ($poller_result === FALSE) { + $time_backend_query=0; + $poller_result='(FALSE)'; + $backend_result='(not run)'; + } else { + $time_backend_query = time_msec(); + $backend_result = call_user_func_array('backend_'.$backend_command, + array($poller_data, $poller_result)); + $time_backend_query = time_msec_diff($time_backend_query); + } // Output the results $poller_param_description = ''; @@ -125,7 +136,7 @@ if ( ($desc_len = strlen($poller_param_description)) > 10) $poller_param_description = substr($poller_param_description,0,4).'..'. substr($poller_param_description,$desc_len-4,4); - logger( + $Child->logger( ' : H '.str_pad($poller_data['host_id'],3,' ',STR_PAD_LEFT). ' : I '.str_pad($poller_data['interface_id'],3,' ',STR_PAD_LEFT). ' : P '.str_pad($poller_row['poller_pos'],3,' ',STR_PAD_LEFT). @@ -136,6 +147,7 @@ " (time P: $time_poller_query | B: $time_backend_query) ". "\n"); } //while poller_row + unset($poller_buffer); return TRUE; } @@ -176,7 +188,7 @@ $poller_plan_result = poller_plan ($poller_plan_filter); // Get the Poller Plan (things to poll) if ($output) - logger(" : H ".str_pad($host_id,3," ",STR_PAD_LEFT)." : Poller Start : ".$poller_plan_result["items"]." Items.\n"); + $Child->logger(" : H ".str_pad($host_id,3," ",STR_PAD_LEFT)." : Poller Start : ".$poller_plan_result["items"]." Items.\n"); else ob_start(); @@ -247,7 +259,7 @@ if ($aux = strlen($poller_param_description) > 10) $poller_param_description = substr($poller_param_description,0,4)."..".substr($poller_param_description,strlen($aux)-4,4); - logger( " : H ".str_pad($poller_data["host_id"],3," ",STR_PAD_LEFT). + $Child->logger( " : H ".str_pad($poller_data["host_id"],3," ",STR_PAD_LEFT). " : I ".str_pad($poller_data["interface_id"],3," ",STR_PAD_LEFT). " : P ".str_pad($poller_data["poller_pos"],3," ",STR_PAD_LEFT). " : ".(($backend_command=="buffer")?"$poller_command:":"").$poller_data["poller_name"]."(".$poller_param_description."): $poller_result ". @@ -261,7 +273,7 @@ } // while $polling_time = round(time_msec_diff($time_start)); if ($output) - logger(" : H ".str_pad($host_id,3," ",STR_PAD_LEFT)." : Poller End, Total Time: $polling_time msec.\n"); + $Child->logger(" : H ".str_pad($host_id,3," ",STR_PAD_LEFT)." : Poller End, Total Time: $polling_time msec.\n"); else ob_end_clean(); diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/poller.php jffnms-0.9.3/engine/poller.php --- ../jffnms-0.9.2/engine/poller.php 2012-02-14 23:10:39.000000000 +1100 +++ jffnms-0.9.3/engine/poller.php 2012-03-28 23:24:29.000000000 +1100 @@ -69,29 +69,27 @@ // Read all the children's chatter function poller_read_children(&$Parent) { - $repeats = 10; + $read_timeout = max(time() + ENGINE_HEARTBEAT/$Parent->max_children,2); - while ($repeats--) { - $read_retval = $Parent->read_children(); - if ($read_retval === FALSE) + while (time() < $read_timeout) + if ($Parent->read_children('poller_read_callback') == FALSE) return; - if ($read_retval === TRUE) - continue; - // otherwise its something we parse - list($child_id, $child_data) = $read_retval; - switch($child_data['cmd']) - { - case 'DONE': - $item_id = $Parent->child_done_job($child_id); - if ($item_id !== FALSE) - poller_set_interface_lpd($item_id); - break; - case 'NOTDONE': - $Parent->child_notdone_job($child_id); - break; - } - } // while repeats -} //poller_read_children() +} + +function poller_read_callback(&$Parent, $child_id, $child_data) +{ + switch($child_data['cmd']) + { + case 'DONE': + $item_id = $Parent->child_done_job($child_id); + if ($item_id !== FALSE) + poller_set_interface_lpd($item_id); + break; + case 'NOTDONE': + $Parent->child_notdone_job($child_id); + break; + } +} function parse_commandline() @@ -234,6 +232,7 @@ 'rw_community' => $row['rwcommunity'], 'ro_community' => $row['rocommunity'], 'sysobjectid' => $row['sysobjectid'], + 'check_status' => $row['check_status'], 'tries' => 0, 'is_dmii' => FALSE, 'dmii_up' => 1 diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/pollers/bgp_peer_status.php jffnms-0.9.3/engine/pollers/bgp_peer_status.php --- ../jffnms-0.9.2/engine/pollers/bgp_peer_status.php 2012-02-14 23:10:39.000000000 +1100 +++ jffnms-0.9.3/engine/pollers/bgp_peer_status.php 2012-03-26 18:11:05.000000000 +1100 @@ -4,19 +4,16 @@ * This program is licensed under the GNU GPL, full terms in the LICENSE file */ -function poller_bgp_peer_status ($options) { - - $oid = ".1.3.6.1.2.1.15.3.1.2.".$options["remote"]; - - $value = snmp_get($options["host_ip"],$options["ro_community"],$oid); +function poller_bgp_peer_status ($options) +{ + $oid = '.1.3.6.1.2.1.15.3.1.2.'.$options['remote']; + $value = snmp_get($options["host_ip"],$options["ro_community"],$oid); - switch ($value) { - case 1: $status = "down"; break; - case 3: $status = "down"; break; //active - case 6: $status = "up"; break; - } - - return $status; + if ($value == '') + return FALSE; + if ($value == '6') + return 'up'; + return 'down'; } ?> diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/pollers/brocade_fcport_phystate.php jffnms-0.9.3/engine/pollers/brocade_fcport_phystate.php --- ../jffnms-0.9.2/engine/pollers/brocade_fcport_phystate.php 2010-05-27 19:51:40.000000000 +1000 +++ jffnms-0.9.3/engine/pollers/brocade_fcport_phystate.php 2012-03-26 18:12:01.000000000 +1100 @@ -4,15 +4,15 @@ * This program is licensed under the GNU GPL, full terms in the LICENSE file */ -define(swFCPortPhyState, '1.3.6.1.4.1.1588.2.1.1.1.6.2.1.3'); - function poller_brocade_fcport_phystate ($options) { +function poller_brocade_fcport_phystate ($options) { + $swFCPortPhyState = '1.3.6.1.4.1.1588.2.1.1.1.6.2.1.3'; $community = $options['ro_community']; $ip = $options['host_ip']; $inst = $options['poller_parameters']; if ($ip && $community && $inst) { - $snmp_value = snmp_get($ip, $community, swFCPortPhyState.".$inst"); + $snmp_value = snmp_get($ip, $community, $swFCPortPhyState.".$inst"); switch ($snmp_value) { case 1: return 'down|No card present'; diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/pollers/buffer.php jffnms-0.9.3/engine/pollers/buffer.php --- ../jffnms-0.9.2/engine/pollers/buffer.php 2010-11-11 22:35:50.000000000 +1100 +++ jffnms-0.9.3/engine/pollers/buffer.php 2012-03-26 18:12:29.000000000 +1100 @@ -3,7 +3,7 @@ * Copyright (C) <2002-2005> Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ - // Get Values fomr the Buffer Temp storage + // Get Values from the Buffer Temp storage function poller_buffer ($options) { diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/pollers/cisco_envmib_status.php jffnms-0.9.3/engine/pollers/cisco_envmib_status.php --- ../jffnms-0.9.2/engine/pollers/cisco_envmib_status.php 2012-02-14 23:10:39.000000000 +1100 +++ jffnms-0.9.3/engine/pollers/cisco_envmib_status.php 2012-03-26 14:25:33.000000000 +1100 @@ -3,30 +3,15 @@ * Copyright (C) <2002-2005> Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ -function poller_cisco_envmib_status ($options) { - - $val="down"; - - $data = &$GLOBALS["cisco_envmib_status_data"][$options["host_ip"]][$options["poller_parameters"]]; - - if (!is_array($data) && $options["ro_community"]) { - $i=0; - $rets=""; - while (!is_array($rets) and $i++ <=2 ) //try 2 times - $rets=snmp_walk($options["host_ip"],$options["ro_community"],".1.3.6.1.4.1.9.9.13.1.".$options["poller_parameters"],1); - - if (is_array($rets)) - foreach ( $rets as $key=>$entry ) { - $key=explode(".",$key); - $key=array_reverse($key); - $key=$key[0]; - $data[$key]=$entry; - } - } - - $value=$data[$options["index"]]; - - if ($value == "1") $val="up"; - return $val; +function poller_cisco_envmib_status ($options) +{ + if ($options['ro_community']=='' or !is_numeric($options['index'])) + return FALSE; + $snmp_value = snmp_get($options['host_ip'], $options['ro_community'], + '.1.3.6.1.4.1.9.9.13.1.'.$options['poller_parameters'].'.'. + $options['index']); + if ($snmp_value == '1') + return 'up'; + return 'down'; } ?> diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/pollers/cisco_saagent_backwardjitter.php jffnms-0.9.3/engine/pollers/cisco_saagent_backwardjitter.php --- ../jffnms-0.9.2/engine/pollers/cisco_saagent_backwardjitter.php 2012-02-14 23:10:39.000000000 +1100 +++ jffnms-0.9.3/engine/pollers/cisco_saagent_backwardjitter.php 2012-03-26 18:22:24.000000000 +1100 @@ -3,66 +3,30 @@ * Copyright (C) <2002-2005> Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ -function poller_cisco_saagent_backwardjitter($options) { +function poller_cisco_saagent_backwardjitter($options) +{ + if (empty($options['ro_community']) or !is_numeric($options['index'])) + return FALSE; + $sa_oid = '1.3.6.1.4.1.9.9.42.1.5.2.1'; + $ip = $options['host_ip']; + $comm = $options['ro_community']; + $inst = $options['index']; + + if ( ($sumposds = snmp_get($ip, $comm, "$sa_oid.19.$inst")) === FALSE) + return FALSE; + if ( ($sumnegds = snmp_get($ip, $comm, "$sa_oid.24.$inst")) === FALSE) + return FALSE; + if ( ($nrposds = snmp_get($ip, $comm, "$sa_oid.18.$inst")) === FALSE) + return FALSE; + if ( ($nrnegds = snmp_get($ip, $comm, "$sa_oid.23.$inst")) === FALSE) + return FALSE; - if ( !is_array($GLOBALS["cisco_saagent_backwardjitter"][$options["host_id"]])) { - $i=0; - while ( !is_array($sumpossd) and $i++ <=2 ) { - $sumpossd=snmp_walk($options["host_ip"],$options["ro_community"],".1.3.6.1.4.1.9.9.42.1.5.2.1.19",1); - $sumnegsd=snmp_walk($options["host_ip"],$options["ro_community"],".1.3.6.1.4.1.9.9.42.1.5.2.1.24",1); - $nrpossd=snmp_walk($options["host_ip"],$options["ro_community"],".1.3.6.1.4.1.9.9.42.1.5.2.1.18",1); - $nrnegsd=snmp_walk($options["host_ip"],$options["ro_community"],".1.3.6.1.4.1.9.9.42.1.5.2.1.23",1); - } + $sum = $sumposds + $sumnegds; + $nr = $nrposds + $nrnegds; - if ( is_array($sumpossd) ) - foreach ( $sumpossd as $key=>$entry ) { - $key=explode(".",$key); - $key=$key[count($key)-1]; - - $sum_pos_sd[$key]=$entry; - } - - if ( is_array($sumnegsd) ) - foreach ( $sumnegsd as $key=>$entry ) { - $key=explode(".",$key); - $key=$key[count($key)-1]; - - $sum_neg_sd[$key]=$entry; - } - - if ( is_array($nrpossd) ) - foreach ( $nrpossd as $key=>$entry ) { - $key=explode(".",$key); - $key=$key[count($key)-1]; - - $nr_pos_sd[$key]=$entry; - } - - if ( is_array($nrnegsd) ) - foreach ( $nrnegsd as $key=>$entry ) { - $key=explode(".",$key); - $key=$key[count($key)-1]; - - $nr_neg_sd[$key]=$entry; - } - - if ( is_array($sum_pos_sd) ) - foreach ( $sum_pos_sd as $key=>$entry ) { - $sum=$sum_pos_sd[$key]+$sum_neg_sd[$key]; - $nr=$nr_pos_sd[$key]+$nr_neg_sd[$key]; - - $backward_jitter[$key]=0; - if ( $nr > 0 ) - $backward_jitter[$key]=($sum/$nr); - - $GLOBALS["cisco_saagent_backwardjitter"][$options["host_id"]][$key]=$backward_jitter[$key]; - } - } - - $value=0; - if ( isset($GLOBALS["cisco_saagent_backwardjitter"][$options["host_id"]][$options["index"]]) ) - $value=$GLOBALS["cisco_saagent_backwardjitter"][$options["host_id"]][$options["index"]]; - - return round($value,2); + $jitter=0; + if ($nr > 0) + $jitter = round($sum / $nr,2); + return $jitter; } ?> diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/pollers/cisco_saagent_bwpacketloss.php jffnms-0.9.3/engine/pollers/cisco_saagent_bwpacketloss.php --- ../jffnms-0.9.2/engine/pollers/cisco_saagent_bwpacketloss.php 2012-02-14 23:10:39.000000000 +1100 +++ jffnms-0.9.3/engine/pollers/cisco_saagent_bwpacketloss.php 2012-03-26 18:29:53.000000000 +1100 @@ -1,48 +1,27 @@ Javier Szyszlican + * Copyright (C) 2012 Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ -function poller_cisco_saagent_bwpacketloss($options) { +function poller_cisco_saagent_bwpacketloss($options) +{ + if (empty($options['ro_community']) or !is_numeric($options['index'])) + return FALSE; + + $sa_oid = '1.3.6.1.4.1.9.9.42.1.5.2.1'; + $ip = $options['host_ip']; + $comm = $options['ro_community']; + $inst = $options['index']; - if (!is_array($GLOBALS["cisco_saagent_bwpacketloss"][$options["host_id"]]) && $options["ro_community"]) { - $i=0; - while ( !is_array($bwpacketloss) and $i++ <=2 ) { - $bwpacketloss_sd=snmp_walk($options["host_ip"],$options["ro_community"],".1.3.6.1.4.1.9.9.42.1.5.2.1.27",1); - $rtlnum=snmp_walk($options["host_ip"],$options["ro_community"],".1.3.6.1.4.1.9.9.42.1.5.2.1.1",1); - } - - if ( is_array($bwpacketloss_sd) ) - foreach ($bwpacketloss_sd as $key=>$entry) { - $key=explode(".",$key); - $key=$key[count($key)-1]; - - $bwpacketloss_sd[$key]=$entry; - } - - if ( is_array($rtlnum) ) - foreach ($rtlnum as $key=>$entry) { - $key=explode(".",$key); - $key=$key[count($key)-1]; - - $rtlnum[$key]=$entry; - } - - if ( is_array($bwpacketloss_sd) ) - foreach ( $bwpacketloss_sd as $key=>$entry ) { - $bwpacketloss[$key]=0; - $nr=$rtlnum[$key]; - if ( $nr > 0 ) - $bwpacketloss[$key]=$bwpacketloss_sd[$key]/($bwpacketloss_sd[$key] + $rtlnum[$key])*100; - - $GLOBALS["cisco_saagent_bwpacketloss"][$options["host_id"]][$key]=$bwpacketloss[$key]; - } - } - - $value=0; - if ( isset($GLOBALS["cisco_saagent_bwpacketloss"][$options["host_id"]][$options["index"]]) ) - $value=$GLOBALS["cisco_saagent_bwpacketloss"][$options["host_id"]][$options["index"]]; - - return $value; + if ( ($bwpacketloss = snmp_get($ip, $comm, "$sa_oid.27.$inst")) === FALSE) + return FALSE; + if ( ($nr = snmp_get($ip, $comm, "$sa_oid.1.$inst")) === FALSE) + return FALSE; + + $pktloss=0; + if ($nr > 0) + $pktloss = $bwpacketloss/($bwpacketloss+$nr)*100; + return $pktloss; } ?> diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/pollers/cisco_saagent_forwardjitter.php jffnms-0.9.3/engine/pollers/cisco_saagent_forwardjitter.php --- ../jffnms-0.9.2/engine/pollers/cisco_saagent_forwardjitter.php 2012-02-14 23:10:39.000000000 +1100 +++ jffnms-0.9.3/engine/pollers/cisco_saagent_forwardjitter.php 2012-03-26 18:30:12.000000000 +1100 @@ -3,66 +3,30 @@ * Copyright (C) <2002-2005> Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ -function poller_cisco_saagent_forwardjitter($options) { - - if ( !is_array($GLOBALS["cisco_saagent_forwardjitter"][$options["host_id"]])) { - $i=0; - while ( !is_array($sumpossd) and $i++ <= 2 ) { - $sumpossd=snmp_walk($options["host_ip"],$options["ro_community"],".1.3.6.1.4.1.9.9.42.1.5.2.1.9",1); - $sumnegsd=snmp_walk($options["host_ip"],$options["ro_community"],".1.3.6.1.4.1.9.9.42.1.5.2.1.14",1); - $nrpossd =snmp_walk($options["host_ip"],$options["ro_community"],".1.3.6.1.4.1.9.9.42.1.5.2.1.8",1); - $nrnegsd =snmp_walk($options["host_ip"],$options["ro_community"],".1.3.6.1.4.1.9.9.42.1.5.2.1.13",1); - } - - if ( is_array($sumpossd) ) - foreach ( $sumpossd as $key=>$entry ) { - $key=explode(".",$key); - $key=$key[count($key)-1]; - - $sum_pos_sd[$key]=$entry; - } - - if ( is_array($sumnegsd) ) - foreach ( $sumnegsd as $key=>$entry ) { - $key=explode(".",$key); - $key=$key[count($key)-1]; - - $sum_neg_sd[$key]=$entry; - } - - if ( is_array($nrpossd) ) - foreach ( $nrpossd as $key=>$entry ) { - $key=explode(".",$key); - $key=$key[count($key)-1]; - - $nr_pos_sd[$key]=$entry; - } - - if ( is_array($nrnegsd) ) - foreach ( $nrnegsd as $key=>$entry ) { - $key=explode(".",$key); - $key=$key[count($key)-1]; - - $nr_neg_sd[$key]=$entry; - } - - if ( is_array($sum_pos_sd) ) - foreach ( $sum_pos_sd as $key=>$entry ) { - $sum=$sum_pos_sd[$key]+$sum_neg_sd[$key]; - $nr=$nr_pos_sd[$key]+$nr_neg_sd[$key]; - - $forward_jitter[$key]=0; - if ( $nr > 0 ) - $forward_jitter[$key]=($sum/$nr); - - $GLOBALS["cisco_saagent_forwardjitter"][$options["host_id"]][$key]=$forward_jitter[$key]; - } - } - - $value=0; - if ( isset($GLOBALS["cisco_saagent_forwardjitter"][$options["host_id"]][$options["index"]]) ) - $value=$GLOBALS["cisco_saagent_forwardjitter"][$options["host_id"]][$options["index"]]; - - return round($value,2); +function poller_cisco_saagent_forwardjitter($options) +{ + if (empty($options['ro_community']) or !is_numeric($options['index'])) + return FALSE; + $sa_oid = '1.3.6.1.4.1.9.9.42.1.5.2.1'; + $ip = $options['host_ip']; + $comm = $options['ro_community']; + $inst = $options['index']; + + if ( ($sumpossd = snmp_get($ip, $comm, "$sa_oid.9.$inst")) === FALSE) + return FALSE; + if ( ($sumnegsd = snmp_get($ip, $comm, "$sa_oid.14.$inst")) === FALSE) + return FALSE; + if ( ($nrpossd = snmp_get($ip, $comm, "$sa_oid.8.$inst")) === FALSE) + return FALSE; + if ( ($nrnegsd = snmp_get($ip, $comm, "$sa_oid.13.$inst")) === FALSE) + return FALSE; + + $sum = $sumpossd + $sumnegsd; + $nr = $nrpostsd + $nrnegsd; + + $jitter=0; + if ($nr > 0) + $jitter = round($sum / $nr,2); + return $jitter; } ?> diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/pollers/cisco_saagent_fwpacketloss.php jffnms-0.9.3/engine/pollers/cisco_saagent_fwpacketloss.php --- ../jffnms-0.9.2/engine/pollers/cisco_saagent_fwpacketloss.php 2012-02-14 23:10:39.000000000 +1100 +++ jffnms-0.9.3/engine/pollers/cisco_saagent_fwpacketloss.php 2012-03-26 18:31:23.000000000 +1100 @@ -1,48 +1,27 @@ Javier Szyszlican + * Copyright (C) 2012 Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ -function poller_cisco_saagent_fwpacketloss($options) { +function poller_cisco_saagent_fwpacketloss($options) +{ + if (empty($options['ro_community']) or !is_numeric($options['index'])) + return FALSE; + + $sa_oid = '1.3.6.1.4.1.9.9.42.1.5.2.1'; + $ip = $options['host_ip']; + $comm = $options['ro_community']; + $inst = $options['index']; - if (!is_array($GLOBALS["cisco_saagent_fwpacketloss"][$options["host_id"]]) && $options["ro_community"]) { - $i=0; - while ( !is_array($fwpacketloss) and $i++ <=2 ) { - $fwpacketloss_sd=snmp_walk($options["host_ip"],$options["ro_community"],".1.3.6.1.4.1.9.9.42.1.5.2.1.26",1); - $rtlnum=snmp_walk($options["host_ip"],$options["ro_community"],".1.3.6.1.4.1.9.9.42.1.5.2.1.1",1); - } - - if ( is_array($fwpacketloss_sd) ) - foreach ($fwpacketloss_sd as $key=>$entry) { - $key=explode(".",$key); - $key=$key[count($key)-1]; - - $fwpacketloss_sd[$key]=$entry; - } - - if ( is_array($rtlnum) ) - foreach ($rtlnum as $key=>$entry) { - $key=explode(".",$key); - $key=$key[count($key)-1]; - - $rtlnum[$key]=$entry; - } - - if ( is_array($fwpacketloss_sd) ) - foreach ( $fwpacketloss_sd as $key=>$entry ) { - $fwpacketloss[$key]=0; - $nr=$rtlnum[$key]; - if ( $nr > 0 ) - $fwpacketloss[$key]=$fwpacketloss_sd[$key]/($fwpacketloss_sd[$key] + $rtlnum[$key])*100; - - $GLOBALS["cisco_saagent_fwpacketloss"][$options["host_id"]][$key]=$fwpacketloss[$key]; - } - } - - $value=0; - if ( isset($GLOBALS["cisco_saagent_fwpacketloss"][$options["host_id"]][$options["index"]]) ) - $value=$GLOBALS["cisco_saagent_fwpacketloss"][$options["host_id"]][$options["index"]]; - - return $value; + if ( ($fwpacketloss = snmp_get($ip, $comm, "$sa_oid.26.$inst")) === FALSE) + return FALSE; + if ( ($nr = snmp_get($ip, $comm, "$sa_oid.1.$inst")) === FALSE) + return FALSE; + + $pktloss=0; + if ($nr > 0) + $pktloss = $fwpacketloss/($fwpacketloss+$nr)*100; + return $pktloss; } ?> diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/pollers/cisco_saagent_rtl.php jffnms-0.9.3/engine/pollers/cisco_saagent_rtl.php --- ../jffnms-0.9.2/engine/pollers/cisco_saagent_rtl.php 2012-02-14 23:10:39.000000000 +1100 +++ jffnms-0.9.3/engine/pollers/cisco_saagent_rtl.php 2012-03-26 18:31:39.000000000 +1100 @@ -1,47 +1,26 @@ Javier Szyszlican + * Copyright (C) 2012 Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ -function poller_cisco_saagent_rtl($options) { +function poller_cisco_saagent_rtl($options) +{ + if (empty($options['ro_community']) or !is_numeric($options['index'])) + return FALSE; + $sa_oid = '1.3.6.1.4.1.9.9.42.1.5.2.1'; + $ip = $options['host_ip']; + $comm = $options['ro_community']; + $inst = $options['index']; - if ( !is_array($GLOBALS["cisco_saagent_rtl"][$options["host_id"]]) ) { - $i=0; - while ( !is_array($rtlsum) and $i++ <=2 ) { - $rtlsum=snmp_walk($options["host_ip"],$options["ro_community"],".1.3.6.1.4.1.9.9.42.1.5.2.1.2",1); - $rtlnum=snmp_walk($options["host_ip"],$options["ro_community"],".1.3.6.1.4.1.9.9.42.1.5.2.1.1",1); - } - - if ( is_array($rtlsum) ) - foreach ( $rtlsum as $key=>$entry ) { - $key=explode(".",$key); - $key=$key[count($key)-1]; - - $rtlsum[$key]=$entry; - } - - if ( is_array($rtlnum) ) - foreach ( $rtlnum as $key=>$entry ) { - $key=explode(".",$key); - $key=$key[count($key)-1]; - - $rtlnum[$key]=$entry; - } - - if ( is_array($rtlsum) ) - foreach ( $rtlsum as $key=>$entry ) { - $rtl[$key]="0"; - $nr=$rtlnum[$key]; - if ( $nr > 0 ) - $rtl[$key]=$rtlsum[$key]/$rtlnum[$key]; - $GLOBALS["cisco_saagent_rtl"][$options["host_id"]][$key]=$rtl[$key]; - } - } - - $value=0; - if (isset($GLOBALS["cisco_saagent_rtl"][$options["host_id"]][$options["index"]]) ) - $value=$GLOBALS["cisco_saagent_rtl"][$options["host_id"]][$options["index"]]; - - return $value; + if ( ($rtlsum = snmpget($ip, $comm, "$sa_oid.2.$inst")) === FALSE) + return FALSE; + if ( ($rtlnum = snmpget($ip, $comm, "$sa_oid.1.$inst")) === FALSE) + return FALSE; + + $rtl = 0; + if ($rtlnum > 0) + $rtl = $rtlsum / $rtlnum; + return $rtl; } ?> diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/pollers/cisco_saagent_verify.php jffnms-0.9.3/engine/pollers/cisco_saagent_verify.php --- ../jffnms-0.9.2/engine/pollers/cisco_saagent_verify.php 2012-02-14 23:10:39.000000000 +1100 +++ jffnms-0.9.3/engine/pollers/cisco_saagent_verify.php 2012-03-26 18:47:54.000000000 +1100 @@ -3,29 +3,15 @@ * Copyright (C) <2002-2005> Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ -function poller_cisco_saagent_verify($options) { - - if (!is_array($GLOBALS["verify_saagent_operation"][$options["host_id"]]) && $options["ro_community"]) { - $i=0; - while (!is_array($rets) and $i++ <=2 ) - $rets=snmp_walk($options["host_ip"],$options["ro_community"],".1.3.6.1.4.1.9.9.42.1.5.2.1.1",1); - - if ( is_array($rets) ) - foreach ( $rets as $key=>$entry ) { - $key=explode(".",$key); - $key=$key[count($key)-1]; - $GLOBALS["verify_saagent_operation"][$options["host_id"]][$key]=$entry; - } - } +function poller_cisco_saagent_verify($options) +{ + if ($options['ro_community'] == '') + return FALSE; - //$value="down"; //don't assume DOWN let that job to the alarm backend - - if ( isset($GLOBALS["verify_saagent_operation"][$options["host_id"]][$options["index"]]) ) - $check_val=$GLOBALS["verify_saagent_operation"][$options["host_id"]][$options["index"]]; - - if (isset($check_val)) - $value="up"; - - return "$value|$value"; + $numrtt = snmpget($options['host_ip'], $options['ro_community'], + '.1.3.6.1.4.1.9.9.42.1.5.2.1.1.'.$options['index']); + if ($numrtt === FALSE) + return FALSE; + return "UP|$numrtt"; } ?> diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/pollers/cisco_snmp_ping_end.php jffnms-0.9.3/engine/pollers/cisco_snmp_ping_end.php --- ../jffnms-0.9.2/engine/pollers/cisco_snmp_ping_end.php 2012-02-14 23:10:39.000000000 +1100 +++ jffnms-0.9.3/engine/pollers/cisco_snmp_ping_end.php 2012-03-26 09:35:44.000000000 +1100 @@ -4,12 +4,17 @@ * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_cisco_snmp_ping_end ($options) { - extract($options); + $peer = $options['peer']; + $host_ip = $options['host_ip']; + $rw_community = $options['rw_community']; + $interface_id = $options['interface_id']; + $oid = '.1.3.6.1.4.1.9.9.16.1.1.1'; - if (($peer) && ($host_ip) && ($rw_community)) { - $oid = ".1.3.6.1.4.1.9.9.16.1.1.1"; - $result = snmp_set($host_ip,$rw_community,"$oid.16.$random$interface_id","i","6"); //destroy - return count($result); - } else return -1; + if ($peer == '' || $host_ip == '' || $rw_community == '' ) + return -1; + + if (snmp_set($host_ip,$rw_community,"$oid.16.$random$interface_id","i","6") !== FALSE) + return 1; + else return -1; } ?> diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/pollers/cisco_snmp_ping_start.php jffnms-0.9.3/engine/pollers/cisco_snmp_ping_start.php --- ../jffnms-0.9.2/engine/pollers/cisco_snmp_ping_start.php 2010-11-08 10:20:56.000000000 +1100 +++ jffnms-0.9.3/engine/pollers/cisco_snmp_ping_start.php 2012-03-26 09:18:17.000000000 +1100 @@ -41,13 +41,12 @@ { foreach($set_oids as $set_oid) { - if (count(snmp_set($host_ip,$rw_community, - $oid.'.'.$set_oid[0].$random.$interface_id, - $set_oid[1], $set_oid[2])) != 1) - { - logger("ERROR: Ping not ready", 0); - return -1; - } + if (snmp_set($host_ip,$rw_community, + $oid.'.'.$set_oid[0].$random.$interface_id, + $set_oid[1], $set_oid[2]) === FALSE) { + logger("ERROR: Ping not ready", 0); + return -1; + } } //foreach if (($result = snmp_get($host_ip,$rw_community,"$oid.16.$random$interface_id"))==2) //2 si esta listo { diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/pollers/hostmib_apps.php jffnms-0.9.3/engine/pollers/hostmib_apps.php --- ../jffnms-0.9.2/engine/pollers/hostmib_apps.php 2012-02-14 23:10:39.000000000 +1100 +++ jffnms-0.9.3/engine/pollers/hostmib_apps.php 2012-03-26 08:59:01.000000000 +1100 @@ -5,29 +5,44 @@ */ -function poller_hostmib_apps ($options) { +function poller_hostmib_apps ($options) +{ global $Apps; + static $buffer_age = 0; + $buffer_max_len=20; + $buffer_max_age=180; $oid = '.1.3.6.1.2.1.25.4.2.1.2'; //host.hrSWRun.hrSWRunTable.hrSWRunEntry.hrSWRunName - $host_id = $options['host_id']; + $hid = $options['host_id']; - $i=0; - while (!is_array($Apps[$host_id]) && ($i++ <= 2) && ($options['ro_community'])) //try 3 times to get the data - $Apps[$host_id]['raw'] = snmp_walk($options['host_ip'],$options['ro_community'],$oid,1); + if (empty($options['ro_community'])) + return FALSE; + + // Check freshness of buffer + if (!array_key_exists('Apps', $GLOBALS) or ($buffer_age + $buffer_max_age < time())) { + $Apps = array(); + $buffer_age = time(); + } + + if (!array_key_exists($hid, $Apps) || !array_key_exists('raw',$Apps[$hid])) + $Apps[$hid] = array( + 'raw'=> snmp_walk($options['host_ip'],$options['ro_community'],$oid,1), + 'pids'=> array() + ); - if (is_array($Apps[$host_id]['raw'])) //if we got something - { + if (is_array($Apps[$hid]['raw'])) { $instances=0; - foreach ($Apps[$host_id]['raw'] as $key=>$service) //go thru all + foreach ($Apps[$hid]['raw'] as $key=>$service) //go thru all { - $interface_in = trim(str_replace("'",'',trim($service))); - if ( $interface_in == $options['interface'] - || ($options['ignorecase'] - && (strcasecmp($interface_in, $options['interface']) == 0))) //until we find the interface we're looking for - { + $interface_in = trim(str_replace(array("\"","'"),'',trim($service))); + if (array_key_exists('ignorecase', $options) && $options['ignorecase']) + $match = strncasecmp($interface_in,$options['interface'],30); + else + $match = strncmp($interface_in,$options['interface'],30); + if ($match == 0) { $instances++; $pid = end(explode('.',$key)); - $Apps[$host_id]['pids'][$interface_in][]=$pid; + $Apps[$hid]['pids'][$interface_in][]=$pid; } } $value='not running'; diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/pollers/hostmib_perf.php jffnms-0.9.3/engine/pollers/hostmib_perf.php --- ../jffnms-0.9.2/engine/pollers/hostmib_perf.php 2012-02-14 23:10:39.000000000 +1100 +++ jffnms-0.9.3/engine/pollers/hostmib_perf.php 2012-04-15 10:15:15.000000000 +1000 @@ -7,22 +7,25 @@ //By: Javier Szyszlican //Based on the Status Poller By: Anders Karlsson - function poller_hostmib_perf ($options) { - global $Apps; +function poller_hostmib_perf ($options) +{ + global $Apps; + $hid = $options['host_id']; - $hrSWRunPerfEntry_oid = ".1.3.6.1.2.1.25.5.1.1"; - $perf_oid = $hrSWRunPerfEntry_oid.".".$options["poller_parameters"]; - - if (is_array($Apps[$options["host_id"]]["pids"][$options["interface"]])) { //if we got something + $hrSWRunPerfEntry_oid = '.1.3.6.1.2.1.25.5.1.1'; + $perf_oid = $hrSWRunPerfEntry_oid.'.'.$options['poller_parameters']; + + if (!array_key_exists('Apps', $GLOBALS)) + return FALSE; - $pids = $Apps[$options["host_id"]]["pids"][$options["interface"]]; - - foreach ($pids as $pid) - $values[] = current(explode(" ",snmp_get($options["host_ip"], $options["ro_community"], $perf_oid.".$pid"))); - - $value = array_sum($values); - - return $value; - } + $value = 0; + if (array_key_exists($hid, $Apps) && is_array($Apps[$hid]['pids'][$options['interface']])) { //if we got something + + $pids = $Apps[$hid]['pids'][$options['interface']]; + + foreach ($pids as $pid) + $value += intval(current(explode(' ',snmp_get($options['host_ip'], $options['ro_community'], $perf_oid.".$pid")))); } + return $value; +} ?> diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/pollers/ntp_client.php jffnms-0.9.3/engine/pollers/ntp_client.php --- ../jffnms-0.9.2/engine/pollers/ntp_client.php 2011-03-03 12:48:07.000000000 +1100 +++ jffnms-0.9.3/engine/pollers/ntp_client.php 2012-03-26 09:00:26.000000000 +1100 @@ -10,7 +10,7 @@ $ntp_command = $Config->get('ntpq_executable'); if (!is_executable($ntp_command)) - return 'error'; + return FALSE; exec($ntp_command.' -p '.$data['host_ip'].' 2>/dev/null',$raw_result); if (count($raw_result)<=2) diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/pollers/reachability_end.php jffnms-0.9.3/engine/pollers/reachability_end.php --- ../jffnms-0.9.2/engine/pollers/reachability_end.php 2011-02-03 15:46:34.000000000 +1100 +++ jffnms-0.9.3/engine/pollers/reachability_end.php 2012-03-26 08:44:54.000000000 +1100 @@ -12,7 +12,7 @@ $uniq = $poller_buffer['ping-'.$options['interface_id']]; //get file id from reachability_start $filename = "$temp_path/$uniq.log"; - $result = -1; + $result = NULL; if (file_exists($filename)) $result = unlink ($filename); return $result; diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/pollers/reachability_start.php jffnms-0.9.3/engine/pollers/reachability_start.php --- ../jffnms-0.9.2/engine/pollers/reachability_start.php 2011-02-09 11:35:55.000000000 +1100 +++ jffnms-0.9.3/engine/pollers/reachability_start.php 2012-03-26 09:40:03.000000000 +1100 @@ -8,9 +8,10 @@ global $Config; $temp_path = $Config->get('engine_temp_path'); + $uniq=FALSE; if ( ($host_info = resolve_host($options['host_ip'])) === FALSE) - return -1; + return FALSE; list ($af, $ip, $port) = $host_info; if ($af == 6) $fping = $Config->get('fping6_executable'); diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/pollers/reachability_wait.php jffnms-0.9.3/engine/pollers/reachability_wait.php --- ../jffnms-0.9.2/engine/pollers/reachability_wait.php 2011-02-03 15:57:31.000000000 +1100 +++ jffnms-0.9.3/engine/pollers/reachability_wait.php 2012-03-26 10:04:31.000000000 +1100 @@ -9,7 +9,10 @@ global $poller_buffer; $temp_path = $Config->get('engine_temp_path'); - $uniq = $poller_buffer['ping-'.$options['interface_id']]; //get file id from reachability_start + $buffer_name ='ping-'.$options['interface_id']; + if (!array_key_exists($buffer_name, $poller_buffer)) + return 'error'; + $uniq = $poller_buffer[$buffer_name]; $filename = "$temp_path/$uniq.log"; diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/pollers/snmp_counter.php jffnms-0.9.3/engine/pollers/snmp_counter.php --- ../jffnms-0.9.2/engine/pollers/snmp_counter.php 2010-11-17 10:20:02.000000000 +1100 +++ jffnms-0.9.3/engine/pollers/snmp_counter.php 2012-03-26 08:57:07.000000000 +1100 @@ -5,18 +5,19 @@ */ function poller_snmp_counter ($options) { - extract($options); + $oid = $options['poller_parameters']; + $host_ip = $options['host_ip']; - $oid = $poller_parameters; + if (!$options['ro_community']) + return FALSE; - if ($ro_community) { //dont do anything if we dont have the community - $value = trim(get_snmp_counter($host_ip,$ro_community,$oid)); - if ($value=="") $value = trim(get_snmp_counter($host_ip,$ro_community,$oid)); - - if (strpos($value," ")!==FALSE) $value = substr($value,0,strpos($value," ")); - $value = str_replace("(","", str_replace(")","",$value)); - } + $value = trim(get_snmp_counter($options['host_ip'], + $options['ro_community'], $oid)); + if ($value === FALSE or $value == '') + return $value; - return $value; + if ( ($pos = strpos($value,' ')) !==FALSE) + $value = substr($value,0,$pos); + return (str_replace(array('(',')'),'',$value)); } ?> diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/pollers/snmp_ibm_power.php jffnms-0.9.3/engine/pollers/snmp_ibm_power.php --- ../jffnms-0.9.2/engine/pollers/snmp_ibm_power.php 2012-02-14 23:10:39.000000000 +1100 +++ jffnms-0.9.3/engine/pollers/snmp_ibm_power.php 2012-03-26 18:40:30.000000000 +1100 @@ -3,14 +3,15 @@ * Copyright (C) <2002-2005> David LIMA * This program is licensed under the GNU GPL, full terms in the LICENSE file */ -function poller_snmp_ibm_power ($options) { - extract($options); +function poller_snmp_ibm_power ($options) +{ + $oid = $options['poller_parameters']; + if (empty($options['ro_community'])) + return FALSE; - $oid = $poller_parameters; - if ($ro_community) { //dont do anything if we dont have the community - $value2 = (snmp_get($host_ip,$ro_community,$oid)); - preg_match('{(\d+)}',$value2,$value); - } - return $value[1]; + $snmp_value = (snmp_get($options['host_ip'],$options['ro_community'],$oid)); + if ( preg_match('{(\d+)}',$snmp_value,$matches)) + return $matches[1]; + return FALSE; } ?> diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/pollers/snmp_ibm_temperature.php jffnms-0.9.3/engine/pollers/snmp_ibm_temperature.php --- ../jffnms-0.9.2/engine/pollers/snmp_ibm_temperature.php 2012-02-14 23:10:39.000000000 +1100 +++ jffnms-0.9.3/engine/pollers/snmp_ibm_temperature.php 2012-03-26 18:42:01.000000000 +1100 @@ -3,14 +3,15 @@ * Copyright (C) <2002-2005> David LIMA * This program is licensed under the GNU GPL, full terms in the LICENSE file */ -function poller_snmp_ibm_temperature ($options) { - extract($options); +function poller_snmp_ibm_temperature ($options) +{ + $oid = $options['poller_parameters']; + if (empty($options['ro_community'])) + return FALSE; - $oid = $poller_parameters; - if ($ro_community) { //dont do anything if we dont have the community - $value2 = (snmp_get($host_ip,$ro_community,$oid)); - preg_match('{[+|-](\d+)}',$value2,$value); - } - return $value[1]; + $snmp_value = (snmp_get($options['host_ip'],$options['ro_community'],$oid)); + if ( preg_match('{[+|-](\d+)}',$snmp_value,$matches)) + return $matches[1]; + return FALSE; } ?> diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/pollers/snmp_interface_status_all.php jffnms-0.9.3/engine/pollers/snmp_interface_status_all.php --- ../jffnms-0.9.2/engine/pollers/snmp_interface_status_all.php 2012-02-14 23:10:39.000000000 +1100 +++ jffnms-0.9.3/engine/pollers/snmp_interface_status_all.php 2012-03-14 21:56:10.000000000 +1100 @@ -8,7 +8,14 @@ function poller_snmp_interface_status_all ($options) { - $stored_data = 'snmp_interface_status_data-'.$options['poller_parameters']; + // buffer->hid + static $static_buffer = array(); + static $buffer_age = 0; + $hid = $options['host_id']; + $buffer_max_age = 180; // 3 minutes of buffer + $buffer_max_size = 20; // 20 hosts worth of data + $min_iface_buffer = 30; // If device has 30 or more int, buffer it + $snmp_col = $options['poller_parameters']; if (!$options['ro_community']) return FALSE; @@ -17,30 +24,42 @@ ($options['fixed_admin_status']==1)) //And the interface has specified that it does not want its admin status to be modified return FALSE; //Return nothing - if (!isset($GLOBALS[$stored_data]['number_of_interfaces'])) //Get the Number of Interfaces - $GLOBALS[$stored_data]['number_of_interfaces'] = - snmp_get($options['host_ip'],$options['ro_community'],'.1.3.6.1.2.1.2.1.0'); - if ($GLOBALS[$stored_data]['number_of_interfaces'] > 30) { - if (count($GLOBALS[$stored_data])==1) { //only the number of interfaces is set - $i=0; - $rets = ''; - while (!is_array($rets) and $i++ <= 2) //check 3 times or until we get something valid - $rets=snmp_walk($options['host_ip'],$options['ro_community'],'.1.3.6.1.2.1.2.2.1.'.$options['poller_parameters'],1); - if (is_array($rets)) - foreach ($rets as $key=>$entry) { - $key=explode('.',$key); - $key=$key[count($key)-1]; - $GLOBALS[$stored_data][$key]=$entry; - } + // Check freshnewss of buffer + if ($buffer_age + $buffer_max_age < time()) { + $static_buffer = array(); + $buffer_age = time(); + } + + // Fill static buffer + if (!array_key_exists($hid, $static_buffer)) { + // Check max size + if (count($static_buffer) > $buffer_max_size) + shift($static_buffer); + + $static_buffer[$hid]=array('number_of_interfaces' => snmp_get($options['host_ip'],$options['ro_community'],'.1.3.6.1.2.1.2.1.0')); + } + if ($static_buffer[$hid]['number_of_interfaces'] > $min_iface_buffer) { + if (!array_key_exists($snmp_col, $static_buffer[$hid])) { + $rets=snmp_walk($options['host_ip'],$options['ro_community'],'.1.3.6.1.2.1.2.2.1.'.$options['poller_parameters'],1); + if (is_array($rets)) { + $static_buffer[$hid][$snmp_col] = array(); + foreach ($rets as $key=>$entry) { + $key=explode('.',$key); + $key=$key[count($key)-1]; + $static_buffer[$hid][$snmp_col][$key]=$entry; + } } - } else - $GLOBALS[$stored_data][$options['interfacenumber']] = - snmp_get($options['host_ip'],$options['ro_community'],'.1.3.6.1.2.1.2.2.1.'.$options['poller_parameters'].'.'.$options['interfacenumber']); + } + } + $check_val = ''; + if ($static_buffer[$hid]['number_of_interfaces'] > $min_iface_buffer) { + if (!array_key_exists($options['interfacenumber'], $static_buffer[$hid][$snmp_col])) + return FALSE; // No found in buffer + $check_val = $static_buffer[$hid][$snmp_col][$options['interfacenumber']]; + } else { + $check_val = snmp_get($options['host_ip'],$options['ro_community'],'.1.3.6.1.2.1.2.2.1.'.$snmp_col.'.'.$options['interfacenumber']); + } - if (!array_key_exists($options['interfacenumber'], $GLOBALS[$stored_data])) - return FALSE; - - $check_val=$GLOBALS[$stored_data][$options['interfacenumber']]; if ($check_val == '') return FALSE; diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/pollers/snmp_walk_average.php jffnms-0.9.3/engine/pollers/snmp_walk_average.php --- ../jffnms-0.9.2/engine/pollers/snmp_walk_average.php 2012-02-14 23:10:39.000000000 +1100 +++ jffnms-0.9.3/engine/pollers/snmp_walk_average.php 2012-03-26 18:44:07.000000000 +1100 @@ -3,16 +3,16 @@ * Copyright (C) <2002-2005> Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ - function poller_snmp_walk_average ($options) { - $oid = $options["poller_parameters"]; +function poller_snmp_walk_average ($options) +{ + $oid = $options["poller_parameters"]; + if (empty($options['ro_community'])) + return FALSE; - if ($options["ro_community"]) { //dont do anything if we dont have the community - $values = snmp_walk ($options["host_ip"],$options["ro_community"],$oid); - - if (is_array($values) && count($values) > 0) - $average = array_sum($values)/count($values); - } - - return $average; - } + $average=FALSE; + $values = snmp_walk ($options['host_ip'],$options['ro_community'],$oid); + if (is_array($values) && count($values) > 0) + $average = array_sum($values)/count($values); + return $average; +} ?> diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/pollers/sql_status.php jffnms-0.9.3/engine/pollers/sql_status.php --- ../jffnms-0.9.2/engine/pollers/sql_status.php 2012-02-14 23:10:39.000000000 +1100 +++ jffnms-0.9.3/engine/pollers/sql_status.php 2012-03-26 18:44:55.000000000 +1100 @@ -4,34 +4,38 @@ * This program is licensed under the GNU GPL, full terms in the LICENSE file */ - function poller_sql_status ($options) { - - $buffer = &$GLOBALS["session_vars"]["poller_buffer"]; - - $record_values = array( - $buffer["records_counter-".$options["interface_id"]], - $buffer["records_absolute-".$options["interface_id"]]); - - $records = is_numeric($record_values[0])?$record_values[0]:$record_values[1]; - - if ($records >= 0) { - if (is_numeric($options["max_records"]) && ($records > $options["max_records"])) - return "out of bounds|$records records is more than Max ".$options["max_records"]; +function poller_sql_status ($options) +{ + global $poller_buffer; + + if (!array_key_exists('records_counter-'.$options['interface_id'], $poller_buffer) or + !array_key_exists('records_absolute-'.$options['interface_id'], $poller_buffer)) + return FALSE; + + $record_values = array( + $poller_buffer['records_counter-'.$options['interface_id']], + $poller_buffer['records_absolute-'.$options['interface_id']]); + + $records = is_numeric($record_values[0])?$record_values[0]:$record_values[1]; + + if ($records >= 0) { + if (is_numeric($options['max_records']) && ($records > $options['max_records'])) + return 'out of bounds|$records records is more than Max '.$options['max_records']; - if (is_numeric($options["min_records"]) && ($records < $options["min_records"])) - return "out of bounds|$records records is less than Min ".$options["min_records"]; + if (is_numeric($options['min_records']) && ($records < $options['min_records'])) + return 'out of bounds|$records records is less than Min '.$options['min_records']; - return "ok|$records records is within boundaries"; + return 'ok|$records records is within boundaries'; - } else { + } else { - switch ($records) { - case -1: $error = "Problem connecting to the DB"; break; - case -2: $error = "Problem in Query"; break; - case -3: $error = "Problem in Data Retrival"; break; - } - - return "out of bounds|$error"; - } + switch ($records) { + case -1: $error = 'Problem connecting to the DB'; break; + case -2: $error = 'Problem in Query'; break; + case -3: $error = 'Problem in Data Retrival'; break; + } + + return 'out of bounds|$error'; } +} ?> diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/pollers/tcp_connection_number.php jffnms-0.9.3/engine/pollers/tcp_connection_number.php --- ../jffnms-0.9.2/engine/pollers/tcp_connection_number.php 2011-03-03 13:11:52.000000000 +1100 +++ jffnms-0.9.3/engine/pollers/tcp_connection_number.php 2012-03-26 14:46:18.000000000 +1100 @@ -7,31 +7,46 @@ //Read the tcp.tcpConnTable.tcpConnEntry.tcpConnState table to find out //which ports are used in the host -function poller_tcp_connection_number ($options) { - global $poller_buffer; - $buffer_name = 'tcpConnEntry:'.$options['host_ip']; +function poller_tcp_connection_number ($options) +{ + static $static_buffer = array(); + static $buffer_age = 0; + $buffer_max_len=20; // 20 hosts of details + $buffer_max_age=180; // 3 minutes of buffer + $port = $options['port']; + $hid = $options['host_id']; if ($options['ro_community'] =='') - return 0; - $cant = 0; - $port = $options['port']; + return FALSE; - if (!array_key_exists($buffer_name, $poller_buffer)) - $poller_buffer[$buffer_name] = snmp_walk ($options['host_ip'],$options['ro_community'],'.1.3.6.1.2.1.6.13.1.1',1); - $tcpConnEntry = $poller_buffer[$buffer_name]; - if (is_array($tcpConnEntry)) { - reset($tcpConnEntry); - //var_dump($tcpConnEntry); + if ($buffer_age + $buffer_max_age < time()) { + $static_buffer = array(); + $buffer_age = time(); + } + if (!array_key_exists($hid, $static_buffer) or count($static_buffer[$hid])==0) { + if (sizeof($static_buffer) > $buffer_max_len) + array_shift($static_buffer); + + // Fill the static buffer with port counts + $snmp_table = snmp_walk ($options['host_ip'],$options['ro_community'],'.1.3.6.1.2.1.6.13.1.1',1); + if (!is_array($snmp_table)) + return 0; + reset($snmp_table); + $static_buffer[$hid]=array(); foreach ($tcpConnEntry as $key => $state) - if (strpos($state,"5")!==FALSE) { //only established - $entry = explode(".",$key); - $entry = array_slice ($entry, count($entry)-10,10); //get only the last 10 items (SRC-IP(4) + srcport + DEST-IP(4) + destport) - $entry_port = $entry[4]; //srcport (local) + if (strpos($state,'5')!==FALSE) { //only established + $entry = explode('.',$key); + $entry = array_slice ($entry, count($entry)-10,10); //get only the last 10 items (SRC-IP(4) + srcport + DEST-IP(4) + destport) + $entry_port = $entry[4]; //srcport (local) - if ($port==$entry_port) //if the search and found ports are equal - $cant++; - } - } - return $cant; + if (array_key_exists($entry_port,$static_buffer[$hid])) + $static_buffer[$hid][$entry_port]++; + else + $static_buffer[$hid][$entry_port]=1; + }//state==5 + }//buffer doesnt have hid + if (array_key_exists($hid, $static_buffer) and array_key_exists($port, $static_buffer[$hid])) + return $static_buffer[$hid][$port]; + return 0; } ?> diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/pollers/tcp_port_content.php jffnms-0.9.3/engine/pollers/tcp_port_content.php --- ../jffnms-0.9.2/engine/pollers/tcp_port_content.php 2012-02-14 23:10:39.000000000 +1100 +++ jffnms-0.9.3/engine/pollers/tcp_port_content.php 2012-03-26 16:34:02.000000000 +1100 @@ -4,84 +4,78 @@ * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_tcp_port_content ($options) { + global $poller_buffer; + $buffer_name = $options['poller_parameters'].'-'.$options['interface_id']; - if ($options["check_content"]==1) { + if (!array_key_exists($buffer_name, $poller_buffer)) + return FALSE; - $buffer = &$GLOBALS["session_vars"]["poller_buffer"]; + if ($options['check_content']!=1) + return 'valid|not checked'; - //URL Parsing - //----------- - $tcp_data = &$buffer[$options["poller_parameters"]."-".$options["interface_id"]]; - - if (!empty($options["check_url"])) //we have a URL to check - $url = $options["check_url"]; - else - if (empty($tcp_data)) { //if didn't have data directly from TCP - - $allowed_protos = array("http","ftp","https","ftps"); //protos we can handle - - list ($proto, $param) = explode ("|",$options["description"]); - $proto_token = strpos($proto,"://"); - - if ($proto_token===FALSE) - $proto_type = $proto; - else - $proto_type = substr($proto,0,$proto_token); - - if (in_array($proto_type, $allowed_protos)) - $url = (($proto_token===FALSE)?"$proto_type://":$proto).$options["host_ip"].":".$options["port"].$param; - } - - //Data Gathering - //-------------- - - if (!empty($url)) { - if (!isset($buffer["tcp_port_content"][$url])) - $buffer["tcp_port_content"][$url]= file($url); - - $data = $buffer["tcp_port_content"][$url]; - - if (is_array($data)) $data = implode("",$data); - } else - $data = $tcp_data; //if we didn't have a URL then use the tcp data; - - - //Analisis - //-------- - - $valid = false; - - if ($data!==false) { //if we didn't had an error - - if (!empty($options["check_regexp"])) { //if we have a regular expression set, use it. - - if (strpos($options["check_regexp"],"\\")!==false) //if the user escaped its regexp take it like it is. - $regexp = $options["check_regexp"]; - else //if he didn't then take it as a simple regexp (without grab) and escape it - $regexp = preg_quote($options["check_regexp"]); - - $regexp = "/$regexp/i"; - echo "REGEXP: $regexp\nDATA: $data\n"; //DEBUG - - if (preg_match($regexp,$data,$parts)==true) { - //var_dump($parts); //DEBUG - - $valid = true; - - if (count($parts) > 1) //more parts means with grab, so take all the parts except the first one as the result - $data = join(" ",array_slice($parts,1,count($parts))); - } - } else - if (strlen($data) >= 60) // if we didn't have a Regular Expression to check, just check if its longer than 60 characters - $valid = true; - } - - if ($valid == true) - return "valid|".substr(trim(strip_tags($data)),0,40); //return part of the valid data - else - return "invalid"; //has URL or TCP data, but data is invalid - } else - return "valid|Not Checked"; //didn't have check_content=1, or didn't have an allowed proto (because it didn't have a check_url) -} + $tcp_data = $poller_buffer[$buffer_name]; + $url=''; + if (!empty($options['check_url'])) //we have a URL to check + $url = $options['check_url']; + else + if (empty($tcp_data)) { //if didn't have data directly from TCP + $allowed_protos = array('http','ftp','https','ftps'); //protos we can handle + list ($proto, $param) = explode ('|',$options['description']); + $proto_token = strpos($proto,'://'); + if ($proto_token===FALSE) + $proto_type = $proto; + else + $proto_type = substr($proto,0,$proto_token); + + if (in_array($proto_type, $allowed_protos)) + $url = (($proto_token===FALSE)?"$proto_type://":$proto).$options["host_ip"].":".$options["port"].$param; + } + + //Data Gathering + //-------------- + + if (!empty($url)) { + if (!array_key_exists('tcp_port_content', $poller_buffer)) + $poller_buffer['tcp_port_content']=array(); + if (!array_key_exists($url, $poller_buffer['tcp_port_content'])) + $poller_buffer['tcp_port_content'][$url]= file($url); + + $data = $poller_buffer['tcp_port_content'][$url]; + + if (is_array($data)) + $data = implode('',$data); + } else + $data = $tcp_data; //if we didn't have a URL then use the tcp data; + + + //Analisis + //-------- + + $valid = FALSE; + + if ($data!==FALSE) { //if we didn't had an error + + if (!empty($options['check_regexp'])) { //if we have a regular expression set, use it. + if (strpos($options["check_regexp"],"\\")!==false) //if the user escaped its regexp take it like it is. + $regexp = $options['check_regexp']; + else //if he didn't then take it as a simple regexp (without grab) and escape it + $regexp = preg_quote($options['check_regexp']); + $regexp = "/$regexp/i"; + //echo "REGEXP: $regexp\nDATA: $data\n"; //DEBUG + + if (preg_match($regexp,$data,$parts)==true) { + //var_dump($parts); //DEBUG + $valid = true; + if (count($parts) > 1) //more parts means with grab, so take all the parts except the first one as the result + $data = join(" ",array_slice($parts,1,count($parts))); + } + } else + if (strlen($data) >= 60) // if we didn't have a Regular Expression to check, just check if its longer than 60 characters + $valid = true; + } + if ($valid == true) + return "valid|".substr(trim(strip_tags($data)),0,40); //return part of the valid data + return 'invalid'; //has URL or TCP data, but data is invalid +} ?> diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/pollers/verify_interface_number.php jffnms-0.9.3/engine/pollers/verify_interface_number.php --- ../jffnms-0.9.2/engine/pollers/verify_interface_number.php 2011-05-25 15:43:13.000000000 +1000 +++ jffnms-0.9.3/engine/pollers/verify_interface_number.php 2012-03-14 22:01:54.000000000 +1100 @@ -1,44 +1,73 @@ Javier Szyszlican + * Copyright (C) 2012 Craig Small * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function poller_verify_interface_number ($options) { - static $static_buffer = array(); + static $static_buffer = array(); + static $buffer_age = 0; + $buffer_max_len=20; // 20 hosts of details + $buffer_max_age=180; // 3 minutes of buffer + require_once(jffnms_shared('catos')); + require_once(jffnms_shared('webos')); + $ifIndex_oid = '.1.3.6.1.2.1.2.2.1.1'; - $current_ifindex = $options['interfacenumber']; + $current_ifindex = $options['interfacenumber']; - //Search by Interface Name (ie. Switches or not IP interfaces) - if (($options['address']=='') && ($options['interfacenumber']!='')) // if IP is empty and it has a interfacenumber in the DB - { - if (!array_key_exists('ifIndex', $static_buffer) && $options['ro_community']) - { //Get the Tables via SNMP only once - - $ifIndex_oid = '.1.3.6.1.2.1.2.2.1.1'; - $static_buffer['ifIndex'] = snmp_walk($options['host_ip'],$options['ro_community'],$ifIndex_oid); - include_once(jffnms_shared('catos')); //Load CatOS code - if (is_catos($options['host_ip'], $options['ro_community'])) //If this host is CatOS - $ifDescr_oid = CATOS_IFDESCR_OID; - else - $ifDescr_oid = '.1.3.6.1.2.1.2.2.1.2'; //Use the Standard IF-MIB OID - $static_buffer['ifDescr'] = snmp_walk($options['host_ip'],$options['ro_community'],$ifDescr_oid); - } - if (is_array($static_buffer['ifDescr'])) - { - $pos = array_search($options['interface'],$static_buffer['ifDescr']); //Find the DB interface name and return the index - if (is_numeric($pos)) //if we found something - $current_ifindex = $static_buffer['ifIndex'][$pos]; //return the ifIndex at the same position we found this - } - } else //Search by IP Address - if (strpos($options['address'],'.') === FALSE) // if the address is not an IP, use that as the IfIndex - { - $current_ifindex = $options['address']; - } else //If its an IP Address - if (!empty($options['ro_community'])) //and has SNMP - $current_ifindex = snmp_get($options['host_ip'],$options['ro_community'], //Get the interface index - '.1.3.6.1.2.1.4.20.1.2.'.$options['address']); //by looking up the IP - return $current_ifindex; + if (empty($options['ro_community'])) + return -1; + $rocommunity = $options['ro_community']; + $ip = $options['host_ip']; + $hid = $options['host_id']; + + # If the interface has no IP address then we need to search by name + if (($options['address']=='')) { + // Check freshness of buffer + if ($buffer_age + $buffer_max_age < time()) { + $static_buffer = array(); + $buffer_age = time(); + } + if (!array_key_exists($hid, $static_buffer)) { + if (sizeof($static_buffer) > $buffer_max_len) + array_shift($static_buffer); + $ifIndex = snmp_walk($options['host_ip'],$options['ro_community'],$ifIndex_oid); + include_once(jffnms_shared('catos')); + if (is_catos($options['host_ip'], $options['ro_community'])) + $ifDescr_oid = CATOS_IFDESCR_OID; + else + $ifDescr_oid = '.1.3.6.1.2.1.2.2.1.2'; + $ifDescr = snmp_walk($options['host_ip'],$options['ro_community'],$ifDescr_oid); + if (is_array($ifIndex) && count($ifIndex) > 0 && is_array($ifDescr) && count($ifDescr) > 0) { + $static_buffer[$hid] = array('ifIndex'=>$ifIndex, 'ifDescr'=>$ifDescr); + } else { + return -1; //snmpwalk failed + } + + } + if ($current_ifindex != '') { + $pos = array_search($current_ifindex, $static_buffer[$hid]['ifIndex']); + if (is_numeric($pos) && array_key_exists($pos, $static_buffer[$hid]['ifDescr'])) { + $polled_ifdescr = $static_buffer[$hid]['ifDescr'][$pos]; + if (strncmp($polled_ifdescr, $options['interface'],30)==0) + return $current_ifindex; // we found it + } + } + // If not matched, then its changed, find new index + $pos = array_search($options['interface'],$static_buffer[$hid]['ifDescr']); //Find the DB interface name and return the index + if (is_numeric($pos) and array_key_exists($pos, $static_buffer[$hid]['ifIndex'])) //if we found something + return $static_buffer[$hid]['ifIndex'][$pos]; //return the ifIndex at the same position we found this + } else //Search by IP Address + if (strpos($options['address'],'.') === FALSE) // if the address is not an IP, use that as the IfIndex + { + return $options['address']; + } else //If its an IP Address + return snmp_get($options['host_ip'],$options['ro_community'], //Get the interface index + '.1.3.6.1.2.1.4.20.1.2.'.$options['address']); //by looking up the IP + return -1; } + + ?> diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/pollers/verify_storage_index.php jffnms-0.9.3/engine/pollers/verify_storage_index.php --- ../jffnms-0.9.2/engine/pollers/verify_storage_index.php 2012-02-14 23:10:39.000000000 +1100 +++ jffnms-0.9.3/engine/pollers/verify_storage_index.php 2012-03-14 22:13:29.000000000 +1100 @@ -3,33 +3,47 @@ * Copyright (C) <2006> Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ -function poller_verify_storage_index ($options) { - - $hrStorageDescr_oid = ".1.3.6.1.2.1.25.2.3.1.3"; - +function poller_verify_storage_index ($options) +{ + $hrStorageDescr_oid = '.1.3.6.1.2.1.25.2.3.1.3'; $index_actual = -1; - - if (!is_array($GLOBALS["verify_storage_index_data"]) && !empty($options["ro_community"])) { - - $aux = snmp_walk($options["host_ip"],$options["ro_community"], + static $static_buffer = array(); + static $buffer_age=0; + $buffer_max_len=20; + $buffer_max_age=180; + + if (empty($options['ro_community'])) + return $index_actual; + + // Check freshness for buffer + if ($buffer_age + $buffer_max_age < time()) { + $static_buffer = array(); + $buffer_age = time(); + } + if (!array_key_exists($options['host_id'], $static_buffer)) { + // Check buffer length + if (sizeof($static_buffer) > $buffer_max_len) + array_shift($static_buffer); + $storage_descs = snmp_walk($options['host_ip'],$options['ro_community'], $hrStorageDescr_oid, INCLUDE_OID_1); - include_once(jffnms_shared("storage")); + include_once(jffnms_shared('storage')); - if (is_array($aux)) - while (list($k, $v) = each ($aux)) // Parse each description to match what we do in discovery - $GLOBALS["verify_storage_index_data"][$k]=current(storage_interface_parse_description ($v)); - - unset ($aux); + if (is_array($storage_descs)) { + $static_buffer[$options['host_id']] = array(); + foreach ($storage_descs as $key => $value) { + $static_buffer[$options['host_id']][$key]=substr(current(storage_interface_parse_description ($value)),0,30); + } + } + unset ($storage_descs); } - if (is_array($GLOBALS["verify_storage_index_data"])) { - $storage_name = $options["interface"]; - - if (($index_actual = array_search($storage_name, $GLOBALS["verify_storage_index_data"]))===false) - $index_actual = 90000+$options["interface_id"]; // if its not found in the host, change its id out of the picture for removal + if (array_key_exists($options['host_id'], $static_buffer) and + sizeof($static_buffer[$options['host_id']]) > 0) { + $storage_name = $options['interface']; + if (($index_actual = array_search($storage_name, $static_buffer[$options['host_id']]))===false) + $index_actual = 90000+$options['interface_id']; // if its not found in the host, change its id out of the picture for removal } - return $index_actual; } ?> diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/pollers/verify_tc_class_number.php jffnms-0.9.3/engine/pollers/verify_tc_class_number.php --- ../jffnms-0.9.2/engine/pollers/verify_tc_class_number.php 2012-02-14 23:10:39.000000000 +1100 +++ jffnms-0.9.3/engine/pollers/verify_tc_class_number.php 2012-03-14 22:24:17.000000000 +1100 @@ -3,21 +3,37 @@ * Copyright (C) <2002-2005> Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ -function poller_verify_tc_class_number ($options) { +function poller_verify_tc_class_number ($options) +{ + static $static_buffer = array(); + static $buffer_age = 0; + $buffer_max_len = 20; + $buffer_max_age = 180; - $linux_tc_oid = $options["autodiscovery_parameters"]; + $linux_tc_oid = $options['autodiscovery_parameters']; - $index_actual = -1; - if (!is_array($GLOBALS["verify_tc_class_number_data"]) && !empty($options["ro_community"])) - $GLOBALS["verify_tc_class_number_data"] = snmp_walk($options["host_ip"],$options["ro_community"], - "$linux_tc_oid.1.2",1); + if (empty($options['ro_community'])) + return -1; - if (is_array($GLOBALS["verify_tc_class_number_data"])) { - $class_name = substr($options["interface"],strpos($options["interface"],"/")+1,strlen($options["interface"])); - $oid_key = array_search($class_name,$GLOBALS["verify_tc_class_number_data"]); - $index_actual = current(array_reverse(explode (".",$oid_key))); + // Check freshness of buffer + if ($buffer_age + $buffer_max_age < time()) { + $static_buffer = array(); + $buffer_age = time(); } - return $index_actual; + if (!array_key_exists($options['host_id'], $static_buffer)) { + // Check max buffer size + if (sizeof($static_buffer) > $buffer_max_len) + array_shift($static_buffer); + + $static_buffer[$options['host_id']] = snmp_walk($options['host_ip'],$options['ro_community'], $linux_tc_oid.'.1.2',1); + } + + if (is_array($static_buffer[$options['host_id']])) { + $class_name = substr($options['interface'],strpos($options['interface'],'/')+1,strlen($options['interface'])); + $oid_key = array_search($class_name,$static_buffer[$options['host_id']]); + return current(array_reverse(explode ('.',$oid_key))); + } + return -1; } ?> diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/rrd_analizer.php jffnms-0.9.3/engine/rrd_analizer.php --- ../jffnms-0.9.2/engine/rrd_analizer.php 2011-04-19 09:16:51.000000000 +1000 +++ jffnms-0.9.3/engine/rrd_analizer.php 2012-04-13 15:05:18.000000000 +1000 @@ -61,6 +61,10 @@ $type_dss[$row['type']] = $interface_data['values'][$row['id']]; unset ($interface_data); } + if (!array_key_exists($row['type'], $type_dss)) { + logger("I$row[id] : has no values.\n"); + continue; + } $dss = &$type_dss[$row['type']]; $values = analyzer_fetch ($row['id'], $start_time, $end_time, $dss); diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/shared/storage.inc.php jffnms-0.9.3/engine/shared/storage.inc.php --- ../jffnms-0.9.2/engine/shared/storage.inc.php 2011-05-25 15:45:57.000000000 +1000 +++ jffnms-0.9.3/engine/shared/storage.inc.php 2012-03-11 19:56:14.000000000 +1100 @@ -5,7 +5,6 @@ */ function storage_interface_parse_description ($descr) { - $interface = ''; $description = ''; $label_hex = strpos($descr,"Hex"); @@ -14,14 +13,21 @@ $descr = str_replace("\"","",$descr); // UCD-SNMP 4.2.4 fix $descr = str_replace("\\","",$descr); // Windows Hack for C:\ breaking the DB + // By default it is the filtered thing given to us + $interface = $descr; //Windows XP Disk Label Hack $label_pos = strpos($descr,"Label"); if ($label_pos!==false) { $interface = substr($descr,0, $label_pos - 1); //strip the \ and the space $description = substr($descr,$label_pos, strlen($descr) - $label_pos); - } else - $interface = $descr; + } + + // Juniper JUNOS hack + if (preg_match('/mounted on: (\S+)/', $descr, $groups)) { + $interface = $groups[1]; + } + return array($interface, $description); } diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/engine/tftp_get_host_config.php jffnms-0.9.3/engine/tftp_get_host_config.php --- ../jffnms-0.9.2/engine/tftp_get_host_config.php 2011-06-02 21:46:21.000000000 +1000 +++ jffnms-0.9.3/engine/tftp_get_host_config.php 2012-03-15 20:19:03.000000000 +1100 @@ -12,6 +12,7 @@ // main { $Hosts = new JffnmsHosts(); + $HostsConfig = new JffnmsHosts_configs(); $time_total = time_msec(); parse_commandline(); @@ -41,8 +42,8 @@ $config_time = time_msec(); $config_file = $Config->get('jffnms_real_path').'/engine/configs/'. $config_row["command"].'.inc.php'; - $config_get_command = 'hosts_config_'.$config_row['command'].'_get'; - $config_wait_command = 'hosts_config_'.$config_row['command'].'_wait'; + $config_get_command = 'config_'.$config_row['command'].'_get'; + $config_wait_command = 'config_'.$config_row['command'].'_wait'; $now = date("Y-m-d H:i:s",time()); if (array_key_exists($config_file, $config_included_files)) @@ -58,17 +59,17 @@ continue; } require_once($config_file); - if (!function_exists($config_get_function)) + if (!function_exists($config_get_command)) { host_config_logger($config_row, $config_time, - "ERROR: Config get function '$config_get_function' does not exist in config file '$config_file'.\n"); + "ERROR: Config get function '$config_get_command' does not exist in config file '$config_file'.\n"); $config_included_files[$config_file] = FALSE; continue; } - if (!function_exists($config_wait_function)) + if (!function_exists($config_wait_command)) { host_config_logger($config_row, $config_time, - "ERROR: Config wait function '$config_wait_function' does not exist in config file '$config_file'.\n"); + "ERROR: Config wait function '$config_wait_command' does not exist in config file '$config_file'.\n"); $config_included_files[$config_file] = FALSE; continue; } @@ -91,19 +92,20 @@ continue; } - $function_data = array($config['host_ip'],$config['rwcommunity'],$config['tftp_server'],$config_filename); + $function_data = array($config_row['host_ip'],$config_row['rwcommunity'], + $config_row['tftp_server'],$real_tftp_filename); - if (call_user_func_array($config_get_function, $function_data) === FALSE) + if (call_user_func_array($config_get_command, $function_data) === FALSE) { host_config_logger($config_row, $config_time, - 'Getting config file from host'); + 'WARNING: Failed to get config file from host'); unlink($real_tftp_filename); continue; } - if (call_user_func_array($wait_function, $function_data) === FALSE) + if (call_user_func_array($config_wait_command, $function_data) === FALSE) { host_config_logger($config_row, $config_time, - 'Waiting for file transfer'); + 'WARNING: Failed waiting for file transfer'); unlink($real_tftp_filename); continue; } @@ -111,13 +113,13 @@ if (!file_exists($real_tftp_filename) || filesize($real_tftp_filename) == 0) { host_config_logger($config_row, $config_time, - 'File did not transfer'); + 'WARNING: file did not transfer'); unlink($real_tftp_filename); continue; } $config_data_new = file_get_contents($real_tftp_filename); unlink($real_tftp_filename); - $db_host_configs = $Hosts->config_list(NULL, $config_row['host_id'],NULL,1); + $db_host_configs = $HostsConfig->get_all(NULL, $config_row['host_id'],NULL,1); $config_data_old = $db_host_configs[0]['config']; $config_id_old = $db_host_configs[0]['id']; @@ -130,14 +132,14 @@ $data = array( 'host'=>$config_row['host_id'], 'date'=>$now, - 'config'=>$config_data + 'config'=>$config_data_new ); - $config_id = $Hosts->config_add(); - $result = $Hosts->config_update($config_id,$data); //save the config in the DB + $config_id = $HostsConfig->add(); + $result = $HostsConfig->update($config_id,$data); //save the config in the DB $info = "new config id $config_id"; } else $info = "same config as last one ($config_id_old)"; - hosts_config_logger($config_row, $config_time,'', $info); + host_config_logger($config_row, $config_time,'', $info); } //while row $time_total = time_msec_diff($time_total); logger( "TIMES \t: Total Time $time_total msec.\n"); @@ -152,9 +154,9 @@ if ($error != '') { $Events = new JffnmsEvents(); - $Events->add($now, $Config->get('jffnms_administrative_type'), + $Events->add(date("Y-m-d H:i:s",time()), $Config->get('jffnms_administrative_type'), $config_row['host_id'],'CPU','error','host_config', - "Host Config Transfer $error",0,0); + 'Host Config Transfer: '.addslashes($error),0,0); } else $error = "OK $info"; diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/htdocs/admin/adm/adm_hosts_config.php jffnms-0.9.3/htdocs/admin/adm/adm_hosts_config.php --- ../jffnms-0.9.2/htdocs/admin/adm/adm_hosts_config.php 2011-01-05 17:02:12.000000000 +1100 +++ jffnms-0.9.3/htdocs/admin/adm/adm_hosts_config.php 2012-03-15 08:32:27.000000000 +1100 @@ -8,12 +8,13 @@ if (!profile('ADMIN_HOSTS')) die ('

You dont have Permission to access this page.

'); adm_header('Hosts Config'); -$api = new JffnmsHosts_config(); +$api = new JffnmsHosts_configs(); $span = $Sanitizer->get_int('span', 30); $init = $Sanitizer->get_int('init', 0); $filter = $Sanitizer->get_string('filter'); $action = $Sanitizer->get_string('action'); +$actionid = $Sanitizer->get_int('actionid'); $diff1 = $Sanitizer->get_int('diff1'); $diff2 = $Sanitizer->get_int('diff2'); $fields = 6; @@ -46,8 +47,8 @@ radiobutton('diff1', ($diff1==$rec['id'])?1:0, $rec['id']). radiobutton('diff2', ($diff2==$rec['id'])?1:0, $rec['id']). linktext('Read', - $Sanitizer->get_url('','all', FALSE, - array('action' => 'read', actionid => $rec['id'], 'init' => $init)), + $Sanitizer->get_url('','all', + array('action' => 'read', 'actionid' => $rec['id'], 'init' => $init)), 'action')). td($rec['id'], 'field_id'). td($rec["date"], "field"). @@ -67,14 +68,15 @@ } //while if ($action == 'diff') { - $clean_url = $Sanitizer->get_url('','all', array('action'), - array('diff1', $diff1, 'diff2', $diff2, 'filter', $filter)); + $clean_url = $Sanitizer->get_url('','all', + array('diff1', $diff1, 'diff2', $diff2, 'filter', $filter), + array('action')); echo tr(linktext('Go Back',$clean_url), 'action', $fields). tr('Difference Between Configurations','header',$fields). tr_open(). td(memobox('', 20, 80, $api->diff($diff1, $diff2)), 'field', 'field_config', $fields, '', true); } else echo tr(adm_form_submit('View Diff'), 'action', $fields). - form_close(); +form_close(); adm_footer(); ?> diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/htdocs/admin/adm/adm_triggers_rules.php jffnms-0.9.3/htdocs/admin/adm/adm_triggers_rules.php --- ../jffnms-0.9.2/htdocs/admin/adm/adm_triggers_rules.php 2012-02-14 23:10:39.000000000 +1100 +++ jffnms-0.9.3/htdocs/admin/adm/adm_triggers_rules.php 2012-04-09 12:29:52.000000000 +1000 @@ -22,23 +22,24 @@ switch ($action) { case 'update': - #if (is_array($value)) $value = join($value,","); + $value = $Sanitizer->get_string('value',array(),TRUE); + if (is_array($value)) + $value = join($value,','); + $update_data = array( + //'trigger_id' => $Sanitizer->get_int('trigger_id'), + 'pos' => $Sanitizer->get_int('pos'), + 'field' => $Sanitizer->get_string('field'), + 'operator' => $Sanitizer->get_string('operator'), + 'value' => $value, + 'action_id' => $Sanitizer->get_int('action_id',1), + 'stop' => $Sanitizer->get_int('stop',0)); $action_params = $Sanitizer->get_string('action_params'); if (is_array($action_params)) { foreach ($action_params as $key=>$data) $aux[]="$key:$data"; - $action_parameters=join(",",$aux); + $update_data['action_parameters']=join(",",$aux); } - $update_data = array( - 'trigger_id' => $Sanitizer->get_int('trigger_id'), - 'pos' => $Sanitizer->get_int('pos'), - 'field' => $Sanitizer->get_string('field'), - 'operator' => $Sanitizer->get_string('operator'), - 'value' => $Sanitizer->get_string('value',array(),TRUE), - 'action_id' => $actionid, - 'action_parameters' => $action_parameters, - 'stop' => $Sanitizer->get_int('stop',0)); $TriggersRules->update($actionid,$update_data); $action="list"; break; diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/htdocs/admin/adm/adm_users.inc.php jffnms-0.9.3/htdocs/admin/adm/adm_users.inc.php --- ../jffnms-0.9.2/htdocs/admin/adm/adm_users.inc.php 2011-03-10 14:33:54.000000000 +1100 +++ jffnms-0.9.3/htdocs/admin/adm/adm_users.inc.php 2012-03-29 22:34:08.000000000 +1100 @@ -29,7 +29,7 @@ $usern = ''; } if ($actionid == 'new' && !empty($usern)) - $_POST['actionid'] = $api->add($usern); + $actionid = $api->add($usern); $api->modify($actionid, $usern, $old_passwd, $new_passwd, $fullname, $router); $GLOBALS['action']='list'; diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/htdocs/admin/adm/structures.php jffnms-0.9.3/htdocs/admin/adm/structures.php --- ../jffnms-0.9.2/htdocs/admin/adm/structures.php 2011-06-16 21:23:48.000000000 +1000 +++ jffnms-0.9.3/htdocs/admin/adm/structures.php 2012-04-11 22:40:46.000000000 +1000 @@ -447,7 +447,7 @@ 'profile'=>'ADMIN_SYSTEM', 'fields'=>array( - 'sla'=>array( 'name'=>'SLA', 'type'=>'select', 'func'=>'select_slas', 'size'=>30, 'view'=>'sla_description'), + //'sla'=>array( 'name'=>'SLA', 'type'=>'select', 'func'=>'select_slas', 'size'=>30, 'view'=>'sla_description'), 'pos'=>array( 'name'=>'Position', 'type'=>'textbox', 'size'=>3), 'cond'=>array( 'name'=>'Condition', 'type'=>'select', 'func'=>'select_slas_cond', 'size'=>30, 'view'=>'cond_description'), 'show_in_result'=>array( 'name'=>'Show', 'type'=>'checkbox'), diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/htdocs/admin/setup.php jffnms-0.9.3/htdocs/admin/setup.php --- ../jffnms-0.9.2/htdocs/admin/setup.php 2012-02-14 23:10:39.000000000 +1100 +++ jffnms-0.9.3/htdocs/admin/setup.php 2012-03-06 07:22:35.000000000 +1100 @@ -222,6 +222,7 @@ if ($Config->get('jffnms_initial_config_finished') ==1) { + require_once('../auth.php'); if (($Config->get('jffnms_access_method') == 'local') && (db_test())) $no_db = 0; if (!profile('ADMIN_SYSTEM')) die ('

You dont have Permission to access this page.

'); diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/INSTALL jffnms-0.9.3/INSTALL --- ../jffnms-0.9.2/INSTALL 2012-03-04 13:43:13.000000000 +1100 +++ jffnms-0.9.3/INSTALL 1970-01-01 10:00:00.000000000 +1000 @@ -1,226 +0,0 @@ -'Just For Fun' Network Management System Version 0.9.2 - By Javier Szyszlican and Craig Small -====================================================== - -Requirements: -============= - --Operating System: - . *NIX (Development is on GNU/Linux, It has been tested on FreeBSD and Solaris too) - . Windows 2000/XP also works (A good crond for windows will be useful). - If you are installing on Windows please read the INSTALL.win32.txt file. - --Apache ( > 1.3.x or > 2.0.x) - --MySQL ( > 3.23.x or > 4.0.x ) or PostgreSQL ( Tested with 7.4.6 ) - --RRDtool (www.rrdtool.org) (> 1.0.33 ) - --PHP ( > 5.0.x ) - Extensions: snmp, ssl, gd, sockets, mysql or pgsql, pcre, posix, ob, pcntl and session - --NET-SNMP utilities and trapd server (optional) - --GNU Diff - --TFTP Server (optional) - --JFF NMS Integration Packages (TACACS+ & Syslog) (optional, useful on routers) - --Graphviz & WebFonts (http://www.graphviz.org) (optional) - --NMAP PortScanner > 2.54B (http://www.insecure.org/nmap/) for TCP Port Discovery (optional) - --Fping (http://www.fping.com) for Reachability (Only on Linux/*NIX) - --tmpwatch (http://linux.maruhn.com/sec/tmpwatch.html) (Only on Linux/*NIX) - Used for deleting all temporary files - - -Steps: -====== - -. Compile and/or Install MySQL / PgSQL - -. Compile and/or Install Apache - -. Compile and/or Install Graphviz and WebFonts (optional) - -. Compile and/or Install NMAP - - Nmap should be set-uid root if you want UDP port monitoring & discovery to work. - - Execute: - # chmod +s /usr/bin/nmap - # chmod a+x /usr/bin/nmap - -. Compile and/or Install Fping - - Verify that the user running the cron jobs, is able to execute fping and that it is set-uid root. - - Execute: - # chmod +s /usr/sbin/fping - # chmod a+x /usr/sbin/fping - - And you should see something like this: - -rwsr-xr-x 1 root adm 28291 May 31 22:14 /usr/sbin/fping - -. Compile and/or Install RRDtool - -. Compile and/or Install PHP - - I M P O R T A N T - ----------------- - - PHP Modules Needed: sockets, snmp, gd, (pgsql and/or mysql), wddx (for satellites), pcre (syslog parsing) - - Be sure to add the required modules to your /etc/php.ini file. - - Remember to verify that your modules are loaded with /admin/adm/test.php or the JFFNMS setup screen. - - A N D - - --------------------------------------------------- - --------------------------------------------------- - Change This in your php.ini file. - - register_globals = On - register_argc_argv = On - error_reporting = E_ALL & ~E_NOTICE - allow_url_fopen = On - include_path = .:/usr/share/pear - short_open_tag = On - - --------------------------------------------------- - --------------------------------------------------- - - Also check if your Apache is loading mod_php. - - Any change to the PHP ini file (ie. /etc/php.ini) requires Apache to be restarted to take effect. - --------------------------------------------------------------- -. Read the docs/* files, these are examples of configuration. --------------------------------------------------------------- - -. Optional: Install Integration Packages tac_plus and msyslog (read the README and INSTALL files of each program). - Hints: - -If you have problems with mysql when compiling (mysql.h lines ~245 & ~256) change DB to db (lowercase); - -If you have a linking problem with compress add -lz to the Makefile libraries - -msyslog: Remember to change your init.d/syslog to the new binary and command line options. (read the example) - -. Create User & Group - - Note: replace apache by your Apache user (like apache, httpd, www-data, etc) - - # groupadd jffnms - # useradd -g jffnms -d /opt/jffnms -s /bin/false -c 'JFFNMS User' jffnms - # usermod -G jffnms apache - -. Unpack the release: - - # tar xvzf jffnms-0.9.2.tar.gz - - You will get a directory called jffnms-0.9.2/ - - # mv jffnms-0.9.2 /opt/jffnms - -. Permissions - - # chown -R jffnms:jffnms /opt/jffnms - # chmod 770 /opt/jffnms - # chmod -R ug+rw /opt/jffnms - -. Crontab - Install the JFFNMS crontab file - - # crontab -u jffnms /opt/jffnms/docs/unix/crontab - - Now modify the values at the top if they don't match your system: - - # crontab -e -u jffnms - - Allow JFFNMS to run cron jobs (AFAIK only needed in Solaris) - - # echo jffnms >> /etc/cron.allow - -. Create the Databases - - Manually create the database "jffnms", set the permissions and then import the schema and data. - - Replace the 'x' with the jffnms version number. - - MySQL: - ====== - # mysql -u -p - mysql> CREATE DATABASE jffnms; - mysql> GRANT ALL PRIVILEGES ON jffnms.* TO jffnms@localhost IDENTIFIED BY 'jffnms'; - mysql> FLUSH PRIVILEGES; - mysql> quit - - # mysql -u jffnms -pjffnms jffnms < docs/install/jffnms-0.9.2.mysql - - PostgreSQL: - =========== - # psql template1 postgres - template1=# create user jffnms password 'jffnms' createdb; - template1=# \connect template1 jffnms - template1=# create database jffnms; - template1=# \q - - # psql jffnms jffnms < docs/install/jffnms-0.9.2.pgsql - - This will create the jffnms Tables and required records. - - -. Configure Apache as follows (from docs/*): - - 1. As a Virtual Host (if you control a DNS server): - - - ServerAdmin you@yournet.com - DocumentRoot /opt/jffnms/htdocs - ServerName nms.yournet.com - LimitRequestLine 20000 - - - 2. As a sym-link (in Unix): - - ln -s /opt/jffnms/htdocs /var/www/html/jffnms - - (or the path your Apache uses). - - JFFNMS needs to be at the main Document Root, a VirtualHost or a SymLink. - -. Restart/Reload Apache, MySQL or PgSQL, xINETD (tftpd) - -. PHP Module Load Errors are reported to /var/log/httpd/error_log (RedHat) or /var/log/apache/error_log (Gentoo) - -. Point your browser to http://www.yourserver.com/jffnms or http://nms.yournet.com/ (depending on what you choose) - - You should see the Setup screen, it should have auto-discovered your configuration. - Verify that everything is correct (OK, YES in green) before saving the config. - -. Point your browser (again) to http://www.yourserver.com/jffnms or http://nms.yournet.com/ (depending on what you -choose) - - Username: admin - Password: admin - - And now, you are inside the system. - - -. You can read the manual at http://www.jffnms.org - - -========================================================================= -If you need anything, contact us at: jffnms-users@lists.sourceforge.net - -Thank You for trying 'Just For Fun' Network Management System - -Don't forget to Donate to the project if you find it useful for your work. -========================================================================= - -Javier Szyszlican aka SzYsZ -Buenos Aires, Argentina -javier@jffnms.org (please try the mailing list first) -ICQ #397319 diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/INSTALL.win32.txt jffnms-0.9.3/INSTALL.win32.txt --- ../jffnms-0.9.2/INSTALL.win32.txt 2012-03-04 13:43:13.000000000 +1100 +++ jffnms-0.9.3/INSTALL.win32.txt 1970-01-01 10:00:00.000000000 +1000 @@ -1,203 +0,0 @@ -Windows 2000/XP Install Procedure -================================= - - -Note: This will not work for Windows 95/98/Me, it's only for Windows 2000/XP and maybe NT 4.0 - -The installation should be done as and Administrator User. - -This guide is for Apache2 with PHP5. If you want to use older versions, -read the JFFNMS 0.7.9 INSTALL.win32.txt file. - -Installation: -------------- - -Install Apache: - Download Apache2 from: http://www.apache.org/dist/httpd/binaries/win32/ - Get the latest release "no_ssl.msi" package, like "apache_2.0.52-win32-x86-no_ssl.msi". - Complete Install, Click on Next until Finish. - You should see Apache running in your taskbar. - Test it going browsing to http://localhost/ or http://IP.OF.YOUR.BOX/ - -Install MySQL: - Download from: http://www.mysql.com/downloads/mysql/4.1.html - Scroll down until you find MySQL Essentials for Windows. - - Select the "Complete Install", Click on Next until Finish. - - When you go into the configuration phase, select "Server Machine", - and then "Non-Transacctional Database Only". - - Then set a new root password. - - All other configuration leave as default. - -Install PHP: - Download PHP 5 from: http://www.php.net/downloads.php - Get the "Windows Binaries ZIP package" with all the modules (First One). - - Extract the archive to c:\php - - Execute the following: - c:\> copy c:\php\php.ini-dist c:\windows\php.ini - c:\> copy c:\php\libmysql.dll c:\windows\ - - Create Folder c:\usr - Copy c:\php\extra\mibs to c:\usr\mibs - -Install JFFNMS: - Download the .zip file (I'm sure you already have done this) and extract it to c:\jffnms - - Create the User 'jffnms' in the Windows User Manager with any password you choose. - - Remember to CHECK 'Password Never Expires' and UNCHECK 'Must Change password at next logon' for this user. - - Give the 'jffnms' user FULL CONTROL over the c:\jffnms folder (and its sub-folders) - -Install RRDTOOL: - Download from: http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/?M=D - Get the rrdtool-1.0.49-win32-bin.zip (or newer) file. - Extract the archive to a temporary location. - Copy the rrdtool.exe file from inside the archive to c:\jffnms - -Install NMAP: (If you are running Windows XP please read the NMAP page carefully, it may not work) - Download it from: http://www.insecure.org/nmap/nmap_download.html - Get the nmap-3.81-win32.zip file (or newer) - Extract the nmap.exe file from the archive to c:\jffnms\ - -Install WinPCAP for NMAP: - - Download it from: http://winpcap.polito.it/ - Choose the Auto-Installer. - Complete Install, Click on Next until Finish. - - -Configuration: --------------- - -Configure Apache for PHP5: - - Add this to the bottom of your c:\program files\apache group\Apache2\conf\httpd.conf file: - - LoadModule php5_module c:/php/php5apache2.dll - AddType application/x-httpd-php .php - - NameVirtualHost * - - - ServerAdmin webmaster@your-domain.com - DocumentRoot c:\jffnms\htdocs - ServerName nms.yourdomain.com - DirectoryIndex index.php - LimitRequestLine 20000 - - - * Make sure you modify the above information to match your needed settings - -Configure PHP: - Make sure you have this on your php.ini file: - - register_globals = On - register_argc_argv = On - allow_url_fopen = On - - extension_dir = c:\php\ext - - (Uncomment the following): - extension=php_gd2.dll - extension=php_snmp.dll - extension=php_mysql.dll - extension=php_sockets.dll - - SMTP = your.mail.server.com (set it to your mail server IP or DNS name) - - Now Restart the Apache Service. - - if you don't change these, JFFNMS will not work. - -Configure MySQL: - - To create the JFFNMS DB run the following: - - Check the path to mysql.exe - - c:\> c:\Program Files\MySQL\MySQL Server 4.1\bin\mysql.exe -u root -p - - mysql>CREATE DATABASE jffnms; - mysql>GRANT ALL PRIVILEGES ON jffnms.* TO jffnms@localhost IDENTIFIED BY 'jffnms'; - mysql>FLUSH PRIVILEGES; - mysql>quit; - - And: - - c:\> c:\Program Files\MySQL\MySQL Server 4.1\bin\mysql.exe -ujffnms -pjffnms jffnms < c:\jffnms\docs\jffnms-0.8.x.mysql - - Replace x with the version you are installing. - -Configure JFFNMS: - - ----------------- - I M P O R T A N T - ----------------- - - Go to: http://yourserver/ - - Verify and change (if needed) the options. - - Don't mind the errors on diff, neato, smsclient, fping, ntpq, PgSQL and SOAP. - - Save the configuration and change the values until everything needed is Green. - - Everything else SHOULD be OK. - - Scheduled Tasks: - ---------------- - If you did not install jffnms in c:\jffnms you will have to change the - contents of the .bat files (path). - - Start/Settings/Control Panel/Scheduled Tasks/Add Scheduled Task. - 1) Next - 2) Click Browse - 3) Browse to c:\jffnms\engine\windows and select the first .bat file. - 4) Select Daily, then Next. - 5) Change the Start time to 12:00 AM - 6) Select Every 1 Days then Next. - 7) Enter Username: jffnms and Password: (the one you choosed before), then Next. - 8) Click the 'Open Avanced...' checkbox, then click Finish - 9) Change "Start In" to c:\jffnms\engine - 10) Click the Schedule tab - 11) For autodiscovery_interfaces, consolidate, poller & rrd_analizer: - Click on the Advanced Button. - Check Repeat Task. In the Every Field enter the respective times: - autodiscovery_interfaces every 30 minutes. - consolidate Every 1 Minute. - poller Every 4 minutes. - rrd_analizer every 30 minutes. - Duration: 24 Hours. - - 12) Click on OK. - 13) Click on OK. - - ** REPEAT THESE STEPS FOR EACH .BATCH FILE IN THE C:\JFFNMS\ENGINE\WINDOWS PATH! - - -Now... try to access http://yourserver/ or http://yourserver/jffnms/ (if you took this way) -Remember to add the last slash / to the URL. -The Default Username and password is "admin". - -If you want to read more, please read the INSTALL file and skip the Unix Parts. - - -========================================================================= - -If you need anything, contact us at: jffnms-users@lists.sourceforge.net - -Thank You for trying 'Just For Fun' Network Management System - -Don't forget to Donate to the project if you find it useful for your work. - -========================================================================= -Javier Szyszlican aka SzYsZ -Buenos Aires, Argentina -javier@jffnms.org (please try the mailing list first) -ICQ #397319 diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/lib/api.classes.inc.php jffnms-0.9.3/lib/api.classes.inc.php --- ../jffnms-0.9.2/lib/api.classes.inc.php 2011-06-15 11:39:31.000000000 +1000 +++ jffnms-0.9.3/lib/api.classes.inc.php 2012-04-11 21:58:45.000000000 +1000 @@ -35,46 +35,6 @@ } } // class jffnms_graph_types -class JffnmsHosts_config extends basic -{ - function diff ($id1, $id2) - { - global $Config; - - if ($id1 != $id2) - { - $aux = $this->config_list(array($id1,$id2)); - $str1 = $aux[0]['config']; - $str2 = $aux[1]['config']; - - $engine_temp = $Config->get('engine_temp_path'); - - $name1 = $engine_temp.'/'.uniqid('').'.dat'; - $name2 = $engine_temp.'/'.uniqid('').'.dat'; - - $pf = fopen($name1,'w'); - fputs($pf,$str1); - fclose($pf); - - $pf = fopen($name2,"w"); - fputs($pf,$str2); - fclose($pf); - - $diff_executable = $Config->get('diff_executable'); - - if (file_exists($diff_executable)) - { - $c = exec($diff_executable.' -Nru '.$name1.' '.$name2, $diff); - unlink($name1); - unlink($name2); - - $diff = join("\n",array_slice($diff, 3)); - return $diff; - } - } - return false; - } -} class JffnmsHosts_config_types extends basic { diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/lib/api.iad.inc.php jffnms-0.9.3/lib/api.iad.inc.php --- ../jffnms-0.9.2/lib/api.iad.inc.php 2010-11-01 10:56:01.000000000 +1100 +++ jffnms-0.9.3/lib/api.iad.inc.php 2012-04-11 22:27:10.000000000 +1000 @@ -24,6 +24,8 @@ $index=$field; break; } + if (!isset($index)) + return $db_interfaces; unset ($field); unset ($fdata); unset ($aux['field_types']); diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/lib/api.inc.php jffnms-0.9.3/lib/api.inc.php --- ../jffnms-0.9.2/lib/api.inc.php 2012-02-14 23:10:39.000000000 +1100 +++ jffnms-0.9.3/lib/api.inc.php 2012-04-13 20:59:05.000000000 +1000 @@ -25,16 +25,19 @@ if ($Config->get('jffnms_debug')==1) { - $file = str_replace('.php','',basename($Config->get('logging_file'))); - $filename = $Config->get('log_path').'/'.$file.'-'.date('Y-m-d').'.log'; - - if ( ($log = fopen($filename,"a+")) === FALSE) - { - print "Unable to open log file $filename.\n"; - return; - } - fputs($log, $text); - fclose($log); + if (array_key_exists('Child', $GLOBALS)) { + $GLOBALS['Child']->logger($text); + return; + } + $file = str_replace('.php','',basename($Config->get('logging_file'))); + $filename = $Config->get('log_path').'/'.$file.'-'.date('Y-m-d').'.log'; + + if ( ($log = fopen($filename,'a+')) === FALSE) { + print "Unable to open log file $filename.\n"; + return; + } + fputs($log, $text); + fclose($log); } echo $text; } @@ -73,6 +76,18 @@ return $result; } +// Youre kidding me right? the float and floatvar are not locale +// aware? Really? +// Lucky for us rrdtool exports things as scientific notation so we don't +// need to worry about thousand separators +function str2f($str) +{ + $linfo = localeconv(); + $str = str_replace(',','.',$str); + return floatval($str); +} + + // TIME FUNCTIONS //----------------------------------------- // diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/lib/api.network.inc.php jffnms-0.9.3/lib/api.network.inc.php --- ../jffnms-0.9.2/lib/api.network.inc.php 2011-06-01 15:10:15.000000000 +1000 +++ jffnms-0.9.3/lib/api.network.inc.php 2012-04-11 22:23:54.000000000 +1000 @@ -70,13 +70,16 @@ if ($include_oid > INCLUDE_OID_BASE) $result = snmp_reduce_table_key ($result, $include_oid-INCLUDE_OID_BASE); - foreach ($result as $oid => $value) + $new_result = array(); + foreach ($result as $oid => $value) { if ( (strpos($value, 'No Such Instance') !== FALSE) or (strpos($value, 'No Such Object') !== FALSE) or (strpos($value, 'No more variables left') !== FALSE) ) - unset($result[$oid]); - return $result; + continue; + $new_result[$oid] = snmp_fix_value($value); + } + return $new_result; } function snmp_get ($host, $comm, $oid, $retries = 2) @@ -107,7 +110,7 @@ (strpos($result, 'No Such Object') !== FALSE) or (strpos($result, 'No more variables left') !== FALSE) ) return FALSE; - return $result; + return snmp_fix_value($result); } function snmp_set ($host, $comm, $oid, $type, $value, $retries = 2) @@ -158,17 +161,17 @@ function snmp_fix_value ($value) { - $value = trim ($value); - if (strpos($value,'=') !== false) // if it has = in the value - $value = substr($value, strpos($value,'=')+2, strlen($value)); // return only the data after the = - - if ($value=preg_replace('/INTEGER: /','',$value)) - return $value; - - if (preg_match("/^\"(\S.+)\"$/",$value,$parts)) $value = $parts[1]; - if (preg_match("/STRING: \"(\S.+)\"/",$value,$parts)) $value = $parts[1]; - - return preg_replace('/(?:STRING|IpAddress|Gauge32|Counter32|Counter64): /','',$value); + if ($value === FALSE) + return FALSE; + $value = preg_replace('/(counter32|counter64|gauge|gauge32|gauge64|hex|ipaddress|integer|string):/i', '', $value); + if ($value == '') + return ''; + if (is_numeric($value)) + return trim($value); + + // Remove quotes and other delimiters + $value = str_replace(array("\"","'",">","<","\\","\n","\r"),'', $value); + return trim($value); } function snmp_reduce_table_key ($table, $important = 1) diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/lib/api.rrdtool.inc.php jffnms-0.9.3/lib/api.rrdtool.inc.php --- ../jffnms-0.9.2/lib/api.rrdtool.inc.php 2012-02-14 23:10:39.000000000 +1100 +++ jffnms-0.9.3/lib/api.rrdtool.inc.php 2012-04-13 16:42:54.000000000 +1000 @@ -50,11 +50,12 @@ $command .= ' --daemon '.RRDCACHED_SOCKET; //debug($command); + $command .= ' 2>&1'; if ($use_pipe) list ($ret1, $ret2) = rrd_pipe($method." '".$file."' ".$aux); else - exec($command,$ret1,$ret2); + $ret3 = exec($command,$ret1,$ret2); //debug($ret1); //debug($ret2); @@ -74,7 +75,7 @@ { for ($i = 1; $i < count($line1); $i++) // Part 1 is timestamp if ($line1[$i]!=="") // Part 2 maybe is a space - $value[] = ($line1[$i]=="nan")?0:(float)$line1[$i]; // Part 3 (or 2) has the data + $value[] = ($line1[$i]=="nan")?0:str2f($line1[$i]); // Part 3 (or 2) has the data $date = (int)$line1[0]; // Time Stamp if (!isset($stop)) $stop=0; if ($date > $stop) $stop = $date; @@ -111,6 +112,7 @@ if ($ret2 != 0 ) { $error=1; $ret = 0; + $info .+ $ret3; } break; case 'last': @@ -125,8 +127,12 @@ $error=1; $ret = 0; } - if ($error==1) - echo("rrd_$method() ERROR: $info"); + if ($error==1) { + if (array_key_exists('Child', $GLOBALS)) { + $GLOBALS['Child']->send_error("rrd_$method(): $ret3"); + } else + echo("rrd_$method() ERROR: $info"); + } return $ret; } diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/lib/gui.admin.inc.php jffnms-0.9.3/lib/gui.admin.inc.php --- ../jffnms-0.9.2/lib/gui.admin.inc.php 2012-02-14 23:10:39.000000000 +1100 +++ jffnms-0.9.3/lib/gui.admin.inc.php 2012-04-13 21:26:48.000000000 +1000 @@ -46,19 +46,16 @@ function adm_table_header($title, $init, &$span, $cols, $total_items = -1, $id = "", $show_add = true) { - global $Sanitizer; + global $Sanitizer; global $filter, $host_id, $client_id, $map_id, $use_interfaces, $interface_id, $filter_field; - if (!$span) $span = 20; - $url = $Sanitizer->get_url('', 'all', - array('filter' => $filter), //new - array('action', 'actionid'));//del - $url_init = $Sanitizer->get_url('', 'all', - array('filter' => $filter), //new - array('action', 'actionid', 'init'));//del - $url_span = $Sanitizer->get_url('', 'all', - array('filter' => $filter), //new - array('action', 'actionid', 'span'));//del + if (!$span) $span = 20; + $url = $Sanitizer->get_url('', array('use_interfaces', 'admin_structure','init','span'), + array('filter' => $filter)); + $url_init = $Sanitizer->get_url('', array('use_interfaces', 'admin_structure', 'span'), + array('filter' => $filter)); + $url_span = $Sanitizer->get_url('', array('use_interfaces', 'admin_structure', 'init'), + array('filter' => $filter)); return table ($id, "admintable"). diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/lib/gui.controls.inc.php jffnms-0.9.3/lib/gui.controls.inc.php --- ../jffnms-0.9.2/lib/gui.controls.inc.php 2011-06-15 11:40:54.000000000 +1000 +++ jffnms-0.9.3/lib/gui.controls.inc.php 2012-04-11 21:58:37.000000000 +1000 @@ -198,7 +198,7 @@ function select_slas_cond ($name,$id, $add_data = NULL, $onchange = "", $params = array()) { - $SLAs_cond = new JffnmsSlas_conds(); + $SLAs_cond = new JffnmsSlas_cond(); return select_object($SLAs_cond,$name,$id,$add_data,'id','description',$params,1,$onchange); } @@ -295,9 +295,9 @@ if ($text==0) return select_custom($name,$trigger_op,$value); - else + if (array_key_exists($value, $trigger_op)) return $trigger_op[$value]; - + return ''; } function get_trigger_fields($type) @@ -357,10 +357,8 @@ { $trigger_fields = get_trigger_fields($type); - //var_dump(array($type, $field)); - #if ((!$field) || ($field=='any') || ($field=='none')) - if ( ($field=='any') || ($field=='none')) - return "field $field f"; + if ((!$field) || ($field=='any') || ($field=='none')) + return ''; else return call_user_func_array($trigger_fields[$field]['function'], array_merge(array($name, $value), $trigger_fields[$field]['params'])); diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/lib/hosts_configs.class.php jffnms-0.9.3/lib/hosts_configs.class.php --- ../jffnms-0.9.2/lib/hosts_configs.class.php 1970-01-01 10:00:00.000000000 +1000 +++ jffnms-0.9.3/lib/hosts_configs.class.php 2012-03-15 21:44:48.000000000 +1100 @@ -0,0 +1,87 @@ + Javier Szyszlican +:w + * This program is licensed under the GNU GPL, full terms in the LICENSE file + */ +class JffnmsHosts_configs extends basic +{ + function jffnms_class() + { + return 'hosts_config'; + } + + function add($host_id=1) { + return db_insert('hosts_config', array('config'=>'New Config', 'host'=>$host_id)); + } // add + + + function diff ($id1, $id2) + { + global $Config; + + if ($id1 != $id2) + { + $aux = $this->get_all(array($id1,$id2)); + $str1 = $aux[0]['config']; + $str2 = $aux[1]['config']; + + $engine_temp = $Config->get('engine_temp_path'); + + $name1 = $engine_temp.'/'.uniqid('').'.dat'; + $name2 = $engine_temp.'/'.uniqid('').'.dat'; + + $pf = fopen($name1,'w'); + fputs($pf,$str1); + fclose($pf); + + $pf = fopen($name2,"w"); + fputs($pf,$str2); + fclose($pf); + + $diff_executable = $Config->get('diff_executable'); + + if (file_exists($diff_executable)) + { + $c = exec($diff_executable.' -Nru '.$name1.' '.$name2, $diff); + unlink($name1); + unlink($name2); + + $diff = join("\n",array_slice($diff, 3)); + return $diff; + } + } + return false; + } + + function get_all($ids = NULL, $host_id=NULL, $init=NULL, $span=NULL, $where_special=NULL) + { + if (!is_array($where_special)) + $where_special = array(); + + if (is_numeric($host_id)) + $where_special[]=array('hosts.id','=',$host_id); + if ($ids!= NULL) + $order = 'asc'; + else + $order = 'desc'; + + return get_db_list( + array('hosts_config','zones','hosts'), + $ids, + array('hosts_config.*', + 'zone_description'=>'zones.zone', + 'host_description'=>'hosts.name' ), + array_merge( + array( + array('hosts.zone','=','zones.id'), + array('hosts_config.host','=','hosts.id'), + array('hosts_config.id','>','1')), + $where_special), + array ( + array('hosts_config.date',$order), + array('hosts.id','asc')), + '',NULL,$init,$span + ); + } +} // class JffnmsHosts_Config diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/LICENSE jffnms-0.9.3/LICENSE --- ../jffnms-0.9.2/LICENSE 2012-03-04 13:43:13.000000000 +1100 +++ jffnms-0.9.3/LICENSE 1970-01-01 10:00:00.000000000 +1000 @@ -1,340 +0,0 @@ - - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 Lesser 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., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 Lesser General -Public License instead of this License. diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/README jffnms-0.9.3/README --- ../jffnms-0.9.2/README 2012-03-04 13:43:13.000000000 +1100 +++ jffnms-0.9.3/README 1970-01-01 10:00:00.000000000 +1000 @@ -1,25 +0,0 @@ -README file for JFFNMS -====================== - -This file contains important information about JFFNMS and should be read -before installing or upgrading JFFNMS. - -Upgrading from 0.8.4 --------------------- -JFFNMS version 0.8.4 shipped with a serious bug with the database extraction. -The part of the build process that makes the databases differences was -missing, however the database dump worked ok. - -This gives us two scenarios: - * You had a pre 0.8.4 (eg 0.8.3) JFFNMS and upgraded, giving you an - unchanged 0.8.3 database. - * You (re)installed jffnms 0.8.4 and used the database dump. You got the - correct database. - -The schema for 0.8.4 and 0.8.5 are the same. - -This means if you are the first pre-0.8.4 scenario you WILL need to run the SQL update scripts to update your schema, just like you normally should do. - -If JFFNMS 0.8.4 was your first database install, your schema is already -current, do NOT update the database (it will error out anyhow). - diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/TODO jffnms-0.9.3/TODO --- ../jffnms-0.9.2/TODO 2012-03-04 13:43:13.000000000 +1100 +++ jffnms-0.9.3/TODO 1970-01-01 10:00:00.000000000 +1000 @@ -1,81 +0,0 @@ -This are the remaining tasks to be done in JFFNMS. -If you want to contribute and you dont know where to start, please read this lines. -If you want to add a task, send me an email. - -Craig's TODO list -================= - - - rewrite tcp_port discovery script to use popen, log better and - new format for nmap 5.21, also pgrep() - -To Do -===== - - - Host Types - - events/interface JS/CSS font-size - - popup selector full-text search - - discovery params: new/old field ? - - SNMP Timeout per-host - - Host Types, IT by Host Type - - Host Groups (modify maps) - - alarm backend: N Downs. db records per-int and global - - Chris ESI: Pix config transfer - - Host Groups (like maps) (modify maps to allow hosts) - - Craig: NUT UPS - - ALL Button in admin_header - - Configurable Delay in the DHTML popups - - TCP Port Hello/Quit string - - new/poller+ad satellite filter - - -For Later: ----------- - -API: - - Thomas DNS monitoring - - Generic Interface Type - - - Poller Helper: Poll only State - - Satellite Remote (Auto)Discovery - - Satellite Sync (virtual satellite in case theres no connection and I'm not the master) - - Modify Pollers that handle the buffer locally to somehow use the backend (or sync it) - - - RRD Analyzers: - - How much traffic the Interface had in X time (95th Percentile also) - - TOP 10 (Top Traffic, Errors, RTT, etc.) - - - Tools: - - Host Tools (Routing Table, ARP Table, Socket State, etc. SNMP-based) - - Tools for all interface types (id =1) - - - New Trigger/Action to allow config transfer as soon as a config change is made (event) - - Make consolidate scripts functions (like the other parts) - - Asset Tracking (Inventory) (Part Number, Serial Number, Cards, etc) (could use ENTITY-MIB/STACK-MIB) - - TFTP Configuration CVS Upload (Requested by Mike Hyde) - - TFTP Configuration Scheduled Upload (Requested by Rob Laidlaw) - - SLA Planned Outages/Maintence Windows - - SNMP Traps Processing more useful and flexible. (match by interfacenumber also) (Call Handler Scripts) - - Event Flap Detection. - -GUI: - - Send a URL to the interface in the Email Action (Requested by Rob Laidlaw) - - Stored Reports - -MISC: - - NetFlow Integration - - Use the Standard msyslog, not one modified for JFFNMS - - MD5 Signature of the tarball - - RPM Package - - Better SOAP Interoperatibility testing - - Snort SNMP TRAP messages integration - - Radius Integration - - Trouble Ticket Plugins (Framework Ready) - - Implement ENTITY-MIB & STACK-MIB for Cisco's & others - - -In the Works: -============= - - - Documentation (on CVS by Craig Small and Javier Szyszlican) - - Interface inter-dependece (will be based on DMII Designated Main Interfaces) - - Multi Language Support (Sergio Martinez) diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/UPGRADE jffnms-0.9.3/UPGRADE --- ../jffnms-0.9.2/UPGRADE 2012-03-04 13:43:13.000000000 +1100 +++ jffnms-0.9.3/UPGRADE 1970-01-01 10:00:00.000000000 +1000 @@ -1,58 +0,0 @@ -This file explains the upgrade procedure between versions: - -0.9.1 to 0.9.2 -============== - - 0. You are adviced to upgrade your PHP and PostgreSQL (if you use that) versions before the upgrade, - because some new features may need that. - - The new poller is still experimental, and its not enabled by default. - - Replace the with the actual path to the patch files, - '../jffnms-upgrade-0.9.1-to-0.9.2' if you are using jffnms-upgrade-0.9.1-to-0.9.2.tar.gz or - '/opt/jffnms-0.9.2/docs/upgrade' if you are using jffnms-0.9.2.tar.gz - - 1. Apply the code patch: - # cd /opt/jffnms - # patch -p1 < /jffnms-0.9.1-to-0.9.2.patch - - If you have not changed the code, there should not be any errors. - Replace apache.apache with your HTTPd username and group (nobody, httpd, etc) - - 2. Upgrade the DB: - MySQL: - Backup in case of failure: - # mysqldump --opt -ujffnms -pjffnms jffnms > /tmp/jffnms.backup.mysql - - Upgrade the MySQL Tables: - # cat docs/upgrade/mysql/jffnms-0.9.1-to-0.9.2.mysql.diff* | mysql -u jffnms -pjffnms jffnms - - PgSQL: - Backup in case of failure: - # pg_dump -U jffnms jffnms -dROc > /tmp/jffnms.backup.pgsql - - Upgrade the PgSQL Tables: - # cat docs/upgrade/pgsql/jffnms-0.9.1-to-0.9.2.pgsql.diff* | psql jffnms jffnms - - 3. Copy the new binary files: - - # cp -Rv /files/* /opt/jffnms/ - - 4. Change Ownership - - # chown -R apache:apache * - - OR if you used the new Instalation method: - # chown -R jffnms:jffnms * - - - And then re apply the permissions to the /opt/jffnms folder: - - # chmod -R ug+rw * - - - 5. Verify Everything is ok: - Go to the Setup page at - http://youserver/jffnms/admin/setup.php (or the path you set) - - Check everything, make the corrections and SAVE the Configuration anyway. diff -Nru '-x*.png' '-x*.ini' '-x*.*sql' '-x*.patch' '-x*.svn' ../jffnms-0.9.2/UPGRADE.win32.txt jffnms-0.9.3/UPGRADE.win32.txt --- ../jffnms-0.9.2/UPGRADE.win32.txt 2012-03-04 13:43:13.000000000 +1100 +++ jffnms-0.9.3/UPGRADE.win32.txt 1970-01-01 10:00:00.000000000 +1000 @@ -1,59 +0,0 @@ -How to do an upgrade on Windows? --------------------------------- - -Please read all this note before executing something, so you can understand all the process. - -Step 1 - Code Update: -===================== - - 1. Rename the c:\jffnms folder to jffnms-old - 2. Rename the new jffnms version folder (like c:\jffnms-0.7.3) to c:\jffnms - 3. Copy your c:\jffnms-old\rrd folder to c:\jffnms\rrd - 4. Copy the c:\jffnms-old\rrdtool.exe and nmap.exe to c:\jffnms\ - 5. Re-apply the permissions, give the jffnms user FULL CONTROL over c:\jffnms - - 6. At this point you have the new version in place with your old version data. - The only thing missing is a correct configuration. You have to go to your setup.php - and reconfigure everything like you did when you first install it. (Step 3) - - -Step 2 - Database Update: -========================= - - You have to send every file in the c:\jffnms\docs\upgrade\mysql to the mysql daemon : - - 1. Backup in case of failure: - c:\> c:\mysql\bin\mysqldump.exe --opt -u root jffnms > c:\jffnms.backup.mysql - - 2. Go to the DB upgrade folder - c:\> cd \jffnms\docs\upgrade\mysql - - 3. Replace OLD with your current JFFNMS version number (like 0.7.2) and NEW with the new version number (like 0.7.3) - c:\jffnms\docs\upgrade\mysql> dir jffnms-OLD-to-NEW* (look at all the file names) - - 4. Apply the DB changes - c:\jffnms\docs\upgrade\mysql> c:\mysql\bin\mysql.exe -u root jffnms < - - or, as suggested by Michael Mayers: - - If in .cmd file: - for /f "tokens=*" %%i in ('dir jffnms* /b') DO c:\mysql\bin\mysql.exe -u root jffnms < %%i - - If not in .cmd file: - for /f "tokens=*" %i in ('dir jffnms* /b') DO c:\mysql\bin\mysql.exe -u root jffnms < %i - - -Step 3 - Check Everything: -========================== - - Go to your setup in http://yourserver/admin/setup.php (put the correct path here). - - Check if everything is ok, and Save the configuration. - - ------------------------------------------------------ -If you have any other note you will like added here, -please send it to the mailing list. - -Thanks. -Javier Szyszlican jffnms-0.9.3/docs/utils/0002755000175000017500000000000011716447477014432 5ustar csmallcsmalljffnms-0.9.3/docs/utils/jffnms-snmp/0002755000175000017500000000000011716447477016670 5ustar csmallcsmalljffnms-0.9.3/docs/utils/jffnms-snmp/tc.inc.php0000644000175000017500000000453111716447477020560 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function unit_convert (&$value, $unit) { switch ($unit) { case "Kbit" : $value *= 1000; break; case "Mbit" : $value *= 1024 * 1000; break; } } function tree_tc () { $dev = "/proc/net/dev"; $devices_raw = file($dev); unset ($devices_raw[0]); unset ($devices_raw[1]); $dev_id = 1; foreach ($devices_raw as $aux) { $dev_name = trim(substr($aux,0,strpos($aux,":"))); $devices[$dev_id][index]=$dev_id; $devices[$dev_id][name]=$dev_name; $dev_id++; } $tc="/sbin/tc"; foreach ($devices as $dev_id=>$aux) { unset ($result); $dev_name = $aux[name]; exec("$tc -s class show dev $dev_name",$result); $pos = 0; foreach ($result as $data) { $data = trim($data); if ($pos==0) if (preg_match ("/^class (\S+) (\S+) (?:parent \S+(?: leaf \S+|)(?: prio \d+|)|root(?: prio \d+|)) rate (\d+)(\S+) ceil (\d+)(\S+).+/",$data,$parts)) { $aux = explode (":",$parts[2]); $class_id = $dev_id.str_pad($aux[0],2,"0",STR_PAD_LEFT).str_pad($aux[1],3,"0",STR_PAD_LEFT); unset ($aux); $classes[$class_id][index]=$class_id; $classes[$class_id][device]=$dev_id; $classes[$class_id][name]=$parts[2]; $classes[$class_id][type]=$parts[1]; $classes[$class_id][rate]=$parts[3]; $classes[$class_id][ceil]=$parts[5]; unit_convert ($classes[$class_id][rate],$parts[4]); unit_convert ($classes[$class_id][ceil],$parts[6]); } //Sent 72133756 bytes 250090 pkts (dropped 0, overlimits 0 requeues 0) //Sent 198540532 bytes 822282 pkt (dropped 587, overlimits 0 requeues 0) if ($pos==1) if (is_array($classes[$class_id]) && preg_match ("/Sent (\d+) bytes (\d+) pkt(?:s*) \(dropped (\d+), overlimits (\d+)/",$data,$parts)) { $classes[$class_id][bytes]=$parts[1]*1; $classes[$class_id][packets]=$parts[2]*1; $classes[$class_id][dropped]=$parts[3]; $classes[$class_id][overlimit]=$parts[4]; truncate_counter ($classes[$class_id][bytes]); truncate_counter ($classes[$class_id][packets]); } $pos++; if (empty($data)) $pos = 0; } } $info[devices]=$devices; $info[classes]=$classes; return $info; } ?> jffnms-0.9.3/docs/utils/jffnms-snmp/snmpd.conf.example0000644000175000017500000000047611377440254022304 0ustar csmallcsmall# Add this to your /etc/snmpd.conf # Replace the paths as needed pass_persist .1.3.6.1.4.1.2021.5001 /usr/bin/php -q /opt/jffnms/docs/utils/jffnms-snmp/jffnms-snmp.php tc .1.3.6.1.4.1.2021.5001 pass_persist .1.3.6.1.4.1.2021.5002 /usr/bin/php -q /opt/jffnms/docs/utils/jffnms-snmp.php iptables .1.3.6.1.4.1.2021.5002 jffnms-0.9.3/docs/utils/jffnms-snmp/iptables.inc.php0000644000175000017500000000671311716447477021761 0ustar csmallcsmall Hans Peter Dittler * Copyright (C) <2005> Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function tree_iptables () { $table_names_file = "/proc/net/ip_tables_names"; $iptables="/usr/sbin/iptables"; if (file_exists($iptables)!==true) $iptables = "/sbin/iptables"; $tables_names = file($table_names_file); // read the names of iptables from proc $table_id = 1; $chain_id = 1; $dyn_chain_id = 1001; //$rule_id = 1; foreach ($tables_names as $table) { // dump now each table $table = trim($table); $tables[$table_id]["index"]=$table_id; $tables[$table_id]["name"]=$table; // insert table index and table name into array tables unset ($result); exec($iptables." --line-numbers -xvnL -t ".$table, $result); //dump chains and rules for each table $pos = 0; foreach ($result as $data) { $data = trim($data); if ($pos==0) { // first line of a chain defines name // this is a built-in chain: Chain OUTPUT (policy ACCEPT 1 packets, 32 bytes) if (preg_match ("/^Chain (\S+) \(policy (\S+) (\d+) packets, (\d+) bytes\)/", $data, $parts)) { $chains[$chain_id]["index"] = $chain_id; $chains[$chain_id]["table"] = $table_id; $chains[$chain_id]["name"] = $parts[1]; $chains[$chain_id]["policy"]= $parts[2]; $chains[$chain_id]["packets"]=$parts[3]; $chains[$chain_id]["bytes"] = $parts[4]; truncate_counter($chains[$chain_id]["packets"]); truncate_counter($chains[$chain_id]["bytes"]); $chain_id++; } // this is a dynamic chain: Chain forward_dmz (1 references) if (preg_match ("/^Chain ([\S\.]+) \((\S+) references\)/", $data, $parts)) { $chains[$dyn_chain_id]["index"] = $chain_id; $chains[$dyn_chain_id]["table"] = $table_id; $chains[$dyn_chain_id]["name"] = $parts[1]; $chains[$dyn_chain_id]["policy"]= "dynamic"; // dynamic chains have no counters, must be added manually $chains[$dyn_chain_id]["packets"]= 0; $chains[$dyn_chain_id]["bytes"] = 0; $dyn_chain_id++; } } //RULES DISABLED // match a rule line of format // line bytes packets rule proto opt ifin ifout source dest options // 7 0 0 LOG all -- * * 0.0.0.0/0 217.160.132.152 LOG flags 6 level 4 prefix `SuSE-FW ON ' /* if (($pos>1) && is_array($chains[$chain_id]) && preg_match ("/^(\d+)\s+(\d+)\s+(\d+)\s+([\S\.]+)\s+(\S.+)/",$data,$parts)) { $rules[$rule_id][index] = str_pad($table_id,2,"0",STR_PAD_LEFT). str_pad($chain_id,3,"0",STR_PAD_LEFT). str_pad($parts[1],4,"0",STR_PAD_LEFT); $rules[$rule_id][chain]=$chain_id; $rules[$rule_id][target]=$parts[4]; $rules[$rule_id][description]=$parts[5]; $rules[$rule_id][packets]=$parts[2]; $rules[$rule_id][bytes]=$parts[3]; truncate_counter($rules[$rule_id][packets]); truncate_counter($rules[$rule_id][bytes]); for ($i = 0; $i < 10 ; $i++) $rules[$rule_id][description] = trim(str_replace(" "," ",$rules[$rule_id]["description"])); $rule_id++; } */ $pos++; if (empty($data)) { // an empty line indicates end of chain $pos = 0; //$chain_id++; } } $table_id++; } $info["tables"]=$tables; $info["chains"]=$chains; //$info[rules]=$rules; return $info; } ?> jffnms-0.9.3/docs/utils/jffnms-snmp/jffnms-snmp.php0000644000175000017500000000610211716447477021634 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function oid_cmp($a, $b) { if ($a == $b) return 0; $a1 = explode (".",$a); $b1 = explode (".",$b); if (count($a1) < count($b1)) return -1; if (count($a1) > count($b1)) return 1; for ($i = 0; $i < count($a1); $i++) { if ($a1[$i] < $b1[$i]) return -1; if ($a1[$i] > $b1[$i]) return 1; } } function truncate_counter (&$value) { $max = pow(2,31); $max_pass = ($value/$max); $max_less = ($max * floor($max_pass)); if ($max_pass >= 1) $value = floor($value - $max_less); } function create_rama ($oid,$k,$data,$deep,&$tree) { if (!is_numeric(current(array_keys($data)))) $data = array_values ($data); while (list ($k1,$item) = each ($data)) { if (is_array($item)) create_rama ("$oid.$k",$k1,$item,++$deep,$tree); else if ($deep==0) $tree["$oid.$k.$k1"]=$item; else $tree["$oid.$k1.$k"]=$item; } } function create_tree ($oid,$data,&$tree) { $start = time(); $data = array_values($data); foreach ($data as $k=>$v) { if (is_array($v)) create_rama ($oid,$k,$v,0,$tree); else $tree["$oid.$k"]=$v; } uksort($tree,"oid_cmp"); reset ($tree); return time()-$start; } function secho ($oid,$var = NULL) { $out .= "$oid\n"; if (!is_null($var)){ $out .= ((is_numeric($var))?"integer":"string")."\n"; $out .= $var."\n"; } return $out; } function walk_tree ($start, &$tree) { $show_next = 0; reset ($tree); while (list ($k,$v) = each ($tree)) { if (($show_next == 1) || ((strpos($k, $start)===0) && ($k!==$start))) return secho ($k,$v); if ($k===$start) $show_next = 1; } return "NONE\n"; } list ($myself, $tree_to_use, $base, $tree_refresh) = $_SERVER["argv"]; if (!is_numeric($tree_refresh)) $tree_refresh = (1*60); include ($tree_to_use.".inc.php"); $in = fopen("php://stdin","r"); $step = 0; while ($line = fgets($in)) { $line = trim($line); if ($tree_time+$tree_refresh < time()) { $tree = array(); $creation_time = create_tree ($base,call_user_func("tree_".$tree_to_use),$tree); $tree_time = time(); } switch ($line) { case "DEBUG": print_r($tree); echo "Tree creation time: $creation_time, Created ".(time()-$tree_time)." seconds ago.\n"; break; case "PING": $result = "PONG\n"; $step = 0; break; default: switch ($step) { case 0: $oper = $line; $step = 1; break; case 1: $oid = $line; $step = 2; break; } if ($step==2) { $step = 0; switch ($oper) { case "getnext": $result = walk_tree ($oid, $tree); break; case "get": if (isset($tree[$oid])) $result = secho ($oid,$tree[$oid]); break; } if (!isset($result)) $result = "NONE\n"; } } if (isset($result)) { echo $result; unset ($result); } } ?> jffnms-0.9.3/docs/utils/exp_poller_test.php0000644000175000017500000000172111716447477020352 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ var_dump($conexion); include ("../../conf/config.php"); var_dump($conexion); while ( 1 ) { //main loop $now = time(); $query_hosts=" SELECT t1.id as host_id, t2.id as interface_id, (t2.last_poll_date + it.rrd_structure_step) as next_poll FROM hosts t1,interfaces t2,interface_types as it WHERE t2.host = t1.id and t2.type = it.id and t2.id > 1 and t1.poll > 0 and t2.poll > 0 and $now > (t2.last_poll_date + it.rrd_structure_step) ORDER BY next_poll asc "; if (!$result_hosts = db_query ($query_hosts)) { echo "Query failed - test - ".db_error()."\n"; break; } $num = db_num_rows($result_hosts); echo $num."\n"; sleep(1); } ?> jffnms-0.9.3/docs/utils/satellite-client.php0000644000175000017500000000475511716447477020416 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ /* How to use this file -------------------- This example shows how to interact with JFFNMS via the Satellites RPC system. You will have access to all the JFFNMS API, including graph functions. To enable the satellite server in your JFFNMS: - go to the /admin/setup.php and clean the Satellite URI field, and click in Save to make it autodiscover it. - paste the contents of the Field into the $jffnms_sat_uri field of the jffnms_call in this file, followed by ?capabilties=S to force PHP serialize usage. - go to the Administration->Host & Interfaces->Satellites - Edit the Satellite 1 (Local) and save it (with no changes), this will make JFFNMS autodiscover the Local Satellte URI (the same as the field in setup.php) - Add a new Satellite and put the IP address or DNS name of the computer that will be accessing, if its different than the same server, select the 'Client' Satellite Type. Please read this file, is only an example, to see all the functions and parameters you will have to read the lib/api.* files. */ function jffnms_call ($object, $method, $params = array()) { $jffnms_sat_uri = "http://nms.yourserver.com/jffnms/admin/satellite.php?capabilities=S"; $call_url = $jffnms_sat_uri . "&class=$object&method=$method¶ms=".urlencode(serialize($params))."&sat_id=1"; //var_dump($call_url); $result_raw = file ($call_url); //var_dump($result_raw); if (is_array($result_raw)) $result = unserialize(current($result_raw)); return $result; } $hosts = jffnms_call ("hosts","get_all"); //var_dump($hosts); $interfaces = jffnms_call ("interfaces","get_all",array(NULL,array("client"=>10))); //var_dump($interfaces); foreach ($interfaces as $int) { //$id, $graph_function, $sizex, $sizey, $title, $graph_time_start, $graph_time_stop, $aux = "" list ($ok, $data) = jffnms_call ("interfaces","graph",array($int["id"],"traffic",500,200,"Graph ".$int["description"],-60*60*12,-60*5)); if ($ok==true) { $data = base64_decode($data); $file = "graph-".$int["id"].".png"; $fp = fopen ($file,"w+"); fwrite($fp,$data); fclose($fp); } } ?> jffnms-0.9.3/docs/utils/mib.php0000644000175000017500000001330211716447477015707 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ $smidump_executable = "/usr/bin/smidump"; function MIBParser_identifiers($mib) { global $smidump_executable; $command = "$smidump_executable $mib -f identifiers"; exec($command,$output); if (is_array($output)) { next ($output); while (list(,$line) = each($output)) if ($line) { $data = explode(" ",$line); //var_dump($data); $list[$data[1]]=$data[count($data)-1]; } } return $list; } function MIBParser_data($mib) { global $smidump_executable; $command = "$smidump_executable $mib -f sming"; exec($command,$output); if (is_array($output)) { next ($output); while (list($key,$line) = each($output)) { $ok = true; $line=trim($line); if (!$line) $ok = false; if (strpos($line,"//")!==false) $ok = false; if ($ok) { $aux = explode (" ",$line); unset($aux2); foreach ($aux as $aux1) if ($aux1) $aux2[]=$aux1; $output[$key]=join(" ",$aux2); //var_dump($aux2); //echo $output[$key]."\n"; } else unset ($output[$key]); } } return $output; } function MIBParser_Process(&$data,&$idents,&$result,$part) { while (list($key,$line) = each ($data)) { if ($line[strlen($line)-1]=="{") { list($section,$name) = explode (" ",$line); if ($name=="{") { $name = rand(); } if ($name) { if ($idents[$name]) $result[$section][$name][oid]=$idents[$name]; unset ($part); $part[]=$line; MIBParser_Process($data,$idents,$result[$section][$name],$part); $aux = join(" ",$part); } switch ($section) { case "table": preg_match ("/description \"(\S.+)\";/",$aux,$parts); $result[$section][$name][description]=$parts[1]; break; case "row": preg_match ("/index \((\S.+)\);( status .+;|)( create ;|) description \"(\S.+)\";/",$aux,$parts); $result[$section][$name][index]=$parts[1]; $result[$section][$name][description]=$parts[4]; break; case "scalar": case "column": preg_match ("/type (\S.+ |\S.+)(\(\S.+\)|); access (\S+); (units \"(\S.+)\"; |)description \"(\S.+)\";/",$aux,$parts); $result[$section][$name][type]=trim($parts[1]); $result[$section][$name][rw]=($parts[3]=="readonly")?0:1; if ($parts[5]) $result[$section][$name][units]=$parts[5]; $result[$section][$name][description]=$parts[6]; $values = Array(); if ($parts[2]) { $val = substr($parts[2],1,strlen($parts[2])-2); $val1 = explode (", ",$val); foreach ($val1 as $val2){ preg_match("/(\S.+)\((\N.+)\)/",$val2,$aux); //$values[]=$aux; } $values = $val; $result[$section][$name][values]=$values; } break; case "module": preg_match ("/organization \"(\S.+)\"; contact \"( |)(\S.+)\"; description \"(\S.+)\";/",$aux,$parts); $result[$section][$name][organization]=$parts[1]; $result[$section][$name][contact]=$parts[3]; $result[$section][$name][description]=$parts[4]; break; case "revision": preg_match ("/date \"(\S.+)\"; description \"(\S.+)\";/",$aux,$parts); $result[$section][$name][date]=$parts[1]; $result[$section][$name][description]=$parts[2]; break; } } else $part[]=$line; if ($line=="};") return 0; } } function MIBParser($mib) { $idents = MIBParser_identifiers($mib); $mib_data = MIBParser_data($mib); reset($mib_data); //var_dump($mib_data); die(); $result = Array(); MIBParser_Process($mib_data,$idents,$result,Array()); $mib_name = key($result[module]); return Array(name=>$mib_name,mib=>$result[module][$mib_name]); } $mib_dir = "/usr/share/snmp/mibs/"; if (!$mib_file) { $handle = opendir($mib_dir); while (false !== ($file = readdir($handle))) echo "$file
"; } if (!$mib_file) die(); $mib = MIBParser ($mib_dir.$mib_file); //var_dump($mib); $ques=array( "[graph][0][0]"=>"Graph1", "[graph][0][1]"=>"Graph1", "[graph][1][0]"=>"Graph2", "[graph][1][1]"=>"Graph2", "[interface][name]"=>"Interface Name", "[interface][description]"=>"Interface Description", "[interface][number]"=>"Interface Number(index)", "[interface][speed]"=>"Interface Speed", "[interface][oper]"=>"Interface Operational Status", "[interface][admin]"=>"Interface Admin Status", "[alarm]"=>"Interface Status" ); echo "\n"; echo "\n"; foreach ($mib[mib][table] as $table_name=>$table){ echo "

".$mib[name]."

"; echo "\n"; echo "\n"; echo "\n"; foreach ($table[row] as $row_name=>$row){ echo ""; foreach ($ques as $aux) echo "\n"; echo "\n"; foreach ($row[column] as $col_name=>$column){ echo "\n"; foreach (array_keys($ques) as $aux) echo "\n"; echo ""; } } echo ""; echo "

$table_name (".$table[oid].")

".$table[description]."

$row_name

".$row[description]."
$aux

$col_name

Type: ".$column[type]." (".(($column[rw]==1)?"Read/Write":"ReadOnly").")
"; if ($column[values]) echo "Values: ".$column[values]."
"; echo " Description: ".$column[description]."
\n"; } echo "
\n"; ?> jffnms-0.9.3/docs/utils/ping.php0000644000175000017500000001204711716447477016102 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ function hex2dec(&$item,$key) { $item = hexdec($item); } function repack ($var) { $var = pack("n",$var); $temp = unpack("n",$var); $aux = $temp[""]; return $aux; } function checksum($buffer) { $cksum = 0; $counter = 0; //var_dump($buffer); $i = 1; foreach ($buffer as $value) { if ($i==0) { $value1 .=$value; $buff1[] = $value1; $i = 1; $value1=0; } else { $value1=$value; $i = 0; } } $buff1[] = $value1; foreach ($buff1 as $value) { $aux = substr($value,2,4).substr($value,0,2); $value1 = hexdec($aux); //echo $counter++." $cksum $value $value1\n"; $cksum += $value1; } $aux = repack(($cksum & 0xffff)); $cksum1 = repack((($cksum >> 16) + $aux)); $cksum2 = repack(($cksum1 + ($cksum1 >> 16))); $ans = ~$cksum2; $ans = repack($ans); //echo "sum1 : $cksum ".decbin($cksum)." ".dechex($cksum)."\n"; //echo "sum2 : $cksum1 ".decbin($cksum1)." ".dechex($cksum1)."\n"; //echo "sum3 :$cksum2 ".decbin($cksum2)." ".dechex($cksum2)."\n"; //echo "answer : $ans ".decbin($ans)." ".dechex($ans)."\n"; $csum1 = dechex($ans); $buffer[2] = substr($csum1,2,4); $buffer[3] = substr($csum1,0,2); return $buffer; } function view_packet($data){ $datas = explode(" ",$data); $i = 1; foreach ($datas as $aux) { $val = hexdec($aux); $val2 = chr($val); $val3 = decbin($val); $val4 = str_pad($val3,8,"0",STR_PAD_LEFT); //bin $show1.= $aux; //hex $show4.= $val4; //bin if ((($i%2)==0)) $show1.= " "; if ((($i%2)==0)) $show4.= " "; if ($i == 8) { $show1.= "\n"; $show4.= "\n"; $i=1; } else { $i++; } } echo "\n------------------------------------------\n"; echo "$show1\n\n$show4"; //echo "$show1"; echo "\n------------------------------------------\n"; flush(); } // ty cd cksum ident seqnu data ---- $data = "08 00 00 00 08 97 00 00 ". "65 00 00 39 8e d8 3c a1 ". "e1 05 ". "00 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 ". //data "15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 ". "25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34". ""; //"35 36 37"; if (!$argv[2]) $cant = 2; else $cant = $argv[2]; if (!$argv[1]) $ipdest = "10.1.0.100"; else $ipdest = $argv[1]; unset($sock); $sock = socket_create(AF_INET,SOCK_RAW,getprotobyname("ICMP")); $set = socket_fd_alloc(); socket_fd_set($set,$sock); $datas = explode(" ",$data); echo "PING $ipdest ($ipdest) from localhost : ".count($datas)." bytes of data.\n"; for ($i = 0; $i < $cant; $i++) { $conn = socket_connect($sock,$ipdest,0); $datas[6]= "05"; // type (internal); $datas[7]= str_pad(dechex($i),2,"0",STR_PAD_LEFT); //seqnum $datas_aux = checksum($datas); //view_packet(join(" ",$datas_aux)); unset($val1); foreach ($datas_aux as $aux) { $val = hexdec($aux); $val2 = chr($val); $val1 .= $val2; //echo ++$i."\t$val\t$val2\t$val3\n"; } $times[$i] = gettimeofday(); $aux = socket_write($sock,$val1,sizeof($val1)); usleep(2000); } for ($i = 0; $i < $cant; $i++) { $aux = 2; if ($aux > 1) { $num = 1; $timeout = 101; while (($num <= 0) and ($timeout < 100)) { $num = socket_select($set, $dum1=NULL, $dum2=NULL, 0, 1000); echo $timeout++." - $num\n"; } if ($num > 0) { $aux = socket_read($sock,100); $time2 = gettimeofday(); $len = strlen($aux)-20; unset($val3); for ($o = 1; $o < strlen($aux) ;$o++){ $val = $aux[$o]; $val1 = ord($val); $val2 = str_pad(dechex($val1),2,"0",STR_PAD_LEFT); $val3 .="$val2 "; //echo "$o\t$val\t$val1\t$val2\n"; } //var_dump($val3); $data_recv = explode(" ",$val3); //view_packet($val3); $src = array_slice($data_recv,11,4); array_walk($src,"hex2dec"); $dest = array_slice($data_recv,15,4); array_walk($dest,"hex2dec"); $type = $data_recv[19]; $seq1 = array_slice($data_recv,25,2); array_walk($seq1,"hex2dec"); $source = join(".",$src); $destination = join(".",$dest); $seq = join(":",$seq1); $ttl= hexdec($data_recv[7]); $time1 = $times[$seq1[1]]; $time1_usec = $time1[sec]*1000000+$time1[usec]; $time2_usec = $time2[sec]*1000000+$time2[usec]; $rtt_usec = $time2_usec - $time1_usec; //msec $rtt_msec = round(($rtt_usec/1000),3); //msec $total_rtt[]=$rtt_msec; echo "$len bytes from $source: icmp_seq=$seq ttl=$ttl time=$rtt_msec msec ($rtt_usec usec)\n"; } else echo "Timeout...\n"; } else echo "Send ERROR\n"; } $cant_recv = count($total_rtt); socket_close($sock); foreach ($total_rtt as $rtt) $rtt_total+=$rtt; $rtt_avg = round($rtt_total/$cant_recv,3); echo "--- $ipdest ping statistics ---\n"; echo "$cant packets transmitted, $cant_recv packets received, ".(($cant_recv/$cant)*100)."% packet loss\n"; echo "round-trip avgv = $rtt_avg ms\n"; ?> jffnms-0.9.3/docs/utils/rrd_import.php0000644000175000017500000000270111716447477017322 0ustar csmallcsmall Javier Szyszlican * This program is licensed under the GNU GPL, full terms in the LICENSE file */ include ("../conf/config.php"); echo "
";
    
    $start = 1021557600;
    $end = 1021576800;

    $query = "select id from interfaces where poll > 1 and id = 3";
    $result = db_query($query);
    
    while ($record = db_fetch_array($result)) {
	extract($record);
	
	$file = "$rrd_real_path/interface-$id.rrd";
	$file1 = "$rrd_real_path/interface-$id.rrd.aux";
	
	$aux = "/tmp/interface-$id.rrd.xml";
	$aux2 = "/tmp/interface-$id.rrd.xml.new";
	
	unlink($aux);
	exec("$rrdtool_executable dump $file > $aux");
	
	$ok=0;
	unset($new_files);

	$fp = fopen ($aux,"r");
	$fp2 = fopen ($aux2,"w+");
	
	$insert = file ($file1);
	
	while ($line = fgets($fp,4096)) {

	    if ($ok==1) {
		$date = trim(substr($line,strpos($line,"/")+2,strpos($line," -->")-strpos($line,"/"))-2);

		//echo "$date\n";

		if (($date >= $start) && ($date <=$end)) { 
		    $line = $insert[$i++];
		    echo $line;
		} 
		

		if (strpos($line,"") > 1) $ok=0;

	    } else if (strpos($line,"") > 1) $ok=1;
	
	    fwrite($fp2,$line);
	}
	
	fclose($fp);
	fclose($fp2);
	unlink($aux);

	exec("$rrdtool_executable restore $aux2 $file.new");

	unlink($aux2);

	exec("chown apache.apache $file.new");
	exec("cp -f $file $file.old");
	exec("cp -f $file.new $file");
	die();
    }

?>
jffnms-0.9.3/docs/utils/int_values_convert.php0000644000175000017500000000764111716447477021062 0ustar  csmallcsmall Javier Szyszlican 
 * This program is licensed under the GNU GPL, full terms in the LICENSE file
 */
    
    function swap (&$r,$old,$new) {
        $o = $GLOBALS["old_r"];
        $r[$new]=$o[$old];
    }

    include("../../conf/config.php");

    if ($argv[1]=="release") $db="jffnms-upgrade";
    
    $query = "select * from interfaces where id > 1 and type > 1 order by type,id";
    
    $result = db_query($query);

    echo "\nConverting OLD interface table fields to the NEW interface_values table...\n";
    
    while ($old_r = db_fetch_array($result)) if (isset($old_r["interfacenumber"])) {
	$old_id = $old_r["id"];

	echo "\nConverting Interface $old_id, Type ".$old_r["type"]."\n";
	unset ($new_r);
	
	//make changes

	swap ($new_r,"description","description");
	
	switch ($old_r["type"]) {
	    
		//host information
	    case 12:	//Win
	    case 11:	//UCD
	    case 10:	//Solaris
	    case 3:	//Cisco
		swap($new_r,"bandwidthin","cpu_num");
		swap($new_r,"interfacenumber","index");
		break;	

	    case 2: //tcp port
		swap($new_r,"interfacenumber","port");
		break;
	    
	    case 8: //storage
		swap ($new_r,"interfacenumber","index");
		swap ($new_r,"bandwidthin","size");
		
		$a = strpos($new_r["description"]," ");
		
		if ($a === false) {
		    $new_r["storage_type"] = $new_r["description"];
		    unset ($new_r["description"]);
		} else {
		    $new_r["storage_type"] = substr($new_r["description"],0,$a);
		    $new_r["description"] = substr($new_r["description"],$a+1,strlen($new_r["description"]));
		}
		
		break;
	
	    case 14: //smokeping
		swap ($new_r,"interfacenumber","index");
		break;
	    
	    
	    case 20: //reachable
		swap ($new_r,"interfacenumber","index");
		break;
	    
	    case 4: //physical interfaces
		//do nothing
		$new_r = $old_r;
		break;
    
	    case 21: //TC
		swap ($new_r,"bandwidthin","rate");
		swap ($new_r,"bandwidthout","ceil");
		swap ($new_r,"interfacenumber","index");
		break;
    
	    case 9: //CSS VIPs
		swap ($new_r,"interfacenumber","index");
		swap ($new_r,"bandwidthin","bandwidth");
		swap ($new_r,"description","owner");
		break;
	    
		//Cisco ENVMIB
	    case 16: //Power Supply
	    case 17: //Temp
	    case 18: //Voltage
		//description is implicit
		swap ($new_r,"interfacenumber","index");
		break;	    

	    case 19: //SA Agent
		swap ($new_r,"interfacenumber","index");
		break;

	    case 13: //MAC Accounting
		swap ($new_r,"bandwidthin","ifindex");
		swap ($new_r,"peer","mac");
		swap ($new_r,"interfacenumber","index");
		break;
    
	    case 6: //BGP
		swap ($new_r,"interfacenumber","index");
		swap ($new_r,"peer","remote");
		swap ($new_r,"address","local");
		swap ($new_r,"description","asn");
		unset ($new_r["description"]);
		break;	

	    case 15: //Applications
		swap ($new_r,"interfacenumber","index");
		swap ($new_r,"bandwidthin","instanses");
		break;

	}
	
	foreach ($new_r as $field=>$value)
	    if (trim($value)==="") unset ($new_r[$field]);
	
	$not_update = array ("noerrors","id","type","host","sla","client","interface","poll","make_sound","show_rootmap","rrd_mode",
	    "creation_date","modification_date","last_poll_date");

	foreach ($not_update as $aux) {
	    unset ($new_r[$aux]);
	    unset ($old_r[$aux]);
	}
	
	echo "OLD Fields: ".join(",",array_keys($old_r))." = ".join(",",$old_r)."\n";
	echo "NEW Fields: ".join(",",array_keys($new_r))." = ".join(",",$new_r)."\n";
	
	$res = adm_interfaces_update($old_id,$new_r);
	$new_id = db_insert_id();
	echo "Result: $new_id - $res.\n";
    }

    echo "\n\nDroping OLD interface table fields...\n";

    $drops=array("description","address","peer","interfacenumber","noerrors","bandwidthin","bandwidthout","flipinout");

    foreach ($drops as $drop) {
    
	$sql = "ALTER TABLE interfaces DROP COLUMN $drop";
	echo "Deleting OLD $drop field from the interfaces table..."; 
	$result = db_query ($sql);
	echo " $result\n";
    }
    
?>
jffnms-0.9.3/docs/utils/satellite_sync.php0000644000175000017500000001511411716447477020165 0ustar  csmallcsmall Javier Szyszlican 
 * This program is licensed under the GNU GPL, full terms in the LICENSE file
 */

    $jffnms_functions_include="engine";
    include_once("../conf/config.php");

    if (!$_SERVER["argv"][0]) $sync = $SCRIPT_NAME;
	else $sync = $_SERVER["argv"][0];

    $sat_id 	= $_SERVER["argv"][1];
    $hosts_ids 	= $_SERVER["argv"][2];
    $tasks 	= $_SERVER["argv"][3];

    if (empty($tasks)) $tasks = "distribute,rrdsync,eventssync";
    
    if ($jffnms_satellite_uri=="none") die("Satellite not configured.\n");
    
    $my_sat_id = satellite_get_id($jffnms_satellite_uri);
    
    if (!$sat_id) {
	$masters = array_keys (satellite_get_masters());
	$peers = array_keys (satellite_get_peers($my_sat_id));
	
	$query_sats="
	    SELECT hosts.id as host_id, satellites.id as sat_id 
	    FROM satellites 
	    LEFT OUTER JOIN hosts on (hosts.satellite = satellites.id and hosts.id > 1)
	    WHERE satellites.id > 1 
	    ORDER by satellites.id asc";

	$result_sats = db_query ($query_sats) or die ("Query failed - R2 - ".db_error());

	while ($sat_data = db_fetch_array($result_sats)) 
	if ($my_sat_id != $sat_data["sat_id"]) { // no distribution to me

	    //echo "Host ".$sat_data[host_id]." - Sat ".$sat_data[sat_id]."\n";
	    $paths = satellite_get_paths($sat_data["sat_id"],NULL,1); //paths down to the destinations using only parents //FIXME multiple masters

	    $paths = satellite_clean_distribution_path($paths,$my_sat_id);

	    if (is_array($paths)) { //there are paths from me to the destination satellite (i'm in the middle)

		    $next_hops = satellite_get_last_distribution_path($paths);

	    	    //logger("S$my_sat_id\t: To get to Satellite ".$sat_data[sat_id]." I have to send data to satellite(s) ".join (" and ",$next_hops)."\n");
		    foreach ($next_hops as $hop) 
			if (!in_array($hop,$masters))  { //if the next hop is not a master 
			    if ($sat_data["host_id"])  //if it has a host assiged
				$distribution[$hop][]=$sat_data["host_id"]; //send host data
		    	    else 
				if (!is_array($distribution[$hop])) //empty hosts, to send only basic data
				    $distribution[$hop]=array();
		    }
	    } else 
		;//echo "No paths from $my_sat_id down to $sat_id\n";
	}
	unset ($result_sats);

	//var_dump($distribution);	
	
	if (is_array($distribution)) { //if there is something to do...
	    if (count($distribution) > 1) { //more than one destination satellite, spawn processes.
		foreach (array_keys($distribution) as $dest_sat_id) {
		    
		    $hosts = join($distribution[$dest_sat_id],",");
		    
		    if (get_config_option("os_type")=="windows") $open = "start /MIN $php_executable -q $sync $dest_sat_id $hosts $tasks";
			else $open = "$php_executable -q $sync $dest_sat_id $hosts $tasks &";

		    echo "$open\n";
		    $p = popen($open,"w");
		    sleep(2); //wait before spawning new proceses
		    unset($sat_id);
		}
	    } else { //if only one, continue directly
		$sat_id = current(array_keys($distribution));
		if (count($distribution[$sat_id]) > 0) $hosts_ids = join($distribution[$sat_id],",");
	    }
	}
    }


    if ($sat_id > 1) { //no one distributes to 1
    	if ($hosts_ids)
	    $hosts = explode (",",$hosts_ids);
	
	if ($tasks) 
	    $sync_tasks = explode (",",$tasks);

	if (in_array("distribute1",$sync_tasks)) { 
	
	    if (count($hosts) > 0)
		logger("S$my_sat_id\t: Sending Basic and Hosts $hosts_ids data to Satellite $sat_id ...\n");
	    else
		logger("S$my_sat_id\t: Sending Basic data to Satellite $sat_id ...\n");

	    $result = satellite_distribute($sat_id,$hosts);
	    //var_dump ($result);

	    $text = "S$my_sat_id\t: Satellite $sat_id sync ".$result["items"]." objects, ".$result["total_errors"]." errors, ".
		    $result["total_sent"]." items sent, ".$result["total_recv"]." recv: ".$result["total_add"]." added, ".$result["total_mod"]." modified, ".$result["total_del"]." deleted. Total time: ".$result["total_time"]."\n";
	    logger($text); 

	    if (($result["total_recv"]!=$result["total_sent"]))
		foreach ($result["data"] as $data_type=>$info)
        	    logger("S$my_sat_id\t: Satellite $sat_id - $data_type\tS:".$info["sent"]." R:".$info["recv"]." A:".$info["added"]." M:".$info["modified"]." D:".$info["deleted"]."\n");    

	    if ($result["total_errors"]>0) //if any errors were found
		foreach ($result["data"] as $data_type=>$info)
		    if (isset($info["error"])) //if this data type has an error field
			logger("S$my_sat_id\t: Satellite $sat_id Data Type: $data_type, Error: ".$info["error"]."\n");    
	}
	
	if (in_array("rrdsync",$sync_tasks)) 
	    if (count($hosts) > 0) { //if there are hosts assigned to this satellite
	    
	    	$result = satellite_rrdsync ($sat_id,$hosts);
		
		if ($result["status"]==true)
		    $text = "S$my_sat_id\t: Satellite $sat_id RRDsync ".$result["number_of_files"]." files, ".$result["stats"];
		else
		    $text = "S$my_sat_id\t: Satellite $sat_id RRDsync ".$result["number_of_files"]." files, ERROR:".$result["error"];
	    
	        logger($text);
	    }
    }

    function satellite_rrdsync ($sat_id, $hosts) {
	
	$interfaces = array();
	$status = false;
	
	foreach ($hosts as $host_id) 
	    $interfaces = array_merge($interfaces,array_keys(interfaces_list(NULL,array("host"=>$host_id))));
	
	if (count($interfaces) > 0) { //if the hosts have some interfaces

	    $interfaces_file = get_config_option("engine_temp_path")."/".uniqid("").".dat.list";
	    $rsync = "rsync";
	    $rrd_path = get_config_option("rrd_real_path");
	    $satellite_data = current(satellite_get ($sat_id));

	    //generate file with all the interface's filenames
	    $fp = fopen($interfaces_file,"w+");
	    foreach ($interfaces as $interface_id)
	        fputs($fp,"interface-$interface_id-*.rrd\n");
	    fclose($fp);
	    var_dump($interfaces_file);
	    die();    
	    preg_match("/^(.*:\/\/)?([^:\/]+):?([0-9]+)?(.*)/", $satellite_data["url"],$aux); 	
	    $sat_host  = $aux[2];

	    $remote_rrd_path = satellite_call ($sat_id,"jffnms","config_option","rrd_real_path");
	    
	    $rsync_command = "rsync -rzve 'ssh' --include-from=$interfaces_file --exclude='*' $sat_host:$remote_rrd_path/ $rrd_path/";
	    exec ($rsync_command,$a,$b);

	    if ($b == 0) { //everything ok
		$aux = count($a);
		$number_of_files = $aux-3; //3 is the number of informational lines
		$stats = $a[$aux-2]." ".$a[$aux-1];
		$status = true;
	    } else
		$error = join("",$a);
	    
	    unlink ($interfaces_file);
	} else
	    $error = "No Interfaces to Sync.";
	
	$result = array("status"=>$status,"number_of_files"=>$number_of_files,"stats"=>$stats,"error"=>$error);		
	return $result;
    }	    

    db_close();
?>
jffnms-0.9.3/docs/utils/clean_auth.php0000644000175000017500000000262311716447477017247 0ustar  csmallcsmall Javier Szyszlican 
 * This program is licensed under the GNU GPL, full terms in the LICENSE file
 */
    $no_db=1;
    
    include("../../conf/config.php");

    $db_type="mysql";    
    $dbhost="localhost";
    $db="jffnms";
    $dbuser="root";
    $dbpass="sun";

    if (!$do) $do = $argv[1];

    $conexion = mysql_connect($dbhost, $dbuser, $dbpass) or die ("Could not connect - CON1");
    mysql_select_db($db) or die ("Could not select DB - CON2");
    echo "* Refixing Users Table\n";

    $result= mysql_query ("ALTER TABLE auth AUTO_INCREMENT = 1") or die ("Query failed - T3 - ".mysql_error());
    $result= mysql_query ("ALTER TABLE profiles AUTO_INCREMENT = 1") or die ("Query failed - T3 - ".mysql_error());
    $result= mysql_query ("ALTER TABLE profiles_values AUTO_INCREMENT = 300") or die ("Query failed - T3 - ".mysql_error());
    
    $user = "admin";

    if ($user) {
    
	echo "* Creating User $user";
	$id = user_add($user);

	echo ", assigned id: $id, now applying profile.\n";
	user_modify($id,"","",$user,"Administrator",0);
    
	profile_add_option($id,"ADMIN_ACCESS"); 
        profile_add_option($id,"ADMIN_USERS"); 
	profile_add_option($id,"ADMIN_SYSTEM"); 
	profile_add_option($id,"ADMIN_HOSTS"); 
	profile_add_option($id,"MESSAGES_VIEW_ALL"); 
	profile_add_option($id,"REPORTS_VIEW_ALL_INTERFACES"); 
    }
jffnms-0.9.3/docs/utils/slice-rrd.php0000644000175000017500000001430411716447477017027 0ustar  csmallcsmall Javier Szyszlican 
 * This program is licensed under the GNU GPL, full terms in the LICENSE file
 */
    include ("../../conf/config.php");

    $cant_part=45;
    $readsize=15000;
    
    $process_data_func = "process_data2";
    

    $cant_lines = 0;
    
    function process_line(&$fps,$filename,$ds_name,$line,&$cant_ds,&$save_ds,&$new_lines,&$last_update,&$ds) {
	    //if ($GLOBALS[cant_lines] >= 10000) return 1;
        global $cant_lines;
        global $process_data_func;

	    $cant_lines++;
	    $pos = strpos($line,"");
	    $pos1 = strpos($line,"");
	    
	    if ($pos1!==false) $last_update=$line;	
	    
	    if ($line=="") $save_ds = 1;
	    else 
		if ($line=="") { 
		    $save_ds = 0;
		    $fps[$cant_ds] = prepare_ds ($filename,$ds_name,$ds[$cant_ds],$last_update,$cant_ds);
		    $cant_ds++;
		} else 
		    if (($save_ds==1) && (strpos($line,"") === false) )
			$ds[$cant_ds].=$line;
	
	    if ($pos!==false) $new_lines[]=$line;

	    $cant_new_lines = count($new_lines);
	    $cant_part = $GLOBALS[cant_part];
	    //$cant_part = 10;

	    if (($cant_new_lines > 1) && ($cant_new_lines%$cant_part==0))  
		$process_data_func($fps,$filename,$new_lines,$cant_part,$cant_ds);    
	    
    }    

    function read_file2 (&$fps,&$filename,$ds_name,$interface_id) {
	
	$fp = fopen($filename,"r");
	$filename = $GLOBALS[rrd_real_path]."/interface-".$interface_id;
	$cant_ds=0;
	$save_ds=0;
	$new_lines = array();
	$line = "";
	$aux = "";
	$pos = 0;
    	while (!feof($fp)) {
	    if ($pos==0) {
		$aux = fread($fp,$GLOBALS[readsize]);
		echo ".";
	    }
	    
	    $pos = strpos ($aux,"\n");

	    if ($pos===false) {
		$pos = 0;
		echo "|";
	    } else {
		$pos1=true;
		while ($pos1!==false) {
		    $pos1 = strpos($aux,"\n");
		    $temp = substr($aux,0,$pos1);
		    $new_line = trim($line.$temp);
		    unset($line);

		    //echo "\npos: $pos\npos1: $pos1\nline: $line\naux: $aux\ntemp: $temp\nnew_line: $new_line\n";
	
		    //if ($new_line=="") break;
		    if ($new_line=="") {$b = 1; break;}
		    if ($new_line) $b = process_line($fps,$filename,$ds_name,$new_line,$cant_ds,$save_ds,$new_lines,$last_update,$ds);

		    $aux = substr($aux,$pos1+1,strlen($aux));
		}
		$pos =0;
		if ($b==1) break;
	    }
	    //echo "\n1\npos: $pos\npos1: $pos1\nline: $line\naux: $aux\ntemp: $temp\nnew_line: $new_line\n";
	    $line .= substr($aux,0,strlen($aux));
	}	
	unset($new_lines);
	fclose($fp);
	return count($ds);
    }

    function process_data2 (&$fps,$filename,&$new_lines,$cant_part,&$cant_ds) { 
	$data = array_splice($new_lines,0,$cant_part);
	for ($i = 0; $i < $cant_part; $i++) {
	    $pos2 = 0;    
	    $line = $data[$i];
	    $j = 0;
	    
	    while ($pos2!==false) {
		$line = substr($line,$pos2,strlen($line));

		$pos1 = strpos($line,"")+3;
		$pos2 = strpos($line,"");
	
		if ($pos2!==false) {
		    $value = trim(substr($line,$pos1,$pos2-$pos1));
	
		    fputs($fps[$j++],"$value\n");
		    $pos2 = $pos2+3;
		}
		//var_dump($line);
		//var_dump($pos1);
		//var_dump($pos2);
		//var_dump($value);	
	    }
	    unset ($data[$i]);
	}
	echo "!";
	flush();
    }


    function prepare_ds ($filename,$dsname,$definition,$last_update,$ds) {
	    //echo "Creating file $filename-$dsname-$ds...\n";
	    echo "$ds";
	    $fp = fopen ("$filename-$dsname-$ds","w+");
	    fputs($fp,"\n0001\n300\n$last_update\n");
	    fputs($fp,"\ndata\n$definition\n");
	    fputs($fp,"\nAVERAGE\n1\n5.0000000000e-01\n\nNaN0\n\n");
	    return $fp;
    }

    function finish_ds ($fp,$filename,$dsname,$ds) {
	    $rrdfile= "$filename-$ds.rrd";
	    $xmlfile= "$filename-$dsname-$ds";
	    echo "$ds";
	    //echo "Finishing file $xmlfile...\n";
	    fputs($fp,"\n\n\n");
	    fclose($fp);
	
	    if (file_exists($rrdfile)) unlink ($rrdfile);
	    rrdtool_restore ($rrdfile,$xmlfile);
	    unlink ($xmlfile);
    }

    
    function start ($filename,$interface_id) {
	global $fps,$cant_lines;
	
	$dsname="ds";
	$start = gettimeofday();
    
	$cant_ds = $read_file2($fps,$filename,$dsname,$interface_id);
	$end = gettimeofday();
    
	for ($i = 0; $i < $cant_ds; $i++)
	    finish_ds ($fps[$i],$filename,$dsname,$i);
    
	$elapsed = (($end[sec]*1000000)+$end[usec]) - (($start[sec]*1000000)+$start[usec]);
	$elapsed_sec = $elapsed / 1000000; $elapsed_sec_round=round($elapsed_sec,2);
        $elapsed_min = $elapsed_sec / 60; $elapsed_min_round=round($elapsed_min,3);
	$lines_per_sec = round($cant_lines / $elapsed_sec,2);
    
	echo "\nElapsed: $elapsed usec - $elapsed_sec_round sec - $elapsed_min_round min \nLines: $cant_lines\nLines Per Second: $lines_per_sec\n";
    }


    $query = "select id from interfaces where rrd_mode = 1 and id > 1";
    $result = db_query($query);
    set_time_limit(0);
    $fps = array();
    
    while ($rec = db_fetch_array($result)) {
	$interface_id = $rec[id];
	$filename_xml = "$rrd_real_path/interface-$interface_id.xml";
	$filename_rrd = "$rrd_real_path/interface-$interface_id.rrd";

	echo "\n\nStarting Interface $interface_id, file $filename_xml\n";

	if (file_exists($filename_rrd)) { //old .rrd exists
	    rrdtool_dump($filename_rrd,$filename_xml);

	    if (file_exists($filename_xml)) { //dump is ok?
	
		start ($filename_xml,$interface_id);

		if (file_exists("$rrd_real_path/interface-$interface_id-0.rrd")) { //upgrade ok
		    $errors["Upgrade OK"]++;
		    db_query("update interfaces set rrd_mode = 2 where id = $interface_id");
		    unlink($filename_rrd); //old rrd

		} else {
		    $errors["Problem in Upgrade"]++;
		    echo "Problem Upgrading, check if you have Free Disk Space\n";
		}
		unlink($filename_xml); //xml dump

	    } else {
		echo "RRD DumpFile $filename_xml not found, probably you dont have rrdtool setup fine, rerun /admin/setup.php\n";
		$errors["Dump Not Found"]++;
	    }
	} else {
	    echo "File $filename_rrd not found... don't worry, it's not a problem.\n";
	    $errors["RRD File Not Found"]++;
	}
    }
    ksort($errors);
    var_dump($errors);
?>
jffnms-0.9.3/docs/utils/adjust_bw.php0000644000175000017500000000076411716447477017132 0ustar  csmallcsmall Javier Szyszlican 
 * This program is licensed under the GNU GPL, full terms in the LICENSE file
 */
include ("../../conf/config.php");

$interfaces = interfaces_list();

foreach ($interfaces as $int){
    echo $int[id]." - ".$int[bandwidthin]." - ".$int[bandwidthout];
    if ($int[bandwidthin] > 2) 
	$result = interface_adjust_rrd($int[id],$int[bandwidthin],$int[bandwidthout]);
    echo "Result $result\n";
}
?>
jffnms-0.9.3/docs/utils/perl_wddx.pl0000644000175000017500000000226511377440254016747 0ustar  csmallcsmall
use HTTP::Request::Common qw(POST);
use LWP::UserAgent;
use WDDX;

my $wddx = new WDDX;
$ua = new LWP::UserAgent;

#@params = (WDDX::NULL,WDDX::NULL,WDDX::NULL,WDDX::NULL,WDDX::NULL,2);
#@params = (undef,undef,undef,undef,2);
@params = ($wddx->null(),1,1,$wddx->null(),0,2);

print $wddx->serialize($wddx->array2wddx(\@params)),"\n";

my $req = POST 'http://boxen.lan.tiba.com/jffnms-sat4/admin/satellite.php',
               [ 
	        "sat_id" => "1",
	        "capabilities" => "W",
	        "class" => "events", "method" => "list",  
#	        "method" => "ping",
		"params" => $wddx->serialize($wddx->array2wddx(\@params))
	       ];

$response = $ua->request($req);

print $response->as_string,"\n";

my $wddx_request = $wddx->deserialize( $response->content() );

$type = $wddx_request->type;
$data = $wddx->wddx2perl($wddx_request);

#print "type: ", $type, " - ",$data,"\n"; 

if ($type eq "hash") {
    foreach $key (keys %$data) {
	$value = $data->{$key};
	print $key, "=>", $value,"\n";
    }    
}

if ($type eq "array") {
    foreach $element (@{$data}) {
	foreach $key (keys %$element) {
	    print $key, "=>", $value = $element->{$key},"\n";
	}    
	print "-----------------\n";
    }
}
jffnms-0.9.3/docs/utils/syslog_file_import.php0000644000175000017500000000141311716447477021051 0ustar  csmallcsmall Javier Szyszlican 
 * This program is licensed under the GNU GPL, full terms in the LICENSE file
 */
//This tool is for importing OLD syslog files to the JFFNMS DB.

    $fcont = file($argv[1]);
    $host = $argv[2];
    
    foreach ($fcont as $line) { 
	$pos1 = strpos($line,"16 ")+3;
	$pos2 = strpos($line,": ");
	$date = substr($line,$pos1,$pos2-$pos1);
	$date2 = "2002-05-16 ".$date;
	$date_unix = strtotime($date2);
	$date3 = date("Y-m-d H:i:s",$date_unix);
	
	$line = substr($line,0,strlen($line)-1);	
	$query = "insert into syslog (host,date,date_logged,message) VALUES ('$host','$date3','$date3','$line');";
	//echo "$date - $date2 - $date3 - $line\n";
	echo "$query \n";   
    }

?>

jffnms-0.9.3/docs/utils/sql_diff.php0000644000175000017500000000500611716447477016731 0ustar  csmallcsmall Javier Szyszlican 
 * This program is licensed under the GNU GPL, full terms in the LICENSE file
 */
    //error_reporting(8);
    
    function sql_values ($values) {
	$len = strlen($values);
	$parsed = array();
	$string = false;
	$data = "";
	
	for ($i = 0; $i < $len; $i++) {
	    $char = $values[$i];
	
	    if ($char=="'") //string start
		if ($string==true) $string = false;
		else $string = true;
	
	    if (($char==",") && ($string==false)) {
		$parsed[]=$data;
		$data = "";
		$string = false;
	    } else
		$data.= $char;
	}
	if (!empty($data) || ($data==="0")) $parsed[]=$data;
	
	return $parsed;
    }

    $file = $_SERVER["argv"][1];
    if (!$file) $file = "php://stdin";
    
    $diffs = array();
    $in = fopen($file,"r");
    $i=0;    
    while ($data = fgets($in)) 
	if (($data[0]=="+") || ($data[0]=="-")) 
	    $diffs[]=$data;
    fclose($in);
    
    
    $records = array();
    foreach ($diffs as $diff) {
	preg_match("/(\S)INSERT INTO (\S+) \((\S.+)\) VALUES \((\S.+)\);/",$diff,$parts);
	$table = $parts[2];
	$fields = explode(",",$parts[3]);
	$values = explode(",",$parts[4]);
	$values = sql_values($parts[4]);
	//var_dump($values);
	
	$type=$parts[1];
	
	if ($table) {
	    $records[$i]=compact("type","table","fields","values");
	    $records[$i++]["id"]=$values[0];
	}
    }
    unset($diffs);
    //var_dump($records);

    $diffs = array();
    if (is_array($records))
    foreach ($records as $rec) {
	$diffs[$rec["table"]]["fields"]=$rec["fields"];
	$diffs[$rec["table"]]["records"][$rec["id"]][$rec["type"]]=$rec["values"];
    }
    unset ($records);
    //var_dump($diffs);
    
    if (is_array($diffs))
    foreach ($diffs as $table=>$data) {

	$records = $data["records"];
	$fields = $data["fields"];

	foreach ($records as $id=>$record) {
	    $mods = array();
	    for ($i=0; $i < count($fields); $i++) 
		if ($record["-"][$i]!=$record["+"][$i]) 
		    if (isset($record["+"][$i])) $mods[$i]=$record["+"][$i];

	    unset($upd);

	    if (count($mods) == 0) {
		$sql = "DELETE FROM $table where id = $id;";
	    } else if (count($mods) == count($fields)) { //all fields insert
		    $sql = "DELETE FROM $table where id = $id; \nINSERT INTO $table (".join(", ",$fields).") VALUES (".join(", ",$record["+"]).");\n";
		} else { //some fields update
		    foreach ($mods as $field=>$data) $upd[]=trim($fields[$field]." = $data");
	    	    $sql = "UPDATE $table SET ".join(", ",$upd)." WHERE id = $id;";
		}
	    echo "$sql\n";
	}
    }
?>
jffnms-0.9.3/docs/utils/lines.sh0000644000175000017500000000012611377440254016062 0ustar  csmallcsmall#!/bin/bash
find | grep php | grep -v ini | grep -v 'docs/utils' | xargs wc | sort -n
jffnms-0.9.3/docs/utils/import_custom.php0000644000175000017500000001522411377440254020036 0ustar  csmallcsmall Javier Szyszlican 
 * Copyright (c) <2009> Craig Small 
 * This program is licensed under the GNU GPL, full terms in the LICENSE file
 */

# Start here
#
$file_argv=1;
$new_ids=array();

// Defaults
$opt_x = FALSE;
$opt_output = FALSE;


error_reporting(E_ALL|E_STRICT);
$options = getopt('c:ho:vx');
foreach($options as $opt => $value) {
    switch ($opt) {
    case 'c':
        if (is_array($value))
            usage("Can only use the -c option once'");
        $opt_conf = $value;
        $file_argv+=2;
        break;
    case 'h':
        usage();
        break;
    case 'o':
        if (is_array($value))
            usage("Can only use the -o option once.");
        $opt_output = $value;
        $file_argv+=2;
        break;
    case 'v':
        version();
        break;
    case 'x':
        $opt_x = TRUE;
        break;
    }
}
if (isset($opt_conf))
    $config_dir = $opt_conf;
else
    $config_dir = '../../conf';
$config_file = $config_dir . '/config.php';
if (!is_readable($config_file)) {
    perr("Cannot open configuration file '$config_file'.\n");
    exit(1);
}
require($config_file);
error_reporting(E_ALL|E_STRICT);

if (!array_key_exists($file_argv, $_SERVER['argv']))
    usage('Need to specify input file.');

$input_file = $_SERVER['argv']["$file_argv"];
if (!is_readable($input_file)) {
    perr("Cannot open input file '$input_file'.\n");
    exit(1);
}
if ($opt_output) {
    if (file_exists($opt_output)) {
        perr("Output file '$opt_output' exists, aborting.\n");
        exit(1);
    }
    if ( ($outfp = fopen($opt_output,"w")) === FALSE) {
        perr("Cannot open output file '$opt_output' for writing.\n");
        exit(1);
    }
} else {
    $outfp = STDOUT;
}

$data = file ($input_file);
foreach ($data as $line)
{
    if (preg_match("/INSERT INTO (\S+) \(([^)]+)\) VALUES (\(.+\))/i", $line, $matches))
    {
        list (,$table, $fields, $value_list) = $matches;

	        $table = str_replace("`", "", $table);
	        $fields = sql_values($fields);
            if (preg_match_all("/\(([^)]+)\)/",$value_list,$matches)>0) {
                foreach($matches[1] as $values) {
	        $values = sql_values($values);
		
		for ($i=0; $i < count($fields); $i++)
		    $rec[str_replace("'","",$fields[$i])]=$values[$i]; 

        if (!array_key_exists($table, $new_ids) 
            || !is_numeric($new_ids[$table]))
	    	    $new_ids[$table] = next_value($table);
		$rec["_new_id"] = $new_ids[$table]++;
		
		$records[$table][$rec["id"]] = $rec;
		unset ($rec);
            }
            }

        continue;
    }
    fputs($outfp,$line."\n");
} 

    foreach ($records as $table=>$recs) 
	foreach ($recs as $old_id=>$aux) {
	    $rec = &$records[$table][$old_id];

	    switch ($table) {
		case "interface_types":
		    new_value ($records, $rec, "autodiscovery_default_poller", "pollers_groups");
		    new_value ($records, $rec, "graph_default", "graph_types");
		    new_value ($records, $rec, "sla_default", "slas");
		break;

		case "interface_types_fields":
		    new_value ($records, $rec, "itype", "interface_types");
		break;

		case "graph_types":
		    new_value ($records, $rec, "type", "interface_types");
		break;

		case "syslog_types":
		    new_value ($records, $rec, "type", "types");
		break;

		case "types":
		    new_value ($records, $rec, "alarm_up", "types");
		break;

		case "pollers_groups":
		    new_value ($records, $rec, "interface_type", "interface_types");
		break;

		case "pollers_backend":
		    if ($rec["command"]=="'alarm'")
			new_value ($records, $rec, "parameters", "types");
		break;

		case "pollers_poller_groups":
		    new_value ($records, $rec, "poller", "pollers");
		    new_value ($records, $rec, "backend", "pollers_backend");
		    new_value ($records, $rec, "poller_group", "pollers_groups");
		break;
	    }	    
	    unset($rec);
	} 

    foreach ($records as $table=>$recs)  
	    foreach ($recs as $old_id=>$rec) {
	        $new_id = $rec["_new_id"];
	        unset ($rec["_new_id"]);
	    
	        $rec["id"] = $new_id;
	    fputs($outfp, regen_sql($table, $rec)."\n");
	}

function sql_values ($values) {
	$len = strlen($values);
	$parsed = array();
	$string = false;
	$data = "";
	
	for ($i = 0; $i < $len; $i++) {
	    $char = $values[$i];
	
	    if ($char=="`") $char = "'";
	    
	    if ($char=="'") //string start
		$string = !$string;
	
	    if (($char==",") && !$string) {
		$parsed[]=trim($data);
		$data = "";
		$string = false;
	    } else
		$data.= $char;
	}
	if (!empty($data) || ($data==="0")) $parsed[]=trim($data);
	
	return $parsed;
    }

    function next_value($table) {
        global $opt_x;
        //if ($opt_x == TRUE)
	      //  return(current(db_fetch_array(db_query("SELECT MAX(id) FROM ".$table.' WHERE id < 10000')))+1);
	    return(current(db_fetch_array(db_query("SELECT MAX(id) FROM ".$table)))+1);
    }
    
    function regen_sql ($table, $rec) {
	
	foreach ($rec as $field=>$value) {
	    $fields[]="`".$field."`";
	    $values[]=$value;
	}
	
	$fields = join(", ",$fields);
	$values = join(", ",$values);
	
	$query = "INSERT INTO `".$table."` (".$fields.") VALUES (".$values.");";
	
	return $query;
    }

function new_value (&$records, &$rec, $field, $lookup_table) {
	$orig_value = str_replace("'","",$rec[$field]);
	
	if ($orig_value > 10000) {
	    $new_value = $records[$lookup_table][$orig_value]["_new_id"];
    
        if (!is_numeric($orig_value)) {
            perr("ERROR $field (".$rec["id"]."): orig value = ".$orig_value."\n");
            die;
        }
	    elseif (!is_numeric($new_value))
        {
            perr("Error: could not find new id for field \"$field\" (".$rec["id"]."): orig value = ".$orig_value."\n");
            die;
        }
	    else
		$rec[$field] = $new_value;
	}
}
function perr($msg)
{
    fputs(STDERR,$msg);
}

function usage($message=NULL)
{
    if ($message)
        print $message."\n";
    print("
Usage: import_custom.php [ -vh ] [ -c CFGDIR ] [ -o outfile ]
Translate a custom made interface type.

    -c CFGDIR   Use CFGDIR for configation directory instead of ../../config
    -h          This help
    -o          Output to OUTFILE instead of stdout
    -v          Print tools version
");
    if ($message)
        exit(1);
    exit(0);
}

function version()
{
    print("
import_custom.php (JFFNMS) v2.0
    Copyright (C) 2002-2005 Javier Szyszlican 
    Copyright (c) 2009 Craig Small 

    JFFNMS comes with ABSOLUTELY NO WARRANTY.
    This is free software, and you are welcome to redistribute it under
    the terms of the GNU General Public License.
    For more information about these matters, see the files named COPYING.
");
    exit(0);
}
?>
jffnms-0.9.3/docs/utils/export_custom.php0000644000175000017500000000437611716447477020066 0ustar  csmallcsmall Javier Szyszlican 
 * This program is licensed under the GNU GPL, full terms in the LICENSE file
 */
    $current_installation = $_SERVER["argv"][1];
    $base_installation = $_SERVER["argv"][2];
    $result_path = $_SERVER["argv"][3];
    $result_name = $_SERVER["argv"][4];
    
    if (!$current_installation || !$base_installation || !$result_path || !$result_name)
	die ("Usage: php -q export_custom.php /opt/jffnms/ /opt/jffnms-0.8.x /tmp my_mods\n");

    @mkdir ($result_path);
    @mkdir ($result_path."/".$result_name);
    // Files
    
    $command = "diff -x*png -x*.ini* -x*rrd -x*log -x*sql -xjffnms.conf* -Nru ".
	    "$base_installation $current_installation > $result_path/$result_name/$result_name.patch";

    exec ($command,$result);
    
    // DB

    include($current_installation."/conf/config.php");

    $fp = fopen($result_path."/".$result_name."/".$result_name.".db.sql","w+");
    
// -1 save all
// 0 empty
// 1+ leave records with id 1 or +

$tables = array (
" interface_types  ",-1, 
" interface_types_fields",-1, 
" interface_types_field_types",-1, 
" graph_types      ",-1, 
" alarm_states     ",-1,
" severity         ",-1,
" syslog_types     ",-1,
" traps_types      ",-1,
" types            ",-1,
" slas             ",-1,
" slas_cond        ",-1,
" slas_sla_cond    ",-1,
" filters          ",-1,
" filters_fields   ",-1,
" filters_cond     ",-1,
" pollers	   ",-1,
" pollers_groups   ",-1,
" pollers_backend  ",-1,
" pollers_poller_groups",-1,
" autodiscovery    ",-1,
" hosts_config_types",-1,
" tools          ",-1,
" profiles_values  ",301,
" profiles_options ",-1,
" triggers   	   ",-1,
" triggers_rules   ",-1,
" actions	   ",-1
);

    for ($i=0; $i < count($tables); $i = $i+2) {
	$limit = ($tables[$i+1]==-1)?10000:$tables[$i+1];
	$command = "mysqldump -h $dbhost -u $dbuser -p$dbpass -n -t -c -w \"id >= $limit\" $db ".$tables[$i];
        //echo $command."\n";

	unset ($result);
        exec($command,$result);

	foreach ($result as $line)
	    if (!empty($line) && (!preg_match("/^--/",$line)))
		fputs ($fp,$line."\n");
    }
    fclose ($fp);

$command = "cd $result_path/$result_name/ ; tar -cz * > ../$result_name.tar.gz";
//echo $command;
exec ($command);

?>
jffnms-0.9.3/docs/utils/rrd_export.php0000644000175000017500000000224611716447477017335 0ustar  csmallcsmall Javier Szyszlican 
 * This program is licensed under the GNU GPL, full terms in the LICENSE file
 */
    include ("../conf/config.php");
    
    echo "
";
    
    $start = 1021557600;
    $end = 1021576800;

    $query = "select id from interfaces where poll > 1";
    $result = db_query($query);
    
    while ($record = db_fetch_array($result)) {
	extract($record);
	
	$file = "$rrd_real_path/interface-$id.rrd";
	$aux = "/tmp/interface-$id.rrd.xml";
	
	unlink($aux);
	exec("$rrdtool_executable dump $file > $aux");
	
	$ok=0;
	unset($new_lines);

	$fp = fopen ($aux,"r");
	
	while (($line = fgets($fp,4096)) && ($ok != 2)) {

	    if ($ok==1) {
		$date = trim(substr($line,strpos($line,"/")+2,strpos($line," -->")-strpos($line,"/"))-2);

		//echo "$date\n";

		if (($date >= $start) && ($date <=$end)) { 
		    $new_lines[]=$line;
		    echo $line;
		}

		if (strpos($line,"") > 1) $ok=2;

	    } else if (strpos($line,"") > 1) $ok=1;
	}
	
	fclose($fp);
	unlink($aux);

	$fp = fopen("$file.aux","w+");
	foreach ($new_lines as $line) fputs($fp,$line);
	fclose($fp);

    }

?>
jffnms-0.9.3/docs/utils/tftp_put_host_config.php0000644000175000017500000000303311716447477021367 0ustar  csmallcsmall Javier Szyszlican 
 * This program is licensed under the GNU GPL, full terms in the LICENSE file
 */

    $functions_include="engine";
    include ("../../conf/config.php");

    $host_id = $_SERVER["argv"][1];
    $filename= $_SERVER["argv"][2];
    
    if ($host_id && $filename) {
	$host = current(hosts_list($host_id));
	
	if ($host["config_type"]==3) { //OLD-CISCO-SYS-MIB
	    $oid = ".1.3.6.1.4.1.9.2.1.53.".$host["tftp"];
	    $aux = snmp_set($host["ip"],$host["rwcommunity"],$oid,"s",$filename,60,0);
	    if ($aux==TRUE) $result = 2;
	}
	    
	if ($host["config_type"]==2) { //CISCO-CONFIG-COPY-MIB
	    $oid = ".1.3.6.1.4.1.9.9.96.1.1.1.1";
	    snmp_set($host[ip],$host[rwcommunity],"$oid.14.999","i",6,60,0); //destroy
	    snmp_set($host[ip],$host[rwcommunity],"$oid.14.999","i",5,60,0); //create and wait
	    snmp_set($host[ip],$host[rwcommunity],"$oid.2.999","i","1",60,0); //tftp
	    snmp_set($host[ip],$host[rwcommunity],"$oid.3.999","i","1",60,0); //running
	    snmp_set($host[ip],$host[rwcommunity],"$oid.4.999","i","4",60,0); //network
	    snmp_set($host[ip],$host[rwcommunity],"$oid.5.999","a",$host[tftp],60,0); //server
	    snmp_set($host[ip],$host[rwcommunity],"$oid.6.999","s",$filename,60,0); //filename
	    snmp_set($host[ip],$host[rwcommunity],"$oid.14.999","i",1,60,0); //activate
	    $result = snmp_get($host[ip],$host[rwcommunity],"$oid.10.999");
	}

	return $result;
    }
    
    echo "$result\n";
?>
jffnms-0.9.3/docs/apache-example0000644000175000017500000000020211377440254016044 0ustar  csmallcsmall
    ServerAdmin you@yournet.com
    DocumentRoot /opt/jffnms/htdocs
    ServerName nms.yournet.com

jffnms-0.9.3/docs/sla-creation-example.txt0000644000175000017500000001063211377440254020032 0ustar  csmallcsmallAn Example of Creating a new SLA:
---------------------------------
	by Christian Zimmerman


Problem: We need to create a new SLA because the default SLA's aren't going to meet our needs. 
We want to monitor disk space on the server and be notified when : disk space used is > 99% of the total disk space. 

Things we need to do:

1. Create a new Event Type
2. Create a new SLA Conditions Individual Definition
3. Create a new SLA group
4. Associate the newly created condition with the new SLA Group
5. Create a new Trigger (allows for notification if needed)
6. Add a rule for the trigger


Step One:
=========
Goto Administration > Internal Configuration > Event Analyzer > Event Types

You should see a list of all event types. Click the ADD link to create a new Event. 
Now we need to input a description, severity, and event text. Enter the following:

Description -> Disk Full-SLA
Severity    -> select Critical
Event Text  -> Disk : 

Next put a check in the next two boxes: Show in Event Viewer? and  Event Generates an Alarm?
Once this is completed click the submit button and now you should see this new event in the list with all the other events.

Step Two:
=========
Goto Administration > Internal Configuration > SLA definitions > SLA Conditions Individual Definition

Again we will need to add the condition that we will want to test for so lets create a new condition. 
Click the ADD link to begin creating a new condition. 
You will need to fill in the following fields Description, Show Info, Condition, Show Expression, and Show Unit. 
Here are the values:

Description 	-> Used Storage > 99%
Show Info	-> Used > 99%
Condition	-> (  > ((*99)/100))
Show Expression	-> (( * 100)/)
Show Unit	-> %

Once you've entered the information in, click submit and your new condition is created.

Steps Three and Four:
=====================
Goto Administration > Internal Configuration > SLA definitions > SLA Conditions Groups

Here we will need to create a new SLA group. Click the ADD button and lets create a new group. 
Here is a list of fields that we need to fill in: Description, Interface Type, Event Type, 
Alarm State, Event Text, Threshold % (for Reports). Here's the values:

Description	-> Storage Full
Interface Type	-> Storage
Event Type	-> Disk Full-SLA
Alarm State	-> Alert
Event Text	-> Storage
Threshold %	-> 100

Notice the value for the Event type is the one we created. 
This is where we link the Event Type to the SLA. 
When the SLA is met or not met depending on how you setup the triggers, an event will be generated. 
Click submit and your new SLA group is created. 
You should see your new event group now with a view link right next to it. 
This view link is where we associate the condition to check for, if the condition is met an event is generated. 
So click the view button and a second frame opens up right below the SLA groups. 
Click the ADD link and a new box appears. Under the "Condition" option select -> Used Storage > 99% and then click the SHOW option. 
Click submit. We have now created a new SLA option on which will test whether or 
not our Server disk space usage is above 99% ( meaning its full or almost full). 
If the SLA is met then an event type will be generated.

Step Five:
==========
Goto Administration > Internal Configuration >Triggers & Filters > Triggers Configuration

Now that our SLA is setup we need to setup a trigger for notification. 
(Note: You don't have to setup a trigger, but you might as well as you can turn them off later if needed without any hassle.) 
Click the ADD link and fill in the Description and Type fields:

Description	-> Disk Full
Type		-> Match Events

Click submit and your done.

Step Six:
=========
The trigger has been created, but we haven't told the trigger what action to perform to lets do this now.
Click on View Rules for the Trigger "Disk Full". A Triggers Rules Administration window shows below the Triggers. 
Click the ADD link. We need to edit these options: Field, Operator, Value, Action, Action Parameters. 
Set them to this:

Field	-> Type
Operator-> IN
Value	-> Disk Full-SLA
Action	-> Send Mail

Action Parameters

subject	-> Disk 
comment	->  


Click submit and your done. This trigger will now send an email to the email configured in your profile when the SLA has been met. 
You should also see an event as well.
jffnms-0.9.3/docs/windows/0002755000175000017500000000000011466226410014744 5ustar  csmallcsmalljffnms-0.9.3/docs/windows/php.ini0000644000175000017500000007050011377440254016241 0ustar  csmallcsmall[PHP]

;;;;;;;;;;;
; WARNING ;
;;;;;;;;;;;
; This is the default settings file for new PHP installations.
; By default, PHP installs itself with a configuration suitable for
; development purposes, and *NOT* for production purposes.
; For several security-oriented considerations that should be taken
; before going online with your site, please consult php.ini-recommended
; and http://php.net/manual/en/security.php.


;;;;;;;;;;;;;;;;;;;
; About this file ;
;;;;;;;;;;;;;;;;;;;
; This file controls many aspects of PHP's behavior.  In order for PHP to
; read it, it must be named 'php.ini'.  PHP looks for it in the current
; working directory, in the path designated by the environment variable
; PHPRC, and in the path that was defined in compile time (in that order).
; Under Windows, the compile-time path is the Windows directory.  The
; path in which the php.ini file is looked for can be overridden using
; the -c argument in command line mode.
;
; The syntax of the file is extremely simple.  Whitespace and Lines
; beginning with a semicolon are silently ignored (as you probably guessed).
; Section headers (e.g. [Foo]) are also silently ignored, even though
; they might mean something in the future.
;
; Directives are specified using the following syntax:
; directive = value
; Directive names are *case sensitive* - foo=bar is different from FOO=bar.
;
; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one
; of the INI constants (On, Off, True, False, Yes, No and None) or an expression
; (e.g. E_ALL & ~E_NOTICE), or a quoted string ("foo").
;
; Expressions in the INI file are limited to bitwise operators and parentheses:
; |        bitwise OR
; &        bitwise AND
; ~        bitwise NOT
; !        boolean NOT
;
; Boolean flags can be turned on using the values 1, On, True or Yes.
; They can be turned off using the values 0, Off, False or No.
;
; An empty string can be denoted by simply not writing anything after the equal
; sign, or by using the None keyword:
;
;  foo =         ; sets foo to an empty string
;  foo = none    ; sets foo to an empty string
;  foo = "none"  ; sets foo to the string 'none'
;
; If you use constants in your value, and these constants belong to a
; dynamically loaded extension (either a PHP extension or a Zend extension),
; you may only use these constants *after* the line that loads the extension.
;
; All the values in the php.ini-dist file correspond to the builtin
; defaults (that is, if no php.ini is used, or if you delete these lines,
; the builtin defaults will be identical).


;;;;;;;;;;;;;;;;;;;;
; Language Options ;
;;;;;;;;;;;;;;;;;;;;

; Enable the PHP scripting language engine under Apache.
engine = On

; Allow the  tags are recognized.
short_open_tag = On

; Allow ASP-style <% %> tags.
asp_tags = Off

; The number of significant digits displayed in floating point numbers.
precision    =  12

; Enforce year 2000 compliance (will cause problems with non-compliant browsers)
y2k_compliance = Off

; Output buffering allows you to send header lines (including cookies) even
; after you send body content, at the price of slowing PHP's output layer a
; bit.  You can enable output buffering during runtime by calling the output
; buffering functions.  You can also enable output buffering for all files by
; setting this directive to On.  If you wish to limit the size of the buffer
; to a certain size - you can use a maximum number of bytes instead of 'On', as
; a value for this directive (e.g., output_buffering=4096).
output_buffering = Off

; You can redirect all of the output of your scripts to a function.  For
; example, if you set output_handler to "ob_gzhandler", output will be
; transparently compressed for browsers that support gzip or deflate encoding.
; Setting an output handler automatically turns on output buffering.
output_handler =

; The unserialize callback function will called (with the undefind class'
; name as parameter), if the unserializer finds an undefined class
; which should be instanciated.
; A warning appears if the specified function is not defined, or if the
; function doesn't include/implement the missing class.
; So only set this entry, if you really want to implement such a 
; callback-function.
unserialize_callback_func=

; Transparent output compression using the zlib library
; Valid values for this option are 'off', 'on', or a specific buffer size
; to be used for compression (default is 4KB)
;
; Note: output_handler must be empty if this is set 'On' !!!!
;
zlib.output_compression = Off

; Implicit flush tells PHP to tell the output layer to flush itself
; automatically after every output block.  This is equivalent to calling the
; PHP function flush() after each and every call to print() or echo() and each
; and every HTML block.  Turning this option on has serious performance
; implications and is generally recommended for debugging purposes only.
implicit_flush = Off

; Whether to enable the ability to force arguments to be passed by reference
; at function call time.  This method is deprecated and is likely to be
; unsupported in future versions of PHP/Zend.  The encouraged method of
; specifying which arguments should be passed by reference is in the function
; declaration.  You're encouraged to try and turn this option Off and make
; sure your scripts work properly with it in order to ensure they will work
; with future versions of the language (you will receive a warning each time
; you use this feature, and the argument will be passed by value instead of by
; reference).
allow_call_time_pass_reference = On

; Safe Mode
;
safe_mode = Off

; By default, Safe Mode does a UID compare check when
; opening files. If you want to relax this to a GID compare,
; then turn on safe_mode_gid.
safe_mode_gid = Off

; When safe_mode is on, UID/GID checks are bypassed when
; including files from this directory and its subdirectories.
; (directory must also be in include_path or full path must
; be used when including)
safe_mode_include_dir =								

; When safe_mode is on, only executables located in the safe_mode_exec_dir
; will be allowed to be executed via the exec family of functions.
safe_mode_exec_dir =

; open_basedir, if set, limits all file operations to the defined directory
; and below.  This directive makes most sense if used in a per-directory
; or per-virtualhost web server configuration file.
;
;open_basedir =

; Setting certain environment variables may be a potential security breach.
; This directive contains a comma-delimited list of prefixes.  In Safe Mode,
; the user may only alter environment variables whose names begin with the
; prefixes supplied here.  By default, users will only be able to set
; environment variables that begin with PHP_ (e.g. PHP_FOO=BAR).
;
; Note:  If this directive is empty, PHP will let the user modify ANY
; environment variable!
safe_mode_allowed_env_vars = PHP_

; This directive contains a comma-delimited list of environment variables that
; the end user won't be able to change using putenv().  These variables will be
; protected even if safe_mode_allowed_env_vars is set to allow to change them.
safe_mode_protected_env_vars = LD_LIBRARY_PATH

; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names.  This directive is
; *NOT* affected by whether Safe Mode is turned On or Off.
disable_functions =

; Colors for Syntax Highlighting mode.  Anything that's acceptable in
;  would work.
highlight.string  = #CC0000
highlight.comment = #FF9900
highlight.keyword = #006600
highlight.bg      = #FFFFFF
highlight.default = #0000CC
highlight.html    = #000000


;
; Misc
;
; Decides whether PHP may expose the fact that it is installed on the server
; (e.g. by adding its signature to the Web server header).  It is no security
; threat in any way, but it makes it possible to determine whether you use PHP
; on your server or not.
expose_php = On


;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

max_execution_time = 30     ; Maximum execution time of each script, in seconds
memory_limit = 8M      ; Maximum amount of memory a script may consume (8MB)


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Error handling and logging ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; error_reporting is a bit-field.  Or each number up to get desired error
; reporting level
; E_ALL             - All errors and warnings
; E_ERROR           - fatal run-time errors
; E_WARNING         - run-time warnings (non-fatal errors)
; E_PARSE           - compile-time parse errors
; E_NOTICE          - run-time notices (these are warnings which often result
;                     from a bug in your code, but it's possible that it was
;                     intentional (e.g., using an uninitialized variable and
;                     relying on the fact it's automatically initialized to an
;                     empty string)
; E_CORE_ERROR      - fatal errors that occur during PHP's initial startup
; E_CORE_WARNING    - warnings (non-fatal errors) that occur during PHP's
;                     initial startup
; E_COMPILE_ERROR   - fatal compile-time errors
; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
; E_USER_ERROR      - user-generated error message
; E_USER_WARNING    - user-generated warning message
; E_USER_NOTICE     - user-generated notice message
;
; Examples:
;
;   - Show all errors, except for notices
;
;error_reporting = E_ALL & ~E_NOTICE
;
;   - Show only errors
;
;error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
;
;   - Show all errors except for notices
;
error_reporting  =  E_ALL & ~E_NOTICE

; Print out errors (as a part of the output).  For production web sites,
; you're strongly encouraged to turn this feature off, and use error logging
; instead (see below).  Keeping display_errors enabled on a production web site
; may reveal security information to end users, such as file paths on your Web
; server, your database schema or other information.
display_errors = On

; Even when display_errors is on, errors that occur during PHP's startup
; sequence are not displayed.  It's strongly recommended to keep
; display_startup_errors off, except for when debugging.
display_startup_errors = Off

; Log errors into a log file (server-specific log, stderr, or error_log (below))
; As stated above, you're strongly advised to use error logging in place of
; error displaying on production web sites.
log_errors = Off

; Store the last error/warning message in $php_errormsg (boolean).
track_errors = Off

; Disable the inclusion of HTML tags in error messages.
;html_errors = Off
  
; String to output before an error message.
;error_prepend_string = ""

; String to output after an error message.
;error_append_string = ""

; Log errors to specified file.
;error_log = filename

; Log errors to syslog (Event Log on NT, not valid in Windows 95).
;error_log = syslog

; Warn if the + operator is used with strings.
warn_plus_overloading = Off


;;;;;;;;;;;;;;;;;
; Data Handling ;
;;;;;;;;;;;;;;;;;
;
; Note - track_vars is ALWAYS enabled as of PHP 4.0.3

; The separator used in PHP generated URLs to separate arguments.
; Default is "&". 
;arg_separator.output = "&"

; List of separator(s) used by PHP to parse input URLs into variables.
; Default is "&". 
; NOTE: Every character in this directive is considered as separator!
;arg_separator.input = ";&"

; This directive describes the order in which PHP registers GET, POST, Cookie,
; Environment and Built-in variables (G, P, C, E & S respectively, often
; referred to as EGPCS or GPC).  Registration is done from left to right, newer
; values override older values.
variables_order = "EGPCS"

; Whether or not to register the EGPCS variables as global variables.  You may
; want to turn this off if you don't want to clutter your scripts' global scope
; with user data.  This makes most sense when coupled with track_vars - in which
; case you can access all of the GPC variables through the $HTTP_*_VARS[],
; variables.
;
; You should do your best to write your scripts so that they do not require
; register_globals to be on;  Using form variables as globals can easily lead
; to possible security problems, if the code is not very well thought of.
register_globals = On

; This directive tells PHP whether to declare the argv&argc variables (that
; would contain the GET information).  If you don't use these variables, you
; should turn it off for increased performance.
register_argc_argv = On

; Maximum size of POST data that PHP will accept.
post_max_size = 8M

; This directive is deprecated.  Use variables_order instead.
gpc_order = "GPC"

; Magic quotes
;

; Magic quotes for incoming GET/POST/Cookie data.
magic_quotes_gpc = On

; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.
magic_quotes_runtime = Off    

; Use Sybase-style magic quotes (escape ' with '' instead of \').
magic_quotes_sybase = Off

; Automatically add files before or after any PHP document.
auto_prepend_file =
auto_append_file =

; As of 4.0b4, PHP always outputs a character encoding by default in
; the Content-type: header.  To disable sending of the charset, simply
; set it to be empty.
;
; PHP's built-in default is text/html
default_mimetype = "text/html"
;default_charset = "iso-8859-1"

; Always populate the $HTTP_RAW_POST_DATA variable.
;always_populate_raw_post_data = On

;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;

; UNIX: "/path1:/path2"  
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"

; The root of the PHP pages, used only if nonempty.
; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root
; if you are running php as a CGI under any web server (other than IIS)
; see documentation for security issues.  The alternate is to use the
; cgi.force_redirect configuration below
doc_root =

; The directory under which PHP opens the script using /~usernamem used only
; if nonempty.
user_dir =

; Directory in which the loadable extensions (modules) reside.
extension_dir = c:\php\extensions

; Whether or not to enable the dl() function.  The dl() function does NOT work
; properly in multithreaded servers, such as IIS or Zeus, and is automatically
; disabled on them.
enable_dl = On

; cgi.force_redirect is necessary to provide security running PHP as a CGI under
; most web servers.  Left undefined, PHP turns this on by default.  You can
; turn it off here AT YOUR OWN RISK
; **You CAN safely turn this off for IIS, in fact, you MUST.**
; cgi.force_redirect = 1

; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape 
; (iPlanet) web servers, you MAY need to set an environment variable name that PHP
; will look for to know it is OK to continue execution.  Setting this variable MAY
; cause security issues, KNOW WHAT YOU ARE DOING FIRST.
; cgi.redirect_status_env = ;

;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;

; Whether to allow HTTP file uploads.
file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
;upload_tmp_dir =

; Maximum allowed size for uploaded files.
upload_max_filesize = 2M


;;;;;;;;;;;;;;;;;;
; Fopen wrappers ;
;;;;;;;;;;;;;;;;;;

; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
allow_url_fopen = On

; Define the anonymous ftp password (your email address)
;from="john@doe.com"


;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
;
; If you wish to have an extension loaded automatically, use the following
; syntax:
;
;   extension=modulename.extension
;
; For example, on Windows:
;
;   extension=msql.dll
;
; ... or under UNIX:
;
;   extension=msql.so
;
; Note that it should be the name of the module only; no directory information 
; needs to go here.  Specify the location of the extension with the
; extension_dir directive above.


;Windows Extensions
;Note that MySQL and ODBC support is now built in, so no dll is needed for it.
;
;extension=php_bz2.dll
;extension=php_ctype.dll
;extension=php_cpdf.dll
;extension=php_curl.dll
;extension=php_cybercash.dll
;extension=php_db.dll
;extension=php_dba.dll
;extension=php_dbase.dll
;extension=php_dbx.dll
;extension=php_domxml.dll
;extension=php_dotnet.dll
;extension=php_exif.dll
;extension=php_fbsql.dll
;extension=php_fdf.dll
;extension=php_filepro.dll
extension=php_gd.dll
;extension=php_gettext.dll
;extension=php_hyperwave.dll
;extension=php_iconv.dll
;extension=php_ifx.dll
;extension=php_iisfunc.dll
;extension=php_imap.dll
;extension=php_ingres.dll
;extension=php_interbase.dll
;extension=php_java.dll
;extension=php_ldap.dll
;extension=php_mbstring.dll
;extension=php_mcrypt.dll
;extension=php_mhash.dll
;extension=php_ming.dll
;extension=php_mssql.dll
;extension=php_oci8.dll
;extension=php_openssl.dll
;extension=php_oracle.dll
;extension=php_pdf.dll
;extension=php_pgsql.dll
;extension=php_printer.dll
;extension=php_shmop.dll
extension=php_snmp.dll
extension=php_sockets.dll
;extension=php_sybase_ct.dll
;extension=php_tokenizer.dll
;extension=php_w32api.dll
;extension=php_xslt.dll
;extension=php_yaz.dll
;extension=php_zlib.dll


;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;

[Syslog]
; Whether or not to define the various syslog variables (e.g. $LOG_PID,
; $LOG_CRON, etc.).  Turning it off is a good idea performance-wise.  In
; runtime, you can define these variables by calling define_syslog_variables().
define_syslog_variables  = Off

[mail function]
; For Win32 only.
SMTP = localhost

; For Win32 only.
sendmail_from = me@localhost.com

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =

[Java]
;java.class.path = .\php_java.jar
;java.home = c:\jdk
;java.library = c:\jdk\jre\bin\hotspot\jvm.dll 
;java.library.path = .\

[SQL]
sql.safe_mode = Off

[ODBC]
;odbc.default_db    =  Not yet implemented
;odbc.default_user  =  Not yet implemented
;odbc.default_pw    =  Not yet implemented

; Allow or prevent persistent links.
odbc.allow_persistent = On

; Check that a connection is still valid before reuse.
odbc.check_persistent = On

; Maximum number of persistent links.  -1 means no limit.
odbc.max_persistent = -1

; Maximum number of links (persistent + non-persistent).  -1 means no limit.
odbc.max_links = -1  

; Handling of LONG fields.  Returns number of bytes to variables.  0 means
; passthru.
odbc.defaultlrl = 4096  

; Handling of binary data.  0 means passthru, 1 return as is, 2 convert to char.
; See the documentation on odbc_binmode and odbc_longreadlen for an explanation
; of uodbc.defaultlrl and uodbc.defaultbinmode
odbc.defaultbinmode = 1  

[MySQL]
; Allow or prevent persistent links.
mysql.allow_persistent = On

; Maximum number of persistent links.  -1 means no limit.
mysql.max_persistent = -1

; Maximum number of links (persistent + non-persistent).  -1 means no limit.
mysql.max_links = -1

; Default port number for mysql_connect().  If unset, mysql_connect() will use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order).  Win32 will only look
; at MYSQL_PORT.
mysql.default_port =

; Default socket name for local MySQL connects.  If empty, uses the built-in
; MySQL defaults.
mysql.default_socket =

; Default host for mysql_connect() (doesn't apply in safe mode).
mysql.default_host =

; Default user for mysql_connect() (doesn't apply in safe mode).
mysql.default_user =

; Default password for mysql_connect() (doesn't apply in safe mode).
; Note that this is generally a *bad* idea to store passwords in this file.
; *Any* user with PHP access can run 'echo cfg_get_var("mysql.default_password")
; and reveal this password!  And of course, any users with read access to this
; file will be able to reveal the password as well.
mysql.default_password =

[mSQL]
; Allow or prevent persistent links.
msql.allow_persistent = On

; Maximum number of persistent links.  -1 means no limit.
msql.max_persistent = -1

; Maximum number of links (persistent+non persistent).  -1 means no limit.
msql.max_links = -1

[PostgresSQL]
; Allow or prevent persistent links.
pgsql.allow_persistent = On

; Detect broken persistent links always with pg_pconnect(). Need a little overhead.
pgsql.auto_reset_persistent = Off 

; Maximum number of persistent links.  -1 means no limit.
pgsql.max_persistent = -1

; Maximum number of links (persistent+non persistent).  -1 means no limit.
pgsql.max_links = -1

[Sybase]
; Allow or prevent persistent links.
sybase.allow_persistent = On

; Maximum number of persistent links.  -1 means no limit.
sybase.max_persistent = -1

; Maximum number of links (persistent + non-persistent).  -1 means no limit.
sybase.max_links = -1

;sybase.interface_file = "/usr/sybase/interfaces"

; Minimum error severity to display.
sybase.min_error_severity = 10

; Minimum message severity to display.
sybase.min_message_severity = 10

; Compatability mode with old versions of PHP 3.0.
; If on, this will cause PHP to automatically assign types to results according
; to their Sybase type, instead of treating them all as strings.  This
; compatability mode will probably not stay around forever, so try applying
; whatever necessary changes to your code, and turn it off.
sybase.compatability_mode = Off

[Sybase-CT]
; Allow or prevent persistent links.
sybct.allow_persistent = On

; Maximum number of persistent links.  -1 means no limit.
sybct.max_persistent = -1

; Maximum number of links (persistent + non-persistent).  -1 means no limit.
sybct.max_links = -1

; Minimum server message severity to display.
sybct.min_server_severity = 10

; Minimum client message severity to display.
sybct.min_client_severity = 10

[bcmath]
; Number of decimal digits for all bcmath functions.
bcmath.scale = 0

[browscap]
;browscap = extra/browscap.ini

[Informix]
; Default host for ifx_connect() (doesn't apply in safe mode).
ifx.default_host =

; Default user for ifx_connect() (doesn't apply in safe mode).
ifx.default_user =

; Default password for ifx_connect() (doesn't apply in safe mode).
ifx.default_password =

; Allow or prevent persistent links.
ifx.allow_persistent = On

; Maximum number of persistent links.  -1 means no limit.
ifx.max_persistent = -1

; Maximum number of links (persistent + non-persistent).  -1 means no limit.
ifx.max_links = -1

; If on, select statements return the contents of a text blob instead of its id.
ifx.textasvarchar = 0

; If on, select statements return the contents of a byte blob instead of its id.
ifx.byteasvarchar = 0

; Trailing blanks are stripped from fixed-length char columns.  May help the
; life of Informix SE users.
ifx.charasvarchar = 0

; If on, the contents of text and byte blobs are dumped to a file instead of
; keeping them in memory.
ifx.blobinfile = 0

; NULL's are returned as empty strings, unless this is set to 1.  In that case,
; NULL's are returned as string 'NULL'.
ifx.nullformat = 0

[Session]
; Handler used to store/retrieve data.
session.save_handler = files

; Argument passed to save_handler.  In the case of files, this is the path
; where data files are stored. Note: Windows users have to change this 
; variable in order to use PHP's session functions.
session.save_path = /tmp

; Whether to use cookies.
session.use_cookies = 1


; Name of the session (used as cookie name).
session.name = PHPSESSID

; Initialize session on request startup.
session.auto_start = 0

; Lifetime in seconds of cookie or, if 0, until browser is restarted.
session.cookie_lifetime = 0

; The path for which the cookie is valid.
session.cookie_path = /

; The domain for which the cookie is valid.
session.cookie_domain =

; Handler used to serialize data.  php is the standard serializer of PHP.
session.serialize_handler = php

; Percentual probability that the 'garbage collection' process is started
; on every session initialization.
session.gc_probability = 1

; After this number of seconds, stored data will be seen as 'garbage' and
; cleaned up by the garbage collection process.
session.gc_maxlifetime = 1440

; Check HTTP Referer to invalidate externally stored URLs containing ids.
; HTTP_REFERER has to contain this substring for the session to be
; considered as valid.
session.referer_check =

; How many bytes to read from the file.
session.entropy_length = 0

; Specified here to create the session id.
session.entropy_file =

;session.entropy_length = 16

;session.entropy_file = /dev/urandom

; Set to {nocache,private,public} to determine HTTP caching aspects.
session.cache_limiter = nocache

; Document expires after n minutes.
session.cache_expire = 180

; use transient sid support if enabled by compiling with --enable-trans-sid.
session.use_trans_sid = 1

url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"

[MSSQL]
; Allow or prevent persistent links.
mssql.allow_persistent = On

; Maximum number of persistent links.  -1 means no limit.
mssql.max_persistent = -1

; Maximum number of links (persistent+non persistent).  -1 means no limit.
mssql.max_links = -1

; Minimum error severity to display.
mssql.min_error_severity = 10

; Minimum message severity to display.
mssql.min_message_severity = 10

; Compatability mode with old versions of PHP 3.0.
mssql.compatability_mode = Off

; Valid range 0 - 2147483647.  Default = 4096.
;mssql.textlimit = 4096

; Valid range 0 - 2147483647.  Default = 4096.
;mssql.textsize = 4096

; Limits the number of records in each batch.  0 = all records in one batch.
;mssql.batchsize = 0

[Assertion]
; Assert(expr); active by default.
;assert.active = On

; Issue a PHP warning for each failed assertion.
;assert.warning = On

; Don't bail out by default.
;assert.bail = Off

; User-function to be called if an assertion fails.
;assert.callback = 0

; Eval the expression with current error_reporting().  Set to true if you want
; error_reporting(0) around the eval().
;assert.quiet_eval = 0

[Ingres II]
; Allow or prevent persistent links.
ingres.allow_persistent = On

; Maximum number of persistent links.  -1 means no limit.
ingres.max_persistent = -1

; Maximum number of links, including persistents.  -1 means no limit.
ingres.max_links = -1

; Default database (format: [node_id::]dbname[/srv_class]).
ingres.default_database =

; Default user.
ingres.default_user =

; Default password.
ingres.default_password =

[Verisign Payflow Pro]
; Default Payflow Pro server.
pfpro.defaulthost = "test-payflow.verisign.com"

; Default port to connect to.
pfpro.defaultport = 443

; Default timeout in seconds.
pfpro.defaulttimeout = 30

; Default proxy IP address (if required).
;pfpro.proxyaddress =

; Default proxy port.
;pfpro.proxyport =

; Default proxy logon.
;pfpro.proxylogon =

; Default proxy password.
;pfpro.proxypassword =

[Sockets]
; Use the system read() function instead of the php_read() wrapper.
sockets.use_system_read = On

[com]
; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs
;com.typelib_file = 
; allow Distributed-COM calls
;com.allow_dcom = true
; autoregister constants of a components typlib on com_load()
;com.autoregister_typelib = true
; register constants casesensitive
;com.autoregister_casesensitive = false
; show warnings on duplicate constat registrations
;com.autoregister_verbose = true

[Printer]
;printer.default_printer = ""

[mbstring]
;mbstring.internal_encoding = EUC-JP
;mbstring.http_input = auto
;mbstring.http_output = SJIS
;mbstring.detect_order = auto
;mbstring.substitute_character = none;

[FrontBase]
;fbsql.allow_persistent = On
;fbsql.autocommit = On
;fbsql.default_database = 
;fbsql.default_database_password =
;fbsql.default_host =
;fbsql.default_password =
;fbsql.default_user = "_SYSTEM"
;fbsql.generate_warnings = Off
;fbsql.max_connections = 128
;fbsql.max_links = 128
;fbsql.max_persistent = -1
;fbsql.max_results = 128
;fbsql.batchSize = 1000

; Local Variables:
; tab-width: 4
; End:
jffnms-0.9.3/docs/windows/httpd.conf0000644000175000017500000011072511377440254016747 0ustar  csmallcsmall#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See  for detailed information about
# the directives.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.  
#
# After this file is processed, the server will look for and process
# C:/Program Files/Apache Group/Apache/conf/srm.conf and then C:/Program Files/Apache Group/Apache/conf/access.conf
# unless you have overridden these with ResourceConfig and/or
# AccessConfig directives here.
#
# The configuration directives are grouped into three basic sections:
#  1. Directives that control the operation of the Apache server process as a
#     whole (the 'global environment').
#  2. Directives that define the parameters of the 'main' or 'default' server,
#     which responds to requests that aren't handled by a virtual host.
#     These directives also provide default values for the settings
#     of all virtual hosts.
#  3. Settings for virtual hosts, which allow Web requests to be sent to
#     different IP addresses or hostnames and have them handled by the
#     same Apache server process.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path.  If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
# with ServerRoot set to "/usr/local/apache" will be interpreted by the
# server as "/usr/local/apache/logs/foo.log".
#
# NOTE: Where filenames are specified, you must use forward slashes
# instead of backslashes (e.g., "c:/apache" instead of "c:\apache").
# If a drive letter is omitted, the drive on which Apache.exe is located
# will be used by default.  It is recommended that you always supply
# an explicit drive letter in absolute paths, however, to avoid
# confusion.
#

### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#

#
# ServerType is either inetd, or standalone.  Inetd mode is only supported on
# Unix platforms.
#
ServerType standalone

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
ServerRoot "C:/Program Files/Apache Group/Apache"

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
#
PidFile logs/httpd.pid

#
# ScoreBoardFile: File used to store internal server process information.
# Not all architectures require this.  But if yours does (you'll know because
# this file will be  created when you run Apache) then you *must* ensure that
# no two invocations of Apache share the same scoreboard file.
#
ScoreBoardFile logs/apache_runtime_status

#
# In the standard configuration, the server will process httpd.conf (this 
# file, specified by the -f command line option), srm.conf, and access.conf 
# in that order.  The latter two files are now distributed empty, as it is 
# recommended that all directives be kept in a single file for simplicity.  
# The commented-out values below are the built-in defaults.  You can have the 
# server ignore these files altogether by using "/dev/null" (for Unix) or
# "nul" (for Win32) for the arguments to the directives.
#
#ResourceConfig conf/srm.conf
#AccessConfig conf/access.conf

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15

#
# Apache on Win32 always creates one child process to handle requests.  If it
# dies, another child process is created automatically.  Within the child
# process multiple threads handle incoming requests.  The next two
# directives control the behaviour of the threads and processes.
#

#
# MaxRequestsPerChild: the number of requests each child process is
# allowed to process before the child dies.  The child will exit so
# as to avoid problems after prolonged use when Apache (and maybe the
# libraries it uses) leak memory or other resources.  On most systems, this
# isn't really needed, but a few (such as Solaris) do have notable leaks
# in the libraries.  For Win32, set this value to zero (unlimited)
# unless advised otherwise.
#
# NOTE: This value does not include keepalive requests after the initial
#       request per connection. For example, if a child process handles
#       an initial request and 10 subsequent "keptalive" requests, it
#       would only count as 1 request towards this limit.
#
MaxRequestsPerChild 0

#
# Number of concurrent threads (i.e., requests) the server will allow.
# Set this value according to the responsiveness of the server (more
# requests active at once means they're all handled more slowly) and
# the amount of system resources you'll allow the server to consume.
#
ThreadsPerChild 50

#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, in addition to the default. See also the 
# directive.
#
#Listen 3000
#Listen 12.34.56.78:80

#
# BindAddress: You can support virtual hosts with this option. This directive
# is used to tell the server which IP address to listen to. It can either
# contain "*", an IP address, or a fully qualified Internet domain name.
# See also the  and Listen directives.
#
#BindAddress *

#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Please read the file README.DSO in the Apache 1.3 distribution for more
# details about the DSO mechanism and run `apache -l' for the list of already
# built-in (statically linked and thus always available) modules in your Apache
# binary.
#
# Note: The order in which modules are loaded is important.  Don't change
# the order below without expert advice.
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
#LoadModule status_module modules/mod_status.so
#LoadModule info_module modules/mod_info.so
#LoadModule speling_module modules/mod_speling.so
#LoadModule rewrite_module modules/mod_rewrite.so
#LoadModule anon_auth_module modules/mod_auth_anon.so
#LoadModule dbm_auth_module modules/mod_auth_dbm.so
#LoadModule digest_auth_module modules/mod_auth_digest.so
#LoadModule digest_module modules/mod_digest.so
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule headers_module modules/mod_headers.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule unique_id_module modules/mod_unique_id.so

#
#  Reconstruction of the complete module list from all available modules
#  (static and shared ones) to achieve correct module execution order.
#
# The modules listed below, without a corresponding LoadModule directive,
# are static bound into the standard Apache binary distribution for Windows.
#
# Note: The order in which modules are loaded is important.  Don't change
# the order below without expert advice.
#
# [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE, UPDATE THIS TOO!]
ClearModuleList
#AddModule mod_vhost_alias.c
AddModule mod_env.c
AddModule mod_log_config.c
#AddModule mod_mime_magic.c
AddModule mod_mime.c
AddModule mod_negotiation.c
#AddModule mod_status.c
#AddModule mod_info.c
AddModule mod_include.c
AddModule mod_autoindex.c
AddModule mod_dir.c
AddModule mod_isapi.c
AddModule mod_cgi.c
AddModule mod_asis.c
AddModule mod_imap.c
AddModule mod_actions.c
#AddModule mod_speling.c
AddModule mod_userdir.c
AddModule mod_alias.c
#AddModule mod_rewrite.c
AddModule mod_access.c
AddModule mod_auth.c
#AddModule mod_auth_anon.c
#AddModule mod_auth_dbm.c
#AddModule mod_auth_digest.c
#AddModule mod_digest.c
#AddModule mod_proxy.c
#AddModule mod_cern_meta.c
#AddModule mod_expires.c
#AddModule mod_headers.c
#AddModule mod_usertrack.c
#AddModule mod_unique_id.c
AddModule mod_so.c
AddModule mod_setenvif.c


#
# ExtendedStatus controls whether Apache will generate "full" status
# information (ExtendedStatus On) or just basic information (ExtendedStatus
# Off) when the "server-status" handler is called. The default is Off.
#
#ExtendedStatus On

### Section 2: 'Main' server configuration
#
# The directives in this section set up the values used by the 'main'
# server, which responds to any requests that aren't handled by a
#  definition.  These values also provide defaults for
# any  containers you may define later in the file.
#
# All of these directives may appear inside  containers,
# in which case these default settings will be overridden for the
# virtual host being defined.
#

#
# Port: The port to which the standalone server listens.  Certain firewall
# products must be configured before Apache can listen to a specific port.
# Other running httpd servers will also interfere with this port.  Disable
# all firewall, security, and other services if you encounter problems.
# To help diagnose problems use the Windows NT command NETSTAT -a
#
Port 80

#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed.  This address appears on some server-generated pages, such
# as error documents.
#
ServerAdmin admin@lan.tiba.com

#
# ServerName allows you to set a host name which is sent back to clients for
# your server if it's different than the one the program would get (i.e., use
# "www" instead of the host's real name).
#
# Note: You cannot just invent host names and hope they work. The name you 
# define here must be a valid DNS name for your host. If you don't understand
# this, ask your network administrator.
# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address (e.g., http://123.45.67.89/)
# anyway, and this will make redirections work in a sensible way.
#
# 127.0.0.1 is the TCP/IP local loop-back address, often named localhost. Your 
# machine always knows itself by this address. If you use Apache strictly for 
# local testing and development, you may use 127.0.0.1 as the server name.
#
ServerName nmslan.lan.tiba.com


#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "C:/Program Files/Apache Group/Apache/htdocs"

#
# Each directory to which Apache has access, can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories). 
#
# First, we configure the "default" to be a very restrictive set of 
# permissions.  
#

    Options FollowSymLinks
    AllowOverride None


#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#

#
# This should be changed to whatever you set DocumentRoot to.
#


#
# This may also be "None", "All", or any combination of "Indexes",
# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
    Options Indexes FollowSymLinks MultiViews

#
# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo", 
# "AuthConfig", and "Limit"
#
    AllowOverride None

#
# Controls who can get stuff from this server.
#
    Order allow,deny
    Allow from all


#
# UserDir: The name of the directory which is appended onto a user's home
# directory if a ~user request is received.
#
# Under Win32, we do not currently try to determine the home directory of
# a Windows login, so a format such as that below needs to be used.  See
# the UserDir documentation for details.
#

    UserDir "C:/Program Files/Apache Group/Apache/users/"


#
# Control access to UserDir directories.  The following is an example
# for a site where these directories are restricted to read-only.
#
#
#    AllowOverride FileInfo AuthConfig Limit
#    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
#    
#        Order allow,deny
#        Allow from all
#    
#    
#        Order deny,allow
#        Deny from all
#    
#

#
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index.  Separate multiple entries with spaces.
#

    DirectoryIndex index.html


#
# AccessFileName: The name of the file to look for in each directory
# for access control information.
#
AccessFileName .htaccess

#
# The following lines prevent .htaccess files from being viewed by
# Web clients.  Since .htaccess files often contain authorization
# information, access is disallowed for security reasons.  Comment
# these lines out if you want Web visitors to see the contents of
# .htaccess files.  If you change the AccessFileName directive above,
# be sure to make the corresponding changes here.
#
# Also, folks tend to use names such as .htpasswd for password
# files, so this will protect those as well.
#

    Order allow,deny
    Deny from all
    Satisfy All


#
# CacheNegotiatedDocs: By default, Apache sends "Pragma: no-cache" with each
# document that was negotiated on the basis of content. This asks proxy
# servers not to cache the document. Uncommenting the following line disables
# this behavior, and proxies will be allowed to cache the documents.
#
#CacheNegotiatedDocs

#
# UseCanonicalName:  (new for 1.3)  With this setting turned on, whenever
# Apache needs to construct a self-referencing URL (a URL that refers back
# to the server the response is coming from) it will use ServerName and
# Port to form a "canonical" name.  With this setting off, Apache will
# use the hostname:port that the client supplied, when possible.  This
# also affects SERVER_NAME and SERVER_PORT in CGI scripts.
#
UseCanonicalName On

#
# TypesConfig describes where the mime.types file (or equivalent) is
# to be found.
#

    TypesConfig conf/mime.types


#
# DefaultType is the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value.  If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
DefaultType text/plain

#
# The mod_mime_magic module allows the server to use various hints from the
# contents of the file itself to determine its type.  The MIMEMagicFile
# directive tells the module where the hint definitions are located.
# mod_mime_magic is not part of the default server (you have to add
# it yourself with a LoadModule [see the DSO paragraph in the 'Global
# Environment' section], or recompile the server and include mod_mime_magic
# as part of the configuration), so it's enclosed in an  container.
# This means that the MIMEMagicFile directive will only be processed if the
# module is part of the server.
#

    MIMEMagicFile conf/magic


#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off

#
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a 
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a 
# container, that host's errors will be logged there and not here.
#
ErrorLog logs/error.log

#
# LogLevel: Control the number of messages logged to the error.log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn

#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

#
# The location and format of the access logfile (Common Logfile Format).
# If you do not define any access logfiles within a 
# container, they will be logged here.  Contrariwise, if you *do*
# define per- access logfiles, transactions will be
# logged therein and *not* in this file.
#
CustomLog logs/access.log common

#
# If you would like to have agent and referer logfiles, uncomment the
# following directives.
#
#CustomLog logs/referer.log referer
#CustomLog logs/agent.log agent

#
# If you prefer a single logfile with access, agent, and referer information
# (Combined Logfile Format) you can use the following directive.
#
#CustomLog logs/access.log combined

#
# Optionally add a line containing the server version and virtual host
# name to server-generated pages (error documents, FTP directory listings,
# mod_status and mod_info output etc., but not CGI generated documents).
# Set to "EMail" to also include a mailto: link to the ServerAdmin.
# Set to one of:  On | Off | EMail
#
ServerSignature On

# 
# Apache parses all CGI scripts for the shebang line by default.
# This comment line, the first line of the script, consists of the symbols
# pound (#) and exclamation (!) followed by the path of the program that 
# can execute this specific script.  For a perl script, with perl.exe in
# the C:\Program Files\Perl directory, the shebang line should be:

   #!c:/program files/perl/perl

# Note you _must_not_ indent the actual shebang line, and it must be the
# first line of the file.  Of course, CGI processing must be enabled by 
# the appropriate ScriptAlias or Options ExecCGI directives for the files 
# or directory in question.
#
# However, Apache on Windows allows either the Unix behavior above, or can
# use the Registry to match files by extention.  The command to execute 
# a file of this type is retrieved from the registry by the same method as 
# the Windows Explorer would use to handle double-clicking on a file.
# These script actions can be configured from the Windows Explorer View menu, 
# 'Folder Options', and reviewing the 'File Types' tab.  Clicking the Edit
# button allows you to modify the Actions, of which Apache 1.3 attempts to
# perform the 'Open' Action, and failing that it will try the shebang line.
# This behavior is subject to change in Apache release 2.0.
#
# Each mechanism has it's own specific security weaknesses, from the means
# to run a program you didn't intend the website owner to invoke, and the
# best method is a matter of great debate.
#
# To enable the this Windows specific behavior (and therefore -disable- the
# equivilant Unix behavior), uncomment the following directive:
#
#ScriptInterpreterSource registry
#
# The directive above can be placed in individual  blocks or the
# .htaccess file, with either the 'registry' (Windows behavior) or 'script' 
# (Unix behavior) option, and will override this server default option.
#

#
# Aliases: Add here as many aliases as you need (with no limit). The format is 
# Alias fakename realname
#


    #
    # Note that if you include a trailing / on fakename then the server will
    # require it to be present in the URL.  So "/icons" isn't aliased in this
    # example, only "/icons/".  If the fakename is slash-terminated, then the 
    # realname must also be slash terminated, and if the fakename omits the 
    # trailing slash, the realname must also omit it.
    #
    Alias /icons/ "C:/Program Files/Apache Group/Apache/icons/"

    
        Options Indexes MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
    

    # This Alias will project the on-line documentation tree under /manual/
    # even if you change the DocumentRoot. Comment it if you don't want to 
    # provide access to the on-line documentation.
    #
    Alias /manual/ "C:/Program Files/Apache Group/Apache/htdocs/manual/"

    
        Options Indexes FollowSymlinks MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
    

    #
    # ScriptAlias: This controls which directories contain server scripts.
    # ScriptAliases are essentially the same as Aliases, except that
    # documents in the realname directory are treated as applications and
    # run by the server when requested rather than as documents sent to the client.
    # The same rules about trailing "/" apply to ScriptAlias directives as to
    # Alias.
    #
    ScriptAlias /cgi-bin/ "C:/Program Files/Apache Group/Apache/cgi-bin/"

    #
    # "C:/Program Files/Apache Group/Apache/cgi-bin" should be changed to whatever your ScriptAliased
    # CGI directory exists, if you have that configured.
    #
    
        AllowOverride None
        Options None
        Order allow,deny
        Allow from all
    


# End of aliases.

#
# Redirect allows you to tell clients about documents which used to exist in
# your server's namespace, but do not anymore. This allows you to tell the
# clients where to look for the relocated document.
# Format: Redirect old-URI new-URL
#

#
# Directives controlling the display of server-generated directory listings.
#


    #
    # FancyIndexing is whether you want fancy directory indexing or standard
    #
    # Note, add the option TrackModified to the IndexOptions default list only
    # if all indexed directories reside on NTFS volumes.  The TrackModified flag
    # will report the Last-Modified date to assist caches and proxies to properly
    # track directory changes, but it does _not_ work on FAT volumes.
    #
    IndexOptions FancyIndexing

    #
    # AddIcon* directives tell the server which icon to show for different
    # files or filename extensions.  These are only displayed for
    # FancyIndexed directories.
    #
    AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip

    AddIconByType (TXT,/icons/text.gif) text/*
    AddIconByType (IMG,/icons/image2.gif) image/*
    AddIconByType (SND,/icons/sound2.gif) audio/*
    AddIconByType (VID,/icons/movie.gif) video/*

    AddIcon /icons/binary.gif .bin .exe
    AddIcon /icons/binhex.gif .hqx
    AddIcon /icons/tar.gif .tar
    AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
    AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
    AddIcon /icons/a.gif .ps .ai .eps
    AddIcon /icons/layout.gif .html .shtml .htm .pdf
    AddIcon /icons/text.gif .txt
    AddIcon /icons/c.gif .c
    AddIcon /icons/p.gif .pl .py
    AddIcon /icons/f.gif .for
    AddIcon /icons/dvi.gif .dvi
    AddIcon /icons/uuencoded.gif .uu
    AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
    AddIcon /icons/tex.gif .tex
    AddIcon /icons/bomb.gif core

    AddIcon /icons/back.gif ..
    AddIcon /icons/hand.right.gif README
    AddIcon /icons/folder.gif ^^DIRECTORY^^
    AddIcon /icons/blank.gif ^^BLANKICON^^

    #
    # DefaultIcon is which icon to show for files which do not have an icon
    # explicitly set.
    #
    DefaultIcon /icons/unknown.gif

    #
    # AddDescription allows you to place a short description after a file in
    # server-generated indexes.  These are only displayed for FancyIndexed
    # directories.
    # Format: AddDescription "description" filename
    #
    #AddDescription "GZIP compressed document" .gz
    #AddDescription "tar archive" .tar
    #AddDescription "GZIP compressed tar archive" .tgz

    #
    # ReadmeName is the name of the README file the server will look for by
    # default, and append to directory listings.
    #
    # HeaderName is the name of a file which should be prepended to
    # directory indexes. 
    #
    # If MultiViews are amongst the Options in effect, the server will
    # first look for name.html and include it if found.  If name.html
    # doesn't exist, the server will then look for name.txt and include
    # it as plaintext if found.
    #
    ReadmeName README
    HeaderName HEADER

    #
    # IndexIgnore is a set of filenames which directory indexing should ignore
    # and not include in the listing.  Shell-style wildcarding is permitted.
    #
    IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t


# End of indexing directives.

#
# Document types.
#


    #
    # AddEncoding allows you to have certain browsers (Mosaic/X 2.1+) uncompress
    # information on the fly. Note: Not all browsers support this.
    # Despite the name similarity, the following Add* directives have nothing
    # to do with the FancyIndexing customization directives above.
    #
    AddEncoding x-compress Z
    AddEncoding x-gzip gz tgz
    #
    # AddLanguage allows you to specify the language of a document. You can
    # then use content negotiation to give a browser a file in a language
    # it can understand.
    #
    # Note 1: The suffix does not have to be the same as the language
    # keyword --- those with documents in Polish (whose net-standard
    # language code is pl) may wish to use "AddLanguage pl .po" to
    # avoid the ambiguity with the common suffix for perl scripts.
    #
    # Note 2: The example entries below illustrate that in quite
    # some cases the two character 'Language' abbreviation is not
    # identical to the two character 'Country' code for its country,
    # E.g. 'Danmark/dk' versus 'Danish/da'.
    #
    # Note 3: In the case of 'ltz' we violate the RFC by using a three char
    # specifier. But there is 'work in progress' to fix this and get
    # the reference data for rfc1766 cleaned up.
    #
    # Danish (da) - Dutch (nl) - English (en) - Estonian (ee)
    # French (fr) - German (de) - Greek-Modern (el)
    # Italian (it) - Korean (kr) - Norwegian (no) - Norwegian Nynorsk (nn)
    # Portugese (pt) - Luxembourgeois* (ltz)
    # Spanish (es) - Swedish (sv) - Catalan (ca) - Czech(cz)
    # Polish (pl) - Brazilian Portuguese (pt-br) - Japanese (ja)
    # Russian (ru)
    #
    AddLanguage da .dk
    AddLanguage nl .nl
    AddLanguage en .en
    AddLanguage et .ee
    AddLanguage fr .fr
    AddLanguage de .de
    AddLanguage el .el
    AddLanguage he .he
    AddCharset ISO-8859-8 .iso8859-8
    AddLanguage it .it
    AddLanguage ja .ja
    AddCharset ISO-2022-JP .jis
    AddLanguage kr .kr
    AddCharset ISO-2022-KR .iso-kr
    AddLanguage nn .nn
    AddLanguage no .no
    AddLanguage pl .po
    AddCharset ISO-8859-2 .iso-pl
    AddLanguage pt .pt
    AddLanguage pt-br .pt-br
    AddLanguage ltz .lu
    AddLanguage ca .ca
    AddLanguage es .es
    AddLanguage sv .sv
    AddLanguage cz .cz
    AddLanguage ru .ru
    AddLanguage tw .tw
    AddLanguage zh-tw .tw
    AddCharset Big5         .Big5    .big5
    AddCharset WINDOWS-1251 .cp-1251
    AddCharset CP866        .cp866
    AddCharset ISO-8859-5   .iso-ru
    AddCharset KOI8-R       .koi8-r
    AddCharset UCS-2        .ucs2
    AddCharset UCS-4        .ucs4
    AddCharset UTF-8        .utf8

    # LanguagePriority allows you to give precedence to some languages
    # in case of a tie during content negotiation.
    #
    # Just list the languages in decreasing order of preference. We have
    # more or less alphabetized them here. You probably want to change this.
    #
    
        LanguagePriority en da nl et fr de el it ja kr no pl pt pt-br ru ltz ca es sv tw
    

    #
    # AddType allows you to tweak mime.types without actually editing it, or to
    # make certain files to be certain types.
    #
    AddType application/x-tar .tgz

    #
    # AddHandler allows you to map certain file extensions to "handlers",
    # actions unrelated to filetype. These can be either built into the server
    # or added with the Action command (see below)
    #
    # If you want to use server side includes, or CGI outside
    # ScriptAliased directories, uncomment the following lines.
    #
    # To use CGI scripts:
    #
    #AddHandler cgi-script .cgi

    #
    # To use server-parsed HTML files
    #
    #AddType text/html .shtml
    #AddHandler server-parsed .shtml

    #
    # Uncomment the following line to enable Apache's send-asis HTTP file
    # feature
    #
    #AddHandler send-as-is asis

    #
    # If you wish to use server-parsed imagemap files, use
    #
    #AddHandler imap-file map

    #
    # To enable type maps, you might want to use
    #
    #AddHandler type-map var


# End of document types.

#
# Action lets you define media types that will execute a script whenever
# a matching file is called. This eliminates the need for repeated URL
# pathnames for oft-used CGI file processors.
# Format: Action media/type /cgi-script/location
# Format: Action handler-name /cgi-script/location
#

#
# MetaDir: specifies the name of the directory in which Apache can find
# meta information files. These files contain additional HTTP headers
# to include when sending the document
#
#MetaDir .web

#
# MetaSuffix: specifies the file name suffix for the file containing the
# meta information.
#
#MetaSuffix .meta

#
# Customizable error response (Apache style)
#  these come in three flavors
#
#    1) plain text
#ErrorDocument 500 "The server made a boo boo.
#  n.b.  the single leading (") marks it as text, it does not get output
#
#    2) local redirects
#ErrorDocument 404 /missing.html
#  to redirect to local URL /missing.html
#ErrorDocument 404 /cgi-bin/missing_handler.pl
#  N.B.: You can redirect to a script or a document using server-side-includes.
#
#    3) external redirects
#ErrorDocument 402 http://some.other-server.com/subscription_info.html
#  N.B.: Many of the environment variables associated with the original
#  request will *not* be available to such a script.

#
# Customize behaviour based on the browser
#


    #
    # The following directives modify normal HTTP response behavior.
    # The first directive disables keepalive for Netscape 2.x and browsers that
    # spoof it. There are known problems with these browser implementations.
    # The second directive is for Microsoft Internet Explorer 4.0b2
    # which has a broken HTTP/1.1 implementation and does not properly
    # support keepalive when it is used on 301 or 302 (redirect) responses.
    #
    BrowserMatch "Mozilla/2" nokeepalive
    BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0

    #
    # The following directive disables HTTP/1.1 responses to browsers which
    # are in violation of the HTTP/1.0 spec by not being able to grok a
    # basic 1.1 response.
    #
    BrowserMatch "RealPlayer 4\.0" force-response-1.0
    BrowserMatch "Java/1\.0" force-response-1.0
    BrowserMatch "JDK/1\.0" force-response-1.0


# End of browser customization directives

#
# Allow server status reports, with the URL of http://servername/server-status
# Change the "lan.tiba.com" to match your domain to enable.
#
#
#    SetHandler server-status
#    Order deny,allow
#    Deny from all
#    Allow from lan.tiba.com
#

#
# Allow remote server configuration reports, with the URL of
# http://servername/server-info (requires that mod_info.c be loaded).
# Change the "lan.tiba.com" to match your domain to enable.
#
#
#    SetHandler server-info
#    Order deny,allow
#    Deny from all
#    Allow from lan.tiba.com
#

#
# There have been reports of people trying to abuse an old bug from pre-1.1
# days.  This bug involved a CGI script distributed as a part of Apache.
# By uncommenting these lines you can redirect these attacks to a logging 
# script on phf.apache.org.  Or, you can record them yourself, using the script
# support/phf_abuse_log.cgi.
#
#
#    Deny from all
#    ErrorDocument 403 http://phf.apache.org/phf_abuse_log.cgi
#

#
# Proxy Server directives. Uncomment the following lines to
# enable the proxy server:
#
#
#    ProxyRequests On

#    
#        Order deny,allow
#        Deny from all
#        Allow from lan.tiba.com
#    

    #
    # Enable/disable the handling of HTTP/1.1 "Via:" headers.
    # ("Full" adds the server version; "Block" removes all outgoing Via: headers)
    # Set to one of: Off | On | Full | Block
    #
#    ProxyVia On

    #
    # To enable the cache as well, edit and uncomment the following lines:
    # (no cacheing without CacheRoot)
    #
#    CacheRoot "C:/Program Files/Apache Group/Apache/proxy"
#    CacheSize 5
#    CacheGcInterval 4
#    CacheMaxExpire 24
#    CacheLastModifiedFactor 0.1
#    CacheDefaultExpire 1
#    NoCache a-domain.com another-domain.edu joes.garage-sale.com

#
# End of proxy directives.

LoadModule php4_module c:\php\sapi\php4apache.dll
AddModule mod_php4.c
AddType application/x-httpd-php .php


### Section 3: Virtual Hosts
#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at 
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
NameVirtualHost *

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#
#    ServerAdmin webmaster@dummy-host.example.com
#    DocumentRoot /www/docs/dummy-host.example.com
#    ServerName dummy-host.example.com
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
#

#This way 

 NameVirtualHost *
 
     ServerAdmin webmaster@your-domain.com
     DocumentRoot c:\jffnms\htdocs
     ServerName nms.yourdomain.com
     ServerAlias 10.1.0.84
     DirectoryIndex index.php
 

# OR
# Script /jffnms/ c:/jffnms/htdocs/
jffnms-0.9.3/docs/windows/SYSLOG_JFFNMS.win32.txt0000644000175000017500000000753411377440254020545 0ustar  csmallcsmallSyslog daemon for JFFNMS on Windows 2000/XP
===========================================

Note: This will not work for Windows 95/98/Me, it's only for Windows 2000/XP and maybe NT 4.0

Installation and configuration:
-------------------------------

Follow the instructions in INSTALL.win32.txt to setup a working JFFNMS.

Install ODBC-driver for MYSQL:
	Download ODBC-driver from: http://dev.mysql.com/downloads/connector/odbc/3.51.html
	Scroll down until you find Windows downloads
	Get the latest MSI-package
	Click on Next until Finish.
	
Create ODBC connection:
	Use the ODBC Data Source Administrator to create a data source for MySQL.
	1) Click Start, point to Settings, and then click Control Panel. 
	2) On computers running Microsoft Windows 2000 or newer, double-click Administrative Tools,
 	   and then double-click Data Sources (ODBC). On computers running older versions of 
	   Windows, double-click 32-bit ODBC or ODBC.
	3) Add a System DSN
	4) Select MySQL ODBC 3.51 Driver, and then click Finish. 
	   The MySQL ODBC 3.51 Driver - DSN Configuration dialog box appears.
	5) Data Source Name: JFFNMS
	   Server: localhost
	   User: jffnms
	   Password: jffnms
	   Database: jffnms
	6) Click Test to test the connection
	7) Click Ok to save the connection

Install SysLog2ODBC:
	Download from: http://sourceforge.net/projects/syslog2odbc/
	Get the ZIP-file
	Copy the syslog2odbc.exe and .ini file from inside the archive to c:\jffnms 
	Install the service with syslog2odbc.exe -i
	
	Change the ODBC-section in syslog2odbc.ini to:
		[ODBC]
		ConnectionString=DSN=JFFNMS
		SQLStatement=INSERT INTO syslog ( host, message, date, date_logged ) VALUES ( ?, ?, NOW(), NOW() )
		Param1=SENDERDEVICE_IP
		Param2=RAWMSG
		WaitOnError=15
		MaxRetryCount=4

	Start the syslog2odbc service: NET START syslog2odbc
	
	Point your devices that generate syslog-messages to IP.OF.YOUR.BOX


==============================================================================	

If you would like to send Windows eventlog messages from a Windows NT4, 2000,
XP or 2003 host to your JFFNMS-box, install NTsyslog on the host:

Install NTsyslog:
	Download from: http://sourceforge.net/projects/ntsyslog/
	Get the ZIP-file
	Unzip it to c:\ on the box you wish to send eventlog messages from.
	Install the service with ntsyslog -install
	
	You can configure NTsyslog with NTSyslogCtrl.exe, but when you need to 
	configure lots of machines use a .REG file (see below).
	After configuration start the NTsyslog service with NET START ntsyslog
	
	
		REGEDIT4

		[HKEY_LOCAL_MACHINE\SOFTWARE\SaberNet]
		"Syslog"="IP.OF.YOUR.JFFNMS-BOX"

		[HKEY_LOCAL_MACHINE\SOFTWARE\SaberNet\Syslog]

		[HKEY_LOCAL_MACHINE\SOFTWARE\SaberNet\Syslog\Application]
		"Information"=dword:00000000
		"Information Priority"=dword:0000000e
		"Warning"=dword:00000001
		"Warning Priority"=dword:0000000c
		"Error"=dword:00000001
		"Error Priority"=dword:0000000b
		"Audit Success"=dword:00000000
		"Audit Success Priority"=dword:0000000d
		"Audit Failure"=dword:00000001
		"Audit Failure Priority"=dword:00000009

		[HKEY_LOCAL_MACHINE\SOFTWARE\SaberNet\Syslog\Security]
		"Information"=dword:00000000
		"Information Priority"=dword:00000026
		"Warning"=dword:00000001
		"Warning Priority"=dword:00000024
		"Error"=dword:00000001
		"Error Priority"=dword:00000023
		"Audit Success"=dword:00000000
		"Audit Success Priority"=dword:00000025
		"Audit Failure"=dword:00000001
		"Audit Failure Priority"=dword:00000021

		[HKEY_LOCAL_MACHINE\SOFTWARE\SaberNet\Syslog\System]
		"Information"=dword:00000000
		"Information Priority"=dword:0000001e
		"Warning"=dword:00000001
		"Warning Priority"=dword:0000001c
		"Error"=dword:00000001
		"Error Priority"=dword:0000001b
		"Audit Success"=dword:00000000
		"Audit Success Priority"=dword:0000001d
		"Audit Failure"=dword:00000001
		"Audit Failure Priority"=dword:00000019
	
	

jffnms-0.9.3/TODO0000644000175000017500000000536311760060424013015 0ustar  csmallcsmallThis are the remaining tasks to be done in JFFNMS.
If you want to contribute and you dont know where to start, please read this lines.
If you want to add a task, send me an email.

Craig's TODO list
=================

  - rewrite tcp_port discovery script to use popen, log better and
    new format for nmap 5.21, also pgrep()

To Do
=====

    - Host Types
    - events/interface JS/CSS font-size
    - popup selector full-text search
    - discovery params: new/old field ?
    - SNMP Timeout per-host
    - Host Types, IT by Host Type
    - Host Groups (modify maps)
    - alarm backend: N Downs. db records per-int and global
    - Chris ESI: Pix config transfer
    - Host Groups (like maps) (modify maps to allow hosts)
    - Craig: NUT UPS
    - ALL Button in admin_header
    - Configurable Delay in the DHTML popups
    - TCP Port Hello/Quit string
    - new/poller+ad satellite filter
	 

For Later:
----------

API:
    - Thomas DNS monitoring
    - Generic Interface Type
        
    - Poller Helper: Poll only State
    - Satellite Remote (Auto)Discovery
    - Satellite Sync (virtual satellite in case theres no connection and I'm not the master)
    - Modify Pollers that handle the buffer locally to somehow use the backend (or sync it)

    - RRD Analyzers:
	- How much traffic the Interface had in X time (95th Percentile also)
	- TOP 10 (Top Traffic, Errors, RTT, etc.)

    - Tools:
	- Host Tools (Routing Table, ARP Table, Socket State, etc. SNMP-based)
	- Tools for all interface types (id =1)

    - New Trigger/Action to allow config transfer as soon as a config change is made (event)
    - Make consolidate scripts functions (like the other parts)
    - Asset Tracking (Inventory) (Part Number, Serial Number, Cards, etc) (could use ENTITY-MIB/STACK-MIB)
    - TFTP Configuration CVS Upload (Requested by Mike Hyde)
    - TFTP Configuration Scheduled Upload (Requested by Rob Laidlaw)
    - SLA Planned Outages/Maintence Windows
    - SNMP Traps Processing more useful and flexible. (match by interfacenumber also) (Call Handler Scripts)
    - Event Flap Detection.
    
GUI:
    - Send a URL to the interface in the Email Action (Requested by Rob Laidlaw)
    - Stored Reports
    
MISC:
    - NetFlow Integration
    - Use the Standard msyslog, not one modified for JFFNMS
    - MD5 Signature of the tarball
    - RPM Package
    - Better SOAP Interoperatibility testing
    - Snort SNMP TRAP messages integration
    - Radius Integration
    - Trouble Ticket Plugins (Framework Ready)
    - Implement ENTITY-MIB & STACK-MIB for Cisco's & others


In the Works:
=============

    - Documentation (on CVS by Craig Small and Javier Szyszlican)
    - Interface inter-dependece (will be based on DMII Designated Main Interfaces)
    - Multi Language Support (Sergio Martinez)
jffnms-0.9.3/INSTALL.win32.txt0000644000175000017500000001426111760060424015132 0ustar  csmallcsmallWindows 2000/XP Install Procedure 
=================================


Note: This will not work for Windows 95/98/Me, it's only for Windows 2000/XP and maybe NT 4.0

The installation should be done as and Administrator User.

This guide is for Apache2 with PHP5. If you want to use older versions, 
read the JFFNMS 0.7.9 INSTALL.win32.txt file.

Installation:
-------------

Install Apache: 
	Download Apache2 from: http://www.apache.org/dist/httpd/binaries/win32/
	Get the latest release "no_ssl.msi" package, like "apache_2.0.52-win32-x86-no_ssl.msi".
	Complete Install, Click on Next until Finish. 
	You should see Apache running in your taskbar.
	Test it going browsing to http://localhost/ or http://IP.OF.YOUR.BOX/

Install MySQL: 
	Download from: http://www.mysql.com/downloads/mysql/4.1.html
	Scroll down until you find MySQL Essentials for Windows.
	
	Select the "Complete Install", Click on Next until Finish.

	When you go into the configuration phase, select "Server Machine", 
	and then "Non-Transacctional Database Only".
	
	Then set a new root password.
	
	All other configuration leave as default.
		
Install PHP:
	Download PHP 5 from: http://www.php.net/downloads.php
	Get the "Windows Binaries ZIP package" with all the modules (First One).

	Extract the archive to c:\php 

	Execute the following: 
	    c:\> copy c:\php\php.ini-dist c:\windows\php.ini
	    c:\> copy c:\php\libmysql.dll c:\windows\
	
	Create Folder c:\usr
	Copy c:\php\extra\mibs to c:\usr\mibs

Install JFFNMS:
	Download the .zip file (I'm sure you already have done this) and extract it to c:\jffnms 

	Create the User 'jffnms' in the Windows User Manager with any password you choose.
	
	Remember to CHECK 'Password Never Expires' and UNCHECK 'Must Change password at next logon' for this user.
	
	Give the 'jffnms' user FULL CONTROL over the c:\jffnms folder (and its sub-folders)

Install RRDTOOL:
	Download from: http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/?M=D
	Get the rrdtool-1.0.49-win32-bin.zip (or newer) file.
	Extract the archive to a temporary location.
	Copy the rrdtool.exe file from inside the archive to c:\jffnms 

Install NMAP: (If you are running Windows XP please read the NMAP page carefully, it may not work)
	Download it from: http://www.insecure.org/nmap/nmap_download.html
	Get the nmap-3.81-win32.zip file (or newer)
	Extract the nmap.exe file from the archive to c:\jffnms\

Install WinPCAP for NMAP:
    
	Download it from: http://winpcap.polito.it/
	Choose the Auto-Installer.
	Complete Install, Click on Next until Finish.
	
	
Configuration:
--------------

Configure Apache for PHP5:

	Add this to the bottom of your c:\program files\apache group\Apache2\conf\httpd.conf file:

	LoadModule php5_module c:/php/php5apache2.dll
	AddType application/x-httpd-php .php

	NameVirtualHost *

	
    	    ServerAdmin webmaster@your-domain.com
    	    DocumentRoot c:\jffnms\htdocs
    	    ServerName nms.yourdomain.com
	    DirectoryIndex index.php
	    LimitRequestLine 20000
	

	* Make sure you modify the above information to match your needed settings

Configure PHP:	
	Make sure you have this on your php.ini file:

	register_globals = On
	register_argc_argv = On
	allow_url_fopen = On
	
	extension_dir = c:\php\ext
	
	(Uncomment the following):
	extension=php_gd2.dll
	extension=php_snmp.dll
	extension=php_mysql.dll
	extension=php_sockets.dll
	
	SMTP = your.mail.server.com	(set it to your mail server IP or DNS name)

	Now Restart the Apache Service.

	if you don't change these, JFFNMS will not work.

Configure MySQL:

	To create the JFFNMS DB run the following:
	
	Check the path to mysql.exe

	c:\> c:\Program Files\MySQL\MySQL Server 4.1\bin\mysql.exe -u root -p
	
	mysql>CREATE DATABASE jffnms;
	mysql>GRANT ALL PRIVILEGES ON jffnms.* TO jffnms@localhost IDENTIFIED BY 'jffnms';  
	mysql>FLUSH PRIVILEGES;  
	mysql>quit;
	
	And:

	c:\> c:\Program Files\MySQL\MySQL Server 4.1\bin\mysql.exe -ujffnms -pjffnms jffnms < c:\jffnms\docs\jffnms-0.8.x.mysql 	
    
	Replace x with the version you are installing.

Configure JFFNMS:
	
	-----------------
	I M P O R T A N T
	-----------------
	
	Go to: http://yourserver/

	Verify and change (if needed) the options. 
	
	Don't mind the errors on diff, neato, smsclient, fping, ntpq, PgSQL and SOAP.
	
	Save the configuration and change the values until everything needed is Green.
	
	Everything else SHOULD be OK. 

	Scheduled Tasks:
	----------------
		If you did not install jffnms in c:\jffnms you will have to change the 
		contents of the .bat files (path).

		Start/Settings/Control Panel/Scheduled Tasks/Add Scheduled Task.
			1) Next
			2) Click Browse
			3) Browse to c:\jffnms\engine\windows and select the first .bat file. 
			4) Select Daily, then Next.
			5) Change the Start time to 12:00 AM
			6) Select Every 1 Days then Next.
			7) Enter Username: jffnms and Password: (the one you choosed before), then Next.
			8) Click the 'Open Avanced...' checkbox, then click Finish
			9) Change "Start In" to c:\jffnms\engine
			10) Click the Schedule tab
			11) For autodiscovery_interfaces, consolidate, poller & rrd_analizer:
				Click on the Advanced Button.
				Check Repeat Task.  In the Every Field enter the respective times: 
					autodiscovery_interfaces every 30 minutes.				
					consolidate Every 1 Minute.
					poller Every 4 minutes.
					rrd_analizer every 30 minutes.
				Duration: 24 Hours.

			12) Click on OK.
			13) Click on OK.
			
		** REPEAT THESE STEPS FOR EACH .BATCH FILE IN THE C:\JFFNMS\ENGINE\WINDOWS PATH!


Now... try to access http://yourserver/ or http://yourserver/jffnms/ (if you took this way)
Remember to add the last slash / to the URL.
The Default Username and password is "admin".

If you want to read more, please read the INSTALL file and skip the Unix Parts.


=========================================================================

If you need anything, contact us at: jffnms-users@lists.sourceforge.net

Thank You for trying 'Just For Fun' Network Management System

Don't forget to Donate to the project if you find it useful for your work.

=========================================================================
Javier Szyszlican aka SzYsZ
Buenos Aires, Argentina
javier@jffnms.org (please try the mailing list first) 
ICQ #397319