OPAR - OPM Package ARchive

Browseable collection of plugins for the popular ticket system software Znuny and ((OTRS)) Community Edition.


ConsoleTools

Version
6.0.9
Other Versions
5.0.2, 6.0.1, 6.0.7, 6.0.8,
Uploaded by/on
reneeb on 06 Feb 2023
Framework
6.0.x, 6.1.x, 6.2.x, 6.3.x, 6.4.x
Links
Download Website
Description
Some more useful commands for the Znuny console

Rate/comment this package

ConsoleTools

This addon provides some commands for the Znuny console script

COMMANDS

The subsequent paragraphs describe the new commands

Admin::ITSM::ConfigItem::Add

    $ perl bin/otrs.Console.pl Admin::ITSM::ConfigItem::Add --help
    
    Add a config item.
    
    Usage:
     otrs.Console.pl Admin::ITSM::ConfigItem::Add --class ... --name ... --incistate ... --deplstate ... [--attribute ...(+)]
    
    Options:
     --class ...                    - Class of the config item
     --name ...                     - Name for the config item.
     --incistate ...                - Incident state of the config item
     --deplstate ...                - Deployment state of the config item
     [--attribute ...(+)]           - One attribute (form: <attrname>=<value>)
     [--help]                       - Display help for this command.
     [--no-ansi]                    - Do not perform ANSI terminal output coloring.
     [--quiet]                      - Suppress informative output, only retain error messages.

Admin::User::Search

    $ perl bin/otrs.Console.pl Admin::User::Search --help
    
    Search for users.
    
    Usage:
     otrs.Console.pl Admin::User::Search --term ... [--valid]
    
    Options:
     --term ...                     - Search term.
     [--valid]                      - Search only for valid users
     [--help]                       - Display help for this command.
     [--no-ansi]                    - Do not perform ANSI terminal output coloring.
     [--quiet]                      - Suppress informative output, only retain error messages.

Output:

    $ perl bin/otrs.Console.pl Admin::User::Search --term root*
    Search for users...
    "Admin Znuny" <root@localhost>
    Done.

Maint::NotificationEvent::Dump

    $ perl bin/otrs.Console.pl Maint::NotificationEvent::Dump --help
    
    Print dump of all event based notifications.
    
    Usage:
     otrs.Console.pl Maint::NotificationEvent::Dump [--id ...(+)] [--name ...(+)]
    
    Options:
     [--id ...(+)]                  - ID of notification to be dumped.
     [--name ...(+)]                - Name of notification to be dumped.
     [--help]                       - Display help for this command.
     [--no-ansi]                    - Do not perform ANSI terminal output coloring.
     [--quiet]                      - Suppress informative output, only retain error messages.

