phpipam-agent-docker/README.md

61 lines
2 KiB
Markdown
Raw Normal View History

2020-10-29 16:01:20 +00:00
# phpipam-agent
phpIPAM is an open-source web IP address management application. Its goal is to provide light and simple IP address management application.
phpIPAM is developed and maintained by Miha Petkovsek, released under the GPL v3 license, project source is [here](https://github.com/phpipam/phpipam-agent)
Learn more on [phpIPAM homepage](http://phpipam.net)
This container can be used as a discovery scan agent.
## How to use this Docker image
### Setup PHPIPAM
* Configure a remote agent (Administration > scan agents), get the key.
![config_agent](https://user-images.githubusercontent.com/4225738/45190599-0b799000-b23f-11e8-9e41-fb993606264d.png)
* For each subnet, enable scan & configure the remote agent by selecting a remote.
![config_subnet](https://user-images.githubusercontent.com/4225738/45190619-2ba94f00-b23f-11e8-9e45-b5e721c63d70.png)
2020-10-30 14:24:21 +00:00
## Scheduled scans
2020-10-30 15:12:17 +00:00
For scheduled scans these commands are added to the cron script.
2020-10-30 14:24:21 +00:00
```bash
2020-10-30 15:10:40 +00:00
1/15 * * * * /usr/local/bin/php /opt/phpipam-agent/index.php update
1/15 * * * * /usr/local/bin/php /opt/phpipam-agent/index.php discover
2020-10-30 14:24:21 +00:00
```
2020-10-30 14:26:45 +00:00
## Run this container
```bash
2020-10-29 16:01:20 +00:00
version: '2'
services:
phpipam-agent:
container_name: phpipam-agent
restart: unless-stopped
image: mc303/phpipam-agent:latest
environment:
- MYSQL_ENV_MYSQL_HOST=10.10.1.10
- MYSQL_ENV_MYSQL_DATABASE=phpipam
- MYSQL_ENV_MYSQL_USER=phpipam
- MYSQL_ENV_MYSQL_PASSWORD=phpipam
- MYSQL_ENV_MYSQL_PORT=3307
- PHPIPAM_AGENT_KEY=abcder1223456xczxcsad
2020-10-30 14:21:03 +00:00
- CRON_SCHEDULE=1/15 * * * *
2020-10-29 16:01:20 +00:00
- TZ=Europe/Amsterdam
ports:
- "3306:3306"
```
2020-10-30 14:30:14 +00:00
Now, the update/discovery scans will be performed every X minute defined by CRON_SCHEDULE environment variable.
The logs are available on stdout/stderr (allowing to use `docker logs`).
2020-10-28 18:20:50 +00:00
2020-10-28 18:22:25 +00:00
# Acknowledgements
2020-10-28 18:21:20 +00:00
2020-10-28 18:25:19 +00:00
Based on [pierrecdn/phpipam-agent](https://github.com/pierrecdn/phpipam-agent), [published on docker hub](https://hub.docker.com/r/pierrecdn/phpipam-agent).
2020-10-28 18:20:50 +00:00
2020-10-28 18:21:20 +00:00
2020-10-30 14:25:39 +00:00
## phpipam-agent