Categories
Knowledge Support Support exacqVision Enterprise Categories Products

Enterprise System Manager Shell

To open Enterprise Manager Shell in Windows, run Command Prompt as an administrator and change directories to the installation directory by running the following command:

cd C:\Program Files\exacqvision\enterprisemanager \enterprisesystemmanager\

Then type:

enterprisesystemmanager.exe shell

To open Enterprise Manager Shell in Linux, open a Terminal window and type:

sudo /usr/local/exacq/esm/enterprisesystemmanager shell

<br>

The following commands can be used in the shell:


Exit the Shell.

Exit with ‘Ctrl+Z’


Test SMTP settings

from evemail.models import EmailServer
es = EmailServer.objects.all()[0]
con = es.get_connection()
con.open()


You will see details about any connection errors, or an email connection object that is opened using the information in ESM.


Show the number of emails in the queue

from evemail.models import EventEmail, EventBatchEmail
EventEmail.objects.count()
EventBatchEmail.objects.count()


Delete emails in the queue

from evemail.models import EventEmail, EventBatchEmail
EventEmail.objects.all().delete()
EventBatchEmail.objects.all().delete()


Reset the Enterprise Manager Root Admin user password

*** This should never be given out to a customer ***

Stop all Enterprise Manager services, then enter shell. Once in shell, enter the following commands:

from organization.models import EnterpriseUser
u = EnterpriseUser.objects.get(username="admin")
u.set_password("admin256")
u.save()
import sys
sys.exit()

Start all Enterprise Manager Services

NOTE: It may be necessary to replace the field username=”admin” above with the actual username configured at time of installation, if not using default value. In example: username=”enterpriseadmin”


Deleting a Failover Group 

from failover.models import *
FailoverLog.objects.all().delete() 
FailoverGroup.objects.all() 

This will give you a list of failover groups.
Then you can delete the group at the proper index using 

FailoverGroup.objects.all()[0].delete() 

​Replacing the number with the index of the group to delete, of course 

import sys
sys.exit()

AES-70


Undeleting data removed using the web GUI

from server.models.core import Server
from django.utils import timezone
readd_date = timezone.now() - timezone.timedelta(days=2)
servers = Server.objects.filter(removalDate__gt=readd_date)
for server in servers:
    server.undelete()

Servers deleted through the GUI are flagged for deletion. As long as the datarolloff retention period has not passed, the servers deleted within the last 2 days can be undeleted with the above commands. You can adjust the days needed if the customer needs something from prior to that by adjusting the “days” number in line 3.

Categories
Knowledge Support Support exacqVision Enterprise

exacqVision Enterprise Manager Error When Saving Custom User Role

When attempting to make changes to an existing user role a warning banner pops up “Error while saving user role. Please try again.”

To resolve copy the script “fix_userroles.py” to the EnterpriseSystemManager install folder.

Windows
C:\Program Files\exacqVision\EnterpriseManager\EnterpriseSystemManager

Linux
/usr/local/exacq/esm/

Navigate to EnterpriseManager directory and Launch the Interactive shell

Windows

cd "C:\Program Files\exacqVision\EnterpriseManager\EnterpriseSystemManager"
enterprisesystemmanager.exe shell
Python 3.7.3 (default, Aug 19 2019, 13:50:07)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>>

Linux

cd \usr\loca\exacq\esm
sudo ./enterprisesystemmanager shell
Python 3.7.3 (default, Aug 19 2019, 13:50:07)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>>

Run the Script

>>> from fix_userroles import start
>>> start()
Dry run? (y/n): n
Enterprise Manager URL? (http://127.0.0.1): http://localhost:8100
Username: admin
Password:

You should begin to see results returning as the script runs.  When complete you will be returned to the shell prompt “>>>”.

Type sys.exit() or press Ctrl+Z to close the shell

Check EM to ensure proper operation.

Note: This issue should be resolved in exacqVision Enterprise Manager v21.06. See #22593 for additional information.