Output:

    $ perl bin/otrs.Console.pl Maint::NotificationEvent::Dump --id 1
    Print dump of all event based notifications...
    $VAR1 = [
      {
        'ChangeBy' => '1',
        'ChangeTime' => '2017-11-26 08:09:58',
        'Comment' => '',
        'CreateBy' => '1',
        'CreateTime' => '2017-11-26 08:09:58',
        'Data' => {
          'AgentEnabledByDefault' => [
            'Email'
          ],
          'Events' => [
            'NotificationNewTicket'
          ],
          'Recipients' => [
            'AgentMyQueues',
            'AgentMyServices'
          ],
          'SendOnOutOfOffice' => [
            '1'
          ],
          'Transports' => [
            'Email'
          ],
          'VisibleForAgent' => [
            '1'
          ],
          'VisibleForAgentTooltip' => [
            'You will receive a notification each time a new ticket is created in one of your "My Queues" or "My Services".'
          ]
        },
        'ID' => '1',
        'Message' => {
          'de' => {
            'Body' => 'Hallo ....'
          }
        },
      }

Maint::Ticket::CheckFlag

    $ perl bin/otrs.Console.pl Maint::Ticket::CheckFlag --help
    
    Check "Seen" flag for all users and all tickets.
    
    Usage:
     otrs.Console.pl Maint::Ticket::CheckFlag [--state ...(+)] [--fix-flag] [--summary] [--links]
    
    Options:
     [--state ...(+)]               - State of ticket.
     [--fix-flag]                   - reset ticket flag if user has not seen all articles.
     [--summary]                    - print summary at the end of the check.
     [--links]                      - print summary at the end of the check.
     [--help]                       - Display help for this command.
     [--no-ansi]                    - Do not perform ANSI terminal output coloring.
     [--quiet]                      - Suppress informative output, only retain error messages.

Output:

    $ perl bin/otrs.Console.pl Maint::Ticket::CheckFlag
    Check 'Seen' flag for all users and all tickets...
    Checks for User root@localhost
    Ok for user root@localhost.
    Checks for User ao
    Ok for user ao.
    Checks for User at
    Ticket 23 marked as seen, but not all articles are marked as seen
    Checks for User ta
    Ok for user ta.
    Checks for User aa
    Ok for user aa.
    Checks for User hm
    Ok for user hm.
    Checks for User hu
    Ok for user hu.
    Checks for User kit
    Ok for user kit.
    Done.

Maint::Ticket::Info

    $ perl bin/otrs.Console.pl Maint::Ticket::Info --help
    
    Infos about a ticket.
    
    Usage:
     otrs.Console.pl Maint::Ticket::Info [--id ...] [--number ...]
    
    Options:
     [--id ...]                     - ticket id.
     [--number ...]                 - ticket number
     [--help]                       - Display help for this command.
     [--no-ansi]                    - Do not perform ANSI terminal output coloring.
     [--quiet]                      - Suppress informative output, only retain error messages.

Output:

    $ perl bin/otrs.Console.pl Maint::Ticket::Info --id 1
    Infos about a ticket...
    TicketID: 1
    Ticket#: 2015071510123456
    Title: Welcome to Znuny!
    State: open
    Owner: root@localhost
    Priority: 3 normal
    Queue: Raw
        Done.

Admin::DynamicField::CheckBackends

This command checks if the backend modules for all dynamic fields can be loaded. This check might fail if Znuny is upgraded, but not all addons (which might add backend modules). Or someone changed the backend and there's a syntax error.

    $ perl bin/otrs.Console.pl Admin::DynamicField::CheckBackends
    Checking all dynamic field backends...
    Check ActivityID...  Ok.
    Check Checkbox...  Ok.
    Check Date...  Ok.
    Check DateTime...  Ok.
    Check Dropdown...  Ok.
    Check Multiselect...  Ok.
    Check ZnunyDBTable...  Ok.
    Check ProcessID...  Ok.
    Check Text...  Ok.
    Check TextArea...  Ok.
    Done.

Admin::Ticket::History::RemoveAgentHistory

When an employee leaves the company the ticket history for that employee might need to be removed due to data protection regulations (GDPR). This command helps to do that:

    $ perl bin/otrs.Console.pl Admin::Ticket::History::RemoveAgentHistory
    Error: please provide option '--login'.

    Remove entries that user has read it from a ticket's history.

    Usage:
     otrs.Console.pl Admin::Ticket::History::RemoveAgentHistory --login ...

    Options:
     --login ...                    - user login.
     [--help]                       - Display help for this command.
     [--no-ansi]                    - Do not perform ANSI terminal output coloring.
     [--quiet]                      - Suppress informative output, only retain error messages.


    $ perl bin/otrs.Console.pl Admin::Ticket::History::RemoveAgentHistory --login ta
    Remove entries that user has read it from a ticket's history....
    User 'ta' has id 2.
    Done.

Admin::Database::RemovePID

If you're stuck with a process id left in the database and you can't run a command, you can delete the process id with this command.

    $ perl bin/otrs.Console.pl Admin::Database::RemovePID --pid 1
    Remove ProcessID(s)....
    Done.
    $ perl bin/otrs.Console.pl Admin::Database::RemovePID --pid 123456
    Remove ProcessID(s)....
    Done.
    $ perl bin/otrs.Console.pl Admin::Database::RemovePID --pid 123457 --pid 123458
    Remove ProcessID(s)....
    Done.
    $ perl bin/otrs.Console.pl Admin::Database::RemovePID --all

Admin::Package::ExportOPM

If you want all opm packages that are installed in the Znuny instance, you can run

    $ perl bin/otrs.Console.pl Admin::Package::ExportOPM --all --target /tmp
    Export package(s)...
    Export FAQ to /tmp/FAQ-6.0.23.opm
    Export ImportExport to /tmp/ImportExport-6.0.23.opm
    Done.
    $ perl bin/otrs.Console.pl Admin::Package::ExportOPM --name FAQ --target /tmp
    Export package(s)...
    Export FAQ to /tmp/FAQ-6.0.23.opm
    Done.

Admin::Email::FetchCheck

Checks all mail accounts if the connect works. This is quite useful when the Znuny instance is moved to a new machine and you want to ensure that the mail account is reachable. Another use case is the addition of a new mail account.

    $ perl bin/otrs.Console.pl Admin::Email::FetchCheck
    Check email accounts...
    Check otrs.dev@example.org/imap.example.org
    POP3: Auth for user otrs.dev@example.org/imap.example.org failed!.
    Done.
    $ perl bin/otrs.Console.pl Admin::Email::FetchCheck --check-alternatives
    Check email accounts...
    Check otrs.dev@example.org/imap.example.org
    POP3: Auth for user otrs.dev@example.org/imap.example.org failed!.
    POP3S works.
    POP3TLS works.
    IMAPS works.
    IMAPTLS works.
    Done.
    $ perl bin/otrs.Console.pl Admin::Email::FetchCheck
    Check email accounts...
    Check otrs.dev@example.org/imap.example.org
    Ok.
    Done.

Admin::Email::SendCheck

Checks if Znuny can connect to the SMTP server.

    $ perl bin/otrs.Console.pl Admin::Email::SendCheck
    Check connection to server...
    Done.

Admin::SystemMaintenance::Add

Add a new system maintenance entry

    $ perl bin/otrs.Console.pl Admin::SystemMaintenance::Add \
      --start "2021-11-29 10:00:00" --end "2021-11-29 11:00:00" \
      --comment "Backup" --login-message "Wir machen ein Backup" --valid 1

Admin::SystemMaintenance::Delete

    $ perl bin/otrs.Console.pl Admin::SystemMaintenance::Delete --id 5

Deletes entry with ID 5.

    $ perl bin/otrs.Console.pl Admin::SystemMaintenance::Delete --all

Deletes all entries.

Comments