Get CPU model name using Proxmox API - virtualization

I use Proxmox REST API to get info about hypervisors. I am able to iterate nodes/storages/qemu and get basic info about every item. Like this is path for storages: $path = "/nodes/$nodeId/storage"; But I can't find an exact CPU model name like 24 x Intel(R) Xeon(R) CPU E5-2620. Can somebody show me the path where I can find CPU model name?

EDIT: As mentioned in the comment to this answer, this information is present in the status API Endpoint for the specific node.
Here are the API Documents for Proxmox VE. If you step down through the tree you can see all of the available API endpoints for nodes/$nodeID including storage as you mention.
I no longer have a Proxmox server at home to test with. However, after looking through the options available via the API documentation, it appears to me that hardware is the only other endpoint in the tree that would normally contain this information. And it seems to only provide information about PCI devices. Which CPUs haven't been for a very long time.
So this leads me to conclude that the Proxmox VE API does not provide information about the CPU of the hypervisor. I'm sure you already know this, but if you are able to refactor your requirements to run a command on your Proxmox server over SSH, then it is quite easy to retrieve the information you want with lscpu. EG:
$> lscpu | grep Model\ name
Model name: Intel(R) Xeon(R) CPU X5482 # 3.20GHz

Related

When and how should DAPI and SAPI be used?

