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.