ArkHost VPSAG - WHMCS Server Module
A comprehensive WHMCS server module for integrating with the VPSAG VPS hosting platform. This module provides full automation for VPS provisioning, management, and client area functionality.
🚀 Features
✅ Core VPS Management
- Automated Provisioning - Instant VPS creation with plan and OS selection
- Account Suspension/Unsuspension - Complete account lifecycle management
- Account Termination - Clean removal with data cleanup
- Package Upgrades - Seamless plan changes and resource scaling
✅ Client Area Features
- Real-time Server Information - CPU, RAM, Disk, and Bandwidth monitoring
- Power Management - Start, Stop, Reboot controls
- VNC Console Access - Direct browser-based console access
- Performance Graphs - Historical usage charts (hourly, daily, weekly, monthly, yearly)
✅ Advanced Management
- Backup Management - Create, restore, and delete backups
- Firewall Configuration - Manage firewall rules and policies
- ISO Management - Mount and eject ISO images
- Hostname & rDNS - Configure hostnames and reverse DNS
- OS Reinstallation - Fresh OS installation with multiple OS options
- Root Password Reset - Secure password reset functionality
✅ Admin Features
- Balance & Discount Display - Real-time account balance and discount information
- Connection Testing - Validate API credentials and connectivity
- Comprehensive Logging - Full API call logging for debugging
- Multi-language Support - Localized interface
📋 Requirements
- WHMCS 8.0 or higher
- PHP 7.4 or higher
- cURL extension enabled
- Valid VPSAG API credentials
📦 Installation
-
Download the module files and extract to your WHMCS directory:
/path/to/whmcs/modules/servers/ArkhostVPSAG/ -
Ensure proper file permissions:
chmod -R 755 modules/servers/ArkhostVPSAG/ -
Log into WHMCS Admin Area and navigate to:
Setup → Products/Services → Servers -
Add a new server with the following details:
- Server Type: ArkhostVPSAG
- Hostname: VPSAG API endpoint
- Username: Your VPSAG API username
- Password: Your VPSAG API key
⚙️ Configuration
Server Setup
- Create a Server Group (optional but recommended)
- Add Server with VPSAG credentials
- Test Connection to verify API access
Product Configuration
- Create a new product in WHMCS
- Select Module: ArkhostVPSAG
- Configure Module Settings:
- Plan: Select from available VPSAG plans
- Operating System: Choose default OS or allow client selection
Configurable Options
The module supports two main configurable options:
planid- VPSAG plan identifierosid- Operating system identifier
🏗️ File Structure
/modules/servers/ArkhostVPSAG/
├── ArkhostVPSAG.php # Main module file
├── callback.php # Webhook handler
├── README.md # This file
├── lang/ # Language files
│ ├── english.php
│ └── [other languages]
└── template/ # Client area templates
├── clientarea_direct.tpl # Main client template
├── error.tpl # Error template
├── css/
│ └── app.min.css # Styles
├── js/
│ └── app.min.js # JavaScript
└── img/ # Images and icons
├── os/ # OS icons
└── [status icons]
🔌 API Integration
The module integrates with VPSAG API v1 endpoints:
Authentication
Headers:
X_API_USER: [username]
X_API_KEY: [api_key]
Base URL
https://www.vpsag.com/api/v1/
Key Endpoints Used
GET /plans- Retrieve available plansPOST /order/plan- Create new VPSGET /vps/{id}- Get server informationPOST /vps/{id}/action/{action}- Power managementGET /vps/{id}/graph/{period}- Performance graphsPOST /vps/{id}/backup- Backup managementPOST /vps/{id}/firewall- Firewall management
🎛️ Client Area Functionality
The module provides a comprehensive client area interface with:
Navigation Tabs
- Overview - Server status and resource usage
- Graphs - Performance monitoring charts
- Backups - Backup management interface
- Settings - Server configuration options
Settings Sections
- Hostname - Configure server hostname and rDNS
- ISO Management - Mount/unmount ISO images
- Password Reset - Reset root password
- Reinstall - Complete OS reinstallation
- Firewall - Manage firewall rules
🔧 Webhook Configuration
The module includes a webhook handler (callback.php) for processing VPSAG notifications:
-
Configure in VPSAG panel to point to:
https://yourdomain.com/modules/servers/ArkhostVPSAG/callback.php -
Webhook handles:
- VPS provisioning completion
- IP address assignment
- Service activation notifications
🐛 Troubleshooting
Common Issues
Connection Failed
- Verify API credentials are correct
- Check server can reach VPSAG API endpoints
- Ensure cURL is enabled and functional
VPS Not Found
- Check if VPS ID is properly stored in service properties
- Verify VPS exists in VPSAG panel
- Check service custom fields for VPSAG ID
Client Area Not Loading
- Verify template files have correct permissions
- Check for PHP errors in WHMCS logs
- Ensure all required files are uploaded
Debug Mode
Enable WHMCS module logging to troubleshoot API issues:
- Go to Utilities → Logs → Module Log
- All API calls and responses are logged for debugging
📝 Changelog
Version 1.3
- Fixed CPU usage display underreporting issue
- Removed duplicate API cases and dead code
- Improved error handling and logging
- Enhanced client area interface
- Added comprehensive backup management
- Implemented firewall configuration
🆘 Support
For technical support and module-related queries:
- Email: support@arkhost.com
- Website: https://arkhost.com
- Documentation: Check WHMCS module logs for detailed error information
📄 License
This module is proprietary software owned by ArkHost. All rights reserved.
Copyright © 2024 ArkHost
For the latest updates and documentation, visit our website at https://arkhost.com