Hi,
as you can see phpIPAM moved to its own domain, phpaipam.net. Please update your links as all content will be available on this site only!
brm
Hi,
as you can see phpIPAM moved to its own domain, phpaipam.net. Please update your links as all content will be available on this site only!
brm
Dear all, I am happy to announce new version of phpipam IP address management – version 0.7. It features completely redesigned UI based on Twitter’s bootstrap, less Javascript and more features. Many bugs have been squashed, features improved and it also brings lots of new features, amongst them:
You can demo it here: http://demo.phpipam.net/
You can download it on sourceforge site: phpipam-0.7.
Be sure to read upgrade / install notes, because we moved to mod_rewrite apache mod, which requires the following changes:
Special thanks to following donors:
Special thank also to Hosterdam team (http://www.hosterdam.com) for VPS server that is used for development of phpIPAM and for demo site. And also to all users that filed a bug report / feature report and helped with feature testing!
Full changelog for this release is:
New features:
----------------------------
+ Completely rewritten UI using twitter's bootstrap as base;
+ Using mod_rewrite apache module to handle GET requests (new install requitements!);
+ Unlimited number of subnetting levels;
+ OpenLDAP authentication support;
+ New URL structure;
+ Sorting of IP addresses;
+ Custom subnet fields;
+ Custom VLAN fields and admin option to allow duplicate VLAN names (metro area VLANs);
+ Script to automatically update IP <-> hostname, run via cron (functions/scripts/resolveIPaddresses.php);
+ Show Subnet name instead of subnet IP address option;
+ Strict mode option in config files that controlls overlapping checks;
+ New subnet menu;
+ Added printLimit feature to break IP addresses into pages;
Enhancements:
----------------------------
+ Lots of UI changes;
+ Less Ajax usage to display websites and details;
+ Hierarchy display under subnet details (breadcrumbs);
+ Search results covering VLANs;
+ Custom IP fields ordering;
+ VLAN creation from adding/editing subnets;
+ IP addresses can now be edited;
+ Collapsed switch list;
+ Removing VLANs also removes references from subnet list;
+ Removing VRFs also removes references from subnet list;
+ Logs for admin on dashboard;
+ Search via GET;
+ Support for range networks (allows use of subnet and broadcast as IP);
+ Import of custom IP fields;
+ Abiility to move subnets between sections;
+ Improved display of nested subnets now shows all IP addresses from nested subnets and orphaned IPs;
+ Hides display of custom fields in subnet if none is filled in whole subnet;
+ Replaced Highcharts with Flot because of licencing issues;
Bugfixes:
------------------------
+ Fixed error with missing custom IP fields when adding new IP address;
+ Fixed bug when deleteing root subnet only deleted directly nested subnets (now whole tree);
+ Fixed checkboxes not working in various browsers;
+ Fixed change in switch details causing IP address associations to switch to be lost;
+ Fixed subnet description display in under subnet administration;
+ Fixed depricated error when showing XLS files;
+ Fixed error when custom fields were not updated on adding IP address;
+ Fixed error when custom fields were with spaces in name were not updated;
+ Fixed error when providing already requested IP address;
+ Search available also to viewer user types;
+ Fixed /127 and /128 IPv6 subnets;
+ Fixed /31 and /32 IPv4 subnets;
+ Significally reduced php processing for dashboard statistics;
+ Fixed importing of if quote is present;
brm
I recently noticed that phpIPAM is available also through FreeBSD ports (Thanks to Jake Smith):
cd /usr/ports/net-mgmt/phpipam && make install clean
Check your package managers, if it is available on some other unix distros post it here for reference…
brm
I have received a request for help on manual installation of phpIPAM on debian linux, so I decided to write a small how-to if anyone else has problems or is not so familiar with linux distributions and environment. I have used fresh default debian 6.0 as distribution because it is widely used, I believe on ubuntu linux procedure should be very similar, except maybe for locations of some config files.
I have used the following settings for installation:
If you already have MySQL/apache set you can skip point 3.
Installation procedure:
Update your sources (apt-get update) and install Apache, php and mysql server:
apt-get install apache2 mysql-server php5 php5-gmp php-pear php5-mysql php5-ldap
After all is installed and the apache server is running, you need to decide weather you will be running it under vhost or in subdirectory or root directory. For this guide I will have it in subdirectory http://server/phpipam/, so do the following:
cd /var/www/
wget http://freefr.dl.sourceforge.net/project/phpipam/phpipam-0.7.tar
tar -xvf phpipam-0.7.tar
rm phpipam-0.7.tar
cd phpipam
At this point you should have all the files and applications installed for phpipam.
Edit config.php and select MySQL user/pass you wish to use for phpipam and set rewriteBase to /phpipam/,and set your database details (select user/pass you wish to have for phpipam and database name – you can also leave it as it is):
vi config.php
$db['host'] = “localhost”;
$db['user'] = “phpipam”;
$db['pass'] = “phpipamadmin”;
$db['name'] = “phpipam”;
also set rewrite base in config.php (If you have it under root directory of your webserver than you can skip it)
define(‘BASE’, “/phpipam/”);
and in .htaccess
RewriteBase /phpipam/
Now you need to setup MySQL database, if this is the first time you installed it (if you already have mysql running with root pass then you can skip this):
mysqladmin -u root password NEWPASSWORD
Make sure apache supports mod_rewrite for web server, if it does not you will get errors /install/ not found (http 404) and similar. This means that either apache is not set to use .htaccess rewrites, or that you did not specify the rewritebase in step2 correctly.
Search for Directory directive in default apache config and add/change it to
vi /etc/apache2/sites-enabled/000-default
Options FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all
On debian you have to manually enable rewrite mod for apache, you can do it manually or via a2enmod
ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load
or
sudo a2enmod rewrite
And restart apache:
/etc/init.d/apache2 restart
Now point you web browser to http://server/phpipam/ and the install script will start that installs default schema for phpipam database. Use mysql root password that you created in step 3 and click install.
br, Miha
Translation support will be available on next phpipam release, code is being redone and final checks ongoing. I have decided to go with gettext, it seems to be the most suitable for phpipam.
Translating is straight-forward, by providing translations for strings, for example:
#: functions/functions-mail.php:176
msgid “your domain username”
msgstr “translated text”
There are many tools available to help with translation, like poedit and others.
If anyone is interested in providing translation, please contact me on email. I have already received some requests in the past, I will try to dig up old emails…
brm
Dear all, I am happy to announce new version of phpipam IP address management – version 0.8. Quite some bugs have been squashed and some new features introduced, like per-group permissions, support for translations, visual subnet displays and other:
You can demo it here: http://demo.phpipam.net/
You can download it on sourceforge site: phpipam-0.8.
Please note that IE8 is no longer supported!
Special thanks to all the people submitting bug reports, donors, translators and feature testers!
Full changelog for this release is:
New features:
----------------------------
+ New group and permission management;
+ Support for translations;
+ Subnet resizing;
+ Subnet splitting into smaller subnets;
+ Added free space display for nested subnets;
+ Added visual display of subnet usage per IP address;
+ Added truncate network option that deletes all IP addresses in subnet;
+ Added button the updates subnet with RIPE information;
Enhancements:
----------------------------
+ Added add nested subnet under subnet details to simplify master subnet selection in hierarchy;
+ Added edit subnet link from search results;
+ Added reverse IPv6 DNS entries to IPCalc (Vincent Boisard);
+ Added option for plain-text emails;
+ Added ckEditor to write instructions;
+ StrictMode is not set globally anymore but set per section;
+ Added custom user fields;
+ Added option to verify that hostname is unique;
+ Improved MySQL exception handling;
+ Added mod_rewrite error detection on installation and upgrade;
+ Added hostname validation;
+ Added Hostfile dump of IP addresses;
+ Search also searches in custom fields;
+ jQuery updated to v 1.9.1;
Bugfixes:
------------------------
+ Fixed overlay on second popup;
+ Fixed IE search bug;
+ Fixed support for non-standard ports;
+ Fixed permitting overlapping subnets if vrfs are different;
+ Fixed dates in logging appearing in 12h format;
+ Fixed broken subnets link in tools > subnets if installation is not at document root;
+ Fixed error when adding new subnet if checkboxes are not selected in newer MySQL servers;
+ Fixed bad display of multilined navigation bar;
+ Fixed wrong output of tools > VLAN list when using Duplicate VLANs;
+ Fixed wrong link for upgrade script;
+ On VRF change all child subnets are updated also;
+ Fixed wrong maximum on dashboard top10 percentage;
+ Fixed Adding a vlan while editing a subnet resets the edit subnet form;
+ Fixed wrong free space calculation for nested subnets;
+ Fixed IP use statistics not cumulative up the hierarchy if subnes has slaves;
brm
Dear all, I am happy to announce new version of phpipam IP address management – version 0.9.
New features, like Support for ICMP network discovery, ICMP check IP status in demand, Compressed (grouped) DHCP IP ranges and other were introduced. Most important are:
Some instructions on how to setup ICMP scanning will follow.
If you find phpIPAM useful for your company donations would be highly appreciated
You can demo it here: http://demo.phpipam.net/
You can download it on sourceforge site: phpipam-0.9.
Special thanks to all the people submitting bug reports, translators and feature testers!
Full changelog for this release is:
New features:
----------------------------
+ Support for ICMP network discovery;
+ Cron script to check status for selected subnets/hosts with threading suport (pcntl php extension required);
+ ICMP check IP status in demand;
+ Compressed (grouped) DHCP IP ranges;
+ API server version 0.1;
+ Option to show and group subnets by VLAN in subnets list;
+ Option to show and group subnets by VRF in subnets list;
+ Added subsections;
+ Added AD username search;
+ Added folders;
Enhancements:
----------------------------
+ Added error catching/displaying for ajax-loaded php scripts;
+ Added default language for login/requests display and new users;
+ Added direct links to different pages in IP address table;
+ Subnets can now be edited directly from nested subnets list;
+ When adding nested subnets default vlan/vrf is selected from parent;
+ Added Section ordering;
+ Added per/section subnet ordering (overrides dafault form settings);
+ Clicking on section now shows all subnets and belonging details;
+ If session timeouts after re-login last requested page will be opened;
+ Searh for IP address now returns also subnet, even if IP is not existing;
+ Per-user selection of widgets to display;
+ Added description and required field checkbox for custom IP/Subnet Fields;
+ Added custom device fields;
+ Mails are now sent through phpmailer;
+ Admin user cannot be deleted;
Translations:
----------------------------
+ Added French translation (Denis Darré);
+ Added Dutch translation (Michiel Visser);
+ Added German translation (Carsten Brückner);
Bugfixes:
----------------------------
+ Fixed wrong VLAN display in tools;
+ Fixed subnet/section links from VLANS if base not /;
+ Fixed warning in apache log on subnet editing if no VRFs are configured;
+ Fixed admin menu off-screen overflow;
+ Fixed firefox error when selectiong rights for section/subnets was not possible;
+ Fixed subnet description in Cyrillic problem;
+ Fixed errors on no permissions for user;
+ Fixed Inaccurate Free Space Calculation (and Chart);
+ Fixed VLAN permissions where VLAN was not displayed;
brm
From version 0.9 on there is a option to automatically check statuses of configured hosts for selected subnets, and I received some related questions about it, so here is a short description and guide for it.
Firstly, pcntl support for php cli is advised so phpipam can do parallel icmp checks, this greatly reduces time required for checking status. You can check if your installation is ok with following command:
php -m | grep pcntl
You should set required parameters for pinging, etc ping path etc under
functions/scan/config-scan.php
You can get your ping path by invoking “whereas ping” in terminal.
You can also set some optional parameters in script itself
functions/scripts/pingCheck.php
Also, set the time parameters for status under Administration > IPAM settings (Ping status intervals), phpipam will set host as down/up based on this values.
Now you have to select which subnets should scan for statuses for configured hosts. Go to edit subnet and check “Check hosts status”. This will tell the cron script to check the status of hosts inside this subnet.
I suggest checking it per 15 minutes:
# update host statuses exery 15 minutes
*/15 * * * * /usr/local/bin/php /usr/local/www/phpipam/functions/scripts/pingCheck.php
Change the paths according to your installation of course
That should be it. I would advise to run the script manually for the first time to see if any errors are present.
brm
Dear all, I am happy to announce new version of phpipam IP address management – version 1.0.
New features, like changelog, favourite subnets, upgraded UI with bootstrap3 and other were introduced, and also lots of improvements and bug fixes are included. Most important are:
If you find phpIPAM useful for your company donations would be highly appreciated
You can demo it here: http://demo.phpipam.net/
You can download it on sourceforge site: phpipam-1.0.
Special thanks to all the people submitting bug reports, translators and feature testers!
Full changelog for this release is:
New features:
----------------------------
+ IP address page with IP address details and IP history (Changelog);
+ IP address changelog, subnet and section changelogs with full changelog under tools;
+ Favourite subnets for quick access;
+ Adding subnets from free space with automatic mask provided;
+ Automatic database validity check after upgrading and automatic field/table fix under administration;
+ Automatic weekly check for new phpipam version;
Enhancements:
----------------------------
+ Bootstrap 3;
+ UI enhancements;
+ Improved views based on browser width;
+ Widget order can now be set;
+ Widgets can be reordered (dragged) directly on dashboard;
+ Subnet can now be splitted to max 256 new subnets (16 before);
+ Scan settings are moved to Administration;
+ Widget management has moved to administration, which allows creation of new widgets;
+ Improved ICMP error detection;
+ Mail settings can now be set on gui (localhost / smtp);
+ Popup windows are now draggable;
+ VLAN adding in the fly enhancements;
+ Master section now shows all subnets in subsections;
+ Tools > devices redone;
+ DeviceTypes can now be edited/set/added;
+ Ping subnet enhancements;
+ Custom field types are now defineable (int/varchar/date/datetime/text/bool/set);
+ Date and timepicker popups if type = date/datetime;
+ For `set` and boolean custom fields dropdown is presented that users can pick;
+ Favourite subnets widget;
+ IP requests widget;
+ Changelog widget;
Translations:
----------------------------
+ Added Brazil translation (Michel Braga Guimarães);
Bugfixes:
--------
+ UI fixes;
+ Fixed bug where last page of IP addresses was inaccessible;
+ IP address state change is now sent to all admins;
+ Fixed subnet displaying as 0.0.0.0/0 in details;
+ Fixed links to subnets form vlans and vrfs;
+ Fixed search result showing all folders if searched item is not IP address;
+ Fixed disapearing section when L2 section was selected as master section;
+ Fixed device ID showing in mail notification instead of hostname;
+ Fixed device ID showing in search results and export instead of hostname;
+ Fixed search for subnet name returned no results;
+ Fixed apostophe in IP address description throws SQL error for scan results and XLS import;
+ Fixed requester email gets cut if longer than 32 chars;
+ Fixed admin folder edit appearing as subnet;
+ Fixed missing device/port in import;
+ Fixed master section delete did not delete subsections and belonging subnets/ips;
+ Fixed online status was not updated when running Ping status scans;
+ Fixed Folder name not appearing when deleting folder;
brm
Dear all, I am happy to announce new version of phpipam IP address management – version 1.1.
This release fixed some bugs, provided some new features, but most importantly it was focused on:
Some screens:
If you find phpIPAM useful for your company donations would be highly appreciated
You can demo it here: http://demo.phpipam.net/
You can download it on sourceforge site: phpipam-1.1.
Special thanks to all the people submitting bug reports, translators and feature testers!
Full changelog for this release is:
Enhancements: ---------------------------- + Caching of SQL results to avoid multiple queries; + Reduced number of DB queries; + Added selected mail notifications to admins to be notified on IP/subnet change; + Added new subnetId index to ipaddresses table that significantly improves network loading; + Now using only 1 network connection towards MySQL server; + Updated pagination; + mod_rewrite no longer required, selectable URL structure under settings; + Added option not to display free ranges; + Added option to set maximum VLAN number; + Selectable custom fields to be visible/hidden in tables view and updated device/VLAN view; + Added additional confirmation before section, subnet, folder and IP address deletion; + New script added for cron checks that discovers new hosts for selected networks; + Added inactivity timeout to settings; + Changed install procedure and updated install scripts; + Added PEAR check for installation; + Added free range disaply for VLANs; + Addes SSL/TLS option for SMTP mail; + API: + Bugfixes; + Added API admin permissions; + read/delete actions for IP addresses; + read/delete actions for Vlans; + read/delete actions for VRFs; Security Fixes: ---------------------------- + Fixed known command injection vulnerabilities in the scan functions; + Fixed known SQL injection vulnerabilities; + Fixed known XSS vulnerabilities; + Fixed known action XSS events; + Moved to crypt method for storing password in database with salting; + Added option to force user to change pass after first login; + Admin password must be changed after installation; + Added captcha code request after 5x unsuccesfull login to prevent brute-force attacks; Translations: ---------------------------- + Added es_ES translation; Bugfixes: ---------------------------- + Fixed top 10 widgets not escaping strings; + Fixed section parent can be set to self that caused section to disapear; + Fixed username instead of password being sent to smtp server; + Fixed IE search bug with workaround; + Fixed subnet and bcast not showing on strict mode disabled; + Fixed top subnets missing on dashboard for non-admin users; + Fixed bug when installation was silently failing bacause pf missing _() function (missing gettext extension) + Fixed device custom field not populated on adding device; + Fixed XLS export silently failed when description longer than 31 characters; + Fixed overlapping check not working; + Fixed subnet free space calcultation; + Fixed visual subnet display not showing on /31 and /32 networks; + Fixed custom fields display on folder edit; + Fixed unable to edit IP addresses when fields are sorted; + Fixde ordering of custom fields defaults to varchar 256; + Fixed IPv6 subnet / broadcast calculation bug and next subnet suggestion;
brm
phpipam 1.1.010 update released with following fixes:
== 1.1.010 Bugfixes: ---------------------------- + Fixed login fails with LDAP when escape characters are in password; + Fixed login not working with spaces in password for AD login; + Fixed Ivalid action when adding vlans from subnet popup menu; + Fixed custom fields not appearing properly on IP request editing; + Fixed Invalid ID error for IP address details on sorting; + Fixed warnings if no VLAN search results are present; + Fixed test mail not sending; + Fixed unable to login if $phpsessname not defined; + Fixed unable to login after upgrade;
I apologise for any inconvenience some users experienced with upgrade.
brm
Having large amount of subnets (and other tables) on unoptimised MySQL database server can significantly increase page loads. To see which parameters need to be change I usually use mysqltuner perl script, which connects to database, analyses data and proposes which parameters need to be changed that are not optimally set based on current load.
Installation is simple:
1.) Fetch mysqltuner on FreeBSD:
cd ~ fetch http://mysqltuner.pl
or wget on linux:
wget http://mysqltuner.com
2.) Make it executable:
chmod +x mysqltuner.pl
3.) And run it to analyse database, you have to provide administrative credentials.
./mysqltuner.pl
Any other similar scripts out there you would recommend?
brm
phpipam has support for creating custom fields to be used in address, subnets, vlans, devices and users tables. This is useful when you need to add some custom data to your tables. You can set your custom fields under Administration > Custom fields.
It supports following types of data and it representations:
Besides setting field type there are some other variables that can be set for each:
You can also set which fields are to be hidden from default table by clicking of filter button. Selected custom fields will not be visible in table view, but will always be visible under details for each data type. For example hiding custom IP address field will be visible in editing IP address and IP address details, but will not be shown in list of all IP addresses in subnet. This is mainly used to control size of table view not to be too wide.
Also note that if for example some field is to be shown for addresses and all inputs for this field are empty in view of all addresses in subnet, the field will not be shown.
Below are some screenshots.
brm
Many issues reported with scanning subnets and updating host statuses are related to SElinux being enabled. So far the solution was to completely disable SElinux, but this was more workaround than anything else. Robert was kind enough to share SElinux policy that should be used with phpipam if SElinux is enabled on your server.
Basically it permits the opening of raw IP sockets for non-root users, that are required for executing ping command.
1) Create the file http_ping.tt and add the following to it:
module http_ping 1.0; require { type httpd_t; class capability net_raw; class rawip_socket { getopt create setopt write read }; } #============= httpd_t ============== allow httpd_t self:capability net_raw; allow httpd_t self:rawip_socket { getopt create setopt write read };
2) Run the following commands (as root user):
checkmodule -M -m -o http_ping.mod http_ping.tt semodule_package -o http_ping.pp -m http_ping.mod semodule -i http_ping.pp
brm
Hi all,
first beta version of phpipam 1.2 is available for download on Github:
If you have time help us squash some bugs before final release, focus is on the following things:
Report any issues to our GitHub page (https://github.com/phpipam/phpipam/).
UPDATE: 1.2_beta2 now available !
I have received some requests for running phpipam on synology, I personally don’t use it, but if you do you will find this useful.
Apparently the problem is in missing GMP php extension, you can find it here, along with instructions:
http://forum.synology.com/enu/viewtopic.php?f=34&t=101226&p=401309#p401309
thanks to Ferdinand for providing extension.
br
Dear all, I am happy to announce new release of phpipam IP address management – version 1.2.
For this release backend code was completely rewritten, for database connections now pdo has replaced mysqli, so make sure you php supports pdo and pdo_mysql before upgrading. It also fixes lots of bugs, parametized SQL queries and brings lots of new features, most important are:
And much more. You can find full changelog below, please read it.
If you find phpIPAM useful for your company donations would be highly appreciated
You can demo it here: http://demo.phpipam.net/
You can download it on sourceforge site: phpipam-1.2 or on github.
Before upgrading make sure you first backup current database, you can follow upgrade guide on our site.
Some screenshots:
Special thanks to all the people submitting bug reports, translators and feature testers!
Full changelog for this release is:
== 1.20 New features: ------------ + Added multiple simultaneous authentication methods (Apache, AD, LDAP, Radius, NetIQ); + Added fping scanning support; + Added selectable scanning type (ping/pear/fping); + Added L2 domains; + Added option to define address as default GW for subnet; + Added customizable address tags with compressed option; + Added temporary subnet / address shares; + Added quick subnet masks; + Added nameserver sets per subnets (jonashauge); + Added optional syslog as log location; + REST API: + documentation: http://phpipam.net/api-documentation/ + API v2, old v1 support added + Complete rewrite of all API calls; + New security models (crypt, ssl, none); + Support for custom fields; + JSON / XML output + Full read/write controllers (Sections, Subnets/Folders, Addresses, Vlans, Vrfs); + PowerDNS integration: + Automatic reverse records creation (PTR) - IPv4 and IPv6; + Automatic SOA, NS record creation; + DNS domain management; + Added Scan agents to scan subnets remotely; + Added firewall zone mappings and module; + Added per-subnet DNS resolvers; + Added option to mark subnet as utilized (full); Enhancements: ---------------------------- + All tables are now InnoDB by default; + Upgraded jQuery to 2.1.3; + All functions rewritten to classes/methods; + Parametized all SQL queries, moved from MySQLI to PDO; + Added VLAN/VRF to search and to search results export; + Redesigned admin and tools menu; + Added scanned/discovered subnets to tools for faster overview; + Per-user display settings; + New widget - tools shortcuts; + New widget - IP calculator; + New widget - request IP address; + Clickable links for subnet fields; + Custom VRF fields; + Subnets can be now linked to devices; + Import/export enhancements; + Fast user switching for admins to impersonate user; + Opened folders and subnets in tree menu are saved on page reload; + RWA users can now process IP requests; + Added auto-suggest for possible slave subnets; + SSL option for MySQL connections; + Enum custom field support; + Added password reset script; + Set sections to display VRF in; Security Fixes: ---------------------------- + Parametized all MySQL querries; + Fixed plainpass being logged on user update; + Fixed XSS exploit on /error/; + Added CSRF protection to forms; Translations: ---------------------------- + Added Czech translation; Bugfixes: ---------------------------- + Fixed bug with SSL/TLS smtp servers; + Fixed visual subnet display issues on 32bit systems; + Fixed IPv6 split subnets bug; + Fixed /31 ping bug scanning out of boundaries; + Fixed nested broadcast not counted to used percentage; + Fixed invalid redirect after timeout; + Fixed discovery script index overridden; + Fixed dashboard graphs links to subnets; + Fixed Invalid ID on subnet scan of large subnets;
brm
phpipam version 1.2.1 was released today. This is a bugfix release, addressing the following issues:
Enhancements: ---------------------------- + French translation updated to verson 1.2; + German translation updated to verson 1.2; Bugfixes: -------- + Fixed upgrade bug that selected invalid auth method for AD/LDAP users; + Fixed LDAP problems after 1.2 upgrade; + Fixed PowerDNS Slave with multiple masters delimiter error; + Fixed owerDNS PTR records not being updated automatically; + Fixed csrf cookie bug when editing folder; + Fixed csrf cookie bug when truncationg subnet; + Fixed invalid code for API crypt method; + Fixed strange headings font display in Firefox; + Fixed invalid proxy settings in config.dist.php; + Fixed search same hostnames in db link form address table; + Fixed import subnet bug caused by fw object; + Fixed Subnet Import (Preview button > no action); Security Fixes: ---------------------------- + Fixed security issues introduced in 1.2;
There is no database change, so just replace phpipam directory and copy over config.php.
br
Miha
To simplify API calls etc. I created a separate GitHub repository to have a collection of phpipam API clients for different languages etc. If you created a client and want to share it head over to https://github.com/phpipam/phpipam-api-clients and share yours !
To start I created a php class to work as API client, now available in repo in php-client folder.
https://github.com/phpipam/phpipam-api-clients/tree/master/php-client
It supports all API calls, also encrypted requests are supported by setting $api_key variable in config file. Supported output formats are json/xml/array/object.
Here is a short example of working with client.
Here is a short example how to get details for specific section:
<?php
include config file and api client class file
require("api-config.php");
require("class.phpipam-api.php");
# init object with settings from config file or specify your own
$API = new phpipam_api_client ($api_url, $api_app_id, $api_key, $api_username, $api_password, $result_format);
# debug - output curl headers it some problems occur
$API->set_debug (false);
# execute call
$API->execute ("GET", "sections", array(5), "", $token_file);
# ger result
$result = $API->get_result();
# print result
print_r($result);
?>
API client takes following parameters for initialization:
$api_url : Url of your phpipam API server - http://10.10.10.3/phpipam/api/
$api_app_id : Name / id of your application as created in phpipam API under administration - myfirstapi
$api_key : API key if API security is set to crypt for you API appid. This will be used to encrypt requests, otherwise set to false
$api_username, $api_password : Username / password of some phpipam account to use for authorization. Not needed for encrypted requests
$result_format : can by one of following: json / xml / array / object
For call execution following parameters are needed:
method : HTTP method to use (OPTIONS, GET, POST, DELETE, PATCH, PUT) - - REQUIRED
controller : Which controller to use (sections, subnets, vlans, ...) - REQUIRED
identifiers : array of identifiers to add to URL request. (/api/myfistapi/sections/identifier1/identifier2/...)
parameters : key/value array of GET/POST parameters to add to URL request. (POST /api/myfistapi/sections/1/?name=test)
Token file : if this is set to false than for each query first authorisation query will be made to obtain access token,
meaning 1 additional request. If you specify filename here the token will be saved to this file, so no additional queries
will be required as long as token is valid.
This is an output from terminal with debug mode :
[root@phpipam /usr/local/www/phpipam.net/phpipam-api-clients/php-client (master*) #] php example.php * Trying 46.19.10.34... * Connected to devel.phpipam.net (46.19.10.34) port 80 (#0) > GET /1.3/api/myapi/sections/5/ HTTP/1.1 Host: devel.phpipam.net User-Agent: phpipam-api php class Accept: */* Content-Type: application/json token: 1UNFcRNGjH5UvHGaRy!vzgt1 < HTTP/1.1 200 OK < Date: Wed, 22 Jun 2016 10:49:52 GMT < Server: Apache/2.4.18 (FreeBSD) OpenSSL/1.0.1l-freebsd < Expires: Thu, 19 Nov 1981 08:52:00 GMT < Cache-Control: no-cache < Pragma: no-cache < Content-Length: 451 < Content-Type: application/json * Connection #0 to host devel.phpipam.net left intact {"code":200,"success":true,"data":{"id":"5","name":"Testing section", "description":null,"masterSection":"0","permissions":null,"strictMode":"1", "subnetOrdering":"default","order":"3","editDate":"2015-12-16 13:04:44", "showVLAN":"1","showVRF":"1","DNS":null,"links":[{"rel":"self", "href":"\/api\/apiclient\/sections\/5\/", "methods":["GET","POST","DELETE","PATCH"]}, {"rel":"subnets","href":"\/api\/apiclient\/sections\/5\/subnets\/", "methods":["GET"]}]}}#
br,
Miha