I`m totally new to Bloomberg and using Bloomberg api in python/flask
I tried to read all the documentation provided by the windows SDK
I understand that DAPI is only for local applications using localhost and default port
but actually I am confused about the usage of SAPI Installation and usage...
First:
after installing sapi on machine with bloomberg terminal and letting the sapi process up , I will write an application by python code that import blbapi and use the sapi
should this application be on the same machine , or it can be on another machine and give it the ip and port of the sapi process and should the other machine have bloomberg terminal too?
second:
what about the client side, any browser which open this application should the clients have bloomberg terminal too??
Excuse my naive question ..
Thanx in advance
Python application machine doesn't have to have a Bloomberg terminal installed. You will only need Bloomberg libraries installed (but not terminal) software.
You need to provide "ip of terminal pc" + "uuid" when making a connection to SAPI.
Also, the user/terminal must be logged in.
Check and be very careful with licensing. You can try asking your account manager.
Don't take this as licensing advice, but different exchanges and data sources can have different rules around the data so it depends what data you pulling. As I understand the data pulled by a user/script is for that specific terminal owner only.
Different terminal "owners" with the same access might not be allowed to see the data pulled by other scripts/users.
SAPI allows you to use BBG data off the machine where the user is logged in HOWEVER this data can not be viewed by anyone but the logged in user - for legal reasons rather than technical ones.
The typical use case for SAPI is there complicated calculatios (be it exotic pricing or realtime portfolio risk) is being performed that aren't practical on the desktop.
Be aware that all BBG data and calculations are tied to the user, the data can't be given to anyone else...

Google Cloud Storage - Download EMEA

I'am new user on GCP-Storage. I have been charged for large downloads to EMEA(region), but my service(API) conects only to Americas.
Question:
Would anyone please advise on how to set StackDriver or other tool to properly monitor storage at CGP egress?
Thanks alot,
Adriano
Stackdriver isn't currently the best tool for this I believe. You should set up a budget and alerts. Just go to billing in the menu, then budget & alerts. The UI should be self-explanatory.
That's the most important part! Only the budget set there can definitely safe you from exorbitant bills if someone is trying to ruin you/send spam from your instances etc.
Stackdriver's integration with the billing system is currently rather weak, possibly because it's an outside technology that was aquired. Here's what you can do:
If you create a chart, set resource type to Pub/Sub Topic you can choose Costs of Operations which shows your costs live (but you can't create alerts on it).
The GCE metrics include outbound and inbound traffic, so create a chart for that as well.
In the alerts section, you can add an alert to notify you when your hourly egress crosses a threshold you can define – Or suddenly increases in a way it usually doesn't. Note that it could be hard to avoid false positives. Try to find out the maximum throughput of your instances, calculate how fast you need to be alerted and set these alerts based on that value.
If you see a sudden, sustained spike in traffic check the logs. Depending on what ports your firewall configuration has opened, you may find the cause in the webserver or sshd logs. (Oh yeah: go to the network settings and disable all ports you don't need).
If that doesn't help, you'll have to leave google and ssh into the machine(s). A tool I've used before and which is quite easy is nethogs.
$ sudo apt-get install nethogs
[...]
The following NEW packages will be installed:
nethogs
[...[
Setting up nethogs (0.8.1-0.3) ...
$ sudo nethogs
TOTAL 2.873 1.829 KB/sec
NetHogs version 0.8.1
PID USER PROGRAM DEV SENT RECEIVED
1975 root /opt/google-fluentd/embedded/bin/ruby ens4 0.480 0.999 KB/sec
23054 root /usr/bin/python ens4 0.021 0.412 KB/sec
[...]
That will show you the process and then, well – it depends on what that is.
Note that one possibility is that you have been hacked and the server(s) are used for spam or porn distribution or whatever. In that case it's possible (or actually to be expected) that the tools on the server have been patched/replaced to hide the intrusion. Search for rootkit detection if there's a mismatch between the server's internal data and the google tools. If you cannot exclude this possibility with certainty, do not attempt to remove the rootkit. Power down the server(s), create new ones from scratch and, if unavoidable, mount the old disks as read-only partitions in another clean instance to extract the data with utmost care.

Is any way to get HP servers Errors Remotely without iLo GUI?

I have more than 200 HP servers in my company branches and I want to automatically monitor server hardware errors. I can see all servers in my WAN.
I want to write a program to monitor HP servers remotely. My application must call an API or other functions remotely, and then get results from servers. After that I can send error signal to my administrators if needed, and my alarm system can read this information and etc. Is any API (or HP Proliant facilities) to get hardware errors and warnings remotely?
The Errors I want to monitor are:
Raid disk errors
Power Errors
CPU Fan Errors
I cant see more than 200 servers iLo GUI every day to monitor errors.
Yes, there is a way to monitor iLO via API. You should be able to integrate your application to the iLO RESTful API. there are some monitoring examples available on GitHub Python library.
you can get things like rest/v1/Managers/{item}/ActiveHealthSystem you might want to look into the complete data model.
Ana
HPE Employee

Any built in methods where I can get the UNIX server manufacturer / model and serial number?

I am writing a Perl script that will be deployed and executed on many servers. Some of my requirements are retrieving the manufacturer, model and serial number. Unfortunately I can't seem to figure out how to do that. I'm not seeing any built in libraries to do this.
I'm not sure if I can use libraries that don't come with Perl since I wouldn't be able to include those when it gets executed on the other servers.
Any thoughts?
There's a perl module called Parse::DMIDecode which will use the dmidecode program that Brian pointed out.
It's not Perl but you can invoke
$ sudo dmidecode
from within your script. That will dump the BIOS info and on my machine I get:
System Information
Manufacturer: Hewlett-Packard
Product Name: HP xw6600 Workstation
Version:
Serial Number: CXC9062H43
UUID: 53F3EB48-4CF9-DD11-BBDA-29023A11001F
Wake-up Type: Power Switch
SKU Number: RV725AV
Family: 103C_53335X
I don't know how much of the above is a) standard info b) populated by our service desk when provisioning PCs for our use. But it's worth investigating further.
From the man page for dmidecode:
dmidecode is a tool for dumping a computer's DMI (some say
SMBIOS) table contents in a human-readable format. This table contains
a
description of the system's hardware components, as well as other useful pieces of information such as serial numbers and BIOS
revision.
Thanks to this table, you can retrieve this information without having to probe for the actual hardware. While this is a good
point in
terms of report speed and safeness, this also makes the presented information possibly unreliable

get ethernet name, class, description vendor, subsystem, etc using c/c++ on linux based systems

Using ioctl interface various info can be fetched. How do you get extra info like product name, class, vendor name, subsystem name etc?
There are couple of command line tools available such as:
1. lshw -C network
2. detecting nic and ports on systems loaded with linux
You can start a process and get the result but Is there any raw c/c++ method to get above mentioned information?
Cheers
Prashant
All the information you seek is in /sys/bus/pci/devices/*/*:
class
device
driver
modalias
subsystem
subsystem_device
subsystem_vendor
vendor
You can see how lspci(8) reads through the files with strace -o /tmp/out lspci, /tmp/out will have plenty of details. (I don't know any easy way to restrict this to just the NICs; I think both lspci(8) and the kernel have hard-coded lists of PCI ID -> name mappings.)
Look in sysfs or procfs, unfortunately this information has a habit of being changed and so cannot be relied on :(