User Tools

Site Tools


infoblox_nios:useful_nios

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
infoblox_nios:useful_nios [2024/10/22 19:53] – [Reset NIOS] bstaffordinfoblox_nios:useful_nios [2025/09/23 13:10] (current) – [Reset NIOS] bstafford
Line 25: Line 25:
  
  
 +===== SCP =====
 +The reasons why the scp failed will be found in logs file. Search for <code>/infoblox/one/bin/syslog_backup_daemon</code>
 ===== Reset NIOS ===== ===== Reset NIOS =====
  
Line 30: Line 32:
 ^ Command ^ Clear NIOS DB and Logs ^ Clear Configuration ^ Clear Network Settings ^ Clear Licenses ^ Clear Network Automation Database ^ ^ Command ^ Clear NIOS DB and Logs ^ Clear Configuration ^ Clear Network Settings ^ Clear Licenses ^ Clear Network Automation Database ^
 | reset all | Yes | Yes | Set to 192.168.1.1/24 | No | N/A | | reset all | Yes | Yes | Set to 192.168.1.1/24 | No | N/A |
 +| reset all secure | Yes | Yes | Set to 192.168.1.1/24 | No | N/A |
 | reset all auto_provision | Yes | Yes | Set to DHCP | Yes | N/A | | reset all auto_provision | Yes | Yes | Set to DHCP | Yes | N/A |
 | reset all licenses | Yes | Yes | Yes | Yes | N/A | | reset all licenses | Yes | Yes | Yes | Yes | N/A |
Line 47: Line 50:
 The following  command removes configuration files and DNS and DHCP data from the NIOS appliance database. However, the network and licensing information remains intact. The network settings of the appliance include the IP address and subnet mask for the appliance, the IP address of the gateway, the host name, and the remote access setting. The following  command removes configuration files and DNS and DHCP data from the NIOS appliance database. However, the network and licensing information remains intact. The network settings of the appliance include the IP address and subnet mask for the appliance, the IP address of the gateway, the host name, and the remote access setting.
 <code>reset database</code> <code>reset database</code>
 +
 +===== HTTPS Speed =====
 +If HTTPS UI takes longer set a higher value like 1000 using the command "set connection_limit https 1000". The maximum allowed value for the limit is 2147483647 .
 +
 +
 +HTTP Keepalive, also referred to as HTTP persistent connection, instructs the server to maintain a single TCP connection for multiple HTTP requests and responses between the client and server. Without HTTP Keepalive, the server closes the TCP connection (not the session) after each request.
 +
 +Also please enable keep alive for httpd_client using the below steps.
 +
 +  - Execute the command ''set httpd_client keepalive on'' in the Grid Master CLI.
 +  - Wait for a few minutes to allow the UI to restart.
 +  - After the UI restart, you can confirm the current keepalive status using the following command:
 +  - Infoblox > ''show httpd_client''
 +<code>Current settings:
 +    keepalive=off (default) keepalivetime=150 (default) minspare=5 (default) maxspare=5 (default) maxserver=150 (default) maxrequest=100 (default) maxkeepaliverequests=0 (default)</code>
 +
  
 ===== General ===== ===== General =====
Line 59: Line 78:
 | show date | Display the date, time and time zone of the appliance |  | show date | Display the date, time and time zone of the appliance | 
 | show debug | Display the status of debugging |  | show debug | Display the status of debugging | 
