I have the following simple digraph:
digraph clientproxyserver {
"Client" -> "Proxy" [ label="Request from Client" ];
"Proxy" -> "Server" [ label="Forwarded Request" ];
"Server" -> "Proxy" [ label="Response from Server" ];
"Proxy" -> "Client" [ label="Forwarded Response" ];
}
Running this trough dot:
dot -Grankdir=LR -Nshape=box -Nheight=1 -Tpng -ocps.png cps.gv
I get the following result:
What can I do to make the two bottom edges straight lines?
That's what usually the option splines=ortho is for:
digraph clientproxyserver {
rankdir=LR;
node[shape=box, height=1];
splines=ortho
"Client" -> "Proxy" [ label="Request from Client" ];
"Proxy" -> "Server" [ label="Forwarded Request" ];
"Server" -> "Proxy" [ label="Response from Server" ];
"Proxy" -> "Client" [ label="Forwarded Response" ];
}
Unfortunately, the placement of the edges/labels is very confusing:
In my experience, ortho splines produce rarely a satisfying result.
An other option would be to use splines=polyline:
Related
Trying to get the expect module to configure a Jira set-up - the module seems to work until the question is repeated - essentially the last two entires.
See the script questions below (With redacted data)
----------------------
JIRA Configurator v1.1
----------------------
--- Main Menu ---
[H] Configure JIRA Home
[D] Database Selection
[W] Web Server (incl. HTTP/HTTPs configuration)
[A] Advanced Settings
[S] Save and Exit
[X] Exit without Saving
Main Menu> D
--- Database Selection ---
Database Type : H2
Instance : (unused)
Connect As : sa / (no password)
* [H] H2 (not for production use)
[M] MySQL 8.0
[N] MySQL 5.7
[O] Oracle
[P] PostgreSQL
[A] Aurora PostgreSQL 9.6 (DC Only)
[S] SQL Server (MS-SQL)
[X] Return to Main Menu
Database Selection [H]> M
MySQL 8.0 Database Configuration.
Hostname (jira.company.com)>
Port (3306)>
Database (jiradb)>
Username (jirauser)>
Password ()>
Test Connection ([Y]/N)? > y
Attempting to connect to jira.company.com:3306/jiradb
Connection successful!
--- Database Selection ---
Database Type : MySQL 8.0
Instance : jira.company.com:3306/jiradb
Connect As : jirauser / *****
[H] H2 (not for production use)
* [M] MySQL 8.0
[N] MySQL 5.7
[O] Oracle
[P] PostgreSQL
[A] Aurora PostgreSQL 9.6 (DC Only)
[S] SQL Server (MS-SQL)
[X] Return to Main Menu
Database Selection [M]> X
--- Main Menu ---
[H] Configure JIRA Home
[D] Database Selection
[W] Web Server (incl. HTTP/HTTPs configuration)
[A] Advanced Settings
[S] Save and Exit
[X] Exit without Saving
Main Menu> S
Question Order with answers below:
Main Menu:
- D
Database Selection [H]:
- M
Hostname:
- jira.company.com
Port:
- 3306
Database:
- jiradb
Username:
- jirauser
Password:
-
Test Connection ([Y]/N)?:
- Y
Database Selection [M]:
- X
Main Menu>:
- S
The last two questions are where it fails - I have also tried to put the second response under the top questions and it fails as well. If you note - I tried to use some different notation to separate the questions and it did not recognize the differences.
Ansible code:
- name: Set-up DBCONFIG.XML
ansible.builtin.expect:
command: /opt/atlassian/jira/latest/bin/config.sh
responses:
Main Menu:
- D
Database Selection:
- M
Hostname:
- jira.company.com
Port:
- 3306
Database:
- jiradb
Username:
- jirauser
Password:
- <PW>
Test Connection ([Y]/N)?:
- Y
Return to Main Menu:
- X
Save and Exit:
- S
Error received by ansible:
The full traceback is:
File "/tmp/ansible_ansible.builtin.expect_payload_4tipe507/ansible_ansible.builtin.expect_payload.zip/ansible/modules/expect.py", line 130, in wrapped
fatal: [dc2-tl8-jira]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"chdir": null,
"command": "/opt/atlassian/jira/latest/bin/config.sh",
"creates": null,
"echo": false,
"removes": null,
"responses": {
"Database": [
"jiradb"
],
"Database Selection": [
"M"
],
"Hostname": [
"jira.company.com"
],
"Main Menu": [
"D"
],
"Password": [
"<PW>"
],
"Port": [
3306
],
"Return to Main Menu": [
"X"
],
"Save and Exit": [
"S"
],
"Test Connection ([Y]/N)?": [
"Y"
],
"Username": [
"jirauser"
]
},
"timeout": 30
}
},
"msg": "No remaining responses for 'Main Menu', output was 'b'\\r\\n [X] Exit without Saving\\r\\n\\r\\nMain Menu''"
}
How do you address and get the module to answer similar questions or the same question later in the sequence? As this seems to go through until it returns to previous questions and the module doesn't pull the next set of question/answers for the question? Just for clarity - I placed the other responses in the code as defined below and received the following error:
Example of adding the other responses and the error received:
- name: Set-up DBCONFIG.XML
ansible.builtin.expect:
command: /opt/atlassian/jira/latest/bin/config.sh
responses:
Main Menu:
- D
- S
Database Selection:
- M
- X
Hostname:
- jira.company.com
Port:
- 3306
Database:
- jiradb
Username:
- jirauser
Password:
- <PW>
Test Connection ([Y]/N)?:
- Y
error:
The full traceback is:
File "/tmp/ansible_ansible.builtin.expect_payload_rzouxmbc/ansible_ansible.builtin.expect_payload.zip/ansible/modules/expect.py", line 130, in wrapped
fatal: [dc2-tl8-jira]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"chdir": null,
"command": "/opt/atlassian/jira/latest/bin/config.sh",
"creates": null,
"echo": false,
"removes": null,
"responses": {
"Database": [
"jiradb"
],
"Database Selection": [
"M",
"X"
],
"Hostname": [
"jira.company.com"
],
"Main Menu": [
"D",
"S"
],
"Password": [
"<PW>"
],
"Port": [
3306
],
"Test Connection ([Y]/N)?": [
"Y"
],
"Username": [
"jira-test"
]
},
"timeout": 30
}
},
"msg": "No remaining responses for 'Main Menu', output was 'b' Type : H2\\r\\n Instance : (unused)\\r\\n Connect As : sa / (no password)\\r\\n\\r\\n* [H] H2 (not for production use)\\r\\n [M] MySQL 8.0\\r\\n [N] MySQL 5.7\\r\\n [O] Oracle\\r\\n [P] PostgreSQL\\r\\n [A] Aurora PostgreSQL 9.6 (DC Only)\\r\\n [S] SQL Server (MS-SQL)\\r\\n\\r\\n [X] Return to Main Menu''"
}
We have a company-created Maven plugin that requires many (40+) defined profiles.
All those profiles are alphabetically listed in the Profiles folder in the Maven tab in IntelliJ IDEA.
Is it possible to create subfolders in the Profiles folder?
Instead of seeing:
V Profiles
[ ] profile_one
[ ] profile_two
[ ] profile_three
:
[ ] profile_forty
I'd like to have:
V Profiles
> Profile_subfolder_A
V Profile_subfolder_B
[ ] profile_five
[ ] profile_six
> Profile_subfolder_C
:
There is no such groupping in IDE. There are related request you can vote for:
IDEA-142807, IDEA-81772.
I am looking to get performance data of various alerts setup in my Nagios Core/XI. I think it is stored in RRDs. Are there ways I can get access to it?
If you're using Nagios XI you can get this data a few different ways.
If you're using XI 5 or later, then the easiest way that springs to mind is the API. Log in to your XI server as an administrator, navigate to 'Help' menu, then select 'Objects Reference' on the left hand side navigation and find 'GET objects/rrdexport' from the Objects Reference navigation box (or just scroll down to near the bottom).
An example curl might look like this:
curl -XGET "http://nagiosxi/nagiosxi/api/v1/objects/rrdexport?apikey=YOURAPIKEY&pretty=1&host_name=localhost"
Your response should look something like:
{
"meta": {
"start": "1453838100",
"step": "300",
"end": "1453838400",
"rows": "2",
"columns": "4",
"legend": {
"entry": [
"rta",
"pl",
"rtmax",
"rtmin"
]
}
},
"data": {
"row": [
{
"t": "1453838100",
"v": [
"6.0373333333e-03",
"0.0000000000e+00",
"1.7536000000e-02",
"3.0000000000e-03"
]
},
{
"t": "1453838400",
"v": [
"6.0000000000e-03",
"0.0000000000e+00",
"1.7037333333e-02",
"3.0000000000e-03"
]
}
]
}
}
BUT WAIT, THERE IS ANOTHER WAY
This way will work no matter what version you're on, and would actually work if you were processing performance data with NPCD on a Core system as well.
Log in to your server via ssh or console and get your butt over to the /usr/local/nagios/share/perfdata directory. From here we're going to use the localhost object as an example..
$ cd /usr/local/nagios/share/perfdata/
$ ls
localhost
$ cd localhost/
$ ls
Current_Load.rrd Current_Users.xml HTTP.rrd PING.xml SSH.rrd Swap_Usage.xml
Current_Load.xml _HOST_.rrd HTTP.xml Root_Partition.rrd SSH.xml Total_Processes.rrd
Current_Users.rrd _HOST_.xml PING.rrd Root_Partition.xml Swap_Usage.rrd Total_Processes.xml
$ rrdtool dump _HOST_.rrd
Once you run the rrdtool dump command, there is going to be an awful lot of output, so I keep that as an exercise for you, the reader ;)
If you're trying to automate something of some kind, then you should note that the xml files contain meta data for the rrd files and could potentially be useful to parse first.
Also, if you're anything like me, you love reading technical manuals. Here is a great one to read: RRDTool documentation
Hope this helped!
I am trying to write a block device driver that reads/writes blocks off of/to a network socket. At some point the when reading multiple blocks the application that uses this driver seems to hang (but would still accept input even though it does nothing with it) and the system in general seems responsive. dmesg shows the following message. And overall I can not use the driver for anything even if I started any other application that uses it.
I am using linux kernel v3.9.
Anyone can help fix this?
[ 489.779458] INFO: task xxd:2939 blocked for more than 120 seconds.
[ 489.779466] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 489.779469] xxd D 0000000000000000 0 2939 2237 0x00000006
[ 489.779475] ffff8801912a9998 0000000000000046 02fc000000000008 ffff8801bfff7000
[ 489.779479] ffff8801b2ef45f0 ffff8801912a9fd8 ffff8801912a9fd8 ffff8801912a9fd8
[ 489.779482] ffff8801b61e9750 ffff8801b2ef45f0 ffff8801912a9998 ffff8801b8e34af8
[ 489.779485] Call Trace:
[ 489.779497] [<ffffffff81131ad0>] ? __lock_page+0x70/0x70
[ 489.779505] [<ffffffff816e86a9>] schedule+0x29/0x70
[ 489.779510] [<ffffffff816e877f>] io_schedule+0x8f/0xd0
[ 489.779514] [<ffffffff81131ade>] sleep_on_page+0xe/0x20
[ 489.779518] [<ffffffff816e654a>] __wait_on_bit_lock+0x5a/0xc0
[ 489.779522] [<ffffffff811348aa>] ? find_get_pages+0xca/0x150
[ 489.779526] [<ffffffff81131ac7>] __lock_page+0x67/0x70
[ 489.779531] [<ffffffff8107fa50>] ? autoremove_wake_function+0x40/0x40
[ 489.779536] [<ffffffff81140bd2>] truncate_inode_pages_range+0x4b2/0x4c0
[ 489.779540] [<ffffffff81140c65>] truncate_inode_pages+0x15/0x20
[ 489.779545] [<ffffffff811d331c>] kill_bdev+0x2c/0x40
[ 489.779548] [<ffffffff811d3931>] __blkdev_put+0x71/0x1c0
[ 489.779552] [<ffffffff811aeb48>] ? __d_free+0x48/0x70
[ 489.779556] [<ffffffff811d3adb>] blkdev_put+0x5b/0x160
[ 489.779559] [<ffffffff811d3c05>] blkdev_close+0x25/0x30
[ 489.779564] [<ffffffff8119b16a>] __fput+0xba/0x240
[ 489.779568] [<ffffffff8119b2fe>] ____fput+0xe/0x10
[ 489.779572] [<ffffffff8107ba18>] task_work_run+0xc8/0xf0
[ 489.779577] [<ffffffff8105f797>] do_exit+0x2c7/0xa70
[ 489.779581] [<ffffffff8106f32e>] ? send_sig_info+0x1e/0x20
[ 489.779585] [<ffffffff8106f34c>] ? send_sig+0x1c/0x20
[ 489.779588] [<ffffffff8105ffd4>] do_group_exit+0x44/0xa0
[ 489.779592] [<ffffffff8106fe00>] get_signal_to_deliver+0x230/0x600
[ 489.779600] [<ffffffff81014398>] do_signal+0x58/0x8e0
[ 489.779605] [<ffffffff81014ca0>] do_notify_resume+0x80/0xc0
[ 489.779608] [<ffffffff816f241a>] int_signal+0x12/0x17
I had the synchronization done wrong around the socket. This meant some race conditions that left some requests without being served. Those not served requests caused the process to hang.
Adding some mutexes (not semaphores) fixed this.
How can I tell the Jasmine spy to only listen the messages I tell it to expect and ignore any others?
For example:
Example Group
describe 'View', ->
describe 'render', ->
beforeEach ->
#view = new View
#view.el = jasmine.createSpyObj 'el', ['append']
#view.render()
it 'appends the first entry to the list', ->
expect(#view.el.append).toHaveBeenCalledWith '<li>First</li>'
it 'appends the second entry to the list', ->
expect(#view.el.append).toHaveBeenCalledWith '<li>Second</li>'
Implementation
class View
render: ->
#el.append '<li>First</li>', '<li>Second</li>'
Output
View
render
appends the first entry to the list
Expected spy el.append to have been called \
with [ '<li>First</li>' ] but was called \
with [ [ '<li>First</li>', '<li>Second</li>' ] ]
appends the second entry to the list
Expected spy el.append to have been called \
with [ '<li>Second</li>' ] but was called \
with [ [ '<li>First</li>', '<li>Second</li>' ] ]
There are two options:
1. Using the argsForCall spy property
it 'appends the first entry to the list', ->
expect(#view.el.append.argsForCall[0]).toContain '<li>First</li>'
2. Using the args property of the mostRecentCall object
it 'appends the first entry to the list', ->
expect(#view.el.append.mostRecentCall.args).toContain '<li>First</li>'
To be clear, you can't prevent the spy from listening. The spy will listen to all function calls and save them. But you can excess every single call by using argsForCall.