Ubuntu 14.04 CUPS driver stops spooling job after first label - printing

I am trying to send multiple print job to printer using CUPS driver, after first job printer stops spooling remaining job.
I installed the printer from the System Settings > Printing
Add network printer
Set the printer type to Generic Raw
If I switch to Generic text only then Cups spools the entire job.
Can any one help me to understand what's problem with Queue type "Raw- Generic Text"?

Related

Zabbix template trigger expression referencing a item from another template

I'm having trouble thinking and implementing a way to do the following:
I have a systemd monitoring template which has 2 main triggers for any given discovered service. "The service has restarted" or "The service is not running". When a given host restarts, every single service trigger kicks off with an alert saying "service has restarted". This makes sense, the host restarts, so do the services.
My goal is to prevent the service trigger alerts from being generated if the host uptime is less than 10 minutes (the default timer for the "host restarted" trigger).
In other words, "Service has restarted" trigger should only be generated when the host uptime is more than 10 minutes.
So my initial thoughts were to use trigger dependencies, but those only create a dependency off another trigger. So I wouldn't want my "service has restarted" trigger to activate if the "host has restarted" trigger was also activated (thats the opposite of what I want). And as far as I am aware, the trigger dependencies do not have a "negate" or "not" function/operator built into them. So I couldn't say something like: "This trigger can only activate if this other trigger is currently inactive."
So my next thought was to edit the template discovery trigger prototype expression and change it from the following: last(/Systemd by Zabbix agent 2/systemd.service.uptime["{#UNIT.NAME}"])<10m to something like last(system.uptime)>10m AND last(/Systemd by Zabbix agent 2/systemd.service.uptime["{#UNIT.NAME}"])<10m. This isn't exact syntax, just the rough idea of what I was thinking of.
The problem is when I try to do the expression editor and include the item from another template, is errors out with:
Trigger prototype "{#UNIT.NAME}: has been restarted" belongs to templates with different linkages.
I assume that it wont let me link a prototype trigger with another templates item?
I am using the default "Linux Generic by Zabbix Agent" Template, and the following template for systemd:
https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/systemd?at=release/6.0
Overall, I definitely don't want to be going around to every host and creating custom triggers for every single service that compares the host uptime with the systemd service uptime. Maybe I could move the system.uptime template item from the "Generic Linux Template" to the Systemd template, but thats rather brute force.
Anyone got an ideas for what to do here?
Any better ways to solve my problem?
You may use items from different templates in triggers that are in another template. BUT the item templates need to be linked to the trigger template.
So in your case, you should do:
create a new, empty XYZ Template
link Generic Linux Template and Systemd Template to your XYZ template
now you can create triggers in your XYZ template that utilizes items from Generic Linux Template and Systemd Template

Monitor specific disk spaces on Jenkins nodes

Currently Jenkins master can do a "preventive monitoring" of the nodes in the "/computer/configure" page but it is only possible to monitor 2 disk spaces :
$JENKINS_HOME
Temp Space
I would like to monitor other disk spaces. For example, the /var/lib/docker (default directory where all docker images are pulled) is quickly full and causes some error on the nodes.
As we use the EC2 slaves plugin, it will be useful to be able to specify a threshold for this space size in order to put the node "offline" when the threshold is reached.. The EC2 instance will then be destroyed and another "healthy" slave will be started if needed.
Is it currently possible to achieve this in Jenkins ?
Version : Jenkins ver. 2.89.1
Thank you !
You are right that Jenkins monitors only those directories out of the box. The code handling this is at hudson.node_monitors.TemporarySpaceMonitor and hudson.node_monitors.DiskSpaceMonitor.
It would be fairly easy to implement a new NodeMonitor that would accept a list of directories to watch and would use the Jenkins plugins framework facility to take a node down if the space goes below a defined limit. I could even imagine a new plugin that would offer a series of enhanced node monitors. The plan has even been to extract all node monitors into a dedicated plugin since long, but this wasn't completed for various reasons (cf. JENKINS-26466 for details).
I wrote such a plugin at https://github.com/jenkinsci/inodes-monitor-plugin if you are looking for an example on how to use the NodeMonitor API.

Jenkins - Multiple terminal output

I have a Python code that when running, creates multiple other terminal windows, in addition to the one I was already running from.
subprocess.call(["gnome-terminal", "-e", "..."])
This opens multiple other terminals that runs the same program with different parameters.
In Jenkins, in a "Freestyle project", when I run the same script from the "Execute shell", the result is not the same (as I was expecting).
./python_file.py -p $MY_PARAMETER
The main console output is working fine, but the other windows terminal that were supposed to open, just don't execute. I want to be able to see the output of those terminals in the Jenkins console (or elsewhere ?)
Should I use another kind of project ? Or just add a new Plugin ? Is there an option in the project that I should checked ? I don't want to run the project on multiple nodes. I just need to see multiple terminals.
This is the error text :
Failed to parse arguments: Cannot open display:
It is not a common problem I supposed, but thanks for input!
I am not sure if a multiple windows output exists in Jenkins but I think that you can bypass this issue.
Instead of running one project in multiple console, I will modify my Python Script so that multiple projects will run one console at a time. Like that it will be easier to control which parameters I want to every single projects and what the outputs are for every single one of them also.
There is a couple way to do that ("multi-configuration project", multiple "freestyle project").

stop jenkins from checking for internet connectivity by trying to reach google

I want to set up Jenkins. When I go to install or update plugins, Jenkins automatically checks for "Internet connectivity". For reasons unclear to me, it appears that the Jenkins definition of "Internet connectivity" is "able to reach google.com". I am located in China, and trying to contact google over an unprotected connection is guaranteed to fail.
I'd like to skip (or at least redirect) this check, which takes a long time, can never succeed, isn't relevant to the task that triggers it, and isn't even used by Jenkins (the actual plugin download goes through fine after Jenkins gives up on reaching google). Is there a way?
open /var/lib/jenkins/updates/default.json file, you will see the connectionCheckUrl is set to www.google.com. change it to www.baidu.com, and restart.
As an alternative to proxy, you can always modify the hosts file on the Jenkins machine (location depends on the OS), and redirect google.com to whatever IP you want.

Jenkins operational log

We have a situation where something causes our Jenkins master to start leaking memory at a certain time each night. No jobs are running at this time, so I'm not interested in logs of build jobs.
We would like to figure out what is happening around this time, but we cannot see much in the jenkins.out.log, since it doesn't log a lot and lacks timestamps.
Does anyone know if there is a way to turn on more detailed operational (not just errors) logging in Jenkins?
You could use the logs accessible from the UI (Manage Jenkins ยป System Log) and set the log level to ALL for the default log recorder in Log Levels. This log is only accessible from the UI though.
Alternatively, you could increase the log level of the regular jenkins.log by passing --debug=9 to the Jenkins command. If you're on CentOS, changing the value of JENKINS_DEBUG_LEVEL in /etc/sysconfig/jenkins has the same effect.
You could also use the Jenkins/Hudson monitoring plugin to see snapshots of memory use etc inside the JVM.
Also you could install sar (sysstat) to see how the server itself is doing over time (if Linux).

Resources