-| show disk | Display the disk space used | +| [[misc#disk|show disk]] | Display the disk space used | 
 | show file | Display the content(s) of a file(s) |  | show file | Display the content(s) of a file(s) | 
 | show hardware-type | Display hardware type |  | show hardware-type | Display hardware type | 
Line 99: Line 118:
 The following value is for the password 'infoblox'. The following value is for the password 'infoblox'.
 <code>value VALUE="{ssha}_HAAAADt7bFVX+JJh4KXe8lzuVi5D9VRTShr1CkajRRI="</code> <code>value VALUE="{ssha}_HAAAADt7bFVX+JJh4KXe8lzuVi5D9VRTShr1CkajRRI="</code>
 +<code><PROPERTY NAME="password" VALUE="theactualpassword"/></code> 
 +<code><PROPERTY NAME="name" VALUE="admin"/><PROPERTY NAME="password" VALUE="{ssha}_SAAAAAAddddddddddddddddddddddddddddddddddddddddddddddddd"/></code>
 NIOS can be very picky about what backup files it will restore onto a version of code. You must always make sure you are running the same version of NIOS that was used to make the Grid backup. However, in a LAB environment, you can edit the first line of the onedb.xml file. This is for LABBING only. NEVER use this in production. Your configuration will not be supported by Infoblox. NIOS can be very picky about what backup files it will restore onto a version of code. You must always make sure you are running the same version of NIOS that was used to make the Grid backup. However, in a LAB environment, you can edit the first line of the onedb.xml file. This is for LABBING only. NEVER use this in production. Your configuration will not be supported by Infoblox.
 +
 +
 +You can script this with 
 +<code>import tarfile
 +import xml.etree.ElementTree as ET
 +import io
 +import shutil
 +import argparse
 +
 +
 +def modify_password_in_tar(tar_path, username, new_password):
 +    # Open tar file
 +    with tarfile.open(tar_path, "r:gz") as tar:
 +        # Extract onedb.xml into memory
 +        xml_member = tar.getmember("onedb.xml")
 +        xml_content = tar.extractfile(xml_member).read()
 +
 +    # Parse XML
 +    root = ET.fromstring(xml_content)
 +
 +    # Extract VERSION and print first 3 parts
 +    version_value = root.attrib.get("VERSION")
 +    if version_value:
 +        version_parts = version_value.split("-")[0]  # take only x.y.z before the dash
 +        version_trimmed = ".".join(version_parts.split(".")[:3])
 +        print(f"Database VERSION: {version_trimmed}")
 +
 +    # Iterate through OBJECT elements
 +    for obj in root.findall(".//OBJECT"):
 +        type_node = obj.find('./PROPERTY[@NAME="__type"]')
 +        name_node = obj.find('./PROPERTY[@NAME="name"]')
 +
 +        if (type_node is not None and type_node.attrib.get("VALUE") == ".com.infoblox.one.admin" and
 +                name_node is not None and name_node.attrib.get("VALUE") == username):
 +
 +            # Find password property
 +            pwd_node = obj.find('./PROPERTY[@NAME="password"]')
 +            if pwd_node is not None:
 +                pwd_node.set("VALUE", new_password)
 +                print(f"Password updated successfully for user: {username}")
 +
 +    # Convert back to string
 +    new_xml_bytes = ET.tostring(root, encoding="utf-8", xml_declaration=True)
 +
 +    # Create a temporary tar
 +    temp_tar_path = tar_path + ".tmp"
 +    with tarfile.open(temp_tar_path, "w:gz") as new_tar:
 +        with tarfile.open(tar_path, "r:gz") as old_tar:
 +            for member in old_tar.getmembers():
 +                if member.name == "onedb.xml":
 +                    # Add modified XML
 +                    info = tarfile.TarInfo(name="onedb.xml")
 +                    info.size = len(new_xml_bytes)
 +                    new_tar.addfile(info, io.BytesIO(new_xml_bytes))
 +                else:
 +                    # Copy other files unchanged
 +                    new_tar.addfile(member, old_tar.extractfile(member) if member.isfile() else None)
 +
 +    # Replace old tar with new tar
 +    shutil.move(temp_tar_path, tar_path)
 +
 +
 +if __name__ == "__main__":
 +    parser = argparse.ArgumentParser(description="Modify password inside onedb.xml in a tar.gz archive")
 +    parser.add_argument("-f", "--file", required=True, help="Path to the tar.gz file")
 +    parser.add_argument("-u", "--username", required=True, help="Username to modify")
 +    parser.add_argument("-p", "--password", required=True, help="New password value")
 +
 +    args = parser.parse_args()
 +
 +    modify_password_in_tar(args.file, args.username, args.password)
 +</code>
  
 In this example, we are making a Grid Backup from 8.6.0 early access NIOS compatible with 8.6.0 GA NIOS. NOTE: We are not actually making it compatible, we are simply tricking NIOS 8.6.0 GA into loading the configuration as best as it can. In this example, we are making a Grid Backup from 8.6.0 early access NIOS compatible with 8.6.0 GA NIOS. NOTE: We are not actually making it compatible, we are simply tricking NIOS 8.6.0 GA into loading the configuration as best as it can.
infoblox_nios/useful_nios.1729626796.txt.gz · Last modified: by bstafford