Giter Site home page Giter Site logo

mohammed-emad / netcool-lds-administration Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 2.52 MB

Netcool-LDS-Administration IBM-DB2

Python 65.08% CSS 1.67% JavaScript 0.09% HTML 33.16%
netcool-lds-administration ibm-db2 ldap-authentication shell-script django db2-database cryptocurrency python lds

netcool-lds-administration's Introduction

Netcool LDS Administration

install IBM-DB2 in Ubuntu[Go] Or Centos[GO]

search

login

We need to clarify what the application does.

  • In general, the system is for managing devices connected over the network based on their mail addresses The system is managed by many administrators,

  • Administrators are divided into groups of users, each with different powers than the other group.

  • Encrypt database passwords and ldap.

  • New users can be added only through the responsible user

  • All users can add new devices either individually or through a csv file

  • They can add filters and connect them to different devices.

  • They can also use a search engine to search within devices or filters in the database

  • and only some users can edit the previously added devices.

  • The application log and all commands that address the database are saved directly, and only officials can view this data.

  • Here are some other details..

1-The login screen integrated with LDAP and setting permissions for a few people can see all APP options and track records.

  • The first screen of the application is "Sign in", which accesses this screen must be informed of the login (must be via LDAP) and then the password of the login.

2- Not all users can obtain the same privileges (permissions) to perform tasks in the application. For this reason, we do have powers to grant or remove user permissions in order to delete, add or change devices or filters.

3 - If the user types "EMEA", the database will receive the code "ige", but this option needs to do the following: If the user types "EMEA" and the device name contains the characters ".ahe". In the "FQDN" field, the code that will be sent to the database will be "ehe", but if it does not contain these characters, the symbol will continue to "ige"

Crate Database..

#su - db2inst1 #db2inst1 vs your user
$db2 CREATE DATABASE GSMALDS
$db2 connect to gsmalds

Crate Tables..

$ db2 "CREATE TABLE RIDALIAS (ID INTEGER(4) NOT NULL ,
                                    RESOURCEID VARCHAR(25) NOT NULL,
                                    ALIAS VARCHAR(25) NOT NULL,
                                    LASTSAVEDDATE DATE NULL,
                                    UPDATEORIGIN INTEGER(4) NULL,)"
$ db2 "CREATE TABLE COMPUTERSYSTEM (ID INTEGER(4) NOT NULL ,
                                    RESOURCEID VARCHAR(25) NOT NULL,
                                    CICLASS VARCHAR(25) NULL,
                                    OSRUNNING VARCHAR(25) NULL,
                                    FQDN VARCHAR(25) NOT NULL,
                                    SUPPORTORG VARCHAR(25) NULL,
                                    CUSTOMERCODE VARCHAR(10) NOT NULL,
                                    COUNTRYCODE VARCHAR(10) NOT NULL,
                                    UPDATEORIGIN INTEGER(4) NULL,
                                    LASTSAVEDDATE DATE,
                                    RESOURCETYPE INTEGER(4) NULL,
                                    RESOURCEUSAGE VARCHAR(10) NULL,
                                    KMANAGED INTEGER(4) NULL)"
$ db2 "CREATE TABLE AUTOMATIONFILTERS (ID INTEGER(4) NOT NULL ,
                                       CUSTOMERCODE VARCHAR(25) NOT NULL,
                                       FILTERNAME VARCHAR(25) NOT NULL,
                                       FILTERDESC VARCHAR(25) NOT NULL,
                                       FILTERSTATE INTEGER(4) NULL,
                                       FILTERWEIGHT INTEGER(4) NOT NULL,
                                       SUBACCOUNT VARCHAR(25) NOT NULL,
                                       TICKETGROUP VARCHAR(25) NOT NULL,
                                       TICKETACTIONID INTEGER(4) ,
                                       KMANAGED INTEGER(4) NULL)"

install python &Tools |LIB

pip3 install ibm_db==2.0.8a
pip3 install ibm_db_django==1.2.0.0
pip3 install django==2.1.7
pip3 install pandas
pip3 install pycrypto

Run migrate app

$python3 manage.py migrate
#This creates the tables we want and in the correct format within the database

Run Server

$python3 manage.py runserver

example of using LDAPSearch

import ldap
from django_auth_ldap.config import LDAPSearch, LDAPSearchUnion

AUTH_LDAP_USER_SEARCH = LDAPSearchUnion(
    LDAPSearch("ou=users,dc=example,dc=com", ldap.SCOPE_SUBTREE, "(uid=%(user)s)"),
    LDAPSearch("ou=otherusers,dc=example,dc=com", ldap.SCOPE_SUBTREE, "(uid=%(user)s)"),
)

Some advice

  • Some problems occur when working with tables inside IBM-DB2 databases
  • So we will use the next solution to address it
class Meta:
      managed = False
      db_table = 'Name_Table!'

-An example of a complete table adapted from the project itself is here

# Create your models here.
class UserProfileInfo(models.Model):
      user = models.OneToOneField(User,on_delete=models.CASCADE)
      email = models.EmailField(max_length=255, unique=True)
      position = models.CharField(max_length=18, choices=manger_choices ,default='normal')
      def __str__(self):
          return self.user.username

      class Meta:
        managed = False
        db_table = 'DJANGOUSER'
>>>None!=me

netcool-lds-administration's People

Contributors

mohammed-emad avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.