Remove SVG diagram functionality
- Delete svg_generator.py and comprehensive_mapper.py - Remove --generate-svg option from integrated_scanner.py - Update complete_workflow.sh to remove SVG generation step - Clean up documentation and examples - Update test_system.py to remove SVG references - Add missing files to repository (EXAMPLES.sh, quickstart.sh, etc.)
This commit is contained in:
@@ -32,6 +32,14 @@ log_error() {
|
||||
echo -e "${RED}[ERROR]${NC} $1"
|
||||
}
|
||||
|
||||
# Move old results to results folder
|
||||
log_info "Moving old results to results folder..."
|
||||
mkdir -p results
|
||||
mv network_scan_*.json server_details_*.json network_summary_*.md *_failed_ssh.json results/ 2>/dev/null || true
|
||||
if [ $? -eq 0 ] && [ "$(ls results/ 2>/dev/null | wc -l)" -gt 0 ]; then
|
||||
log_info "Moved old result files to results/ folder"
|
||||
fi
|
||||
|
||||
# Check if we're in the right directory
|
||||
if [ ! -f "src/integrated_scanner.py" ]; then
|
||||
log_error "src/integrated_scanner.py not found. Please run this script from the network scanner directory."
|
||||
@@ -60,24 +68,30 @@ log_info "Step 2: Running integrated network scan..."
|
||||
SCAN_OUTPUT="network_scan_$(date +%Y%m%d_%H%M%S).json"
|
||||
if python3 src/integrated_scanner.py -o "$SCAN_OUTPUT" -v; then
|
||||
log_success "Network scan completed: $SCAN_OUTPUT"
|
||||
|
||||
# Check for failed SSH hosts file
|
||||
FAILED_SSH_OUTPUT="${SCAN_OUTPUT%.json}_failed_ssh.json"
|
||||
if [ -f "$FAILED_SSH_OUTPUT" ]; then
|
||||
FAILED_COUNT=$(jq '.total_failed' "$FAILED_SSH_OUTPUT" 2>/dev/null || echo "unknown")
|
||||
log_warning "Found $FAILED_COUNT hosts with SSH port open but failed authentication: $FAILED_SSH_OUTPUT"
|
||||
fi
|
||||
else
|
||||
log_error "Network scan failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Step 3: Generate SVG diagram
|
||||
log_info "Step 3: Generating network diagram..."
|
||||
SVG_OUTPUT="${SCAN_OUTPUT%.json}.svg"
|
||||
if python3 src/svg_generator.py "$SCAN_OUTPUT" -o "$SVG_OUTPUT"; then
|
||||
log_success "SVG diagram generated: $SVG_OUTPUT"
|
||||
# Step 3: Collect server information from hypervisors
|
||||
log_info "Step 3: Collecting server information from hypervisors..."
|
||||
SERVER_OUTPUT="server_details_$(date +%Y%m%d_%H%M%S).json"
|
||||
if python3 src/server_info_collector.py -o "$SERVER_OUTPUT"; then
|
||||
log_success "Server information collected: $SERVER_OUTPUT"
|
||||
else
|
||||
log_error "SVG generation failed"
|
||||
exit 1
|
||||
log_warning "Server information collection failed"
|
||||
fi
|
||||
|
||||
# Step 4: Generate pfSense summary if XML files exist
|
||||
# Step 5: Generate pfSense summary if XML files exist
|
||||
if [ "$XML_FILES" -gt 0 ]; then
|
||||
log_info "Step 4: Generating pfSense network summary..."
|
||||
log_info "Step 5: Generating pfSense network summary..."
|
||||
SUMMARY_OUTPUT="network_summary_$(date +%Y%m%d_%H%M%S).md"
|
||||
if python3 src/pfsense_integrator.py *.xml --summary "$SUMMARY_OUTPUT"; then
|
||||
log_success "Network summary generated: $SUMMARY_OUTPUT"
|
||||
@@ -86,7 +100,7 @@ if [ "$XML_FILES" -gt 0 ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# Step 5: Show results summary
|
||||
# Step 6: Show results summary
|
||||
echo ""
|
||||
echo "=========================================="
|
||||
log_success "Network Discovery Complete!"
|
||||
@@ -94,7 +108,12 @@ echo "=========================================="
|
||||
echo ""
|
||||
echo "Generated files:"
|
||||
echo " 📊 Network Scan: $SCAN_OUTPUT"
|
||||
echo " 🎨 Network Diagram: $SVG_OUTPUT"
|
||||
if [ -f "$SERVER_OUTPUT" ]; then
|
||||
echo " 🖥️ Server Details: $SERVER_OUTPUT"
|
||||
fi
|
||||
if [ -f "$FAILED_SSH_OUTPUT" ]; then
|
||||
echo " 🔐 Failed SSH Hosts: $FAILED_SSH_OUTPUT"
|
||||
fi
|
||||
if [ "$XML_FILES" -gt 0 ]; then
|
||||
echo " 📋 Network Summary: $SUMMARY_OUTPUT"
|
||||
fi
|
||||
@@ -114,11 +133,21 @@ if command -v jq >/dev/null 2>&1; then
|
||||
fi
|
||||
|
||||
echo "Next steps:"
|
||||
echo " 1. Open $SVG_OUTPUT in your web browser to view the network diagram"
|
||||
if [ "$XML_FILES" -gt 0 ]; then
|
||||
echo " 2. Review $SUMMARY_OUTPUT for detailed pfSense configuration"
|
||||
if [ -f "$SERVER_OUTPUT" ]; then
|
||||
echo " 1. Review $SERVER_OUTPUT for detailed server and VM information"
|
||||
STEP_NUM=2
|
||||
else
|
||||
STEP_NUM=1
|
||||
fi
|
||||
echo " 3. Examine $SCAN_OUTPUT for complete network data (use jq for querying)"
|
||||
if [ -f "$FAILED_SSH_OUTPUT" ]; then
|
||||
echo " $STEP_NUM. Review $FAILED_SSH_OUTPUT for hosts needing SSH credential fixes"
|
||||
STEP_NUM=$((STEP_NUM + 1))
|
||||
fi
|
||||
if [ "$XML_FILES" -gt 0 ]; then
|
||||
echo " $STEP_NUM. Review $SUMMARY_OUTPUT for detailed pfSense configuration"
|
||||
STEP_NUM=$((STEP_NUM + 1))
|
||||
fi
|
||||
echo " $STEP_NUM. Examine $SCAN_OUTPUT for complete network data (use jq for querying)"
|
||||
echo ""
|
||||
|
||||
log_success "Workflow completed successfully! 🎉"
|
||||
Reference in New Issue
Block a user